From mark.schira at gmail.com Fri May 1 00:23:21 2009 From: mark.schira at gmail.com (mschira) Date: Thu, 30 Apr 2009 21:23:21 -0700 (PDT) Subject: [vtkusers] build vtk libs using Visual Studio 2005 (for dummies) In-Reply-To: <387ee2020904301948u25ca97e1oa9257a07cd62a758@mail.gmail.com> References: <23327055.post@talk.nabble.com> <387ee2020904301821h7357b8abhbc879194989b6893@mail.gmail.com> <23327328.post@talk.nabble.com> <387ee2020904301849k16fc46fs2dbc49d9700a83a9@mail.gmail.com> <23327456.post@talk.nabble.com> <387ee2020904301948u25ca97e1oa9257a07cd62a758@mail.gmail.com> Message-ID: <23328314.post@talk.nabble.com> John M. Drescher wrote: > > > I have been using it for almost a year now, on XP SP3, linux, Win2k3 > Advanced Server and on XP64. Yes I do use all 4 daily, good thing all > my code is in cvs.. I have little experience with 2.4 so I can not > really help with the difference. However I can tell you that > cmake-gui.exe is much better CMakeSetup.exe at setting variables and > dealing with problems in your CMakeLists.txt files. > > John > > Hm, maybe I should try 2.6 I worked the step by step list from Jeremy Drysdale, and well - I can't really say weather it is a success or not. When I press the OK button after the configure thing, CMakeSetup builds something and then disappears. Not sure if that's a crash or normal behaviour. I get a hole bunch of file in the directory I specified as the build target, so I guess that's not a total failure :-) The thing is I don't get any .lib files. In particular I look for vtkCommon.lib vtkFiltering.lib and vtkGraphics.lib (those are the files my matlab function wants to compile). So where do I go wrong? Ideas? M. -- View this message in context: http://www.nabble.com/build-vtk-libs-using-Visual-Studio-2005--%28for-dummies%29-tp23327055p23328314.html Sent from the VTK - Users mailing list archive at Nabble.com. From mark.schira at gmail.com Fri May 1 00:58:09 2009 From: mark.schira at gmail.com (mschira) Date: Thu, 30 Apr 2009 21:58:09 -0700 (PDT) Subject: [vtkusers] build vtk libs using Visual Studio 2005 (for dummies) In-Reply-To: <23328314.post@talk.nabble.com> References: <23327055.post@talk.nabble.com> <387ee2020904301821h7357b8abhbc879194989b6893@mail.gmail.com> <23327328.post@talk.nabble.com> <387ee2020904301849k16fc46fs2dbc49d9700a83a9@mail.gmail.com> <23327456.post@talk.nabble.com> <387ee2020904301948u25ca97e1oa9257a07cd62a758@mail.gmail.com> <23328314.post@talk.nabble.com> Message-ID: <23328473.post@talk.nabble.com> Hm, maybe I should try 2.6 So I did. And it looks a bit more ensuring. Though I get the impression that's all :-( When I am done with the configuring and the generating, i get a few warnings, none of these seems fatal to me. When I turn of the warnings the output is simple and reassuring, configuring done generating done So that looks like a success to me though I still can't find vtkFiltering.lib, vtkGraphics.lib or vtkCommon.lib. One of the warnings confuses me "... and other libraries with known full path: C:/VTK50source/binaries/bin/Debug/vtkFiltering.lib" Oh sweet vtkFiltering.lib so close but still unreachable, the directory C:/VTK50source/binaries/bin/ simply doesn't exist. M. -- View this message in context: http://www.nabble.com/build-vtk-libs-using-Visual-Studio-2005--%28for-dummies%29-tp23327055p23328473.html Sent from the VTK - Users mailing list archive at Nabble.com. From mark.schira at gmail.com Fri May 1 02:12:07 2009 From: mark.schira at gmail.com (mschira) Date: Thu, 30 Apr 2009 23:12:07 -0700 (PDT) Subject: [vtkusers] build vtk libs using Visual Studio 2005 (for dummies) In-Reply-To: <23327055.post@talk.nabble.com> References: <23327055.post@talk.nabble.com> Message-ID: <23328848.post@talk.nabble.com> I thinks I made it! Well sort of. I managed to compile it or parts that is, Seems like I got all the bits I needed, I even got my freaking matlab function to compile -error free - however the .mexw64 this produces is broken. Jippi. M. -- View this message in context: http://www.nabble.com/build-vtk-libs-using-Visual-Studio-2005--%28for-dummies%29-tp23327055p23328848.html Sent from the VTK - Users mailing list archive at Nabble.com. From mathieu.malaterre at gmail.com Fri May 1 04:26:44 2009 From: mathieu.malaterre at gmail.com (Mathieu Malaterre) Date: Fri, 1 May 2009 10:26:44 +0200 Subject: [vtkusers] VTK shifts CT data In-Reply-To: <1241125154.1895.37.camel@ECKO> References: <1241125154.1895.37.camel@ECKO> Message-ID: Peter, On Thu, Apr 30, 2009 at 10:59 PM, Peter Halverson wrote: > VTK users, > > I am struggling with the two issues. ?The first issue is that when I > read in my CT data the image is shifted left. Meaning that the patients > left hand appears disembodied and floating on his right side. ?I believe > the shift is ~50 pixels. ?(It did this in MatLab too, but not when using > Dicomworks or pydicom). ?Is there a way to shift the data back or reset > the origin? > > My input code is > > import vtk > from vtk.util.misc import vtkGetDataRoot > from vtk.util.colors import * > VTK_DATA_ROOT = vtkGetDataRoot() > import dicom > filename="./SE1/IM50" > info=dicom.ReadFile(filename) > > aRenderer = vtk.vtkRenderer() > renWin = vtk.vtkRenderWindow() > renWin.AddRenderer(aRenderer) > iren = vtk.vtkRenderWindowInteractor() > iren.SetRenderWindow(renWin) > > v16 = vtk.vtkVolume16Reader() > v16.SetDataDimensions(info.Rows, info.Columns) > v16.SetDataByteOrderToLittleEndian() > v16.SetFilePrefix("./SE1/IM") > #v16.SetFilePrefix("Z:/COM and COR/PA3/ST1/SE1/IM") > v16.SetFilePattern('%s%d') > v16.SetImageRange(3, 60) > v16.SetDataSpacing(info.PixelSpacing[0], info.PixelSpacing[1], > info.SliceThickness) > Why are you using vtkVolume16Reader to read in a DICOM file ? http://www.vtk.org/Wiki/VTK_FAQ#How_can_I_read_DICOM_files_.3F If the DICOM file has a Data Set Trailing Padding attribute (well anything after the Pixel Data element so to say), then vtkVolume16Reader will simply not work. HTH -- Mathieu From alex.dutu at gmail.com Fri May 1 07:04:28 2009 From: alex.dutu at gmail.com (=?UTF-8?Q?Alexandru_Du=C5=A3u?=) Date: Fri, 1 May 2009 14:04:28 +0300 Subject: [vtkusers] Building VTK application with Visual Studio 2008 Message-ID: Dear VTK users, I am using Windows XP SP3 and Visual Studio 2008. I downloaded VTK sources, branch 5-4-0 from the CVS repository. I built them with Visual Studio 2008 (I generated the build workspaces for Visual Studio with Cmake, set the BUILD_EXAMPLES option and left unchecked BUILD_SHARED_LIBS options). After the buid process there was no error or warnings, I installed VTK from Visual Studio, also no errors or warnings. I have started another instance of Visual Studio and created a solution and in that solution an empty console application project. After that I configured the depencies within Visual Studio: 1. I've added the include directory to the "Addional Include Directories". - My include directory is "c:\Program Files\VTK\include\vtk-5.4" 2. I've added the library directory to the "Additional Library Directories" - My library directory is "c:\Program Files\VTK\lib\vtk-5.4" 3. I've Included all the VTK libraries (.lib) files I used in your program under "Additional Dependencies" - vtkCommon.lib, vtkFiltering.lib, vtkGraphics.lib, vtkRendering.lib, and vtksys.lib. 4. I've linked to the OpenGL library ("opengl32.lib") also under "Additional Dependencies". I've added the Cone.cxx example to my project and build it. Compilation went ok, at linking I had 31 errors. It seems that there are unresolved symbols in my linking process (vtkRendering.lib(vtkProperty.obj) : error LNK2001: unresolved external symbol "public: class vtkXMLDataElement * __thiscall vtkXMLMaterial::GetProperty(int)" (?GetProperty at vtkXMLMaterial @@QAEPAVvtkXMLDataElement@@H at Z)) You can check the attachement for the complete build log. If I put all the lib files to the linker Additional Dependencies there are much more linking errors (aprox 300 errors). -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: build.log Type: application/octet-stream Size: 6366 bytes Desc: not available URL: From alex.dutu at gmail.com Fri May 1 12:07:59 2009 From: alex.dutu at gmail.com (=?UTF-8?Q?Alexandru_Du=C5=A3u?=) Date: Fri, 1 May 2009 19:07:59 +0300 Subject: [vtkusers] Building VTK application with Visual Studio 2008 In-Reply-To: References: Message-ID: I forgot to mention that if I build in debug the linker tells me this "Linking... LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library" So I used this option for the linker /NODEFAULTLIB:MSVCRT and I got much more errors form this option. Also I tried to build the examples and I got linking errors so some examples were not built. The error I got for the failed builds is: "LINK : fatal error LNK1104: cannot open file 'vtkRendering.lib' " I checked in the vtk_build_folder/bin/release/ for vtkRendering.lib and it is not there, but the library exists in the installation forder "c:\Program Files\VTK\lib\vtk-5.4" I do not realize what am I doing wrong. Can anybody please help Best Regards, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Fri May 1 12:26:30 2009 From: drescherjm at gmail.com (John Drescher) Date: Fri, 1 May 2009 12:26:30 -0400 Subject: [vtkusers] Building VTK application with Visual Studio 2008 In-Reply-To: References: Message-ID: <387ee2020905010926y43c548c9o3be328f9713d6056@mail.gmail.com> On Fri, May 1, 2009 at 12:07 PM, Alexandru Du?u wrote: > I forgot to mention that if I build in debug the linker tells me this > "Linking... > LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other > libs; use /NODEFAULTLIB:library" > > So I used this option for the linker?/NODEFAULTLIB:MSVCRT and I got much > more errors form this option. > Also I tried to build the examples and I got linking errors so some examples > were not built. The error I got for the failed builds is: "LINK : fatal > error LNK1104: cannot open file 'vtkRendering.lib'?" > I checked in the vtk_build_folder/bin/release/ ?for?vtkRendering.lib and it > is not there, but the library exists in the installation forder?"c:\Program > Files\VTK\lib\vtk-5.4" > I do not realize what?am?I doing wrong. > Can anybody please help I highly recommend that you use cmake to generate your project file for your application. It will take some time to get used to for a windows programmer. I have written > 600K lines of MFC in the last 10 or so years so I would definitely be one of those.. Anyways it solves all of these problems and also simplifies things if you ever want to compile your application on a different compiler. Right now I develop my application (Qt + VTK + ITK) under VS2005 under windows 32 bit XP but also use VS2008 under 64 bit Windows7 and gcc 4.4 under 64 gentoo linux with the same exact CMakeLists.txt files. I have everything in cvs and the generated stuff (like make files or visual studio project files are not in the repository. Also the separate build and binary folders that cmake make using cvs or backups easy since there is no junk in the source tree and noting of value in the binary tree. When my current project is over I plan to go back and generate CMakeLists.txt files for all my code and get the project files out of the cvs. One reason is that will help with porting code and maintenance since I do not need to juggle 3 versions of visual studio project files for each project anymore.. John From nkwmailinglists at gmail.com Fri May 1 12:45:39 2009 From: nkwmailinglists at gmail.com (kent williams) Date: Fri, 1 May 2009 11:45:39 -0500 Subject: [vtkusers] Can a vtkActor be added to more than one renderer Message-ID: <44f773f50905010945p1bd041afh97d5fd85912a673a@mail.gmail.com> Subject line says it all. What I want to do: I have multiple views in separate windows. In one view I have one or more vtkSeedWidgets. I want to display the points from the SeedWidgets in the other views. What it looks like I have to do is create some geometry, add it to a mapper, add the mapper to the actor, add the actor to the renderer for each views. Can one actor be added to more than one renderer? From jiksed at yahoo.com Fri May 1 14:29:27 2009 From: jiksed at yahoo.com (Jim) Date: Fri, 1 May 2009 11:29:27 -0700 (PDT) Subject: [vtkusers] volume rendering Message-ID: <885480.14831.qm@web32005.mail.mud.yahoo.com> I have a volume data set which are rendered in two different mappers: ?vtkVolumeRayCastMapper (upper image in the attachment) and vtkDataSetMapper (lower image). I am wondering why vtkVolumeRayCastMapper image lost some outer layers and became smaller. This happens for thin-slab objects?very often. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: VolumeRendering.PNG Type: image/x-png Size: 56304 bytes Desc: not available URL: From bioinfguy at gmail.com Sat May 2 06:34:57 2009 From: bioinfguy at gmail.com (Grzegorz Pytel) Date: Sat, 2 May 2009 12:34:57 +0200 Subject: [vtkusers] Adding points dynamically Message-ID: <867c8430905020334v26866bfbybc414a13d98caba4@mail.gmail.com> I have following variables: I want to have points added dynamically on mouse click event and force the gaussian filter to create surface out of modified points and have it displayed. The commands like splatMapper->Update() or contour->Update() do not take effect. How should I force GaussianSplatter to recompute surface and redraw? I store points in points like this: vtkPoints * points; vtkCellArray * vertices; vtkGaussianSplatter * splatter; vtkPolyData * pData; pData = vtkPolyData::New(); pData->SetPoints(points); pData->SetVerts(vertices); I use my own function that returns pointer to GaussianSplatter: vtkGaussianSplatter* GetGaussianSplatter() { return splatter } My filters I have set up as following: vtkContourFilter * contour; vtkPolyDataMapper *splatMapper; contour = vtkContourFilter::New(); contour->SetInputConnection(this->sculpture->GetGaussianSplatter()->GetOutputPort()); contour->SetValue(0, 0.9); //contour->SetInput(sculpture->GetGaussianSplatter()->GetOutput()); splatMapper = vtkPolyDataMapper::New(); splatMapper->SetInput(contour->GetOutput()); splatActor = vtkActor::New(); splatActor->SetMapper(splatMapper); renderer->AddActor(splatActor); This code does not work properly I have on mouse left down event: for(int i=0;i<1000;i++) { double np[3]; np[0] = rand()/RAND_MAX; np[1] = rand()/RAND_MAX; np[2] = rand()/RAND_MAX; sculpture->AddPoint(np); } void Sculpture::AddPoint(double point[]) { this->points->InsertNextPoint(point); this->vertices->InsertNextCell(1); this->vertices->InsertCellPoint(0); } Thanks in advance, Gregory -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Sat May 2 08:24:27 2009 From: daviddoria at gmail.com (David Doria) Date: Sat, 2 May 2009 08:24:27 -0400 Subject: [vtkusers] Marching Cubes with Polydata Message-ID: I asked about this a while back, but was never able to get it to work - Here is an attempt at a simple example: Input data: polydata, points on a sphere http://rpi.edu/~doriad/SpherePoints.vtp required output: the surface of the sphere vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(Filename.c_str()); reader->Update(); vtkPolyData* InputPolydata = reader->GetOutput(); vtkSmartPointer CF = vtkSmartPointer::New(); CF->SetInput(InputPolydata); CF->Update(); vtkMarchingCubes* MC = vtkMarchingCubes::New(); MC->SetInput(CF->GetOutput()); //ERROR: cannot do this, because the input is vtkPolyData, not vtkImageData MC->Update(); vtkPolyData* Output = MC->GetOutput(); //write vtkSmartPointer writer = vtkSmartPointer::New(); writer->SetFileName(Filename.c_str()); writer->SetInput(Output); writer->Write(); I thought the ContourFilter was supposed to do this polydata to imagedata conversion? A while back Bryn had recommended creating an empty image data and manually binning the points, but I feel like there should be a filter that does this? Also recommended was Deluanay triangulation. I've had bad luck with this in the past with the type of surfaces I'm trying to reconstruct, so I would like to compare it to marching cubes. There have been several questions about this, but I haven't seen any resolutions. Has anyone gotten it to work? Thanks, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca.ramundo at hotmail.it Sun May 3 14:21:29 2009 From: luca.ramundo at hotmail.it (Luca Ramundo) Date: Sun, 3 May 2009 20:21:29 +0200 Subject: [vtkusers] clip a polydata with 3 orthogonal planes Message-ID: Hi all.. I'm using vtkClipPlolyData class to clip my object.. I set a plane with the SetClip function and It works fine.. but I'd like to set 3 orthogonal planes and not only one. Is it possible? Thanks, Luca _________________________________________________________________ Pi? di 30 stazioni. Ascolta la Radio su Messenger! http://messenger.it/radioMessenger.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Sun May 3 18:09:01 2009 From: daviddoria at gmail.com (David Doria) Date: Sun, 3 May 2009 18:09:01 -0400 Subject: [vtkusers] Store multiple versions of an array in a vtp file Message-ID: I have added a "ClassLabel" array to a polydata which stores, for each point, which class/cluster the point is associated with (integer values). I would like to track these class associations over "time", that is, in each iteration of my clustering algorithm, I would like to save the current class associations, the idea being that I could watch the evolution of the clusters in paraview. It seems silly to add a bunch of vectors (Association_1, Association_2, ... Association_1000), and I don't think that would be able to be animated anyway. Is there a way to do this without having to write a separate vtp file for each one of these iterations (as they would quickly fill the hard drive!)? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From louxkr at gmail.com Sun May 3 21:50:17 2009 From: louxkr at gmail.com (Kerry Loux) Date: Sun, 3 May 2009 21:50:17 -0400 Subject: [vtkusers] vtkJPEGWriter not creating file Message-ID: <65c344fe0905031850n36384381l2c4fae23617d52f5@mail.gmail.com> Hello, I am trying to create a function that writes the contents of my renderwindow (on screen) to file. I have tried a method from an old post to this list as well as a method similar to what is used in the vtkWindowToImageFilter example (two very similar methods), but in both cases the code executes without generating the file. No errors/crashes/warnings or anything like that, it just doesn't seem to work. The code I've tried is this: vtkWindowToImageFilter *WindowToImage = vtkWindowToImageFilter::New(); WindowToImage->SetInput(RenderWindow); WindowToImage->Update(); Writer = vtkJPEGWriter::New(); Writer->SetQuality(100); Writer->SetInputConnection(WindowToImage->GetOutputPort()); Writer->SetFileName("test.jpg"); RenderWindow->Render(); Writer->Write(); and this: vtkWindowToImageFilter *WindowToImage = vtkWindowToImageFilter::New(); WindowToImage->SetInput(RenderWindow); WindowToImage->Modified(); Writer = vtkJPEGWriter::New(); Writer->SetQuality(100); Writer->SetInput(WindowToImage->GetOutput()); Writer->SetFileName("test.jpg"); RenderWindow->Render(); Writer->Write(); I've got to be missing something... any ideas? Thanks, Kerry -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.schira at gmail.com Mon May 4 00:40:45 2009 From: mark.schira at gmail.com (mschira) Date: Sun, 3 May 2009 21:40:45 -0700 (PDT) Subject: [vtkusers] build vtk libs using Visual Studio 2005 (for dummies) In-Reply-To: <23327055.post@talk.nabble.com> References: <23327055.post@talk.nabble.com> Message-ID: <23362995.post@talk.nabble.com> Success! Somehow my compiled used dynamic links (dll), not static ones and windows didn't find the dynamic libs, so I made it find them ;-), which fixed it M. mschira wrote: > > Hi Folks > I am trying to build the VTK library for a Windows XP64 system. > Problem is: I have no idea what I am doing. > I have Visual Studio 2005 installed, I have downloaded the source code for > VTK 5.4 and I have read (part of of it at least) the VTK Readme.html > > Yea, but I understand no thing. > First it tells me "Run the CMakeSetup dialog to get started." O.K. Would > love to do so, but I just can't find it, nor how to run it if I would find > it,. > Then it reads "It must be executed from an environment configured to run > the compiler to be used." > ??? > further: > "In the case of the Visual Studio IDE no special environment is needed and > CMakeSetup can be started from its icon." O.K. that SOUNDS like I'll have > to find this icon. Is it a file? because I can't find a file called > CMakeSetup. > Sorry but I am really lost here. > > I actually have a rough idea how to compile things using the gcc in linux, > with CMake and all these things. But Visual Studio 2005? I am SOOOOO lost. > Cheers > Mark > > I need VTK because ultimately I want to compile a function that I need for > matlab, (compiling with the mex command). > This shouldn't bother you, but it may explain why I have no idea how C++ > works, but still need to use it. > > -- View this message in context: http://www.nabble.com/build-vtk-libs-using-Visual-Studio-2005--%28for-dummies%29-tp23327055p23362995.html Sent from the VTK - Users mailing list archive at Nabble.com. From iskicy at gmail.com Mon May 4 03:53:48 2009 From: iskicy at gmail.com (iskicy) Date: Mon, 4 May 2009 15:53:48 +0800 Subject: [vtkusers] vtkDICOMImageReader error Message-ID: <200905041553465388597@gmail.com> Hello, I am trying to read the data from a file with DICOM format. The code I have written is below: vtkDICOMImageReader* dcm = vtkDICOMImageReader::New(); dcm->SetDirectoryName("C:/1"); dcm->SetDataByteOrderToLittleEndian(); dcm->Update(); It runs successfully on other machines with VS 2005 and VS 6.0. But when I try to run it in my computer( VS 2005 ), some error happens with blow information: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. I hope someone can help me to solve this problem. Thanks in advance. 2009-05-04 skicy --------------------------- CS @ SJTU -------------- next part -------------- An HTML attachment was scrubbed... URL: From jerome.velut at gmail.com Mon May 4 03:54:13 2009 From: jerome.velut at gmail.com (=?ISO-8859-1?B?Suly9G1l?=) Date: Mon, 4 May 2009 09:54:13 +0200 Subject: [vtkusers] clip a polydata with 3 orthogonal planes In-Reply-To: References: Message-ID: Hi, I used to instanciate 3 vtkClipPolyData for that to work, just like ImageOrthoSlicer does with 3 vtkImagePlaneWidget. Best, Jerome 2009/5/3 Luca Ramundo > Hi all.. > I'm using vtkClipPlolyData class to clip my object.. I set a plane with the > SetClip function and It works fine.. but I'd like to set 3 orthogonal planes > and not only one. > Is it possible? > > Thanks, > Luca > > ------------------------------ > Scrivi, parla e gioca con i tuoi amici! Scarica Messenger 2009! > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 Stefan.Bommes at rwth-aachen.de Mon May 4 04:36:09 2009 From: Stefan.Bommes at rwth-aachen.de (Stefan Bommes) Date: Mon, 04 May 2009 10:36:09 +0200 Subject: [vtkusers] time dependant data Message-ID: Hi all, currently, I'm writing a converter to change the output of a flow simulation program into the VTK format. It already works for steady flow fields, but now I want it to convert unsteady cases, too. I've got the data for every occurring time step but I don't know how to apply time dependant data to the VTK format. Is there a way to store data for multiple time steps? Do I have to use the XML format or SL? Stefan From mweiss at cbs.mpg.de Mon May 4 05:36:37 2009 From: mweiss at cbs.mpg.de (Marcel Weiss) Date: Mon, 4 May 2009 11:36:37 +0200 (CEST) Subject: [vtkusers] clip a polydata with 3 orthogonal planes In-Reply-To: Message-ID: <32400410.938931241429797021.JavaMail.root@zimbra> just use an instance of vtkBox as the clip function Marcel Weiss PhD student Department of Neurophysics Max Planck Institute for Human Cognitive and Brain Sciences ----- Original Message ----- From: "J?r?me" To: "Luca Ramundo" Cc: vtkusers at vtk.org Sent: Monday, May 4, 2009 9:54:13 AM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: [vtkusers] clip a polydata with 3 orthogonal planes Hi, I used to instanciate 3 vtkClipPolyData for that to work, just like ImageOrthoSlicer does with 3 vtkImagePlaneWidget. Best, Jerome 2009/5/3 Luca Ramundo < luca.ramundo at hotmail.it > Hi all.. I'm using vtkClipPlolyData class to clip my object.. I set a plane with the SetClip function and It works fine.. but I'd like to set 3 orthogonal planes and not only one. Is it possible? Thanks, Luca Scrivi, parla e gioca con i tuoi amici! Scarica Messenger 2009! _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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 _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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 From jeff.baumes at kitware.com Mon May 4 09:58:59 2009 From: jeff.baumes at kitware.com (Jeff Baumes) Date: Mon, 4 May 2009 09:58:59 -0400 Subject: [vtkusers] vtkDICOMImageReader error In-Reply-To: <200905041553465388597@gmail.com> References: <200905041553465388597@gmail.com> Message-ID: <2137e33e0905040658saa235d9t2fcd706631cfe0e4@mail.gmail.com> This "feels" like an inconsistency in your headers, build libraries, or runtime libraries. When I get that error I try building again from scratch and checking my PATH environment variable to make sure it isn't pulling in some alternate libraries. Jeff 2009/5/4 iskicy > Hello, > > I am trying to read the data from a file with DICOM format. The code I have > written is below: > > > vtkDICOMImageReader* dcm = vtkDICOMImageReader::New(); > dcm->SetDirectoryName("C:/1"); > dcm->SetDataByteOrderToLittleEndian(); > dcm->Update(); > > > It runs successfully on other machines with VS 2005 and VS 6.0. But when I > try to run it in my computer( VS 2005 ), some error happens with blow > information: > > Run-Time Check Failure #0 - The value of ESP was not properly saved across > a function call. This is usually a result of calling a function declared > with one calling convention with a function pointer declared with a > different calling convention. > > I hope someone can help me to solve this problem. > Thanks in advance. > > > 2009-05-04 > ------------------------------ > skicy > --------------------------- > CS @ SJTU > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 joelthelion at laposte.net Mon May 4 10:06:40 2009 From: joelthelion at laposte.net (Joel Schaerer) Date: Mon, 4 May 2009 07:06:40 -0700 (PDT) Subject: [vtkusers] Bug in vtkPolyDataToImageStencil? Message-ID: <23368312.post@talk.nabble.com> Hi all, Following the advice people have given me in http://www.nabble.com/Creating-a-3D-surface-mesh-from-a-stack-of-contours-td23293256.html this thread, I'm trying to create a 3D mesh from a stack of contours using vtkLinearExtrusionFilter, vtkPolyDataToImageStencil and vtkMarchingCubes. It all seems to work quite well except for a very annoying bug, which is that there are spurious white lines in the output of the binarizer. Minimal code showing the problem with sample input and output data, as well as a screenshot of the problem can be found here: http://www.creatis.insa-lyon.fr/~schaerer/binarizer_bug.tar.bz2 The input are a polydata containing a closed polyline, and an empty image to get the required spacing, origin, etc. for the output. Is this a bug in vtk? Or am I missing something? Thanks! joel PS: Here is the sample code: #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(int argc,char * argv[]) { vtkSmartPointer imread=vtkSmartPointer::New(); imread->SetFileName("input.mhd"); imread->Update(); vtkSmartPointer contour_reader=vtkSmartPointer::New(); contour_reader->SetFileName("input_contour.vtk"); contour_reader->Update(); vtkLinearExtrusionFilter * extrude=vtkLinearExtrusionFilter::New(); extrude->SetInput(contour_reader->GetOutput()); extrude->SetVector(0, 0, 3); //3 is the Z spacing between contours //extrude->CappingOn(); //doesn't seem to be doing anything extrude->Update(); vtkPolyDataToImageStencil* sts=vtkPolyDataToImageStencil::New(); vtkImageStencil* stencil=vtkImageStencil::New(); sts->SetInput(extrude->GetOutput()); sts->SetInformationInput(imread->GetOutput()); sts->Update(); stencil->SetStencil(sts->GetOutput()); stencil->SetInput(imread->GetOutput()); vtkSmartPointer binary_writer=vtkSmartPointer::New(); binary_writer->SetInput(stencil->GetOutput()); binary_writer->SetFileName("binary_output.mhd"); binary_writer->Write(); extrude->Delete(); sts->Delete(); stencil->Delete(); return 0; } -- View this message in context: http://www.nabble.com/Bug-in-vtkPolyDataToImageStencil--tp23368312p23368312.html Sent from the VTK - Users mailing list archive at Nabble.com. From joelthelion at laposte.net Mon May 4 10:23:03 2009 From: joelthelion at laposte.net (Joel Schaerer) Date: Mon, 4 May 2009 07:23:03 -0700 (PDT) Subject: [vtkusers] Marching Cubes with Polydata In-Reply-To: References: Message-ID: <23369192.post@talk.nabble.com> Hi, The marching cubes algorithm takes a binary mask and creates a surface mesh out of it, that's not what you're trying to do. What you're trying to do, if I understand well, is to create a surface from a disconnected set of points. This is an ill-posed problem in the general case, however there are solutions in specific case. In the case of your example, if the points are sampled well enough, a vtkDelaunay3D and a vtkGeometryFilter would probably give you the correct solution. joel daviddoria wrote: > > I asked about this a while back, but was never able to get it to work - > Here > is an attempt at a simple example: > > Input data: polydata, points on a sphere > http://rpi.edu/~doriad/SpherePoints.vtp > > required output: the surface of the sphere > > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(Filename.c_str()); > reader->Update(); > > vtkPolyData* InputPolydata = reader->GetOutput(); > > vtkSmartPointer CF = > vtkSmartPointer::New(); > CF->SetInput(InputPolydata); > CF->Update(); > > vtkMarchingCubes* MC = vtkMarchingCubes::New(); > MC->SetInput(CF->GetOutput()); //ERROR: cannot do this, because the > input is vtkPolyData, not vtkImageData > MC->Update(); > > vtkPolyData* Output = MC->GetOutput(); > > //write > vtkSmartPointer writer = > vtkSmartPointer::New(); > writer->SetFileName(Filename.c_str()); > writer->SetInput(Output); > writer->Write(); > > I thought the ContourFilter was supposed to do this polydata to imagedata > conversion? A while back Bryn had recommended creating an empty image data > and manually binning the points, but I feel like there should be a filter > that does this? Also recommended was Deluanay triangulation. I've had bad > luck with this in the past with the type of surfaces I'm trying to > reconstruct, so I would like to compare it to marching cubes. > > There have been several questions about this, but I haven't seen any > resolutions. Has anyone gotten it to work? > > Thanks, > Dave > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -- View this message in context: http://www.nabble.com/Marching-Cubes-with-Polydata-tp23345719p23369192.html Sent from the VTK - Users mailing list archive at Nabble.com. From lars-friedrich at gmx.net Mon May 4 10:58:07 2009 From: lars-friedrich at gmx.net (lars-friedrich) Date: Mon, 4 May 2009 07:58:07 -0700 (PDT) Subject: [vtkusers] Bug in vtkPolyDataToImageStencil? In-Reply-To: <23368312.post@talk.nabble.com> References: <23368312.post@talk.nabble.com> Message-ID: <23370191.post@talk.nabble.com> hi joel, I had a similar problem with 2D-binarization based on a contour. after some experiments, I found out that applying extrude->SetVector(0.1, 0.1, 1) instead of extrude->SetVector(0, 0, 1) worked for me. It seems that the 'straight' zeroes (perpendicular vector) were the problem. maybe these values cause calculation troubles internally - division by zero? don't know ... the marginal vector direction change did not change my segmentation results. maybe applying extrude->SetVector(0.1, 0.1, 3) works in your example, I'd try it ... regards, lars Joel Schaerer wrote: > > Hi all, > > Following the advice people have given me in > http://www.nabble.com/Creating-a-3D-surface-mesh-from-a-stack-of-contours-td23293256.html > this thread, I'm trying to create a 3D mesh from a stack of contours > using vtkLinearExtrusionFilter, vtkPolyDataToImageStencil and > vtkMarchingCubes. > > It all seems to work quite well except for a very annoying bug, which is > that there are spurious white lines in the output of the binarizer. > Minimal code showing the problem with sample input and output data, as > well as a screenshot of the problem can be found here: > > http://www.creatis.insa-lyon.fr/~schaerer/binarizer_bug.tar.bz2 > > The input are a polydata containing a closed polyline, and an empty image > to get the required spacing, origin, etc. for the output. > > Is this a bug in vtk? Or am I missing something? > > Thanks! > > joel > > > PS: Here is the sample code: > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > > > int main(int argc,char * argv[]) > { > vtkSmartPointer > imread=vtkSmartPointer::New(); > imread->SetFileName("input.mhd"); > imread->Update(); > > vtkSmartPointer > contour_reader=vtkSmartPointer::New(); > contour_reader->SetFileName("input_contour.vtk"); > contour_reader->Update(); > > vtkLinearExtrusionFilter * extrude=vtkLinearExtrusionFilter::New(); > extrude->SetInput(contour_reader->GetOutput()); > extrude->SetVector(0, 0, 3); //3 is the Z spacing between contours > //extrude->CappingOn(); //doesn't seem to be doing anything > extrude->Update(); > > vtkPolyDataToImageStencil* sts=vtkPolyDataToImageStencil::New(); > vtkImageStencil* stencil=vtkImageStencil::New(); > sts->SetInput(extrude->GetOutput()); > sts->SetInformationInput(imread->GetOutput()); > sts->Update(); > stencil->SetStencil(sts->GetOutput()); > stencil->SetInput(imread->GetOutput()); > > vtkSmartPointer > binary_writer=vtkSmartPointer::New(); > binary_writer->SetInput(stencil->GetOutput()); > binary_writer->SetFileName("binary_output.mhd"); > binary_writer->Write(); > > extrude->Delete(); > sts->Delete(); > stencil->Delete(); > > return 0; > } > > -- View this message in context: http://www.nabble.com/Bug-in-vtkPolyDataToImageStencil--tp23368312p23370191.html Sent from the VTK - Users mailing list archive at Nabble.com. From joelthelion at laposte.net Mon May 4 11:36:28 2009 From: joelthelion at laposte.net (Joel Schaerer) Date: Mon, 4 May 2009 08:36:28 -0700 (PDT) Subject: [vtkusers] Bug in vtkPolyDataToImageStencil? In-Reply-To: <23370191.post@talk.nabble.com> References: <23368312.post@talk.nabble.com> <23370191.post@talk.nabble.com> Message-ID: <23370933.post@talk.nabble.com> Hi Lars, thanks a lot for your answer! Using extrude->SetVector(0.1, 0.1, 1) on my example does in fact "solve" the problem. However your answer also conforts my feeling that this is indeed a bug in VTK. If nobody opposes it, I will submit it to the VTK bugtracker tomorrow. joel lars-friedrich wrote: > > hi joel, > > I had a similar problem with 2D-binarization based on a contour. after > some experiments, I found out that applying > extrude->SetVector(0.1, 0.1, 1) > instead of > extrude->SetVector(0, 0, 1) > worked for me. > It seems that the 'straight' zeroes (perpendicular vector) were the > problem. maybe these values cause calculation troubles internally - > division by zero? don't know ... > the marginal vector direction change did not change my segmentation > results. > > maybe applying extrude->SetVector(0.1, 0.1, 3) works in your example, I'd > try it ... > > regards, > lars > > > > Joel Schaerer wrote: >> >> Hi all, >> >> Following the advice people have given me in >> http://www.nabble.com/Creating-a-3D-surface-mesh-from-a-stack-of-contours-td23293256.html >> this thread, I'm trying to create a 3D mesh from a stack of contours >> using vtkLinearExtrusionFilter, vtkPolyDataToImageStencil and >> vtkMarchingCubes. >> >> It all seems to work quite well except for a very annoying bug, which is >> that there are spurious white lines in the output of the binarizer. >> Minimal code showing the problem with sample input and output data, as >> well as a screenshot of the problem can be found here: >> >> http://www.creatis.insa-lyon.fr/~schaerer/binarizer_bug.tar.bz2 >> >> The input are a polydata containing a closed polyline, and an empty image >> to get the required spacing, origin, etc. for the output. >> >> Is this a bug in vtk? Or am I missing something? >> >> Thanks! >> >> joel >> >> >> PS: Here is the sample code: >> >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> >> >> >> int main(int argc,char * argv[]) >> { >> vtkSmartPointer >> imread=vtkSmartPointer::New(); >> imread->SetFileName("input.mhd"); >> imread->Update(); >> >> vtkSmartPointer >> contour_reader=vtkSmartPointer::New(); >> contour_reader->SetFileName("input_contour.vtk"); >> contour_reader->Update(); >> >> vtkLinearExtrusionFilter * extrude=vtkLinearExtrusionFilter::New(); >> extrude->SetInput(contour_reader->GetOutput()); >> extrude->SetVector(0, 0, 3); //3 is the Z spacing between contours >> //extrude->CappingOn(); //doesn't seem to be doing anything >> extrude->Update(); >> >> vtkPolyDataToImageStencil* sts=vtkPolyDataToImageStencil::New(); >> vtkImageStencil* stencil=vtkImageStencil::New(); >> sts->SetInput(extrude->GetOutput()); >> sts->SetInformationInput(imread->GetOutput()); >> sts->Update(); >> stencil->SetStencil(sts->GetOutput()); >> stencil->SetInput(imread->GetOutput()); >> >> vtkSmartPointer >> binary_writer=vtkSmartPointer::New(); >> binary_writer->SetInput(stencil->GetOutput()); >> binary_writer->SetFileName("binary_output.mhd"); >> binary_writer->Write(); >> >> extrude->Delete(); >> sts->Delete(); >> stencil->Delete(); >> >> return 0; >> } >> >> > > -- View this message in context: http://www.nabble.com/Bug-in-vtkPolyDataToImageStencil--tp23368312p23370933.html Sent from the VTK - Users mailing list archive at Nabble.com. From nkwmailinglists at gmail.com Mon May 4 13:12:46 2009 From: nkwmailinglists at gmail.com (kent williams) Date: Mon, 4 May 2009 12:12:46 -0500 Subject: [vtkusers] Is there any documentation for VTK wrapping? Message-ID: <44f773f50905041012g6fe09ccbnf3490ae1d9fc0a5d@mail.gmail.com> Maybe I'm just missing the tree I need for the forest, but I went looking for documentation on VTK Wrapping, and came up empty. In fact, in the top ten hits for google search on "vtk wrapping" my own posts to the VTK-Users come up, the ones where I claim that VTK wrapping are driving me insane. I've acquired the bare minimum knowledge necessary to survive VTK wrapping for KWWidgets applications --- use //BTX and //ETX to keep the wrapping parser from losing its mind, always name classes with a 'vtk' prefix, limit argument types to built-in scalar types and char * -- but is VTK wrapping actually documented anywhere? From dave.demarle at kitware.com Mon May 4 13:22:58 2009 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 4 May 2009 13:22:58 -0400 Subject: [vtkusers] [vtk-developers] Is there any documentation for VTK wrapping? In-Reply-To: <44f773f50905041012g6fe09ccbnf3490ae1d9fc0a5d@mail.gmail.com> References: <44f773f50905041012g6fe09ccbnf3490ae1d9fc0a5d@mail.gmail.com> Message-ID: A search on markmail turned up a fairly recent discussion of the topic. http://vtk.markmail.org/search/?q=wrapping#query:wrapping+page:1+mid:plwydwprhlreh24s+state:results It doesn't look the the wiki page was ever moved over to vtk.org. I will do that now. David E DeMarle Kitware, Inc. R&D Engineer 28 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-371-3971 x109 On Mon, May 4, 2009 at 1:12 PM, kent williams wrote: > Maybe I'm just missing the tree I need for the forest, but I went > looking for documentation on VTK Wrapping, and came up empty. > > In fact, in the top ten hits for google search on "vtk wrapping" ?my > own posts to the VTK-Users come up, the ones where I claim that VTK > wrapping are driving me insane. > > I've acquired the bare minimum knowledge necessary to survive VTK > wrapping for KWWidgets applications --- use //BTX and //ETX to keep > the wrapping parser from losing its mind, always name classes with a > 'vtk' prefix, limit argument types to built-in scalar types and char * > -- but is VTK wrapping actually documented anywhere? > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtk-developers > > From pat.marion at kitware.com Mon May 4 14:27:17 2009 From: pat.marion at kitware.com (pat marion) Date: Mon, 4 May 2009 14:27:17 -0400 Subject: [vtkusers] [vtk-developers] Is there any documentation for VTK wrapping? In-Reply-To: References: <44f773f50905041012g6fe09ccbnf3490ae1d9fc0a5d@mail.gmail.com> Message-ID: <2c86953b0905041127r727c5e9foc156b2b24c549c4f@mail.gmail.com> Another helpful detail- you can tell the wrapper to ignore certain files by using this in your CMakeLists.txt: SET_SOURCE_FILES_PROPERTIES( vtkMyUnwrappableClass.cxx WRAP_EXCLUDE ) Pat On Mon, May 4, 2009 at 1:22 PM, David E DeMarle wrote: > A search on markmail turned up a fairly recent discussion of the topic. > > http://vtk.markmail.org/search/?q=wrapping#query:wrapping+page:1+mid:plwydwprhlreh24s+state:results > > It doesn't look the the wiki page was ever moved over to vtk.org. I > will do that now. > > David E DeMarle > Kitware, Inc. > R&D Engineer > 28 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-371-3971 x109 > > > > On Mon, May 4, 2009 at 1:12 PM, kent williams wrote: >> Maybe I'm just missing the tree I need for the forest, but I went >> looking for documentation on VTK Wrapping, and came up empty. >> >> In fact, in the top ten hits for google search on "vtk wrapping" ?my >> own posts to the VTK-Users come up, the ones where I claim that VTK >> wrapping are driving me insane. >> >> I've acquired the bare minimum knowledge necessary to survive VTK >> wrapping for KWWidgets applications --- use //BTX and //ETX to keep >> the wrapping parser from losing its mind, always name classes with a >> 'vtk' prefix, limit argument types to built-in scalar types and char * >> -- but is VTK wrapping actually documented anywhere? >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtk-developers >> >> > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtk-developers > > From darren.weber.lists at gmail.com Mon May 4 16:18:15 2009 From: darren.weber.lists at gmail.com (Darren Weber) Date: Mon, 4 May 2009 13:18:15 -0700 Subject: [vtkusers] [vtk-developers] Is there any documentation for VTK wrapping? In-Reply-To: <2c86953b0905041127r727c5e9foc156b2b24c549c4f@mail.gmail.com> References: <44f773f50905041012g6fe09ccbnf3490ae1d9fc0a5d@mail.gmail.com> <2c86953b0905041127r727c5e9foc156b2b24c549c4f@mail.gmail.com> Message-ID: Does the python (and other lang) wrapping depend on swig? Thanks, Darren On Mon, May 4, 2009 at 11:27 AM, pat marion wrote: > Another helpful detail- you can tell the wrapper to ignore certain > files by using this in your CMakeLists.txt: > > SET_SOURCE_FILES_PROPERTIES( > vtkMyUnwrappableClass.cxx > WRAP_EXCLUDE > ) > > Pat > > On Mon, May 4, 2009 at 1:22 PM, David E DeMarle > wrote: > > A search on markmail turned up a fairly recent discussion of the topic. > > > > > http://vtk.markmail.org/search/?q=wrapping#query:wrapping+page:1+mid:plwydwprhlreh24s+state:results > > > > It doesn't look the the wiki page was ever moved over to vtk.org. I > > will do that now. > > > > David E DeMarle > > Kitware, Inc. > > R&D Engineer > > 28 Corporate Drive > > Clifton Park, NY 12065-8662 > > Phone: 518-371-3971 x109 > > > > > > > > On Mon, May 4, 2009 at 1:12 PM, kent williams > wrote: > >> Maybe I'm just missing the tree I need for the forest, but I went > >> looking for documentation on VTK Wrapping, and came up empty. > >> > >> In fact, in the top ten hits for google search on "vtk wrapping" my > >> own posts to the VTK-Users come up, the ones where I claim that VTK > >> wrapping are driving me insane. > >> > >> I've acquired the bare minimum knowledge necessary to survive VTK > >> wrapping for KWWidgets applications --- use //BTX and //ETX to keep > >> the wrapping parser from losing its mind, always name classes with a > >> 'vtk' prefix, limit argument types to built-in scalar types and char * > >> -- but is VTK wrapping actually documented anywhere? > >> _______________________________________________ > >> Powered by www.kitware.com > >> > >> Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > >> > >> Follow this link to subscribe/unsubscribe: > >> http://www.vtk.org/mailman/listinfo/vtk-developers > >> > >> > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > > Follow this link to subscribe/unsubscribe: > > http://www.vtk.org/mailman/listinfo/vtk-developers > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtk-developers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcthomp at sandia.gov Mon May 4 16:17:57 2009 From: dcthomp at sandia.gov (David Thompson) Date: Mon, 04 May 2009 13:17:57 -0700 Subject: [vtkusers] [vtk-developers] Is there any documentation for VTK wrapping? In-Reply-To: References: <44f773f50905041012g6fe09ccbnf3490ae1d9fc0a5d@mail.gmail.com> <2c86953b0905041127r727c5e9foc156b2b24c549c4f@mail.gmail.com> Message-ID: <1241468277.7244.8971.camel@gonzo> > Does the python (and other lang) wrapping depend on swig? No, the wrapping in VTK is a parser written in C with the help of lex and yacc. It was written before SWIG existed, as I recall. David > On Mon, May 4, 2009 at 11:27 AM, pat marion > wrote: > Another helpful detail- you can tell the wrapper to ignore > certain > files by using this in your CMakeLists.txt: > > SET_SOURCE_FILES_PROPERTIES( > vtkMyUnwrappableClass.cxx > WRAP_EXCLUDE > ) > > Pat > > > On Mon, May 4, 2009 at 1:22 PM, David E DeMarle > wrote: > > A search on markmail turned up a fairly recent discussion of > the topic. > > > > http://vtk.markmail.org/search/?q=wrapping#query:wrapping > +page:1+mid:plwydwprhlreh24s+state:results > > > > It doesn't look the the wiki page was ever moved over to > vtk.org. I > > will do that now. > > > > David E DeMarle > > Kitware, Inc. > > R&D Engineer > > 28 Corporate Drive > > Clifton Park, NY 12065-8662 > > Phone: 518-371-3971 x109 > > > > > > > > On Mon, May 4, 2009 at 1:12 PM, kent williams > wrote: > >> Maybe I'm just missing the tree I need for the forest, but > I went > >> looking for documentation on VTK Wrapping, and came up > empty. > >> > >> In fact, in the top ten hits for google search on "vtk > wrapping" my > >> own posts to the VTK-Users come up, the ones where I claim > that VTK > >> wrapping are driving me insane. > >> > >> I've acquired the bare minimum knowledge necessary to > survive VTK > >> wrapping for KWWidgets applications --- use //BTX and //ETX > to keep > >> the wrapping parser from losing its mind, always name > classes with a > >> 'vtk' prefix, limit argument types to built-in scalar types > and char * > >> -- but is VTK wrapping actually documented anywhere? > >> _______________________________________________ > >> Powered by www.kitware.com > >> > >> Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > >> > >> Follow this link to subscribe/unsubscribe: > >> http://www.vtk.org/mailman/listinfo/vtk-developers > >> > >> > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > > Follow this link to subscribe/unsubscribe: > > http://www.vtk.org/mailman/listinfo/vtk-developers > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtk-developers > > > From darren.weber.lists at gmail.com Mon May 4 16:29:40 2009 From: darren.weber.lists at gmail.com (Darren Weber) Date: Mon, 4 May 2009 13:29:40 -0700 Subject: [vtkusers] [vtk-developers] Is there any documentation for VTK wrapping? In-Reply-To: <1241468277.7244.8971.camel@gonzo> References: <44f773f50905041012g6fe09ccbnf3490ae1d9fc0a5d@mail.gmail.com> <2c86953b0905041127r727c5e9foc156b2b24c549c4f@mail.gmail.com> <1241468277.7244.8971.camel@gonzo> Message-ID: I'm working on the package for vtk 5-4-0 in macports (vtk-devel). The src/Wrapping/README.txt indicates a dependency on yacc (byacc) and flex. I have the following available (through macports), which dependency should I use? ***************************************************************************** bison @2.4.1 (devel) general-purpose parser generator bison1 @1.875 (devel, lang) general-purpose parser generator byacc @20090221 (devel) Berkeley Yacc flex @2.5.35 (devel) Fast lexical analyser generator py-bison @0.1.8 (python, lang) Python-based parsing at the speed of C ***************************************************************************** bison @2.4.1 (devel) Variants: universal, yacc Bison is a general-purpose parser generator that converts a grammar description for an LALR context-free grammar into a C program to parse that grammar. Once you are proficient with Bison, you can use it to develop a wide range of language parsers, from those used in simple desk calculators to complex programming languages. Homepage: http://www.gnu.org/software/bison/ Library Dependencies: gettext, m4, libiconv Platforms: darwin Maintainers: mww at macports.org ***************************************************************************** byacc @20090221 (devel) Variants: universal Berkeley Yacc (byacc) is generally conceded to be the best yacc variant available. In contrast to bison, it is written to avoid dependencies upon a particular compiler. Homepage: http://invisible-island.net/byacc/ Platforms: darwin Maintainers: toby at macports.org ***************************************************************************** Furthermore, if both bison yacc and byacc are installed, how are they called; ie, how do we control which one is used? Thanks in advance, Darren On Mon, May 4, 2009 at 1:17 PM, David Thompson wrote: > > Does the python (and other lang) wrapping depend on swig? > No, the wrapping in VTK is a parser written in C with the help of lex > and yacc. It was written before SWIG existed, as I recall. > > David > > > On Mon, May 4, 2009 at 11:27 AM, pat marion > > wrote: > > Another helpful detail- you can tell the wrapper to ignore > > certain > > files by using this in your CMakeLists.txt: > > > > SET_SOURCE_FILES_PROPERTIES( > > vtkMyUnwrappableClass.cxx > > WRAP_EXCLUDE > > ) > > > > Pat > > > > > > On Mon, May 4, 2009 at 1:22 PM, David E DeMarle > > wrote: > > > A search on markmail turned up a fairly recent discussion of > > the topic. > > > > > > http://vtk.markmail.org/search/?q=wrapping#query:wrapping > > +page:1+mid:plwydwprhlreh24s+state:results > > > > > > It doesn't look the the wiki page was ever moved over to > > vtk.org. I > > > will do that now. > > > > > > David E DeMarle > > > Kitware, Inc. > > > R&D Engineer > > > 28 Corporate Drive > > > Clifton Park, NY 12065-8662 > > > Phone: 518-371-3971 x109 > > > > > > > > > > > > On Mon, May 4, 2009 at 1:12 PM, kent williams > > wrote: > > >> Maybe I'm just missing the tree I need for the forest, but > > I went > > >> looking for documentation on VTK Wrapping, and came up > > empty. > > >> > > >> In fact, in the top ten hits for google search on "vtk > > wrapping" my > > >> own posts to the VTK-Users come up, the ones where I claim > > that VTK > > >> wrapping are driving me insane. > > >> > > >> I've acquired the bare minimum knowledge necessary to > > survive VTK > > >> wrapping for KWWidgets applications --- use //BTX and //ETX > > to keep > > >> the wrapping parser from losing its mind, always name > > classes with a > > >> 'vtk' prefix, limit argument types to built-in scalar types > > and char * > > >> -- but is VTK wrapping actually documented anywhere? > > >> _______________________________________________ > > >> Powered by www.kitware.com > > >> > > >> Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > >> > > >> Follow this link to subscribe/unsubscribe: > > >> http://www.vtk.org/mailman/listinfo/vtk-developers > > >> > > >> > > > _______________________________________________ > > > Powered by www.kitware.com > > > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > > > Follow this link to subscribe/unsubscribe: > > > http://www.vtk.org/mailman/listinfo/vtk-developers > > > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Follow this link to subscribe/unsubscribe: > > http://www.vtk.org/mailman/listinfo/vtk-developers > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Pont at scionresearch.com Mon May 4 16:41:27 2009 From: David.Pont at scionresearch.com (David.Pont at scionresearch.com) Date: Tue, 5 May 2009 08:41:27 +1200 Subject: [vtkusers] clip a polydata with 3 orthogonal planes In-Reply-To: Message-ID: Luca, You could also try vtkPlanes, it is a vtkImplicitFunction Dave P J?r?me wrote on 04/05/2009 19:54:13: > Hi, > I used to instanciate 3 vtkClipPolyData for that to work, just like > ImageOrthoSlicer does with 3 vtkImagePlaneWidget. > > Best, > Jerome > 2009/5/3 Luca Ramundo > Hi all.. > I'm using vtkClipPlolyData class to clip my object.. I set a plane > with the SetClip function and It works fine.. but I'd like to set 3 > orthogonal planes and not only one. > Is it possible? > > Thanks, > Luca > > Scrivi, parla e gioca con i tuoi amici! Scarica Messenger 2009! > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 dcthomp at sandia.gov Mon May 4 16:40:53 2009 From: dcthomp at sandia.gov (David Thompson) Date: Mon, 04 May 2009 13:40:53 -0700 Subject: [vtkusers] [vtk-developers] Is there any documentation for VTK wrapping? In-Reply-To: References: <44f773f50905041012g6fe09ccbnf3490ae1d9fc0a5d@mail.gmail.com> <2c86953b0905041127r727c5e9foc156b2b24c549c4f@mail.gmail.com> <1241468277.7244.8971.camel@gonzo> Message-ID: <1241469653.7244.8989.camel@gonzo> > I'm working on the package for vtk 5-4-0 in macports (vtk-devel). The > src/Wrapping/README.txt indicates a dependency on yacc (byacc) and > flex. I have the following available (through macports), which > dependency should I use? Since the VTK CVS repository and source distributions include the output of byacc and flex, there is no need for a dependency on these to build VTK. You'll only need them when changing the parser. As the README.txt says, bison cannot be used -- only byacc. David > > ***************************************************************************** > > bison @2.4.1 (devel) > general-purpose parser generator > > bison1 @1.875 (devel, lang) > general-purpose parser generator > > byacc @20090221 (devel) > Berkeley Yacc > > flex @2.5.35 (devel) > Fast lexical analyser generator > > py-bison @0.1.8 (python, lang) > Python-based parsing at the speed of C > > ***************************************************************************** > > bison @2.4.1 (devel) > Variants: universal, yacc > > Bison is a general-purpose parser generator that converts a grammar > description for an LALR context-free grammar into a C program to > parse that grammar. Once you are proficient with Bison, you can use it > to develop a wide range of language parsers, from those used in > simple desk calculators to complex programming languages. > Homepage: http://www.gnu.org/software/bison/ > > Library Dependencies: gettext, m4, libiconv > Platforms: darwin > Maintainers: mww at macports.org > > ***************************************************************************** > > byacc @20090221 (devel) > Variants: universal > > Berkeley Yacc (byacc) is generally conceded to be the best yacc > variant available. In contrast to bison, it is written to avoid > dependencies upon a particular compiler. > Homepage: http://invisible-island.net/byacc/ > > Platforms: darwin > Maintainers: toby at macports.org > > ***************************************************************************** > > > Furthermore, if both bison yacc and byacc are installed, how are they > called; ie, how do we control which one is used? > > Thanks in advance, > Darren > > > > > > On Mon, May 4, 2009 at 1:17 PM, David Thompson > wrote: > > Does the python (and other lang) wrapping depend on swig? > > No, the wrapping in VTK is a parser written in C with the help > of lex > and yacc. It was written before SWIG existed, as I recall. > > David > > > > On Mon, May 4, 2009 at 11:27 AM, pat marion > > > wrote: > > Another helpful detail- you can tell the wrapper to > ignore > > certain > > files by using this in your CMakeLists.txt: > > > > SET_SOURCE_FILES_PROPERTIES( > > vtkMyUnwrappableClass.cxx > > WRAP_EXCLUDE > > ) > > > > Pat > > > > > > On Mon, May 4, 2009 at 1:22 PM, David E DeMarle > > wrote: > > > A search on markmail turned up a fairly recent > discussion of > > the topic. > > > > > > > http://vtk.markmail.org/search/?q=wrapping#query:wrapping > > +page:1+mid:plwydwprhlreh24s+state:results > > > > > > It doesn't look the the wiki page was ever moved > over to > > vtk.org. I > > > will do that now. > > > > > > David E DeMarle > > > Kitware, Inc. > > > R&D Engineer > > > 28 Corporate Drive > > > Clifton Park, NY 12065-8662 > > > Phone: 518-371-3971 x109 > > > > > > > > > > > > On Mon, May 4, 2009 at 1:12 PM, kent williams > > wrote: > > >> Maybe I'm just missing the tree I need for the > forest, but > > I went > > >> looking for documentation on VTK Wrapping, and > came up > > empty. > > >> > > >> In fact, in the top ten hits for google search on > "vtk > > wrapping" my > > >> own posts to the VTK-Users come up, the ones > where I claim > > that VTK > > >> wrapping are driving me insane. > > >> > > >> I've acquired the bare minimum knowledge > necessary to > > survive VTK > > >> wrapping for KWWidgets applications --- use //BTX > and //ETX > > to keep > > >> the wrapping parser from losing its mind, always > name > > classes with a > > >> 'vtk' prefix, limit argument types to built-in > scalar types > > and char * > > >> -- but is VTK wrapping actually documented > anywhere? > > >> _______________________________________________ > > >> Powered by www.kitware.com > > >> > > >> Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > >> > > >> Follow this link to subscribe/unsubscribe: > > >> > http://www.vtk.org/mailman/listinfo/vtk-developers > > >> > > >> > > > _______________________________________________ > > > Powered by www.kitware.com > > > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > > > Follow this link to subscribe/unsubscribe: > > > http://www.vtk.org/mailman/listinfo/vtk-developers > > > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Follow this link to subscribe/unsubscribe: > > http://www.vtk.org/mailman/listinfo/vtk-developers > > > > > > > > > > From jalal.sadeghy at gmail.com Tue May 5 04:30:18 2009 From: jalal.sadeghy at gmail.com (jalal sadeghi) Date: Tue, 5 May 2009 13:00:18 +0430 Subject: [vtkusers] ImmediateModeRenderingOn Message-ID: Hi I have multiple renderer in multiple windows . i add some polydata to them;in other way i create an actor and add it to multiple renderer.but after that some strange behavior occurred.some property changed randomly position,color or its polydata .after 2 week i Suddenly found that the problem is ImmediateModeRenderingOn ,but there isnot clear document about why i cant share polydata beeetween multiple context.can any one help me? thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Maxim.Schaefner at gmx.de Tue May 5 07:20:06 2009 From: Maxim.Schaefner at gmx.de (=?iso-8859-1?Q?=22Maxim_Sch=E4fner=22?=) Date: Tue, 05 May 2009 13:20:06 +0200 Subject: [vtkusers] Got vtkPolydata out of vtkActor, can get vtkCells out of it, but can't get textureCoordinates Message-ID: <20090505112006.133490@gmx.net> Hello, I need realy help with the fellowing. I assigned an vtkActor with a mapped vtkSphereSource. Now I want to get the data of this, on another side of the programm. I managed to get the the vtkPolyData of the vtkActor. Now I can run through the vtkPolyData and get the Cells of it. If I ask for example for the NumberOfCells, I get the correct count and can even calculate facenormals for example.... But if I ask for NumberOfVerts, I get 0. I have no idea, why. The 3d-object is displayed right with texture and so on... Thanks for any advice. Maxim Some code: vtkSphereSource *sphere = vtkSphereSource::New(); sphere->SetRadius(10.5); sphere->SetThetaResolution(5); sphere->SetPhiResolution(5); vtkTextureMapToSphere *tmapper = vtkTextureMapToSphere::New(); tmapper->SetInput(sphere->GetOutput()); tmapper->PreventSeamOn(); vtkTransformTextureCoords *xform = vtkTransformTextureCoords::New(); xform->SetInput(tmapper->GetOutput()); vtkDataSetMapper *mapper = vtkDataSetMapper::New(); mapper->SetInput(xform->GetOutput()); vtkBMPReader *cmr = vtkBMPReader::New(); cmr->SetFileName(VTK_DATA_ROOT "cm.bmp"); vtkTexture *cmt = vtkTexture::New(); cmt->SetInputConnection(cmr->GetOutputPort()); cmt->InterpolateOn(); vtkActor *aSphere = vtkActor::New(); aSphere->SetMapper(mapper); //add to scene... /////////////////////////////////// OTHER SIDE ////////////////////////////////// void fct(vtkActor *actor){ ... vtkPolyData *pd = (vtkPolyData*)actor->GetMapper()->GetInput(); cout<GetNumberOfVerts()<GetNumberOfCells()< Hi, I have an 3d visualization application which reads data from a file which isn't related to vtk and at present I'm having to write the data out in vtk format to disk and then let a vtk reader read it a second time. It would help considerably if I was able to simply pass the data to vtk internally but thus far I've not been able to figure out how to do it and nothing I see on the web helps. The data is unsigned char and the piece of code which presents it looks like this: void AddBagVolumeToWindow4(vtk.vtkRenderWindow renWin) { // 3d texture map vtkStructuredPointsReader reader = new vtkStructuredPointsReader(); vtkVolume volume = new vtkVolume(); vtkVolumeProperty volumeProperty = new vtkVolumeProperty(); vtkRenderer renderer = new vtkRenderer(); vtkRenderWindowInteractor interactor = new vtkRenderWindowInteractor(); vtkVolumeTextureMapper3D volumeMapper = new vtkVolumeTextureMapper3D(); //vtkVolumeRayCastCompositeFunction compositeFunction = new vtkVolumeRayCastCompositeFunction(); vtkPiecewiseFunction opacity = new vtkPiecewiseFunction(); vtkColorTransferFunction color = new vtkColorTransferFunction(); reader.SetFileName("c:\\zz.vtk"); reader.Update(); opacity.AddPoint(0, 0); opacity.AddPoint(64, .005); opacity.AddPoint(128, .01); opacity.AddPoint(200, .05); opacity.AddPoint(220, .4); color.AddRGBPoint(64, .665, .84, .88); color.AddRGBPoint(128, 0, .746, .95); color.AddRGBPoint(220, 0, 1, 0); color.AddRGBPoint(230, 1, 0, 0); volumeProperty.SetColor(color); volumeProperty.SetScalarOpacity(opacity); volumeProperty.SetInterpolationTypeToLinear(); volumeProperty.ShadeOn(); volumeMapper.SetInput(reader.GetOutput()); //int[] iiex = reader.GetOutput().GetExtent(); volume.SetMapper(volumeMapper); volume.SetProperty(volumeProperty); renderer.SetBackground(1, 1, 1); renderer.AddVolume(volume); interactor.SetRenderWindow(renWin); renWin.AddRenderer(renderer); renx = renderer; volx = volume; renWin.Render(); interactor.Start(); vtk.vtkWin32OpenGLRenderWindow win32win = vtk.vtkWin32OpenGLRenderWindow.SafeDownCast(renWin); win32win.Clean(); } That's after the data has been written out to "c:\\zz.vtk" of course. What it looks like I'd want to do, rather than use the vtkStructuredPointsReader, is to set up my own vtkStructuredPoints object something like: vtkStructuredPoints bsp = new vtkStructuredPoints(); bsp.SetScalarTypeToUnsignedChar(); bsp.SetDimensions(Width, Height, NumSlices); bsp.SetOrigin(0, 0, 0); bsp.SetExtent(0, Width - 1, 0, Height - 1, 0, NumSlices - 1); and then set the data array but, again, I've no clue as to how to do that. Any help would be apreciated. Ted -------------- next part -------------- An HTML attachment was scrubbed... URL: From emonson at cs.duke.edu Tue May 5 11:38:54 2009 From: emonson at cs.duke.edu (Eric E. Monson) Date: Tue, 5 May 2009 11:38:54 -0400 Subject: [vtkusers] Store multiple versions of an array in a vtp file In-Reply-To: References: Message-ID: Hey David, I think the easiest way would be to either write a separate vtp file for each iteration (and then write a pvd file to treat them as a time series for animating in ParaView), or else change your data file format. I've never used it, but evidently the Ensight Gold format allows separate files for the mesh and the data associated with it. For my work I use XDMF (http://xdmf.org), which would allow you to write one copy of the geometry and the scalars for each iteration to a single HDF5 file, and then the XMF file that goes with it would describe a time series which points to the one copy of the geometry on each "time" step along with the new cluster array scalars. Otherwise, as a long-shot, there was some talk on the ParaView mailing list last year saying that vtu files could actually hold multiple time steps, and that someone had patches which would allow pvd files to be read in using "shared" geometry, but I'm not sure what the status of that is... http://www.vtk.org/pipermail/vtkusers/2008-February/094463.html Good luck, -Eric ------------------------------------------------------ Eric E Monson Duke Visualization Technology Group On May 3, 2009, at 6:09 PM, David Doria wrote: > I have added a "ClassLabel" array to a polydata which stores, for > each point, which class/cluster the point is associated with > (integer values). I would like to track these class associations > over "time", that is, in each iteration of my clustering algorithm, > I would like to save the current class associations, the idea being > that I could watch the evolution of the clusters in paraview. It > seems silly to add a bunch of vectors (Association_1, > Association_2, ... Association_1000), and I don't think that would > be able to be animated anyway. Is there a way to do this without > having to write a separate vtp file for each one of these iterations > (as they would quickly fill the hard drive!)? > > Thanks, > > David > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers From dave.demarle at kitware.com Tue May 5 11:47:46 2009 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 5 May 2009 11:47:46 -0400 Subject: [vtkusers] vtkPOVExporter problem - multiple face_indices In-Reply-To: <3B835AA9B5452B449FDA04A828CDD19701D6B0428BF7@EXCHMB.ornl.gov> References: <3B835AA9B5452B449FDA04A828CDD19701D6B0428BF7@EXCHMB.ornl.gov> Message-ID: Hi Ray, Ollie said that it may be a bug in vtkPOVExporter. If the PolyData has both polygon and triangle strip, it will generate two face_indices in a single mesh2. If you insert a vtkTriangleFilter into the pipeline before the exported, it should get by the bug. David E DeMarle Kitware, Inc. R&D Engineer 28 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-371-3971 x109 On Fri, Apr 24, 2009 at 12:59 PM, Flanery Jr, Raymond E. wrote: > For some reason my application is creating 2 sets of face_indices for each mesh object, which POVRAY does not like. I have reduced this to a fairly simple case. If you run test1.py it generates incorrect povray file, test2.py generates correct povray file. The difference is that test1.py extrudes the polygon and test2.py does not. > > I have attached the files. Is there a bug in vtkPOVExporter? > > Ray Flanery > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > > From daviddoria at gmail.com Tue May 5 12:16:30 2009 From: daviddoria at gmail.com (David Doria) Date: Tue, 5 May 2009 12:16:30 -0400 Subject: [vtkusers] Store multiple versions of an array in a vtp file In-Reply-To: References: Message-ID: On Tue, May 5, 2009 at 11:38 AM, Eric E. Monson wrote: > Hey David, > > I think the easiest way would be to either write a separate vtp file for > each iteration (and then write a pvd file to treat them as a time series for > animating in ParaView), or else change your data file format. > > I've never used it, but evidently the Ensight Gold format allows separate > files for the mesh and the data associated with it. For my work I use XDMF ( > http://xdmf.org), which would allow you to write one copy of the geometry > and the scalars for each iteration to a single HDF5 file, and then the XMF > file that goes with it would describe a time series which points to the one > copy of the geometry on each "time" step along with the new cluster array > scalars. > > Otherwise, as a long-shot, there was some talk on the ParaView mailing list > last year saying that vtu files could actually hold multiple time steps, and > that someone had patches which would allow pvd files to be read in using > "shared" geometry, but I'm not sure what the status of that is... > > http://www.vtk.org/pipermail/vtkusers/2008-February/094463.html > > Good luck, > -Eric > > ------------------------------------------------------ > Eric E Monson > Duke Visualization Technology Group Eric - I already have 10,000 (ok, maybe I'm exaggerating a little bit :) ) file formats to convert from/to, so it'd be nice to keep everything in vt*. Does anyone know what happened to the patches Eric is talking about (either multiple timesteps in a vtu or "shared" geometry?) That thread seemed to die with no resolution. Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christopher.E.Kees at usace.army.mil Tue May 5 13:25:52 2009 From: Christopher.E.Kees at usace.army.mil (Chris Kees) Date: Tue, 5 May 2009 12:25:52 -0500 Subject: [vtkusers] Mac/Cocoa/Qt "invalid drawable" Message-ID: <042F896A-814A-4589-8058-A2E05C944074@usace.army.mil> Hi, I've installed vtk from cvs on a Mac with OS X 10.5.6 using the 64 bit Qt 4.5 libraries and the patched VTK source. The code runs fine except I get a warning: 2009-05-05 12:17:16.313 python[75352:807] invalid drawable when calling Initialize on the QVTKRenderWindowInteractor. If I just remove the Initialize call then the code runs fine without warnings. I saw a post from 2005 that mentioned the warning and a work around that I don't quite understand. Anybody know if this is still something that needs a work around, or am I just doing something wrong? Chris Here's an example that generates the warning (needs PyQt installed as well): #!/usr/bin/env python from vtk import * from vtk.qt4.QVTKRenderWindowInteractor import * import sys from PyQt4 import QtGui import copy app = QtGui.QApplication(sys.argv) import numpy from math import cos,sin nPoints=10 x = numpy.zeros((3,),'d') d=2.0 pointData=vtkPoints() pointData.SetNumberOfPoints(2*nPoints) for ix in range(2): for iTheta in range(nPoints): x[0] = ix*d x[1] = cos(float(iTheta)*(2.0*3.14)/float(nPoints)) x[2] = sin(float(iTheta)*(2.0*3.14)/float(nPoints)) pointData.SetPoint(ix*nPoints+iTheta,x) polygons=vtkCellArray() scalars=vtkDoubleArray() for ix in range(2): polygons.InsertNextCell(nPoints) scalars.InsertNextValue(float(ix)) for iTheta in range(nPoints): polygons.InsertCellPoint(ix*nPoints+iTheta) ix=0 for iTheta in range(nPoints): polygons.InsertNextCell(4) scalars.InsertNextValue(0.5) polygons.InsertCellPoint(ix*nPoints+iTheta) polygons.InsertCellPoint(ix*nPoints+(iTheta+1)%nPoints) polygons.InsertCellPoint((ix+1)*nPoints+(iTheta+1)%nPoints) polygons.InsertCellPoint((ix+1)*nPoints+iTheta) cylinder = vtkPolyData() cylinder.SetPoints(pointData) cylinder.SetPolys(polygons) cylinder.GetCellData().SetScalars(scalars) # #visualize # tabs = True#False mainWindow = QtGui.QMainWindow() if tabs: tabWidget = QtGui.QTabWidget(mainWindow) mainWindow.setCentralWidget(tabWidget) frameWidget = QtGui.QFrame(mainWindow) hbox = QtGui.QHBoxLayout() frameWidget2 = QtGui.QFrame(mainWindow) hbox2 = QtGui.QHBoxLayout() iren = QVTKRenderWindowInteractor(frameWidget) iren2 = QVTKRenderWindowInteractor(frameWidget2) else: frameWidget = QtGui.QFrame(mainWindow) hbox = QtGui.QHBoxLayout() mainWindow.setCentralWidget(frameWidget) iren = QVTKRenderWindowInteractor(frameWidget) iren2 = QVTKRenderWindowInteractor(frameWidget) iren.Initialize() iren2.Initialize() cylinderMapper = vtkPolyDataMapper() cylinderMapper.SetInput(cylinder) cylinderMapper.SetScalarRange(0,1) cylinderActor = vtkActor() cylinderActor.SetMapper(cylinderMapper) renderer = vtkRenderer() renderer.AddActor(cylinderActor) renderer2 = vtkRenderer() renderer2.AddActor(cylinderActor) renWin = iren.GetRenderWindow() renWin.AddRenderer(renderer) renWin2 = iren2.GetRenderWindow() renWin2.AddRenderer(renderer2) if tabs: hbox.addWidget(iren) frameWidget.setLayout(hbox) hbox2.addWidget(iren2) frameWidget2.setLayout(hbox2) tabWidget.addTab(frameWidget,"Cylinder 1") tabWidget.addTab(frameWidget2,"Cylinder 2") else: hbox.addWidget(iren) hbox.addWidget(iren2) frameWidget.setLayout(hbox) mainWindow.show() #iren.show() #iren2.show() #app.exec_() #iren.show() #iren2.show() #app.exec_() sys.exit(app.exec_()) From mike.jackson at bluequartz.net Tue May 5 13:51:36 2009 From: mike.jackson at bluequartz.net (Mike Jackson) Date: Tue, 5 May 2009 13:51:36 -0400 Subject: [vtkusers] How to set data programmatically... In-Reply-To: <897102.67127.qm@web38608.mail.mud.yahoo.com> References: <897102.67127.qm@web38608.mail.mud.yahoo.com> Message-ID: <811a1f290905051051q1e9f215y4a555291e4a34be9@mail.gmail.com> You probably want to write your own custom reader object. There are lots of examples floating around the internet on that. The basics are: Select a vtk class in which to inherit from. In your case probably vtkStructuredPointsAlgorithm? programatically set the "numberOfInputs=0". Implement the RequestInformation and RequestData methods. In the RequestInformation method you should read just enough information from your file to be able to setup the output type with its extents and all that. In the RequestData method do the actual reading of data from your file and convert it into a vtk object as appropriate. HTH Mike On Tue, May 5, 2009 at 11:26 AM, Theodore Holden wrote: > Hi, > > I have an 3d visualization application which reads data from a file which > isn't related to vtk and at present I'm having to write the data out in vtk > format to disk and then let a vtk reader read it a second time. > > It would help considerably if I was able to simply pass the data to vtk > internally but thus far I've not been able to figure out how to do it and > nothing I see on the web helps.? The data is unsigned char and the piece of > code which presents it looks like this: > > ?????? void AddBagVolumeToWindow4(vtk.vtkRenderWindow renWin) > ??????? { > ??????????? // 3d texture map > ??????????? vtkStructuredPointsReader reader = new > vtkStructuredPointsReader(); > > ??????????? vtkVolume volume = new vtkVolume(); > ??????????? vtkVolumeProperty volumeProperty = new vtkVolumeProperty(); > > ??????????? vtkRenderer renderer = new vtkRenderer(); > ??????????? vtkRenderWindowInteractor interactor = new > vtkRenderWindowInteractor(); > ??????????? vtkVolumeTextureMapper3D volumeMapper = new > vtkVolumeTextureMapper3D(); > ??????????? //vtkVolumeRayCastCompositeFunction compositeFunction = new > vtkVolumeRayCastCompositeFunction(); > > ??????????? vtkPiecewiseFunction opacity = new vtkPiecewiseFunction(); > ??????????? vtkColorTransferFunction color = new vtkColorTransferFunction(); > > ??????????? reader.SetFileName("c:\\zz.vtk"); > ??????????? reader.Update(); > > ??????????? opacity.AddPoint(0, 0); > ??????????? opacity.AddPoint(64, .005); > ??????????? opacity.AddPoint(128, .01); > ??????????? opacity.AddPoint(200, .05); > ??????????? opacity.AddPoint(220, .4); > > ??????????? color.AddRGBPoint(64, .665, .84, .88); > ??????????? color.AddRGBPoint(128, 0, .746, .95); > ??????????? color.AddRGBPoint(220, 0, 1, 0); > ??????????? color.AddRGBPoint(230, 1, 0, 0); > > ??????????? volumeProperty.SetColor(color); > ??????????? volumeProperty.SetScalarOpacity(opacity); > ??????????? volumeProperty.SetInterpolationTypeToLinear(); > ??????????? volumeProperty.ShadeOn(); > > ??????????? volumeMapper.SetInput(reader.GetOutput()); > > ??????????? //int[] iiex = reader.GetOutput().GetExtent(); > > ??????????? volume.SetMapper(volumeMapper); > ??????????? volume.SetProperty(volumeProperty); > > ??????????? renderer.SetBackground(1, 1, 1); > ??????????? renderer.AddVolume(volume); > > ??????????? interactor.SetRenderWindow(renWin); > ??????????? renWin.AddRenderer(renderer); > > ??????????? renx = renderer; > ??????????? volx = volume; > > ??????????? renWin.Render(); > ??????????? interactor.Start(); > > ??????????? vtk.vtkWin32OpenGLRenderWindow win32win = > ??????????????? vtk.vtkWin32OpenGLRenderWindow.SafeDownCast(renWin); > ??????????? win32win.Clean(); > > ??????? } > > That's after the data has been written out to "c:\\zz.vtk" of course.? What > it looks like I'd want to do, rather than use the vtkStructuredPointsReader, > is to set up my own vtkStructuredPoints object something like: > > ??????????? vtkStructuredPoints bsp = new vtkStructuredPoints(); > ??????????? bsp.SetScalarTypeToUnsignedChar(); > ??????????? bsp.SetDimensions(Width, Height, NumSlices); > ??????????? bsp.SetOrigin(0, 0, 0); > ??????????? bsp.SetExtent(0, Width - 1, 0, Height - 1, 0, NumSlices - 1); > > ?and then set the data array but, again, I've no clue as to how to do that. > Any help would be apreciated. > > > Ted > > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > From shady_shidfar at yahoo.com Tue May 5 13:58:18 2009 From: shady_shidfar at yahoo.com (Shady Shidfar) Date: Tue, 5 May 2009 10:58:18 -0700 (PDT) Subject: [vtkusers] Disabling interpolation when zooming Message-ID: <103255.2308.qm@web110311.mail.gq1.yahoo.com> Hi everyone, does anyone know how I can disable interpolation when zooming. I'm displaying an image and while I zoom (move the camera) the image becomes smooth and the pixels can't be distinguished explicitly. I need to find a way to disable the feature so I'll be able to view the pixel borders precisely. ? Thanks for any help Shaadi -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrewc at mac.com Tue May 5 13:26:50 2009 From: andrewc at mac.com (Andrew Cunningham) Date: Tue, 05 May 2009 10:26:50 -0700 Subject: [vtkusers] [NEWBIE] shaded background etc Message-ID: <98296957415664418663024738116080728773-Webmail@me.com> Hi, I am a new VTK user - porting my own OpenGL based C++ scene graph to VTK to take advantage of the many powerful visualization capabilities. Unfortunately I have to keep the same 'look and feel' rather than starting with a clean slate and I am stumbling on a few things that I can't find answers to after searching MarkMail - I am trying to avoid trial-and-error! - Our 3D window has a shaded background (done through openGL). A search for "shaded background" showed only 1 unanswered post on this topic in 2002 and it involved modifying a core VTK class using similar OGL commands. I can't see anyway to do this easily using VTK - Attribute inheritance. I took a lot of advantage of "attribute inheritance" in my scene graph to control rendering. VTK does not seem to have this concept unlike most scene graphs. How do people deal with this? - "Sticky small axes in lower left corner". I have small XYZ axes in the lower left corner that follow the rotations of the camera view matrix. This has to be easy. In my scene graph I did this through a separate glviewport in the window, but in VTK? Thanks Andrew From jeff.baumes at kitware.com Tue May 5 14:33:31 2009 From: jeff.baumes at kitware.com (Jeff Baumes) Date: Tue, 5 May 2009 14:33:31 -0400 Subject: [vtkusers] [NEWBIE] shaded background etc In-Reply-To: <98296957415664418663024738116080728773-Webmail@me.com> References: <98296957415664418663024738116080728773-Webmail@me.com> Message-ID: <2137e33e0905051133r14732fc6ibbd1ba4b6af25970@mail.gmail.com> On Tue, May 5, 2009 at 1:26 PM, Andrew Cunningham wrote: > - Our 3D window has a shaded background (done through openGL). A search for > "shaded background" showed only 1 unanswered post on this topic in 2002 and > it involved modifying a core VTK class using similar OGL commands. I can't > see anyway to do this easily using VTK > VTK does support simple top-to-bottom shaded background. Take a look at the SetGradientBackground method: http://www.vtk.org/doc/nightly/html/classvtkViewport.html -- Jeff Baumes, Ph.D. R&D Engineer, Kitware Inc. (518) 881-4932 jeff.baumes at kitware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From gbivins at objectreservoir.com Tue May 5 14:41:14 2009 From: gbivins at objectreservoir.com (Gerrick Bivins) Date: Tue, 05 May 2009 13:41:14 -0500 Subject: [vtkusers] [NEWBIE] shaded background etc In-Reply-To: <98296957415664418663024738116080728773-Webmail@me.com> Message-ID: Hi Andrew, If you just need the data storage and sci vis capability of VTK, I would recommend using something like vtkActorToOSG/vtkActorToPF ( http://brighton.ncsa.uiuc.edu/~prajlich/vtkActorToPF/) to integrate VTK into your existing code base. Those classes allow you to setup a VTK pipeline to create the vtkActors for what you need and then converts them into OpenSceneGraph nodes or Performer nodes( old skool!! ). If you are using some other scenegraph, you can probably reference that code to write a similar interface for your scenegraph. We used this pretty extensively at my previous job ( http://www.vesuite.org/ ) and it worked well. biv On 5/5/09 12:26 PM, "Andrew Cunningham" wrote: > Hi, > I am a new VTK user - porting my own OpenGL based C++ scene graph to VTK to > take advantage of the many powerful visualization capabilities. Unfortunately > I have to keep the same 'look and feel' rather than starting with a clean > slate and I am stumbling on a few things that I can't find answers to after > searching MarkMail - I am trying to avoid trial-and-error! > > - Our 3D window has a shaded background (done through openGL). A search for > "shaded background" showed only 1 unanswered post on this topic in 2002 and it > involved modifying a core VTK class using similar OGL commands. I can't see > anyway to do this easily using VTK > > - Attribute inheritance. I took a lot of advantage of "attribute inheritance" > in my scene graph to control rendering. VTK does not seem to have this concept > unlike most scene graphs. How do people deal with this? > > - "Sticky small axes in lower left corner". I have small XYZ axes in the lower > left corner that follow the rotations of the camera view matrix. This has to > be easy. In my scene graph I did this through a separate glviewport in the > window, but in VTK? > > > Thanks > Andrew > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 From sean at rogue-research.com Tue May 5 14:49:49 2009 From: sean at rogue-research.com (Sean McBride) Date: Tue, 5 May 2009 14:49:49 -0400 Subject: [vtkusers] Mac/Cocoa/Qt "invalid drawable" In-Reply-To: <042F896A-814A-4589-8058-A2E05C944074@usace.army.mil> References: <042F896A-814A-4589-8058-A2E05C944074@usace.army.mil> Message-ID: <20090505184949.1289242282@kingu.local> On 5/5/09 12:25 PM, Chris Kees said: >I've installed vtk from cvs on a Mac with OS X 10.5.6 using the 64 bit >Qt 4.5 libraries and the patched VTK source. The code runs fine except >I get a warning: > >2009-05-05 12:17:16.313 python[75352:807] invalid drawable This warning is harmless (as best as I can tell). I remember once trying to figure it out/get rid of it, but I never did. I wouldn't worry. Also, it has nothing to do with Qt, it happens without Qt too. -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From clinton at elemtech.com Tue May 5 14:53:35 2009 From: clinton at elemtech.com (Clinton Stimpson) Date: Tue, 05 May 2009 12:53:35 -0600 Subject: [vtkusers] Mac/Cocoa/Qt "invalid drawable" In-Reply-To: <042F896A-814A-4589-8058-A2E05C944074@usace.army.mil> References: <042F896A-814A-4589-8058-A2E05C944074@usace.army.mil> Message-ID: <4A008B2F.50100@elemtech.com> I saw the same thing when doing it in C++ with Qt 4.5 and Cocoa. The fix there was to overload vtkRenderWindowInteractor::Initialize() and skip the Render() and let the GUI say when to do the first render. Can you do that in QVTKRenderWindowInteractor.py? Or try commenting out the Render() call in vtkRenderWindowInteractor::Initialize() to see if that fixes your problem. I don't know why it even has the Render() in there. It seems if the window is coming up for the first time and an event loop is being used, one would get an event to do a first Render() anyways. If one isn't using an event loop (and probably not using the interactor), they are calling Render() themselves. Clint Chris Kees wrote: > Hi, > > I've installed vtk from cvs on a Mac with OS X 10.5.6 using the 64 bit > Qt 4.5 libraries and the patched VTK source. The code runs fine except > I get a warning: > > 2009-05-05 12:17:16.313 python[75352:807] invalid drawable > > when calling Initialize on the QVTKRenderWindowInteractor. If I just > remove the Initialize call then the code runs fine without warnings. I > saw a post from 2005 that mentioned the warning and a work around that > I don't quite understand. Anybody know if this is still something > that needs a work around, or am I just doing something wrong? > > Chris > > Here's an example that generates the warning (needs PyQt installed as > well): > > #!/usr/bin/env python > from vtk import * > from vtk.qt4.QVTKRenderWindowInteractor import * > import sys > from PyQt4 import QtGui > import copy > > app = QtGui.QApplication(sys.argv) > > import numpy > from math import cos,sin > > nPoints=10 > x = numpy.zeros((3,),'d') > d=2.0 > pointData=vtkPoints() > pointData.SetNumberOfPoints(2*nPoints) > for ix in range(2): > for iTheta in range(nPoints): > x[0] = ix*d > x[1] = cos(float(iTheta)*(2.0*3.14)/float(nPoints)) > x[2] = sin(float(iTheta)*(2.0*3.14)/float(nPoints)) > pointData.SetPoint(ix*nPoints+iTheta,x) > polygons=vtkCellArray() > scalars=vtkDoubleArray() > > for ix in range(2): > polygons.InsertNextCell(nPoints) > scalars.InsertNextValue(float(ix)) > for iTheta in range(nPoints): > polygons.InsertCellPoint(ix*nPoints+iTheta) > > ix=0 > for iTheta in range(nPoints): > polygons.InsertNextCell(4) > scalars.InsertNextValue(0.5) > polygons.InsertCellPoint(ix*nPoints+iTheta) > polygons.InsertCellPoint(ix*nPoints+(iTheta+1)%nPoints) > polygons.InsertCellPoint((ix+1)*nPoints+(iTheta+1)%nPoints) > polygons.InsertCellPoint((ix+1)*nPoints+iTheta) > > cylinder = vtkPolyData() > cylinder.SetPoints(pointData) > cylinder.SetPolys(polygons) > cylinder.GetCellData().SetScalars(scalars) > > # > #visualize > # > tabs = True#False > mainWindow = QtGui.QMainWindow() > > if tabs: > tabWidget = QtGui.QTabWidget(mainWindow) > mainWindow.setCentralWidget(tabWidget) > frameWidget = QtGui.QFrame(mainWindow) > hbox = QtGui.QHBoxLayout() > frameWidget2 = QtGui.QFrame(mainWindow) > hbox2 = QtGui.QHBoxLayout() > iren = QVTKRenderWindowInteractor(frameWidget) > iren2 = QVTKRenderWindowInteractor(frameWidget2) > else: > frameWidget = QtGui.QFrame(mainWindow) > hbox = QtGui.QHBoxLayout() > mainWindow.setCentralWidget(frameWidget) > iren = QVTKRenderWindowInteractor(frameWidget) > iren2 = QVTKRenderWindowInteractor(frameWidget) > > iren.Initialize() > iren2.Initialize() > > cylinderMapper = vtkPolyDataMapper() > cylinderMapper.SetInput(cylinder) > cylinderMapper.SetScalarRange(0,1) > > cylinderActor = vtkActor() > cylinderActor.SetMapper(cylinderMapper) > > renderer = vtkRenderer() > renderer.AddActor(cylinderActor) > > renderer2 = vtkRenderer() > renderer2.AddActor(cylinderActor) > > renWin = iren.GetRenderWindow() > renWin.AddRenderer(renderer) > > renWin2 = iren2.GetRenderWindow() > renWin2.AddRenderer(renderer2) > > if tabs: > hbox.addWidget(iren) > frameWidget.setLayout(hbox) > hbox2.addWidget(iren2) > frameWidget2.setLayout(hbox2) > tabWidget.addTab(frameWidget,"Cylinder 1") > tabWidget.addTab(frameWidget2,"Cylinder 2") > else: > hbox.addWidget(iren) > hbox.addWidget(iren2) > frameWidget.setLayout(hbox) > > mainWindow.show() > > #iren.show() > #iren2.show() > #app.exec_() > #iren.show() > #iren2.show() > #app.exec_() > sys.exit(app.exec_()) > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 From pavel.pokutnev at googlemail.com Tue May 5 15:10:42 2009 From: pavel.pokutnev at googlemail.com (Pavel Pokutnev) Date: Tue, 5 May 2009 21:10:42 +0200 Subject: [vtkusers] Fitting a straight line? In-Reply-To: <70e2b00d0905051158q397113b3q1b140154ab1a330e@mail.gmail.com> References: <70e2b00d0905051158q397113b3q1b140154ab1a330e@mail.gmail.com> Message-ID: <70e2b00d0905051210j375df767od7bf9fbe97cd1213@mail.gmail.com> Hi! I just wondering if VTK has any algorithms for fitting purposes like straight line, circle/ellipse... Thanks, Pavel -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christopher.E.Kees at usace.army.mil Tue May 5 16:03:11 2009 From: Christopher.E.Kees at usace.army.mil (Chris Kees) Date: Tue, 5 May 2009 15:03:11 -0500 Subject: [vtkusers] Mac/Cocoa/Qt "invalid drawable" In-Reply-To: <4A008B2F.50100@elemtech.com> References: <042F896A-814A-4589-8058-A2E05C944074@usace.army.mil> <4A008B2F.50100@elemtech.com> Message-ID: <90B26504-2BF1-4023-B9F7-1E753A234C76@usace.army.mil> I commented out Render() and the warning went away in all the simple cases: RCS file: /cvsroot/VTK/VTK/Rendering/vtkRenderWindowInteractor.cxx,v retrieving revision 1.121 diff -r1.121 vtkRenderWindowInteractor.cxx 629c629 < this->Render(); --- > //this->Render(); For future reference, in one case where I keep pushing frames into a tab widget I found that I still got the warning unless I raise the tabs as I add them: g.tabWidget.addTab(self.frameWidget,title) g.tabWidget.setCurrentWidget(self.frameWidget)#added to get rid of warning Maybe in that case what is happening is that only the first tab gets drawn unless you select the tab. As the code was building the frames it was calling Render() on things that must be in much the same state as a newly initialized iren. Chris On May 5, 2009, at 1:53 PM, Clinton Stimpson wrote: > > I saw the same thing when doing it in C++ with Qt 4.5 and Cocoa. > The fix there was to overload vtkRenderWindowInteractor::Initialize() > and skip the Render() and let the GUI say when to do the first render. > > Can you do that in QVTKRenderWindowInteractor.py? Or try commenting > out the Render() call in vtkRenderWindowInteractor::Initialize() to > see if that fixes your problem. > > I don't know why it even has the Render() in there. It seems if the > window is coming up for the first time and an event loop is being > used, one would get an event to do a first Render() anyways. If one > isn't using an event loop (and probably not using the interactor), > they are calling Render() themselves. > > Clint > > > Chris Kees wrote: >> Hi, >> >> I've installed vtk from cvs on a Mac with OS X 10.5.6 using the 64 >> bit Qt 4.5 libraries and the patched VTK source. The code runs fine >> except I get a warning: >> >> 2009-05-05 12:17:16.313 python[75352:807] invalid drawable >> >> when calling Initialize on the QVTKRenderWindowInteractor. If I >> just remove the Initialize call then the code runs fine without >> warnings. I saw a post from 2005 that mentioned the warning and a >> work around that I don't quite understand. Anybody know if this is >> still something that needs a work around, or am I just doing >> something wrong? >> >> Chris >> >> Here's an example that generates the warning (needs PyQt installed >> as well): >> >> #!/usr/bin/env python >> from vtk import * >> from vtk.qt4.QVTKRenderWindowInteractor import * >> import sys >> from PyQt4 import QtGui >> import copy >> >> app = QtGui.QApplication(sys.argv) >> >> import numpy >> from math import cos,sin >> >> nPoints=10 >> x = numpy.zeros((3,),'d') >> d=2.0 >> pointData=vtkPoints() >> pointData.SetNumberOfPoints(2*nPoints) >> for ix in range(2): >> for iTheta in range(nPoints): >> x[0] = ix*d >> x[1] = cos(float(iTheta)*(2.0*3.14)/float(nPoints)) >> x[2] = sin(float(iTheta)*(2.0*3.14)/float(nPoints)) >> pointData.SetPoint(ix*nPoints+iTheta,x) >> polygons=vtkCellArray() >> scalars=vtkDoubleArray() >> >> for ix in range(2): >> polygons.InsertNextCell(nPoints) >> scalars.InsertNextValue(float(ix)) >> for iTheta in range(nPoints): >> polygons.InsertCellPoint(ix*nPoints+iTheta) >> >> ix=0 >> for iTheta in range(nPoints): >> polygons.InsertNextCell(4) >> scalars.InsertNextValue(0.5) >> polygons.InsertCellPoint(ix*nPoints+iTheta) >> polygons.InsertCellPoint(ix*nPoints+(iTheta+1)%nPoints) >> polygons.InsertCellPoint((ix+1)*nPoints+(iTheta+1)%nPoints) >> polygons.InsertCellPoint((ix+1)*nPoints+iTheta) >> >> cylinder = vtkPolyData() >> cylinder.SetPoints(pointData) >> cylinder.SetPolys(polygons) >> cylinder.GetCellData().SetScalars(scalars) >> >> # >> #visualize >> # >> tabs = True#False >> mainWindow = QtGui.QMainWindow() >> >> if tabs: >> tabWidget = QtGui.QTabWidget(mainWindow) >> mainWindow.setCentralWidget(tabWidget) >> frameWidget = QtGui.QFrame(mainWindow) >> hbox = QtGui.QHBoxLayout() >> frameWidget2 = QtGui.QFrame(mainWindow) >> hbox2 = QtGui.QHBoxLayout() >> iren = QVTKRenderWindowInteractor(frameWidget) >> iren2 = QVTKRenderWindowInteractor(frameWidget2) >> else: >> frameWidget = QtGui.QFrame(mainWindow) >> hbox = QtGui.QHBoxLayout() >> mainWindow.setCentralWidget(frameWidget) >> iren = QVTKRenderWindowInteractor(frameWidget) >> iren2 = QVTKRenderWindowInteractor(frameWidget) >> >> iren.Initialize() >> iren2.Initialize() >> >> cylinderMapper = vtkPolyDataMapper() >> cylinderMapper.SetInput(cylinder) >> cylinderMapper.SetScalarRange(0,1) >> >> cylinderActor = vtkActor() >> cylinderActor.SetMapper(cylinderMapper) >> >> renderer = vtkRenderer() >> renderer.AddActor(cylinderActor) >> >> renderer2 = vtkRenderer() >> renderer2.AddActor(cylinderActor) >> >> renWin = iren.GetRenderWindow() >> renWin.AddRenderer(renderer) >> >> renWin2 = iren2.GetRenderWindow() >> renWin2.AddRenderer(renderer2) >> >> if tabs: >> hbox.addWidget(iren) >> frameWidget.setLayout(hbox) >> hbox2.addWidget(iren2) >> frameWidget2.setLayout(hbox2) >> tabWidget.addTab(frameWidget,"Cylinder 1") >> tabWidget.addTab(frameWidget2,"Cylinder 2") >> else: >> hbox.addWidget(iren) >> hbox.addWidget(iren2) >> frameWidget.setLayout(hbox) >> >> mainWindow.show() >> >> #iren.show() >> #iren2.show() >> #app.exec_() >> #iren.show() >> #iren2.show() >> #app.exec_() >> sys.exit(app.exec_()) >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://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 > From theodoreholden at yahoo.com Tue May 5 16:28:42 2009 From: theodoreholden at yahoo.com (Theodore Holden) Date: Tue, 5 May 2009 13:28:42 -0700 (PDT) Subject: [vtkusers] How to set data programmatically... In-Reply-To: <811a1f290905051051q1e9f215y4a555291e4a34be9@mail.gmail.com> References: <897102.67127.qm@web38608.mail.mud.yahoo.com> <811a1f290905051051q1e9f215y4a555291e4a34be9@mail.gmail.com> Message-ID: <266994.90255.qm@web38605.mail.mud.yahoo.com> Hi, and thanks for the response. I'm guessing there must be several versions of vtk in use and large differences between them. I'm using (or trying to use) version 5.4 on windows and the wrapper class for .net and C# (company orders, not my choice)..... I don't see vtkStructuredPointsAlgorithm on this system or anything else obvious which has requestdata or requestinformation methods. Google searches on the two methods turn up mostly suggestions to look at a description of the new vtk pipeline architecture ( http://www.cmake.org/cgi-bin/viewcvs.cgi/*checkout*/Utilities/Upgrading/TheNewVTKPipeline.pdf?revision=1.5 ). It would solve most of my basic problem if I knew a way to adjust opacity of an image on the fly without having to re-read any data. It might also solve my problem if I could figure out what the "coordinate" array is in the GetArrayPointer function for vtkStructuredPoints objects. Again thanks, and any/all information is appreciated. Ted ________________________________ From: Mike Jackson To: Theodore Holden Cc: vtkusers at vtk.org Sent: Tuesday, May 5, 2009 1:51:36 PM Subject: Re: [vtkusers] How to set data programmatically... You probably want to write your own custom reader object. There are lots of examples floating around the internet on that. The basics are: Select a vtk class in which to inherit from. In your case probably vtkStructuredPointsAlgorithm? programatically set the "numberOfInputs=0". Implement the RequestInformation and RequestData methods. In the RequestInformation method you should read just enough information from your file to be able to setup the output type with its extents and all that. In the RequestData method do the actual reading of data from your file and convert it into a vtk object as appropriate. HTH Mike On Tue, May 5, 2009 at 11:26 AM, Theodore Holden wrote: > Hi, > > I have an 3d visualization application which reads data from a file which > isn't related to vtk and at present I'm having to write the data out in vtk > format to disk and then let a vtk reader read it a second time. > > It would help considerably if I was able to simply pass the data to vtk > internally but thus far I've not been able to figure out how to do it and > nothing I see on the web helps. The data is unsigned char and the piece of > code which presents it looks like this: > > void AddBagVolumeToWindow4(vtk.vtkRenderWindow renWin) > { > // 3d texture map > vtkStructuredPointsReader reader = new > vtkStructuredPointsReader(); > > vtkVolume volume = new vtkVolume(); > vtkVolumeProperty volumeProperty = new vtkVolumeProperty(); > > vtkRenderer renderer = new vtkRenderer(); > vtkRenderWindowInteractor interactor = new > vtkRenderWindowInteractor(); > vtkVolumeTextureMapper3D volumeMapper = new > vtkVolumeTextureMapper3D(); > //vtkVolumeRayCastCompositeFunction compositeFunction = new > vtkVolumeRayCastCompositeFunction(); > > vtkPiecewiseFunction opacity = new vtkPiecewiseFunction(); > vtkColorTransferFunction color = new vtkColorTransferFunction(); > > reader.SetFileName("c:\\zz.vtk"); > reader.Update(); > > opacity.AddPoint(0, 0); > opacity.AddPoint(64, .005); > opacity.AddPoint(128, .01); > opacity.AddPoint(200, .05); > opacity.AddPoint(220, .4); > > color.AddRGBPoint(64, .665, .84, .88); > color.AddRGBPoint(128, 0, .746, .95); > color.AddRGBPoint(220, 0, 1, 0); > color.AddRGBPoint(230, 1, 0, 0); > > volumeProperty.SetColor(color); > volumeProperty.SetScalarOpacity(opacity); > volumeProperty.SetInterpolationTypeToLinear(); > volumeProperty.ShadeOn(); > > volumeMapper.SetInput(reader.GetOutput()); > > //int[] iiex = reader.GetOutput().GetExtent(); > > volume.SetMapper(volumeMapper); > volume.SetProperty(volumeProperty); > > renderer.SetBackground(1, 1, 1); > renderer.AddVolume(volume); > > interactor.SetRenderWindow(renWin); > renWin.AddRenderer(renderer); > > renx = renderer; > volx = volume; > > renWin.Render(); > interactor.Start(); > > vtk.vtkWin32OpenGLRenderWindow win32win = > vtk.vtkWin32OpenGLRenderWindow.SafeDownCast(renWin); > win32win.Clean(); > > } > > That's after the data has been written out to "c:\\zz.vtk" of course. What > it looks like I'd want to do, rather than use the vtkStructuredPointsReader, > is to set up my own vtkStructuredPoints object something like: > > vtkStructuredPoints bsp = new vtkStructuredPoints(); > bsp.SetScalarTypeToUnsignedChar(); > bsp.SetDimensions(Width, Height, NumSlices); > bsp.SetOrigin(0, 0, 0); > bsp.SetExtent(0, Width - 1, 0, Height - 1, 0, NumSlices - 1); > > and then set the data array but, again, I've no clue as to how to do that. > Any help would be apreciated. > > > Ted > > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 David.Pont at scionresearch.com Tue May 5 16:45:12 2009 From: David.Pont at scionresearch.com (David.Pont at scionresearch.com) Date: Wed, 6 May 2009 08:45:12 +1200 Subject: [vtkusers] Store multiple versions of an array in a vtp file In-Reply-To: Message-ID: Hi David, I posted a similar query last week: ie how to use vt* xml files to hold data (efficiently) with constant geometry and varying data values. Please keep me posted if you get any leads on this. Should this question be posted to the Paraview mail list, which I am not (yet) a member of?) Found these from a quick search on Paraview list, http://markmail.org/message/lsyjxkf5vvxv2zuk http://markmail.org/message/zoljls7eadz3sa6c seem to be talking about modifying code to get desired bahaviour... http://markmail.org/thread/vogxdltk3sqcsjx6 suggestion to use Ensight files for holding data regards, Dave P David Doria To Sent by: vtkusers-bounces@ cc vtk.org "vtkusers at vtk.org" Subject 06/05/2009 04:18 Re: [vtkusers] Store multiple versions of an array in a vtp file On Tue, May 5, 2009 at 11:38 AM, Eric E. Monson wrote: Hey David, I think the easiest way would be to either write a separate vtp file for each iteration (and then write a pvd file to treat them as a time series for animating in ParaView), or else change your data file format. I've never used it, but evidently the Ensight Gold format allows separate files for the mesh and the data associated with it. For my work I use XDMF (http://xdmf.org), which would allow you to write one copy of the geometry and the scalars for each iteration to a single HDF5 file, and then the XMF file that goes with it would describe a time series which points to the one copy of the geometry on each "time" step along with the new cluster array scalars. Otherwise, as a long-shot, there was some talk on the ParaView mailing list last year saying that vtu files could actually hold multiple time steps, and that someone had patches which would allow pvd files to be read in using "shared" geometry, but I'm not sure what the status of that is... http://www.vtk.org/pipermail/vtkusers/2008-February/094463.html Good luck, -Eric ------------------------------------------------------ Eric E Monson Duke Visualization Technology Group Eric - I already have 10,000 (ok, maybe I'm exaggerating a little bit :) ) file formats to convert from/to, so it'd be nice to keep everything in vt*. Does anyone know what happened to the patches Eric is talking about (either multiple timesteps in a vtu or "shared" geometry?) That thread seemed to die with no resolution. Thanks, David _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: graycol.gif Type: image/gif Size: 105 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pic18651.gif Type: image/gif Size: 1255 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 45 bytes Desc: not available URL: From mike.jackson at bluequartz.net Tue May 5 16:48:13 2009 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Tue, 5 May 2009 16:48:13 -0400 Subject: [vtkusers] How to set data programmatically... In-Reply-To: <266994.90255.qm@web38605.mail.mud.yahoo.com> References: <897102.67127.qm@web38608.mail.mud.yahoo.com> <811a1f290905051051q1e9f215y4a555291e4a34be9@mail.gmail.com> <266994.90255.qm@web38605.mail.mud.yahoo.com> Message-ID: <39C4DDCE-87B7-4E1F-9B58-62783364F39F@bluequartz.net> I am not familiar with the .Net stuff but if you can get to the vtkActor that is doing the rendering for the image data then you should be able to set it's opacity using the actor->GetProperty()- >SetOpacity(1.0f); _______________________________________________ Mike Jackson mike.jackson at bluequartz.net BlueQuartz Software www.bluequartz.net Principal Software Engineer Dayton, Ohio On May 5, 2009, at 4:28 PM, Theodore Holden wrote: > Hi, and thanks for the response. > > I'm guessing there must be several versions of vtk in use and large > differences between them. I'm using (or trying to use) version 5.4 > on windows and the wrapper class for .net and C# (company orders, > not my choice)..... > > I don't see vtkStructuredPointsAlgorithm on this system or anything > else obvious which has requestdata or requestinformation methods. > Google searches on the two methods turn up mostly suggestions to > look at a description of the new vtk pipeline architecture (http://www.cmake.org/cgi-bin/viewcvs.cgi/*checkout*/Utilities/Upgrading/TheNewVTKPipeline.pdf?revision=1.5 > ). > > It would solve most of my basic problem if I knew a way to adjust > opacity of an image on the fly without having to re-read any data. > It might also solve my problem if I could figure out what the > "coordinate" array is in the GetArrayPointer function for > vtkStructuredPoints objects. > > Again thanks, and any/all information is appreciated. > > > Ted > > From: Mike Jackson > To: Theodore Holden > Cc: vtkusers at vtk.org > Sent: Tuesday, May 5, 2009 1:51:36 PM > Subject: Re: [vtkusers] How to set data programmatically... > > You probably want to write your own custom reader object. There are > lots of examples floating around the internet on that. The basics are: > > Select a vtk class in which to inherit from. In your case probably > vtkStructuredPointsAlgorithm? > programatically set the "numberOfInputs=0". > Implement the RequestInformation and RequestData methods. > > In the RequestInformation method you should read just enough > information from your file to be able to setup the output type with > its extents and all that. > > In the RequestData method do the actual reading of data from your file > and convert it into a vtk object as appropriate. > > HTH > Mike > > On Tue, May 5, 2009 at 11:26 AM, Theodore Holden > wrote: > > Hi, > > > > I have an 3d visualization application which reads data from a > file which > > isn't related to vtk and at present I'm having to write the data > out in vtk > > format to disk and then let a vtk reader read it a second time. > > > > It would help considerably if I was able to simply pass the data > to vtk > > internally but thus far I've not been able to figure out how to do > it and > > nothing I see on the web helps. The data is unsigned char and the > piece of > > code which presents it looks like this: > > > > void AddBagVolumeToWindow4(vtk.vtkRenderWindow renWin) > > { > > // 3d texture map > > vtkStructuredPointsReader reader = new > > vtkStructuredPointsReader(); > > > > vtkVolume volume = new vtkVolume(); > > vtkVolumeProperty volumeProperty = new > vtkVolumeProperty(); > > > > vtkRenderer renderer = new vtkRenderer(); > > vtkRenderWindowInteractor interactor = new > > vtkRenderWindowInteractor(); > > vtkVolumeTextureMapper3D volumeMapper = new > > vtkVolumeTextureMapper3D(); > > //vtkVolumeRayCastCompositeFunction compositeFunction > = new > > vtkVolumeRayCastCompositeFunction(); > > > > vtkPiecewiseFunction opacity = new > vtkPiecewiseFunction(); > > vtkColorTransferFunction color = new > vtkColorTransferFunction(); > > > > reader.SetFileName("c:\\zz.vtk"); > > reader.Update(); > > > > opacity.AddPoint(0, 0); > > opacity.AddPoint(64, .005); > > opacity.AddPoint(128, .01); > > opacity.AddPoint(200, .05); > > opacity.AddPoint(220, .4); > > > > color.AddRGBPoint(64, .665, .84, .88); > > color.AddRGBPoint(128, 0, .746, .95); > > color.AddRGBPoint(220, 0, 1, 0); > > color.AddRGBPoint(230, 1, 0, 0); > > > > volumeProperty.SetColor(color); > > volumeProperty.SetScalarOpacity(opacity); > > volumeProperty.SetInterpolationTypeToLinear(); > > volumeProperty.ShadeOn(); > > > > volumeMapper.SetInput(reader.GetOutput()); > > > > //int[] iiex = reader.GetOutput().GetExtent(); > > > > volume.SetMapper(volumeMapper); > > volume.SetProperty(volumeProperty); > > > > renderer.SetBackground(1, 1, 1); > > renderer.AddVolume(volume); > > > > interactor.SetRenderWindow(renWin); > > renWin.AddRenderer(renderer); > > > > renx = renderer; > > volx = volume; > > > > renWin.Render(); > > interactor.Start(); > > > > vtk.vtkWin32OpenGLRenderWindow win32win = > > vtk.vtkWin32OpenGLRenderWindow.SafeDownCast(renWin); > > win32win.Clean(); > > > > } > > > > That's after the data has been written out to "c:\\zz.vtk" of > course. What > > it looks like I'd want to do, rather than use the > vtkStructuredPointsReader, > > is to set up my own vtkStructuredPoints object something like: > > > > vtkStructuredPoints bsp = new vtkStructuredPoints(); > > bsp.SetScalarTypeToUnsignedChar(); > > bsp.SetDimensions(Width, Height, NumSlices); > > bsp.SetOrigin(0, 0, 0); > > bsp.SetExtent(0, Width - 1, 0, Height - 1, 0, > NumSlices - 1); > > > > and then set the data array but, again, I've no clue as to how to > do that. > > Any help would be apreciated. > > > > > > Ted > > > > > > > > > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://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 > > > > > > --- Mike Jackson www.bluequartz.net From daviddoria at gmail.com Tue May 5 16:58:58 2009 From: daviddoria at gmail.com (David Doria) Date: Tue, 5 May 2009 16:58:58 -0400 Subject: [vtkusers] Store multiple versions of an array in a vtp file In-Reply-To: References: Message-ID: On Tue, May 5, 2009 at 4:45 PM, wrote: > Hi David, > I posted a similar query last week: ie how to use vt* xml files to hold > data (efficiently) with constant geometry and varying data values. > Please keep me posted if you get any leads on this. > Should this question be posted to the Paraview mail list, which I am not > (yet) a member of? > > Found these from a quick search on Paraview list, > > http://markmail.org/message/lsyjxkf5vvxv2zuk > http://markmail.org/message/zoljls7eadz3sa6c > seem to be talking about modifying code to get desired bahaviour... > > http://markmail.org/thread/vogxdltk3sqcsjx6 > suggestion to use Ensight files for holding data > > regards, Dave P > > [image: Inactive hide details for David Doria ]David > Doria > Dave P, I posted it as a paraview feature request: http://public.kitware.com/Bug/view.php?id=8962 The only feedback so far is to use a different file type. David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 105 bytes Desc: not available URL: From pavel.pokutnev at googlemail.com Tue May 5 17:34:43 2009 From: pavel.pokutnev at googlemail.com (Pavel Pokutnev) Date: Tue, 5 May 2009 23:34:43 +0200 Subject: [vtkusers] Fitting a straight line? Message-ID: <70e2b00d0905051434ma454d53n820f5c8923e15af1@mail.gmail.com> Hi! I just wondering if VTK has any algorithms for fitting purposes like straight line, circle/ellipse and others? Thanks, Pavel -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrewc at mac.com Tue May 5 19:08:49 2009 From: andrewc at mac.com (Andrew Cunningham) Date: Tue, 05 May 2009 16:08:49 -0700 Subject: [vtkusers] [NEWBIE] shaded background etc In-Reply-To: <2137e33e0905051133r14732fc6ibbd1ba4b6af25970@mail.gmail.com> References: <98296957415664418663024738116080728773-Webmail@me.com> <2137e33e0905051133r14732fc6ibbd1ba4b6af25970@mail.gmail.com> Message-ID: <70137545571518730264269992276104639969-Webmail@me.com> Hi Jeff, Thanks! That rates as an embarrassing duh! on my part... searching using the wrong terminology! Andrew On Tuesday, May 05, 2009, at 11:33AM, "Jeff Baumes" wrote: >On Tue, May 5, 2009 at 1:26 PM, Andrew Cunningham wrote: > >> - Our 3D window has a shaded background (done through openGL). A search for >> "shaded background" showed only 1 unanswered post on this topic in 2002 and >> it involved modifying a core VTK class using similar OGL commands. I can't >> see anyway to do this easily using VTK >> > >VTK does support simple top-to-bottom shaded background. Take a look at the >SetGradientBackground method: >http://www.vtk.org/doc/nightly/html/classvtkViewport.html > >-- From andrewc at mac.com Tue May 5 19:25:39 2009 From: andrewc at mac.com (Andrew Cunningham) Date: Tue, 05 May 2009 16:25:39 -0700 Subject: [vtkusers] [NEWBIE] shaded background etc Message-ID: <13773879341705284254476111497877271421-Webmail@me.com> Hi Gerrick, The C++ scene graph I wrote is pretty old and limited and and needs to be completely torn up . I did look at replacing it with OSG ( or even NVSG) - but VTK is more oriented towards my simulation visualization needs right out of the box - I can deal with these few 'compatibility' issues fairly easily ( with the great help already received from this list). I must say the thought of embedding a VTK actor as an OSG node just seems slightly perverse :) ....having to learn/build/integrate/update two large and complex C++ frameworks just does not sound like a good time to me! Andrew On Tuesday, May 05, 2009, at 11:41AM, "Gerrick Bivins" wrote: >Hi Andrew, >If you just need the data storage and sci vis capability of VTK, I would >recommend using something like vtkActorToOSG/vtkActorToPF ( >http://brighton.ncsa.uiuc.edu/~prajlich/vtkActorToPF/) to integrate VTK >into your existing code base. > >T > > From theodoreholden at yahoo.com Tue May 5 20:18:15 2009 From: theodoreholden at yahoo.com (Theodore Holden) Date: Tue, 5 May 2009 17:18:15 -0700 (PDT) Subject: [vtkusers] How to set data programmatically... In-Reply-To: <39C4DDCE-87B7-4E1F-9B58-62783364F39F@bluequartz.net> References: <897102.67127.qm@web38608.mail.mud.yahoo.com> <811a1f290905051051q1e9f215y4a555291e4a34be9@mail.gmail.com> <266994.90255.qm@web38605.mail.mud.yahoo.com> <39C4DDCE-87B7-4E1F-9B58-62783364F39F@bluequartz.net> Message-ID: <791642.96699.qm@web38601.mail.mud.yahoo.com> Mike, Thanks, that actually works. Ted ________________________________ From: Michael Jackson To: Theodore Holden Cc: vtkusers at vtk.org Sent: Tuesday, May 5, 2009 4:48:13 PM Subject: Re: [vtkusers] How to set data programmatically... I am not familiar with the .Net stuff but if you can get to the vtkActor that is doing the rendering for the image data then you should be able to set it's opacity using the actor->GetProperty()->SetOpacity(1.0f); _______________________________________________ Mike Jackson mike.jackson at bluequartz.net BlueQuartz Software www.bluequartz.net Principal Software Engineer Dayton, Ohio On May 5, 2009, at 4:28 PM, Theodore Holden wrote: > Hi, and thanks for the response. > > I'm guessing there must be several versions of vtk in use and large differences between them. I'm using (or trying to use) version 5.4 on windows and the wrapper class for .net and C# (company orders, not my choice)..... > > I don't see vtkStructuredPointsAlgorithm on this system or anything else obvious which has requestdata or requestinformation methods. Google searches on the two methods turn up mostly suggestions to look at a description of the new vtk pipeline architecture (http://www.cmake.org/cgi-bin/viewcvs.cgi/*checkout*/Utilities/Upgrading/TheNewVTKPipeline.pdf?revision=1.5 ). > > It would solve most of my basic problem if I knew a way to adjust opacity of an image on the fly without having to re-read any data. It might also solve my problem if I could figure out what the "coordinate" array is in the GetArrayPointer function for vtkStructuredPoints objects. > > Again thanks, and any/all information is appreciated. > > > Ted > > From: Mike Jackson > To: Theodore Holden > Cc: vtkusers at vtk.org > Sent: Tuesday, May 5, 2009 1:51:36 PM > Subject: Re: [vtkusers] How to set data programmatically... > > You probably want to write your own custom reader object. There are > lots of examples floating around the internet on that. The basics are: > > Select a vtk class in which to inherit from. In your case probably > vtkStructuredPointsAlgorithm? > programatically set the "numberOfInputs=0". > Implement the RequestInformation and RequestData methods. > > In the RequestInformation method you should read just enough > information from your file to be able to setup the output type with > its extents and all that. > > In the RequestData method do the actual reading of data from your file > and convert it into a vtk object as appropriate. > > HTH > Mike > > On Tue, May 5, 2009 at 11:26 AM, Theodore Holden > wrote: > > Hi, > > > > I have an 3d visualization application which reads data from a file which > > isn't related to vtk and at present I'm having to write the data out in vtk > > format to disk and then let a vtk reader read it a second time. > > > > It would help considerably if I was able to simply pass the data to vtk > > internally but thus far I've not been able to figure out how to do it and > > nothing I see on the web helps. The data is unsigned char and the piece of > > code which presents it looks like this: > > > > void AddBagVolumeToWindow4(vtk.vtkRenderWindow renWin) > > { > > // 3d texture map > > vtkStructuredPointsReader reader = new > > vtkStructuredPointsReader(); > > > > vtkVolume volume = new vtkVolume(); > > vtkVolumeProperty volumeProperty = new vtkVolumeProperty(); > > > > vtkRenderer renderer = new vtkRenderer(); > > vtkRenderWindowInteractor interactor = new > > vtkRenderWindowInteractor(); > > vtkVolumeTextureMapper3D volumeMapper = new > > vtkVolumeTextureMapper3D(); > > //vtkVolumeRayCastCompositeFunction compositeFunction = new > > vtkVolumeRayCastCompositeFunction(); > > > > vtkPiecewiseFunction opacity = new vtkPiecewiseFunction(); > > vtkColorTransferFunction color = new vtkColorTransferFunction(); > > > > reader.SetFileName("c:\\zz.vtk"); > > reader.Update(); > > > > opacity.AddPoint(0, 0); > > opacity.AddPoint(64, .005); > > opacity.AddPoint(128, .01); > > opacity.AddPoint(200, .05); > > opacity.AddPoint(220, .4); > > > > color.AddRGBPoint(64, .665, .84, .88); > > color.AddRGBPoint(128, 0, .746, .95); > > color.AddRGBPoint(220, 0, 1, 0); > > color.AddRGBPoint(230, 1, 0, 0); > > > > volumeProperty.SetColor(color); > > volumeProperty.SetScalarOpacity(opacity); > > volumeProperty.SetInterpolationTypeToLinear(); > > volumeProperty.ShadeOn(); > > > > volumeMapper.SetInput(reader.GetOutput()); > > > > //int[] iiex = reader.GetOutput().GetExtent(); > > > > volume.SetMapper(volumeMapper); > > volume.SetProperty(volumeProperty); > > > > renderer.SetBackground(1, 1, 1); > > renderer.AddVolume(volume); > > > > interactor.SetRenderWindow(renWin); > > renWin.AddRenderer(renderer); > > > > renx = renderer; > > volx = volume; > > > > renWin.Render(); > > interactor.Start(); > > > > vtk.vtkWin32OpenGLRenderWindow win32win = > > vtk.vtkWin32OpenGLRenderWindow.SafeDownCast(renWin); > > win32win.Clean(); > > > > } > > > > That's after the data has been written out to "c:\\zz.vtk" of course. What > > it looks like I'd want to do, rather than use the vtkStructuredPointsReader, > > is to set up my own vtkStructuredPoints object something like: > > > > vtkStructuredPoints bsp = new vtkStructuredPoints(); > > bsp.SetScalarTypeToUnsignedChar(); > > bsp.SetDimensions(Width, Height, NumSlices); > > bsp.SetOrigin(0, 0, 0); > > bsp.SetExtent(0, Width - 1, 0, Height - 1, 0, NumSlices - 1); > > > > and then set the data array but, again, I've no clue as to how to do that. > > Any help would be apreciated. > > > > > > Ted > > > > > > > > > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://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 > > > > > > --- Mike Jackson www.bluequartz.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From Maxim.Schaefner at gmx.de Wed May 6 07:26:25 2009 From: Maxim.Schaefner at gmx.de (=?iso-8859-1?Q?=22Maxim_Sch=E4fner=22?=) Date: Wed, 06 May 2009 13:26:25 +0200 Subject: [vtkusers] vtk Render-to-texture Message-ID: <20090506112625.201150@gmx.net> Hello, We want to render multiple renderscreen with help of different camera angles and save them in different vtkTextures. We managed it, to render them and save them on the harddisk. But in the moment we render them, and give these rendered screens different vtkTextures, the last in vtkTextures rendered screen, override all other prerendered vtkTextures. For the renderings we use the class vtkWindowToImageFilter. Some code: thanks maxim code: //x,y,z direction of view vtkTexture* getImageFromWindow(vtkRenderer *ren,vtkRenderWindow *win, vtkActor *ac, double x, double y, double z) { vtkCamera *c= vtkCamera::New(); double *richt = ac->GetCenter(); c->SetPosition(richt[0],richt[1],richt[2]); c->SetFocalPoint(richt[0]+x,richt[1]+y,richt[2]+z); ren->SetActiveCamera(c); win->Render(); vtkWindowToImageFilter *wti= vtkWindowToImageFilter::New(); wti->SetInput(win); vtkTexture *t = vtkTexture::New(); t->SetInput( wti->GetOutput()); t->InterpolateOn(); return t; } //use of the function: vtkTexture *id2 = vtkTexture::New(); id2 = getImageFromWindow(renderer,renWin,actor,1,0,0); vtkTexture *id1 = vtkTexture::New(); id1 = getImageFromWindow(renderer,renWin,actor,-1,0,0); actor->SetTexture(id2); //actor don't get the texture from id2, but the actor get the texture from id1. although id2 was rendered first and was given to the actor. thanks for any suggestions. maxim -- Psssst! Schon vom neuen GMX MultiMessenger geh?rt? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01 From varguna at gmail.com Wed May 6 15:33:11 2009 From: varguna at gmail.com (Aytekin Vargun) Date: Wed, 6 May 2009 15:33:11 -0400 Subject: [vtkusers] How to obtain VTK 5.5 with CVS Message-ID: Hello, How can I download VTK5.5 from CVS? We could not do it from the instructions on the web. After logging in we tried the following but it did not work: cvs -d :pserver:anonymous at public.kitware.com:/cvsroot/VTK checkout -r VTK-5-5 VTK We just need the latest and safe version not the nightly part. Thanks Aytekin -- My web page: http://www.cs.rpi.edu/~vargua -------------- next part -------------- An HTML attachment was scrubbed... URL: From francois.bertel at kitware.com Wed May 6 15:41:54 2009 From: francois.bertel at kitware.com (Francois Bertel) Date: Wed, 6 May 2009 15:41:54 -0400 Subject: [vtkusers] How to obtain VTK 5.5 with CVS In-Reply-To: References: Message-ID: Hi, The latest stable/release version of VTK is 5.4. Odd number on minor version means unstable/CVS HEAD/development version. Try: cvs -q -d :pserver:anonymous at www.vtk.org:/cvsroot/VTK co -r "VTK-5-4" VTK 5.0 stable 5.1 older development version 5.2 stable 5.3 older development version 5.4 stable 5.5 current development version On Wed, May 6, 2009 at 3:33 PM, Aytekin Vargun wrote: > Hello, > How can I download VTK5.5 from CVS? We could not do it from the instructions > on the web. > > After logging in we tried the following but it did not work: > > cvs -d :pserver:anonymous at public.kitware.com:/cvsroot/VTK checkout -r > VTK-5-5 VTK > > We just need the latest and safe? version not the nightly part. > Thanks > Aytekin > > > -- > My web page: http://www.cs.rpi.edu/~vargua > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > -- Fran?ois Bertel, PhD | Kitware Inc. Suite 204 1 (518) 371 3971 x113 | 28 Corporate Drive | Clifton Park NY 12065, USA From David.Pont at scionresearch.com Wed May 6 16:56:57 2009 From: David.Pont at scionresearch.com (David.Pont at scionresearch.com) Date: Thu, 7 May 2009 08:56:57 +1200 Subject: [vtkusers] Store multiple versions of an array in a vtp file In-Reply-To: Message-ID: David Doria wrote on 06/05/2009 08:58:58: > On Tue, May 5, 2009 at 4:45 PM, wrote: > Hi David, > I posted a similar query last week: ie how to use vt* xml files to > hold data (efficiently) with constant geometry and varying data values. > Please keep me posted if you get any leads on this. > Should this question be posted to the Paraview mail list, which I am > not (yet) a member of? > > Found these from a quick search on Paraview list, > > http://markmail.org/message/lsyjxkf5vvxv2zuk > http://markmail.org/message/zoljls7eadz3sa6c > seem to be talking about modifying code to get desired bahaviour... > > http://markmail.org/thread/vogxdltk3sqcsjx6 > suggestion to use Ensight files for holding data > > regards, Dave P > > [image removed] David Doria > Dave P, > > I posted it as a paraview feature request: > http://public.kitware.com/Bug/view.php?id=8962 > > The only feedback so far is to use a different file type. > > David Hi David, I really appreciate the speedy response. This query was from a co-worker, I will suggest to him that he write (and contribute) new code to do this, but he is just getting started with vtk, so that might not happen! I guess this is not trivial? Now that I think about this again briefly, why not store as FieldData ? cheers, Dave P -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Wed May 6 17:07:37 2009 From: daviddoria at gmail.com (David Doria) Date: Wed, 6 May 2009 17:07:37 -0400 Subject: [vtkusers] Store multiple versions of an array in a vtp file In-Reply-To: References: Message-ID: > > Hi David, > I really appreciate the speedy response. This query was from a co-worker, I > will suggest to him that he write (and contribute) new code to do this, but > he is just getting started with vtk, so that might not happen! I guess this > is not trivial? Now that I think about this again briefly, why not store as > FieldData ? > > cheers, Dave P > > Hm I didn't think about writing it to FieldData, but there would have to be some support in Paraview to iterate over arrays in the FieldData. Ie. if I wrote arrays Clusters_1, Clusters_2, etc to FieldData, how would I tell Paraview "set frame 1 to color by Clusters_1, set frame 2 to color by Cluster_2, etc"? Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.mzik.vtkusers at googlemail.com Thu May 7 04:33:50 2009 From: michael.mzik.vtkusers at googlemail.com (Michael Mzik) Date: Thu, 7 May 2009 10:33:50 +0200 Subject: [vtkusers] Building VTK 5.4 against STLport 5.1.5 with VS2005 Message-ID: <2b2b71300905070133v4d254d3fua367456cc1d3d5b1@mail.gmail.com> Hello there! I am trying to build VTK 5.4 against STLport 5.1.5 under Visual Studio 2005. I successfully used CMake-gui (2.6-patch 4) for configuration and solution/projects-generation and VTK just compiles fine (without STLport !). However, if I add STLport to the compilers Include- and Lib-Path settings, and configure the appropriate CMAKE_CXX_FLAGS_DEBUG (added /D_STL_DEBUG flag) and CMAKE_..._LINKER_FLAGS to link against STLport, I am facing problems compiling (under release/debug) the file: vtkMultiCorrelativeStatistics.cxx . Please see the error-log at the end of the post.. Now I just wanted to ask if those "problems" are already known before I start trying to do a patch, or if STLport isn't supported at all ? Thanks a lot and best regards, Michael Error-log: Compiling... 1>vtkMultiCorrelativeStatistics.cxx 1>..\..\vtk-5.4.0\Infovis\vtkMultiCorrelativeStatistics.cxx(270) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'stlp_std::_Rb_tree_iterator<_Value,_Traits>' (or there is no acceptable conversion) 1> with 1> [ 1> _Value=vtkStdString, 1> _Traits=stlp_std::priv::_ConstSetTraitsT 1> ] 1> D:\PERFORCE\SOFTWARE_DEVELOPMENT\GENERIC\LIBS\StlPort\stlport\stl/_tree.h(199): could be 'stlp_std::_Rb_tree_iterator<_Value,_Traits> &stlp_std::_Rb_tree_iterator<_Value,_Traits>::operator =(const stlp_std::_Rb_tree_iterator<_Value,_Traits> &)' 1> with 1> [ 1> _Value=vtkStdString, 1> _Traits=stlp_std::priv::_SetTraitsT 1> ] 1> while trying to match the argument list '(stlp_std::_Rb_tree_iterator<_Value,_Traits>, stlp_std::_Rb_tree_iterator<_Value,_Traits>)' 1> with 1> [ 1> _Value=vtkStdString, 1> _Traits=stlp_std::priv::_SetTraitsT 1> ] 1> and 1> [ 1> _Value=vtkStdString, 1> _Traits=stlp_std::priv::_ConstSetTraitsT 1> ] 1>..\..\vtk-5.4.0\Infovis\vtkMultiCorrelativeStatistics.cxx(303) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'stlp_std::_Rb_tree_iterator<_Value,_Traits>' (or there is no acceptable conversion) 1> with 1> [ 1> _Value=vtkStdString, 1> _Traits=stlp_std::priv::_ConstSetTraitsT 1> ] 1> D:\PERFORCE\SOFTWARE_DEVELOPMENT\GENERIC\LIBS\StlPort\stlport\stl/_tree.h(199): could be 'stlp_std::_Rb_tree_iterator<_Value,_Traits> &stlp_std::_Rb_tree_iterator<_Value,_Traits>::operator =(const stlp_std::_Rb_tree_iterator<_Value,_Traits> &)' 1> with 1> [ 1> _Value=vtkStdString, 1> _Traits=stlp_std::priv::_SetTraitsT 1> ] 1> while trying to match the argument list '(stlp_std::_Rb_tree_iterator<_Value,_Traits>, stlp_std::_Rb_tree_iterator<_Value,_Traits>)' 1> with 1> [ 1> _Value=vtkStdString, 1> _Traits=stlp_std::priv::_SetTraitsT 1> ] 1> and 1> [ 1> _Value=vtkStdString, 1> _Traits=stlp_std::priv::_ConstSetTraitsT 1> ] 1>..\..\vtk-5.4.0\Infovis\vtkMultiCorrelativeStatistics.cxx(491) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'stlp_std::_Rb_tree_iterator<_Value,_Traits>' (or there is no acceptable conversion) 1> with 1> [ 1> _Value=vtkStdString, 1> _Traits=stlp_std::priv::_ConstSetTraitsT 1> ] 1> D:\PERFORCE\SOFTWARE_DEVELOPMENT\GENERIC\LIBS\StlPort\stlport\stl/_tree.h(199): could be 'stlp_std::_Rb_tree_iterator<_Value,_Traits> &stlp_std::_Rb_tree_iterator<_Value,_Traits>::operator =(const stlp_std::_Rb_tree_iterator<_Value,_Traits> &)' 1> with 1> [ 1> _Value=vtkStdString, 1> _Traits=stlp_std::priv::_SetTraitsT 1> ] 1> while trying to match the argument list '(stlp_std::_Rb_tree_iterator<_Value,_Traits>, stlp_std::_Rb_tree_iterator<_Value,_Traits>)' 1> with 1> [ 1> _Value=vtkStdString, 1> _Traits=stlp_std::priv::_SetTraitsT 1> ] 1> and 1> [ 1> _Value=vtkStdString, 1> _Traits=stlp_std::priv::_ConstSetTraitsT 1> ] -------------- next part -------------- An HTML attachment was scrubbed... URL: From jhnwright86 at gmail.com Thu May 7 08:22:43 2009 From: jhnwright86 at gmail.com (John Wright) Date: Thu, 7 May 2009 15:22:43 +0300 Subject: [vtkusers] Urgent Create .vtk image from float numbers? Message-ID: <4da4e2e40905070522n2c021c73vfece2e0ab2e79557@mail.gmail.com> Hey Guys, I check the web and the book but I couldn't find much information about my problem. I need to create 3-D . vtk image from float numbers that are read from a file. Does anyone know how I can solve this problem? Does anyone has a code for it? Thanks in advance John Wright -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtaverne at engits.com Thu May 7 09:11:30 2009 From: mtaverne at engits.com (Mike Taverne) Date: Thu, 07 May 2009 15:11:30 +0200 Subject: [vtkusers] How can I highlight a picked cell? Message-ID: <4A02DE02.9090509@engits.com> Hi, What is the best way to highlight a picked cell on a surface (representation of a vtkUnstructuredGrid)? Do I have to create a new actor or can this be done by coloring just one cell of the surface? Here are some excerpts from the current code: vtkUnstructuredGrid *grid; class vtkEgBoundaryCodesFilter : public vtkEgGridFilter class vtkEgGridFilter : public vtkUnstructuredGridAlgorithm, public EgVtkObject bcodes_filter = vtkEgBoundaryCodesFilter::New(); bcodes_filter->SetInput(grid); surface_filter = vtkGeometryFilter::New(); surface_filter->SetInput(bcodes_filter->GetOutput()); boundary_pd = vtkPolyData::New(); boundary_pd->DeepCopy(surface_filter->GetOutput()); surface_mapper = vtkPolyDataMapper::New(); surface_mapper->SetInput(boundary_pd); surface_actor = vtkActor::New(); surface_actor->SetBackfaceProperty(backface_property); surface_actor->GetProperty()->SetColor(0.5,1,0.5); surface_actor->GetBackfaceProperty()->SetColor(1,1,0.5); surface_actor->SetMapper(surface_mapper); Basically, I want to highlight one cell from the grid/surface_actor (and more than one eventually), while still keeping global colors for the front and back of the surface. From dave.demarle at kitware.com Thu May 7 09:34:10 2009 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 7 May 2009 09:34:10 -0400 Subject: [vtkusers] How can I highlight a picked cell? In-Reply-To: <4A02DE02.9090509@engits.com> References: <4A02DE02.9090509@engits.com> Message-ID: ParaView uses the approach of having a separate actor that just draws the picked cells. Picked cells are added to a list inside a vtkSelection data object. That selection and the original data are put through an ExtractSelection filter which extracts just those picked cells out into a new data set. That dataset is given its own actor. See selection discussions in the vtk wiki and kitware newsletter. That being said, you could do it by changing the color of one cell. Replace the data values in the picked cells with some flag value. Then setup the color lookup table to draw that flag value with some color that is not in the range of the normal transfer function. David E DeMarle Kitware, Inc. R&D Engineer 28 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-371-3971 x109 On Thu, May 7, 2009 at 9:11 AM, Mike Taverne wrote: > Hi, > > What is the best way to highlight a picked cell on a surface > (representation of a vtkUnstructuredGrid)? > Do I have to create a new actor or can this be done by coloring just one > cell of the surface? > > Here are some excerpts from the current code: > > ? ? ? ?vtkUnstructuredGrid *grid; > > ? ? ? ?class vtkEgBoundaryCodesFilter : public vtkEgGridFilter > ? ? ? ?class vtkEgGridFilter : public vtkUnstructuredGridAlgorithm, > public EgVtkObject > > ? ? ? ?bcodes_filter = vtkEgBoundaryCodesFilter::New(); > ? ? ? ?bcodes_filter->SetInput(grid); > > ? ? ? ?surface_filter = vtkGeometryFilter::New(); > ? ? ? ?surface_filter->SetInput(bcodes_filter->GetOutput()); > > ? ? ? ?boundary_pd = vtkPolyData::New(); > ? ? ? ?boundary_pd->DeepCopy(surface_filter->GetOutput()); > > ? ? ? ?surface_mapper = vtkPolyDataMapper::New(); > ? ? ? ?surface_mapper->SetInput(boundary_pd); > > ? ? ? ?surface_actor = vtkActor::New(); > ? ? ? ?surface_actor->SetBackfaceProperty(backface_property); > ? ? ? ?surface_actor->GetProperty()->SetColor(0.5,1,0.5); > ? ? ? ?surface_actor->GetBackfaceProperty()->SetColor(1,1,0.5); > ? ? ? ?surface_actor->SetMapper(surface_mapper); > > Basically, I want to highlight one cell from the grid/surface_actor (and > more than one eventually), while still keeping global colors for the > front and back of the surface. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > From ilferraresebono at hotmail.it Thu May 7 11:47:59 2009 From: ilferraresebono at hotmail.it (Giancarlo Amati) Date: Thu, 7 May 2009 17:47:59 +0200 Subject: [vtkusers] vtkProp * and vtkAssembly* what's the difference!!?!? Message-ID: Hello everybody, I have an object belonging to vtkAssembly * which has a set of actors in it. I'm using vtk54 and I wanted to call the addActor function of the renderer to add this assembly. Now, I got an error saying that I can't convert a vtkAssembly * to a vtkProp * but....vktAssembly derives from vtkProp3D which derives from vtkProp * in a public way! so, what's this error about!?! Kind regards. Giancarlo _________________________________________________________________ Cerca le Parole, gioca su Typectionary! http://typectionary.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From francois.bertel at kitware.com Thu May 7 13:22:19 2009 From: francois.bertel at kitware.com (Francois Bertel) Date: Thu, 7 May 2009 13:22:19 -0400 Subject: [vtkusers] vtkProp * and vtkAssembly* what's the difference!!?!? In-Reply-To: References: Message-ID: Did you make sure you included vtkAssembly.h ? ref: http://www.vtk.org/Wiki/VTK_FAQ#The_C.2B.2B_compiler_cannot_convert_some_pointer_type_to_another_pointer_type_in_my_little_program On Thu, May 7, 2009 at 11:47 AM, Giancarlo Amati wrote: > Hello everybody, > > I have an object belonging to vtkAssembly * which has a set of actors in it. > I'm using vtk54 and I wanted to call the addActor function of the renderer > to add this assembly. > Now, I got an error saying that I can't convert a vtkAssembly * to a vtkProp > * but....vktAssembly derives from vtkProp3D which derives from vtkProp * in > a public way! so, > what's this error about!?! > > Kind regards. > Giancarlo > > > > ________________________________ > Chiamate gratis da PC a PC? Provale da Messenger! > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > -- Fran?ois Bertel, PhD | Kitware Inc. Suite 204 1 (518) 371 3971 x113 | 28 Corporate Drive | Clifton Park NY 12065, USA From tavares at fe.up.pt Thu May 7 12:28:57 2009 From: tavares at fe.up.pt (=?iso-8859-1?Q?Jo=E3o_Manuel_R._S._Tavares?=) Date: Thu, 7 May 2009 17:28:57 +0100 Subject: [vtkusers] =?iso-8859-1?q?Special_Track_=22Computational_Bioimagi?= =?iso-8859-1?q?ng=22_within_the_ISVC09_USA_-_Announce_=26_Call_for?= =?iso-8859-1?q?_Papers?= Message-ID: <1ead01c9cf30$eb87b890$c29729b0$@up.pt> ---------------------------------------------------------------------------- ----------------------- (Apologies for cross-posting) Special Track ?Computational Bioimaging? 5th International Symposium on Visual Computing (ISVC09) Las Vegas, Nevada, USA, November 30 - December 2, 2009 http://www.isvc.net We would appreciate if you could distribute this information by your colleagues and co-workers. ---------------------------------------------------------------------------- ----------------------- Dear Colleague, Within the ISVC09 ? 5th International Symposium on Visual Computing (http://www.isvc.net), to be held in Las Vegas, Nevada, USA, in November 30 - December 2, 2009, we are organizing the Special Track ?ST6 - Computational Bioimaging? (http://www.isvc.net/ST6.pdf). The main goal of the Special Track ?ST6 - Computational Bioimaging? is to bring together researchers working in the related fields of Image Acquisition, Segmentation, Registration, Tracking, Matching, Shape Reconstruction, Motion and Deformation Analysis, Medical Imaging, Software Development, Grid, Parallel and High Performing Computing, to discuss and share ideas that will lead us to set the major lines of development for the near future. Therefore, the Special Track ?ST6 - Computational Bioimaging? will gather researchers representing the various fields of Computational Vision, Computational Mechanics, Mathematics, Statistics, and Biomedical Imaging. This track intends to contribute more realistic computational models extracted from images of living organisms and attempts to establish a bridge between practitioners and researchers from these diverse fields. Due to your research activities in those fields, we would like to invite you to submit your work and participate in the Special Track ?ST6 - Computational Bioimaging?. TOPICS The topics of interest include but are not limited to the following areas: - Image Processing and Analysis for Computational Bioimaging; - Segmentation, Reconstruction, Tracking and Motion Analyse in Biomedical Images; - Biomedical Signal and Image Acquisition and Processing; - Computer Aided Diagnosis, Surgery, Therapy, Treatment and Telemedicine Systems; - Software Development for Computational Bioimaging; - Grid and High Performance Computing for Computational Bioimaging. SUBMISSION/PROCEEDINGS Instructions for authors are available in the website of ISVC'09 (http://www.isvc.net/author.html). Authors should submit electronically their contributions through the website of ISVC'09 (http://www.isvc.net), selecting the Special Track ?ST6 - Computational Bioimaging?. Accepted papers will appear in the symposium proceedings which will be published by Springer-Verlag in the Lecture Notes in Computer Science (LNCS) series. IMPORTANT DATES - Submission deadline: July 10, 2009; - Notification of acceptance: August 31, 2009; - Camera-ready version: September 14, 2009. SCIENTIFIC COMMITTEE - Alberto De Santis, Universit? degli Studi di Roma "La Sapienza", Italy - Alexandre Cunha, California Institute of Technology, USA - Alexandre Xavier Falc?o, University of Campinas, Brazil - Ana Mafalda Reis, University of Porto, Portugal - Arrate Mu?oz Barrutia, University of Navarra, Spain - Bego?a Calvo, University of Zaragoza, Spain - Constantine Kotropoulos, Aristotle University of Thessaloniki, Greece - Daniela Iacoviello, Universit? degli Studi di Roma "La Sapienza", Italy - Denilson Laudares Rodrigues, PUC Minas, Brazil - Dinggang Shen, University of Pennsylvania, USA - Djemel Ziou, University of Sherbrooke, Canada - Eduardo Borges Pires, Instituto Superior T?cnico, Portugal - Fiorella Sgallari, University of Bologna, Italy - Francisco Perales, Balearic Islands University, Spain - Gustavo Rohde, Carnegie Mellon University, USA - Hanchuan Peng, Howard Hughes Medical Institute, USA - H?lder C. Rodrigues, Instituto Superior T?cnico, Portugal - Hemerson Pistori, Dom Bosco Catholic University, Brazil - Huiyu Zhou, Brunel University, UK - Igor Yanovsky, Jet Propulsion Laboratory, USA - Jason Corso, SUNY at Buffalo, USA - Jo?o Manuel R. S. Tavares, University of Porto, Portugal - Javier Melench?n Maldonado, Open University of Catalonia, Spain - Jorge M. G. Barbosa, University of Porto, Portugal - Jorge S. Marques, Instituto Superior T?cnico, Portugal - Jose M. Garc?a Aznar, University of Zaragoza, Spain - Jussi Tohka, Tampere University of Technology, Finland - Luminita Vese, University of California at Los Angeles, USA - Lu?s Paulo Reis, University of Porto, Portugal - Mahmoud El-Sakka, The University of Western Ontario London, Canada - Manuel Gonz?lez Hidalgo, Balearic Islands University, Spain - Maria Elizete Kunkel, Universit?t Ulm, Germany - Metin N. Gurcan, Ohio State University, USA - Michael Liebling, University of California at Santa Barbara, USA - Patrick Dubois, Institut de Technologie M?dicale, France - Renato M. N. Jorge, University of Porto, Portugal - Reneta P. Barneva, State University of New York, USA - Roberto Bellotti, University of Bari, Italy - Sabina Tangaro, National Institute of Nuclear Physics, Italy - Shawn Newsam, University of California at Merced, USA - Susana Branco Silva, University of Lisbon, Portugal - Todd Pataky, University of Liverpool, UK - Valentin Brimkov, State University of New York, USA - Yongjie Zhan, Carnegie Mellon University, USA With kind regards, Jo?o Manuel R. S. Tavares, University of Porto, Portugal, tavares at fe.up.pt Renato Natal Jorge, University of Porto, Portugal, rnatal at fe.up.pt Alexandre Cunha, California Institute of Technology, USA, cunha at caltech.edu (Organizers of the Special Track ?ST6 - Computational Bioimaging and Visualization?) PS. For more information about the Special Track ?ST6 - Computational Bioimaging?, please download its flyer at: www.fe.up.pt/~tavares/downloads/calls/bima09.pdf From darren.weber.lists at gmail.com Thu May 7 13:46:09 2009 From: darren.weber.lists at gmail.com (Darren Weber) Date: Thu, 7 May 2009 10:46:09 -0700 Subject: [vtkusers] python testing? Message-ID: Is there an easy way to test all the vtk functions within python? Is there anything like ctest that can run everything in python? Thanks, Darren -------------- next part -------------- An HTML attachment was scrubbed... URL: From francois.bertel at kitware.com Thu May 7 14:03:14 2009 From: francois.bertel at kitware.com (Francois Bertel) Date: Thu, 7 May 2009 14:03:14 -0400 Subject: [vtkusers] python testing? In-Reply-To: References: Message-ID: Hi, Some vtk tests are written in python. Example: VTK/Graphics/Testing/Python/tubeComb.py Most of the TCL tests are converted to python tests automatically. See VTK/CMakeLists.txt: # Build scripts to convert tcl tests to python ADD_SUBDIRECTORY(Utilities/vtkTclTest2Py) On Thu, May 7, 2009 at 1:46 PM, Darren Weber wrote: > > Is there an easy way to test all the vtk functions within python? > > Is there anything like ctest that can run everything in python? > > Thanks, Darren > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > -- Fran?ois Bertel, PhD | Kitware Inc. Suite 204 1 (518) 371 3971 x113 | 28 Corporate Drive | Clifton Park NY 12065, USA From nbilal at mirarco.org Thu May 7 13:21:41 2009 From: nbilal at mirarco.org (Nehme Bilal) Date: Thu, 07 May 2009 13:21:41 -0400 Subject: [vtkusers] embedding python in a vtk plugin In-Reply-To: References: Message-ID: Hi all, I am trying to call a python script from my vtk plugin. First I tried to include "Python.h" or "vtkPython.h" but I am getting the following error: fatal error LNK1104: cannot open file 'python25.lib' When I built vtk, I did enable python and I have the python directory in my path. Should I add something to my plugin cmake list ? how can I fix this problem ? Thank you. From baoyun_li123 at yahoo.com Thu May 7 16:08:37 2009 From: baoyun_li123 at yahoo.com (Baoyun Li) Date: Thu, 7 May 2009 13:08:37 -0700 (PDT) Subject: [vtkusers] want to put cursur on one slice, but the cursor can be seen at mutiple slice Message-ID: <128975.86610.qm@web111008.mail.gq1.yahoo.com> Dear All: This is the first time I sending messeage to the list. I want to put some seeds points on special position of 3D image( lest say slice 100), but finally I can see the cursor at mutiple slice from 1-100. I use QtVtkWidge and vtkImageView2 to display the image. When I move the slider in QT, I can go through the image slice by slice. Below is my code to put seed points. vtkCurosr2D is used for painting the curosr. vtkPolyData is used to store all the seed points, I then add the Actor of SeedsGlyph to vtkImageViewer2 render. ???? SeedsCursor = vtkCursor2D::New(); ???? //SeedsCursor = vtkImageCursor3D::New(); ??? ???? SeedsCursor->AllOff(); ???? SeedsCursor->AxesOn(); ???? SeedsCursor->PointOn(); ???? pts=vtkPoints::New(); ??? // for(unsigned int i=0;i<200;i++) ???????? pts->InsertPoint( 0, 128*1.37, 128*1.37, 100 ); ??? ???? VisibleSeedsPolyData=vtkPolyData::New(); ???? VisibleSeedsPolyData->SetPoints(pts);///// input later ???? ???? SeedsGlyph = vtkGlyph3D::New(); ???? SeedsGlyph->SetVectorModeToVectorRotationOff(); ???? SeedsGlyph->ScalingOn(); ???? SeedsGlyph->SetScaleModeToDataScalingOff(); ???? SeedsGlyph->SetScaleFactor( 10); ???? SeedsGlyph->SetInput( VisibleSeedsPolyData ); ???? SeedsGlyph->SetSource( SeedsCursor->GetOutput() ); ???? SeedsMapper = vtkPolyDataMapper::New(); ???? SeedsMapper->SetInput( SeedsGlyph->GetOutput() ); ???? SeedsActor = vtkActor::New(); ???? SeedsActor->SetMapper( SeedsMapper ); ???? //image_view2->GetImageActor()->SetOpacity(1.0); ???? image_view2->GetRenderer()->AddActor(SeedsActor); Can somebody teach me what is wrong with my code. Thanks Baoyun -------------- next part -------------- An HTML attachment was scrubbed... URL: From x0_y0_0 at 126.com Thu May 7 23:29:12 2009 From: x0_y0_0 at 126.com (x0_y0_0) Date: Fri, 8 May 2009 11:29:12 +0800 (CST) Subject: [vtkusers] render two Windows Message-ID: <17684649.622721241753352468.JavaMail.coremail@bj126app22.126.com> hi,vtkusers, I restruct 3D CT,and render it on MFC dialog.I extract a reslice using vtkImageReslice ,and then render it on the same dialog.I could see the two ones in the dialog at the sanme time,but when I close the window there is vtkoutputWindow and qiuckly disappear. Could anyone help me ? thanks render = vtkRenderer::New(); render->SetBackground(0.1,0.2,0.4); renWin = vtkRenderWindow::New(); renWin->AddRenderer(render); iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(renWin); render->AddVolume(newvol); void CVTK::VTKToDialog(CStatic * aStatic) { CRect rect; aStatic->GetClientRect(&rect); renWin->SetSize(rect.Width(),rect.Height()); renWin->SetParentId(aStatic->m_hWnd); renWin->Render(); } regards, mexiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From stevec at renci.org Fri May 8 09:22:42 2009 From: stevec at renci.org (Steve Chall) Date: Fri, 8 May 2009 09:22:42 -0400 Subject: [vtkusers] The basics of setting up VTK in Windows Message-ID: Colleagues, I've had reasonable success setting up, maintaining and using VTK with GCC/g++ in a Linux environment for a couple of years now. However, I have a new project coming up that stipulates that I use VTK in C++ within Microsoft Visual Studio 2008, and I'm not sure where to look for guidelines for practical setup: where to put the include files and libraries, the best way to let Visual Studio know where they are. I downloaded and ran the Windows 5.4.0 installer, which seems to have only installed a tiny sample program and none of the other stuff one needs to build VTK apps. I've also downloaded and decompressed the Source, Data, and Documentation files. For some reason the docs are not externally accessible to me, and at this point rudimentary questions are proliferating wildly. I'm sure there are thousands of successful setups just like I want to create, and that I'm missing something really basic and probably obvious. Can someone point me to a Getting Started and Setup guide for VTK with VC++? Thanks. -Steve Chall Senior Research Software Developer Renaissance Computing Institute Phone: 919-515-0051 Email: stevec at renci.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Fri May 8 09:43:28 2009 From: drescherjm at gmail.com (John Drescher) Date: Fri, 8 May 2009 09:43:28 -0400 Subject: [vtkusers] The basics of setting up VTK in Windows In-Reply-To: References: Message-ID: <387ee2020905080643i6bc5f86fma1322347f274db94@mail.gmail.com> On Fri, May 8, 2009 at 9:22 AM, Steve Chall wrote: > Colleagues, > > I?ve had reasonable success setting up, maintaining and using VTK with > GCC/g++ in a Linux environment for a couple of years now.? However, I have a > new project coming up that stipulates that I use VTK in C++ within Microsoft > Visual Studio 2008, and I?m not sure where to look for guidelines for > practical setup:? where to put the include files and libraries, the best way > to let Visual Studio know where they are.? I downloaded and ran the Windows > 5.4.0 installer, which seems to have only installed a tiny sample program > and none of the other stuff one needs to build VTK apps.? I?ve also > downloaded and decompressed the Source, Data, and Documentation files.? For > some reason the docs are not externally accessible to me, and at this point > rudimentary questions are proliferating wildly.? I?m sure there are > thousands of successful setups just like I want to create, and that I?m > missing something really basic and probably obvious.? Can someone point me > to a Getting Started and Setup guide for VTK with VC++?? Thanks. > > My advice, is to use CMake to generate your Visual Studio project files and build VTK from source with the same compiler you will use for your application. Letting VS manage the project files will only lead to headaches with includes, and linking. John From drescherjm at gmail.com Fri May 8 09:44:46 2009 From: drescherjm at gmail.com (John Drescher) Date: Fri, 8 May 2009 09:44:46 -0400 Subject: [vtkusers] The basics of setting up VTK in Windows In-Reply-To: <387ee2020905080643i6bc5f86fma1322347f274db94@mail.gmail.com> References: <387ee2020905080643i6bc5f86fma1322347f274db94@mail.gmail.com> Message-ID: <387ee2020905080644t41f65daeh96aac43890c63a65@mail.gmail.com> On Fri, May 8, 2009 at 9:43 AM, John Drescher wrote: > On Fri, May 8, 2009 at 9:22 AM, Steve Chall wrote: >> Colleagues, >> >> I?ve had reasonable success setting up, maintaining and using VTK with >> GCC/g++ in a Linux environment for a couple of years now.? However, I have a >> new project coming up that stipulates that I use VTK in C++ within Microsoft >> Visual Studio 2008, and I?m not sure where to look for guidelines for >> practical setup:? where to put the include files and libraries, the best way >> to let Visual Studio know where they are.? I downloaded and ran the Windows >> 5.4.0 installer, which seems to have only installed a tiny sample program >> and none of the other stuff one needs to build VTK apps.? I?ve also >> downloaded and decompressed the Source, Data, and Documentation files.? For >> some reason the docs are not externally accessible to me, and at this point >> rudimentary questions are proliferating wildly.? I?m sure there are >> thousands of successful setups just like I want to create, and that I?m >> missing something really basic and probably obvious.? Can someone point me >> to a Getting Started and Setup guide for VTK with VC++?? Thanks. >> >> > > My advice, is to use CMake to generate your Visual Studio project > files Here I mean for both the application you are writing and VTK itself. John From drescherjm at gmail.com Fri May 8 13:21:48 2009 From: drescherjm at gmail.com (John Drescher) Date: Fri, 8 May 2009 13:21:48 -0400 Subject: [vtkusers] The basics of setting up VTK in Windows In-Reply-To: References: <387ee2020905080643i6bc5f86fma1322347f274db94@mail.gmail.com> <387ee2020905080644t41f65daeh96aac43890c63a65@mail.gmail.com> Message-ID: <387ee2020905081021v43f9eb37l4d0d88450f0b1aa1@mail.gmail.com> On Fri, May 8, 2009 at 1:07 PM, Bob Palank wrote: > As I understand it, you can download cmake and all additional files and > build it yourself from the source code! Perhaps someone else has already > done all of the compilation and produced a complete set of .lib and .dll > files. ?To me requesting the current release libs and dlls seems reasonable. > On the other hand, perhaps there is a reason all VS2008 users need to build > from scratch ? > Maybe someone else knows why. > Please report what you find out. > BobbyP > On windows I believe you should build vtk, itk ... from source most of the time if you are developing your own software anyways because there are two issues with a binary download. The first issue is that unless you are using .dlls you probably need the libraries to be built from the same compiler version (and sometimes same service pack) otherwise you can and will run into library incompatibilities. Second you probably want to customize the options of what is included in vtk (at least I do that).. John From frencyvarghese at yahoo.com Fri May 8 14:38:13 2009 From: frencyvarghese at yahoo.com (frency v) Date: Fri, 8 May 2009 11:38:13 -0700 (PDT) Subject: [vtkusers] Iso-surface coloring Message-ID: <853973.29629.qm@web52312.mail.re2.yahoo.com> Hello everyone i have an 3D image (.raw) that? has? values from 0 to 500. I use vtkcontourfilter to see the image on the renderwindow. But what i want is different color for voxels ie for voxels with value 0 to 100 should have a different color when they appear on tthe renderwindow, and different color for voxels with value 110 to 250 and different color for voxles with value 250 to 500 when they appear on tthe renderwindow. Rgds frency -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrewc at mac.com Fri May 8 15:01:20 2009 From: andrewc at mac.com (Andrew Cunningham) Date: Fri, 08 May 2009 12:01:20 -0700 Subject: [vtkusers] Using GetResolveCoincidentTopologyPolygonOffsetParameters etc Message-ID: <159677669730232208107809077645550698058-Webmail@me.com> Hi, I am drawing a Finite Element mesh object where one wishes to display the wireframe mesh 'on top of ' the shaded mesh. Typically one does this in OpenGL by drawing the mesh twice - once filled and once as wireframe, using glPolygonOffset to make sure the mesh is visible. VTK has the functionality with the various Set/GetCoincidentTopologyxxx calls. But no examples and nothing on the mailing list as far as I can tell. Anyone have a code snippet? Or do I need another lesson in searching... Cheers, Andrew From francois.bertel at kitware.com Fri May 8 15:06:26 2009 From: francois.bertel at kitware.com (Francois Bertel) Date: Fri, 8 May 2009 15:06:26 -0400 Subject: [vtkusers] Using GetResolveCoincidentTopologyPolygonOffsetParameters etc In-Reply-To: <159677669730232208107809077645550698058-Webmail@me.com> References: <159677669730232208107809077645550698058-Webmail@me.com> Message-ID: Hi, Take a look at: VTK/Rendering/Testing/Cxx/SurfacePlusEdges.cxx Regards. On Fri, May 8, 2009 at 3:01 PM, Andrew Cunningham wrote: > ?Hi, > I am drawing a Finite Element mesh object where one wishes to display the wireframe mesh 'on top of ' the shaded mesh. Typically one does this in OpenGL by drawing the mesh twice - once filled and once as wireframe, using glPolygonOffset to make sure the mesh is visible. > VTK has the ?functionality with the various Set/GetCoincidentTopologyxxx calls. But no examples and nothing on the mailing list as far as I can tell. Anyone have a code snippet? Or do I need another lesson in searching... > > Cheers, > Andrew > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > -- Fran?ois Bertel, PhD | Kitware Inc. Suite 204 1 (518) 371 3971 x113 | 28 Corporate Drive | Clifton Park NY 12065, USA From theodoreholden at yahoo.com Fri May 8 16:00:22 2009 From: theodoreholden at yahoo.com (Theodore Holden) Date: Fri, 8 May 2009 13:00:22 -0700 (PDT) Subject: [vtkusers] C#/VTK Memory Leak Message-ID: <108738.27956.qm@web38601.mail.mud.yahoo.com> If I can solve one or two more problems here, I'll be looking at replacing an existing system of around 12,000 lines of OpenGL code with a couple of hundred lines of VTK code, and the VTK graphics look better. It's probably a common situation, the data involved is fairly simple but the existing code for presenting it is byzantine and borderline unmaintainable. But there's a big and non-obvious problem with a memory leak in the picture. The application reads data from a proprietary file, writes that data out to a .vtk file, and then calls a function which uses VTK code to draw the data on a VTK form which is created using the sourceforge wrapper library and component for c# available at http://vtkdotnet.sourceforge.net/. The problem I'm seeing is definitely in the VTK code and not any part of the code which generates the data. If I insert a return statement just prior to the call to the vtk code, the memory leak vanishes. Worse, the Red-Gate ANTS memory profiler offers no help; it shows the largest objects in the system being a couple of inconsequential byte arrays which are definitely not part of the problem. The examples provided show functions with names like AddConeSurfaceToWindow and AddFlamingoToWindow. Trying to use the same techniques produces a function which looks like this: // 3d texture void AddBagVolumeToWindow4(vtk.vtkRenderWindow renWin) { // 3d texture map vtkStructuredPointsReader reader = new vtkStructuredPointsReader(); vtkVolume volume = new vtkVolume(); vtkVolumeProperty volumeProperty = new vtkVolumeProperty(); vtkRenderer renderer = new vtkRenderer(); vtkRenderWindowInteractor interactor = new vtkRenderWindowInteractor(); vtkVolumeTextureMapper3D volumeMapper = new vtkVolumeTextureMapper3D(); vtkPiecewiseFunction opacity = new vtkPiecewiseFunction(); vtkColorTransferFunction color = new vtkColorTransferFunction(); reader.SetFileName("c:\\zz.vtk"); reader.Update(); ifileLoaded = 1; opacity.AddPoint(0, 0); opacity.AddPoint(64, .005); opacity.AddPoint(127, .01); opacity.AddPoint(128, .05); opacity.AddPoint(200, .5); color.AddRGBPoint(0, 1, 1, 1); color.AddRGBPoint(126, .665, .84, .88); color.AddRGBPoint(127, 0, 1, 0); color.AddRGBPoint(199, 1, 0, 0); volumeProperty.SetColor(color); volumeProperty.SetScalarOpacity(opacity); volumeProperty.SetInterpolationTypeToLinear(); volumeProperty.ShadeOn(); volumeMapper.SetInput(reader.GetOutput()); volume.SetMapper(volumeMapper); volume.SetProperty(volumeProperty); renderer.SetBackground(1, 1, 1); renderer.AddVolume(volume); interactor.SetRenderWindow(renWin); renWin.AddRenderer(renderer); renWin.Render(); interactor.Start(); reader.Dispose(); volume.Dispose(); volumeProperty.Dispose(); renderer.Dispose(); interactor.Dispose(); opacity.Dispose(); color.Dispose(); vtk.vtkWin32OpenGLRenderWindow win32win = vtk.vtkWin32OpenGLRenderWindow.SafeDownCast(renWin); win32win.Clean(); } Again testing indicates that the memory leak has nothing to do with code outside of this function and a memory profiler reputed to be the best provides no information. I get the impression that many if not most VTK apps only need to put a particular 3D image on a screen once, while this function is called repeatedly as a succession of images is read in by the user. Again the read process reads data and throws it out to c:\\zz.vtk, which the vtk code then reads. It occurred to me that eliminating the repeated VTK constructor calls might help. That leads to this code in the app constructor: public Form1() { InitializeComponent(); // clear out vtk widget screen vtkForm1.GetRenderWindow().Frame(); vtkRenderer vr = new vtkRenderer(); vr.SetBackground(1, 1, 1); vr.SetRenderWindow(vtkForm1.GetRenderWindow()); vtkForm1.GetRenderWindow().AddRenderer(vr); vr.Clear(); vr.Render(); vtk.vtkWin32OpenGLRenderWindow win32win = vtk.vtkWin32OpenGLRenderWindow.SafeDownCast(vtkForm1.GetRenderWindow()); win32win.Clean(); // set viewing objects for 3D texture map model volume4 = new vtkVolume(); volumeProperty4 = new vtkVolumeProperty(); renderer4 = new vtkRenderer(); interactor4 = new vtkRenderWindowInteractor(); volumeMapper4 = new vtkVolumeTextureMapper3D(); opacity = new vtkPiecewiseFunction(); color = new vtkColorTransferFunction(); renderer4.AddVolume(volume4); vtkForm1.GetRenderWindow().AddRenderer(renderer4); volume4.SetMapper(volumeMapper4); volume4.SetProperty(volumeProperty4); } and then a modified function to display images: void AddBagVolumeToWindow4(vtk.vtkRenderWindow renWin) { vtkStructuredPointsReader reader4 = new vtkStructuredPointsReader(); reader4.SetFileName("c:\\zz.vtk"); reader4.Update(); opacity.AddPoint(0, 0); opacity.AddPoint(64, .005); opacity.AddPoint(128, .01); opacity.AddPoint(200, .05); opacity.AddPoint(220, .4); color.AddRGBPoint(64, .665, .84, .88); color.AddRGBPoint(128, 0, .746, .95); color.AddRGBPoint(220, 0, 1, 0); color.AddRGBPoint(230, 1, 0, 0); volumeProperty4.SetColor(color); volumeProperty4.SetScalarOpacity(opacity); volumeProperty4.SetInterpolationTypeToLinear(); volumeProperty4.ShadeOn(); volumeMapper4.SetInput(reader4.GetOutput()); volumeMapper4.Update(); renderer4.SetBackground(1, 1, 1); interactor4.SetRenderWindow(renWin); renWin.Render(); interactor4.Start(); reader4.Dispose(); GC.Collect(); vtk.vtkWin32OpenGLRenderWindow win32win = vtk.vtkWin32OpenGLRenderWindow.SafeDownCast(renWin); win32win.Clean(); } But even that doesn't help. The computer loses around 50MB each time a new image is read in and these images are not that large, more like around 10MB on average. Again I'm new at this, and any help or information would be appreciated. Ted -------------- next part -------------- An HTML attachment was scrubbed... URL: From nkwmailinglists at gmail.com Fri May 8 18:09:50 2009 From: nkwmailinglists at gmail.com (kent williams) Date: Fri, 8 May 2009 17:09:50 -0500 Subject: [vtkusers] 2 more (possibly dumb) questions about vtkSeedWidget Message-ID: <44f773f50905081509i7cd1ff07q1f95a6f91a8fb24b@mail.gmail.com> 1. In order to work with 2D windows, I have a vtkSeedWidget associated with a particular image Slice. When the user changes slices, vtkSeedWidget::SetEnabled(0) gets called to turn off interaction and display. When the user changes back to a slice with an associated SeedWidget, the converse happens: vtkSeedWidget::SetEnabled(1) is called. The question is this: Can I turn the SeedWidget back on without putting it in the state where it's adding new points? I find myself inadvertently creating a new point when what I want to do is to move an existing one. Hitting the right mouse button seems to sometimes turn off adding new points on every click, but not consistently. 2. Our application has 3 different planar views -- anatomically they represent Axial, Sagittal and coronal views. My boss would like for this program to allow a point to be initially created in one view, but displayed in the other two views, and allow the user to move the point in those other views. Is it possible to have ONE instance of vtkSeedRepresentation, but attach it to 3 different SeedWidgets? I can see this is probably not such a grand idea, since depending on the ImageActor the SeedWidget is attached to, it has a different idea about which direction the axes are pointing, relative to world coordinates. How would one do this? According to my boss, Slicer can have a fiducial point manipulated in three different views at the same time. Well one view at a time because you only have one mouse pointer, but the point can be associated with 3 views at once. Unfortunately, it takes a lot of study to figure out what Slicer is doing -- I can't even find where the mouse interaction and point display is happening. From david.cole at kitware.com Fri May 8 18:12:00 2009 From: david.cole at kitware.com (David Cole) Date: Fri, 8 May 2009 18:12:00 -0400 Subject: [vtkusers] C#/VTK Memory Leak In-Reply-To: <108738.27956.qm@web38601.mail.mud.yahoo.com> References: <108738.27956.qm@web38601.mail.mud.yahoo.com> Message-ID: At first glance, I do not see anything obviously incorrect about your code. Have you tried similar code using Kitware's ActiViz .NET Personal Edition? We run test suites that do similar tasks and do not see memory leaks like this in our testing for ActiViz (we have leak checking built in to VTK, and we have seen leak reports when there have been bugs in the past...) I am not familiar with the implementation of the vtkdotnet C# wrappers, but if you see similar behavior with ActiViz .NET, I'd be interested to hear about that... HTH, David Cole Kitware, Inc. On Fri, May 8, 2009 at 4:00 PM, Theodore Holden wrote: > If I can solve one or two more problems here, I'll be looking at replacing > an existing system of around 12,000 lines of OpenGL code with a couple of > hundred lines of VTK code, and the VTK graphics look better. It's probably > a common situation, the data involved is fairly simple but the existing code > for presenting it is byzantine and borderline unmaintainable. > > But there's a big and non-obvious problem with a memory leak in the > picture. The application reads data from a proprietary file, writes that > data out to a .vtk file, and then calls a function which uses VTK code to > draw the data on a VTK form which is created using the sourceforge wrapper > library and component for c# available at > http://vtkdotnet.sourceforge.net/. > > The problem I'm seeing is definitely in the VTK code and not any part of > the code which generates the data. If I insert a return statement just > prior to the call to the vtk code, the memory leak vanishes. > > Worse, the Red-Gate ANTS memory profiler offers no help; it shows the > largest objects in the system being a couple of inconsequential byte arrays > which are definitely not part of the problem. > > The examples provided show functions with names like AddConeSurfaceToWindow > and AddFlamingoToWindow. > > Trying to use the same techniques produces a function which looks like > this: > > // 3d texture > void AddBagVolumeToWindow4(vtk.vtkRenderWindow renWin) > { > // 3d texture map > vtkStructuredPointsReader reader = new > vtkStructuredPointsReader(); > vtkVolume volume = new vtkVolume(); > vtkVolumeProperty volumeProperty = new > vtkVolumeProperty(); > vtkRenderer renderer = new vtkRenderer(); > vtkRenderWindowInteractor interactor = new > vtkRenderWindowInteractor(); > vtkVolumeTextureMapper3D volumeMapper = new > vtkVolumeTextureMapper3D(); > vtkPiecewiseFunction opacity = new vtkPiecewiseFunction(); > vtkColorTransferFunction color = new > vtkColorTransferFunction(); > > reader.SetFileName("c:\\zz.vtk"); > reader.Update(); > ifileLoaded = 1; > > opacity.AddPoint(0, 0); > opacity.AddPoint(64, .005); > opacity.AddPoint(127, .01); > opacity.AddPoint(128, .05); > opacity.AddPoint(200, .5); > > color.AddRGBPoint(0, 1, 1, 1); > color.AddRGBPoint(126, .665, .84, .88); > color.AddRGBPoint(127, 0, 1, 0); > color.AddRGBPoint(199, 1, 0, 0); > > volumeProperty.SetColor(color); > volumeProperty.SetScalarOpacity(opacity); > volumeProperty.SetInterpolationTypeToLinear(); > volumeProperty.ShadeOn(); > > volumeMapper.SetInput(reader.GetOutput()); > > volume.SetMapper(volumeMapper); > volume.SetProperty(volumeProperty); > > renderer.SetBackground(1, 1, 1); > renderer.AddVolume(volume); > interactor.SetRenderWindow(renWin); > > renWin.AddRenderer(renderer); > > renWin.Render(); > interactor.Start(); > > reader.Dispose(); > volume.Dispose(); > volumeProperty.Dispose(); > renderer.Dispose(); > interactor.Dispose(); > opacity.Dispose(); > color.Dispose(); > > vtk.vtkWin32OpenGLRenderWindow win32win = > vtk.vtkWin32OpenGLRenderWindow.SafeDownCast(renWin); > win32win.Clean(); > } > > Again testing indicates that the memory leak has nothing to do with code > outside of this function and a memory profiler reputed to be the best > provides no information. I get the impression that many if not most VTK > apps only need to put a particular 3D image on a screen once, while this > function is called repeatedly as a succession of images is read in by the > user. Again the read process reads data and throws it out to c:\\zz.vtk, > which the vtk code then reads. > > It occurred to me that eliminating the repeated VTK constructor calls might > help. That leads to this code in the app constructor: > > public Form1() > { > InitializeComponent(); > > // clear out vtk widget screen > vtkForm1.GetRenderWindow().Frame(); > vtkRenderer vr = new vtkRenderer(); > vr.SetBackground(1, 1, 1); > vr.SetRenderWindow(vtkForm1.GetRenderWindow()); > vtkForm1.GetRenderWindow().AddRenderer(vr); > vr.Clear(); > vr.Render(); > vtk.vtkWin32OpenGLRenderWindow win32win = > > vtk.vtkWin32OpenGLRenderWindow.SafeDownCast(vtkForm1.GetRenderWindow()); > win32win.Clean(); > > // set viewing objects for 3D texture map model > volume4 = new vtkVolume(); > volumeProperty4 = new vtkVolumeProperty(); > renderer4 = new vtkRenderer(); > interactor4 = new vtkRenderWindowInteractor(); > volumeMapper4 = new vtkVolumeTextureMapper3D(); > > opacity = new vtkPiecewiseFunction(); > color = new vtkColorTransferFunction(); > > renderer4.AddVolume(volume4); > vtkForm1.GetRenderWindow().AddRenderer(renderer4); > volume4.SetMapper(volumeMapper4); > volume4.SetProperty(volumeProperty4); > } > > and then a modified function to display images: > > void AddBagVolumeToWindow4(vtk.vtkRenderWindow renWin) > { > > vtkStructuredPointsReader reader4 = new > vtkStructuredPointsReader(); > reader4.SetFileName("c:\\zz.vtk"); > reader4.Update(); > > opacity.AddPoint(0, 0); > opacity.AddPoint(64, .005); > opacity.AddPoint(128, .01); > opacity.AddPoint(200, .05); > opacity.AddPoint(220, .4); > > color.AddRGBPoint(64, .665, .84, .88); > color.AddRGBPoint(128, 0, .746, .95); > color.AddRGBPoint(220, 0, 1, 0); > color.AddRGBPoint(230, 1, 0, 0); > > volumeProperty4.SetColor(color); > volumeProperty4.SetScalarOpacity(opacity); > volumeProperty4.SetInterpolationTypeToLinear(); > volumeProperty4.ShadeOn(); > > volumeMapper4.SetInput(reader4.GetOutput()); > volumeMapper4.Update(); > > renderer4.SetBackground(1, 1, 1); > interactor4.SetRenderWindow(renWin); > > renWin.Render(); > interactor4.Start(); > > reader4.Dispose(); > GC.Collect(); > > vtk.vtkWin32OpenGLRenderWindow win32win = > vtk.vtkWin32OpenGLRenderWindow.SafeDownCast(renWin); > win32win.Clean(); > > } > > But even that doesn't help. The computer loses around 50MB each time a new > image is read in and these images are not that large, more like around 10MB > on average. > > Again I'm new at this, and any help or information would be appreciated. > > > Ted > > > > > > > > > > > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 tracy.hu at yahoo.com Fri May 8 18:23:16 2009 From: tracy.hu at yahoo.com (Tracy Hu) Date: Fri, 8 May 2009 15:23:16 -0700 (PDT) Subject: [vtkusers] why is interacting with an assembly of many vtkLODActors much slower than interacting directly with many vtkLODActors? Message-ID: <662063.95324.qm@web45102.mail.sp1.yahoo.com> I added a bunch of vtkLODActor into a renderer and set? up abortcheck event. Interacting with window is quick. But if I put all vtkLODActors into an vtkAssembly and add only that assembly into renderer, the interaction with window become much slower although the assembly also becomes point cloud during interaction. Is there any way to make interaction with assembly quicker or it's just not possible? Thanks a lot for any hint Tracy ==================================== #include "vtkRenderer.h" #include "vtkRenderWindow.h" #include "vtkRenderWindowInteractor.h" #include "vtkStructuredPointsReader.h" #include "vtkPiecewiseFunction.h" #include "vtkVolumeProperty.h" #include "vtkVolumeRayCastCompositeFunction.h" #include "vtkVolumeRayCastMapper.h" #include "vtkVolume.h" #include "vtkColorTransferFunction.h" #include "vtkCamera.h" #include "vtkStructuredPoints.h" #include "vtkInteractorStyleTrackballCamera.h" #include "vtkCommand.h" #include "time.h" #include "vtkSphereSource.h" #include "vtkPolyDataMapper.h" #include "vtkLODActor.h" #include "vtkConeSource.h" #include "vtkGlyph3D.h" #include "vtkAssembly.h" #include "vtkProp3DCollection.h" class InteractionCallBack : public vtkCommand { public: ? static InteractionCallBack* New() { ??? return new InteractionCallBack; ? } ? virtual void Execute(vtkObject* caller, unsigned long, void* data) { ??? vtkRenderWindow* renWin = vtkRenderWindow::SafeDownCast(caller); ??? if (renWin->GetEventPending()) { ????? renWin->SetAbortRender(1); ??? } ? } }; int main( int argc, char *argv[] ) { ??? vtkSphereSource *sphere = vtkSphereSource::New(); ??? ??? sphere->SetThetaResolution(80); ??? ??? sphere->SetPhiResolution(80); ??? vtkConeSource *cone = vtkConeSource::New(); ??? vtkGlyph3D *glyph = vtkGlyph3D::New(); ??? ??? glyph->SetInputConnection(sphere->GetOutputPort()); ??? ??? glyph->SetSourceConnection(cone->GetOutputPort()); ??? ??? glyph->SetVectorModeToUseNormal(); ??? ??? glyph->SetScaleModeToScaleByVector(); ??? ??? glyph->SetScaleFactor(0.5); ??? vtkPolyDataMapper *spikeMapper = vtkPolyDataMapper::New(); ??? ??? spikeMapper->SetInput(glyph->GetOutput()); ??? vtkLODActor *spikeActor = vtkLODActor::New(); ??? ??? spikeActor->SetMapper(spikeMapper); ??? vtkRenderer *renderer = vtkRenderer::New(); ??? ??? renderer->SetBackground(0.5, 0.5, 0.5); ??? ??? renderer->AddActor(spikeActor); ??? ??? renderer->ResetCamera(); ??? //make a lot of spike actors ??? vtkAssembly *assembly = vtkAssembly::New(); ??? renderer->AddActor(assembly); ??? for(int i=0; i<200; ++i) ??? { ??? ??? vtkLODActor *actor = vtkLODActor::New(); ??? ??? actor->SetMapper(spikeMapper); ??? ??? actor->SetPosition(i*0.1, 0.0, 0.0); ??? ?? // renderer->AddActor(actor);? //this line is used if next line is comment out. ??? ??? assembly->AddPart(actor);? //this line is used if above line is comment out ??? } ??? vtkRenderWindow *renWindow = vtkRenderWindow::New(); ??? ??? renWindow->SetSize(400,400); ??? ??? renWindow->SetPosition(600, 400); ??? ??? renWindow->AddRenderer(renderer); ??? vtkRenderWindowInteractor *interactor = vtkRenderWindowInteractor::New(); ??? ??? interactor->SetRenderWindow(renWindow); ??? vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New(); ??? ??? interactor->SetInteractorStyle(style); ??? InteractionCallBack* icb = InteractionCallBack::New(); ??? renWindow->AddObserver(vtkCommand::AbortCheckEvent, icb); ??? ?? ??? renWindow->Render(); ??? ??? interactor->Start(); ??? return 0; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcplatt at dsl.pipex.com Fri May 8 18:35:01 2009 From: jcplatt at dsl.pipex.com (John Platt) Date: Fri, 8 May 2009 23:35:01 +0100 Subject: [vtkusers] UsingGetResolveCoincidentTopologyPolygonOffsetParameters etc References: <159677669730232208107809077645550698058-Webmail@me.com> Message-ID: <74A486D86BE442F3A8E22C95EEC6B72D@pafec5> Hi, vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); works fine for my FE meshes with the default offset parameters. Note it is a static method. John. ----- Original Message ----- From: "Andrew Cunningham" To: Sent: Friday, May 08, 2009 8:01 PM Subject: [vtkusers] UsingGetResolveCoincidentTopologyPolygonOffsetParameters etc > Hi, > I am drawing a Finite Element mesh object where one wishes to display the > wireframe mesh 'on top of ' the shaded mesh. Typically one does this in > OpenGL by drawing the mesh twice - once filled and once as wireframe, > using glPolygonOffset to make sure the mesh is visible. > VTK has the functionality with the various Set/GetCoincidentTopologyxxx > calls. But no examples and nothing on the mailing list as far as I can > tell. Anyone have a code snippet? Or do I need another lesson in > searching... > > Cheers, > Andrew > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > From elvis.chen at gmail.com Sat May 9 12:53:13 2009 From: elvis.chen at gmail.com (Elvis Chen) Date: Sat, 9 May 2009 12:53:13 -0400 Subject: [vtkusers] pipeline for slicing a volume in oblique plane and show the cut plane as an image Message-ID: <4c2a34b40905090953i10a5593cpde378f43a4b67cf@mail.gmail.com> hi all, I'm trying to slice a volume using a vtkPlane and display the cutplane as an image. I know the equation for the vtkPlane (plane normal+origin). My current pipeline is: vtkPlane->vtkCutter->vtkStructuredPointsReader I can use a vtkOutlineFilter to display on the cut plane on the volume. However, if I pipe the output of vtkCutter to an, say, imageActor, I only get black image. Can anyone please verify what I'm doing is correct, and if I'm not, suggest the proper pipeline of doing so? Thanks in advance, Elvis -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidrpost at gmail.com Sat May 9 13:50:07 2009 From: davidrpost at gmail.com (David Post) Date: Sat, 9 May 2009 13:50:07 -0400 Subject: [vtkusers] Fwd: could not load type vtkAlgorthmOutput In-Reply-To: <1bde0a8f0903262230g5c585670u3a2b73f0d74f9d94@mail.gmail.com> References: <1bde0a8f0903262230g5c585670u3a2b73f0d74f9d94@mail.gmail.com> Message-ID: <1bde0a8f0905091050r31bc3a4bj4bd605913faed45b@mail.gmail.com> ---------- Forwarded message ---------- From: David Post Date: Mar 27, 2009 1:30 AM Subject: could not load type vtkAlgorthmOutput To: vtkusers at vtk.org i am trying to have a visual studio .net 2003 c++ console application for the vtk 5.0.4 cone step 1 example. windows 2 000. i get the following exception. An unhandled exception of type 'System.TypeLoadException' occurred in Unknown Module. Additional information: Could not load type vtkAlgorithmOutput from assembly cone, Version=1.0.3368.27902, Culture=neutral, PublicKeyToken=null. can someone please help me with this? david post -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcplatt at dsl.pipex.com Sat May 9 19:22:44 2009 From: jcplatt at dsl.pipex.com (John Platt) Date: Sun, 10 May 2009 00:22:44 +0100 Subject: [vtkusers] UsingGetResolveCoincidentTopologyPolygonOffsetParameters etc References: <159677669730232208107809077645550698058-Webmail@me.com> <74A486D86BE442F3A8E22C95EEC6B72D@pafec5> <2B446EFF-722F-4B1B-94AC-7DA008C24161@mac.com> Message-ID: Hi, Yes, create 2 actors. I usually add the actors to a vtkAssembly and add the assembly to the renderer. This ensures the actors stay together. HTH John. ----- Original Message ----- From: Andrew Cunningham To: John Platt Sent: Saturday, May 09, 2009 4:54 PM Subject: Re: [vtkusers] UsingGetResolveCoincidentTopologyPolygonOffsetParameters etc Hi John, Thanks for the reply - I am still a bit confused about how to use this. I am using an unstructuredmesh to represent the FE mesh. Do I create two actors, one with wireframe properties, and one with filled properties... and let this setting take care of the overlay? Andrew On May 8, 2009, at 3:35 PM, John Platt wrote: Hi, vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); works fine for my FE meshes with the default offset parameters. Note it is a static method. John. Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From abdalrahman.eweiwi at googlemail.com Sun May 10 04:37:35 2009 From: abdalrahman.eweiwi at googlemail.com (abdalrahman eweiwi) Date: Sun, 10 May 2009 10:37:35 +0200 Subject: [vtkusers] please help in lookuptable Message-ID: <2c86725c0905100137o41e0337dx9ecc7a548245a828@mail.gmail.com> hello guys i am a newbie to VTK and i really have a problem that getting me so nervous i have a file where i am reading a set of points , my problem is that to use lookuptable for coloring those points , i tried everyway possible but it did not work please any help here is my code PTR reader = PTR::New(); reader->SetFileName("../headsq-pointcloud.vtp"); reader->Update(); PTR PolyData = PTR::New(); PolyData = reader->GetOutput(); vtkIdType NumPoints = PolyData->GetNumberOfPoints(); PTR LookupTable = PTR::New(); LookupTable->SetNumberOfColors(3440); LookupTable->SetTableRange(0,3440); LookupTable->ForceBuild(); PTR colorbar = PTR::New(); colorbar->SetLookupTable(LookupTable); colorbar->SetWidth(0.05); colorbar->SetPosition(0.95,0.1); colorbar->SetLabelFormat("%.3g"); colorbar->PickableOff(); colorbar->VisibilityOn(); PTR mapper = PTR::New(); mapper->SetInput (PolyData); //mapper->SetScalarRange(PolyData->GetScalarRange()); mapper->SetLookupTable(LookupTable ); //mapper->UseLookupTableScalarRangeOn (); //mapper->SetColorModeToDefault (); PTR myRenderer = PTR::New(); PTR myRedndererWindow = PTR::New(); PTR myActor = PTR::New(); myActor->SetMapper(mapper); myRenderer->AddActor(myActor); myRenderer->AddActor(colorbar); myRedndererWindow->AddRenderer(myRenderer); doRenderingAndInteraction(myRedndererWindow); myRedndererWindow->Delete(); -- Regards Abdalrahman Eweiwi Msc in Media Informatics RWTH-AACHEN B-it -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulojamorim at gmail.com Sun May 10 07:28:58 2009 From: paulojamorim at gmail.com (Paulo Henrique Junqueira Amorim) Date: Sun, 10 May 2009 08:28:58 -0300 Subject: [vtkusers] Merge two polydata. Junction very visible Message-ID: <98e18c70905100428y3ab47bc3h89f516a29d0e664d@mail.gmail.com> Hi, I'm using vtkAppendPolyData to merge two polydata. But the junction is very visible [ 1 ] within the limits of the two polydata. If use SetInterpolationToFlat() of the actor, is better. But I need to use the SetInterpolationToPhong() Is there a filter to make the triangles in that region together? without the line? [ 1 ] - http://paulojamorim.sites.uol.com.br/merge_two_polydata.PNG Regards, Paulo Amorim -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.rabotnikov at philips.com Sun May 10 08:53:59 2009 From: mark.rabotnikov at philips.com (Rabotnikov, Mark) Date: Sun, 10 May 2009 14:53:59 +0200 Subject: [vtkusers] Off-screen rendering question Message-ID: Hello, Is off-screen rendering done on GPU in version 5.4 on WinXP64, or on CPU as in the older versions? Thank you, Mark ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bogdan.indy at gmail.com Sun May 10 10:55:01 2009 From: bogdan.indy at gmail.com (Bogdan Munteanu) Date: Sun, 10 May 2009 10:55:01 -0400 Subject: [vtkusers] Building 64bit vtk on Vista using Visual Studio 2008 Message-ID: <4a06eac4.0735640a.4c60.545a@mx.google.com> I am trying to build the 64 bit version of vtk on Windows. I am using: - vtk 5.4.0 - cmake 2.6.4 - Visual Studio Team System 2008 SP1 - Windows Vista Ultimate with Service Pack 1 In a cmd window I set up the environment for a 64 bit build using: "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" amd64 ,after which I launched cmake (GUI version). After running config in cmake I got the following set of options: CMAKE_CXX_COMPILER - C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/amd64/cl.exe CMAKE_CXX_FLAGS - /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR CMAKE_CXX_FLAGS_DEBUG - /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 CMAKE_CXX_FLAGS_MINSIZEREL - /MD /O1 /Ob1 /D NDEBUG CMAKE_CXX_FLAGS_RELEASE - /MD /O2 /Ob2 /D NDEBUG CMAKE_CXX_FLAGS_RELWITHDEBINFO - /MD /Zi /O2 /Ob1 /D NDEBUG CMAKE_CXX_STANDARD_LIBRARIES - kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib CMAKE_C_COMPILER - C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/amd64/cl.exe CMAKE_C_FLAGS - /DWIN32 /D_WINDOWS /W3 /Zm1000 CMAKE_C_FLAGS_DEBUG - /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 CMAKE_C_FLAGS_MINSIZEREL - /MD /O1 /Ob1 /D NDEBUG CMAKE_C_FLAGS_RELEASE - /MD /O2 /Ob2 /D NDEBUG CMAKE_C_FLAGS_RELWITHDEBINFO - /MD /Zi /O2 /Ob1 /D NDEBUG CMAKE_C_STANDARD_LIBRARIES - kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib CMAKE_EXE_LINKER_FLAGS - /MANIFEST /STACK:10000000 /machine:x64 CMAKE_C_FLAGS_DEBUG - /debug /INCREMENTAL:YES CMAKE_C_FLAGS_MINSIZEREL - /INCREMENTAL:NO CMAKE_C_FLAGS_RELEASE - /INCREMENTAL:NO CMAKE_C_FLAGS_RELWITHDEBINFO - /debug /INCREMENTAL:YES It looks like cmake picks up properly the 64 bit compiler and linker (i.e., cl.exe in amd64 folder) but the compilation/link flags look like targeting a 32 bit platform (e.g., the platform constant is WIN32, while I would have expected WIN64) and all .lib files specify the 32 bit version. Is there something I am missing here? Thank you, Bogdan -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Sun May 10 12:08:09 2009 From: drescherjm at gmail.com (John Drescher) Date: Sun, 10 May 2009 12:08:09 -0400 Subject: [vtkusers] Building 64bit vtk on Vista using Visual Studio 2008 In-Reply-To: <4a06eac4.0735640a.4c60.545a@mx.google.com> References: <4a06eac4.0735640a.4c60.545a@mx.google.com> Message-ID: <387ee2020905100908k56e39d9aoa1b67c7c49805e79@mail.gmail.com> On Sun, May 10, 2009 at 10:55 AM, Bogdan Munteanu wrote: > I am trying to build the 64 bit version of vtk on Windows. I am using: > > > > - vtk 5.4.0 > > - cmake 2.6.4 > > - Visual Studio Team System 2008 SP1 > > - Windows Vista Ultimate with Service Pack 1 > > > > In a cmd window I set up the environment for a 64 bit build using: > > "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" amd64 > > > > ,after which I launched cmake (GUI version). > > > > After running config in cmake I got the following set of options: > > > > CMAKE_CXX_COMPILER???????????? - C:/Program Files (x86)/Microsoft Visual > Studio 9.0/VC/bin/amd64/cl.exe > > CMAKE_CXX_FLAGS??? ????????????- /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR > > CMAKE_CXX_FLAGS_DEBUG????????? - /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 > > CMAKE_CXX_FLAGS_MINSIZEREL???? - /MD /O1 /Ob1 /D NDEBUG > > CMAKE_CXX_FLAGS_RELEASE??????? - /MD /O2 /Ob2 /D NDEBUG > > CMAKE_CXX_FLAGS_RELWITHDEBINFO - /MD /Zi /O2 /Ob1 /D NDEBUG > > CMAKE_CXX_STANDARD_LIBRARIES?? - kernel32.lib user32.lib gdi32.lib > winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib > advapi32.lib > > CMAKE_C_COMPILER?????????????? - C:/Program Files (x86)/Microsoft Visual > Studio 9.0/VC/bin/amd64/cl.exe > > CMAKE_C_FLAGS????????????????? - /DWIN32 /D_WINDOWS /W3 /Zm1000 > > CMAKE_C_FLAGS_DEBUG??????????? - /D_DEBUG /MDd /Zi? /Ob0 /Od /RTC1 > > CMAKE_C_FLAGS_MINSIZEREL?????? - /MD /O1 /Ob1 /D NDEBUG > > CMAKE_C_FLAGS_RELEASE????????? - /MD /O2 /Ob2 /D NDEBUG > > CMAKE_C_FLAGS_RELWITHDEBINFO?? - /MD /Zi /O2 /Ob1 /D NDEBUG > > CMAKE_C_STANDARD_LIBRARIES???? - kernel32.lib user32.lib gdi32.lib > winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib > advapi32.lib > > CMAKE_EXE_LINKER_FLAGS???????? - /MANIFEST /STACK:10000000 /machine:x64 > > CMAKE_C_FLAGS_DEBUG??????????? - /debug /INCREMENTAL:YES > > CMAKE_C_FLAGS_MINSIZEREL?????? - /INCREMENTAL:NO > > CMAKE_C_FLAGS_RELEASE????????? - /INCREMENTAL:NO > > CMAKE_C_FLAGS_RELWITHDEBINFO?? - /debug /INCREMENTAL:YES > > > > It looks like cmake picks up properly the 64 bit compiler and linker (i.e., > cl.exe in amd64 folder) but the compilation/link flags look like targeting a > 32 bit platform (e.g., the platform constant is WIN32, while I would have > expected WIN64) and all .lib files specify the 32 bit version. > > > > Is there something I am missing here? > I just opened up cmake-gui and selected Visual Studio 9 WIN64 and then opened the solution in VS2008 and compiled. It is building for x64 right now but did not finish yet.\ John From drescherjm at gmail.com Sun May 10 12:15:18 2009 From: drescherjm at gmail.com (John Drescher) Date: Sun, 10 May 2009 12:15:18 -0400 Subject: [vtkusers] Building 64bit vtk on Vista using Visual Studio 2008 In-Reply-To: <387ee2020905100908k56e39d9aoa1b67c7c49805e79@mail.gmail.com> References: <4a06eac4.0735640a.4c60.545a@mx.google.com> <387ee2020905100908k56e39d9aoa1b67c7c49805e79@mail.gmail.com> Message-ID: <387ee2020905100915x38ebf9d6l266bf40f78ebc161@mail.gmail.com> > I just opened up cmake-gui and selected Visual Studio 9 WIN64 and then > opened the solution in VS2008 and compiled. It is building for x64 > right now but did not finish yet.\ > I did not say but I did do two Configures and a Generate in cmake-gui.. Still building. This is on a laptop with a mechanical disk so it will take some time... John From drescherjm at gmail.com Sun May 10 12:28:39 2009 From: drescherjm at gmail.com (John Drescher) Date: Sun, 10 May 2009 12:28:39 -0400 Subject: [vtkusers] Building 64bit vtk on Vista using Visual Studio 2008 In-Reply-To: <387ee2020905100915x38ebf9d6l266bf40f78ebc161@mail.gmail.com> References: <4a06eac4.0735640a.4c60.545a@mx.google.com> <387ee2020905100908k56e39d9aoa1b67c7c49805e79@mail.gmail.com> <387ee2020905100915x38ebf9d6l266bf40f78ebc161@mail.gmail.com> Message-ID: <387ee2020905100928k6462bb61u20d044eb1392848f@mail.gmail.com> On Sun, May 10, 2009 at 12:15 PM, John Drescher wrote: >> I just opened up cmake-gui and selected Visual Studio 9 WIN64 and then >> opened the solution in VS2008 and compiled. It is building for x64 >> right now but did not finish yet.\ >> > I did not say but I did do two Configures and a Generate in > cmake-gui.. Still building. This is on a laptop with a mechanical disk > so it will take some time... > Result, It built only 1/2 of the projects and does have WIN32 defined. 1>------ Build started: Project: vtksys, Configuration: Debug x64 ------ 1>Generating vtksysProcessFwd9xEnc.c 2>------ Build started: Project: vtkRendering, Configuration: Debug x64 ------ 2>Generating vtkShadowMapPassShader_vs.cxx, vtkShadowMapPassShader_vs.h 2>The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail. 2>Project : error PRJ0019: A tool returned an error code from "Generating vtkShadowMapPassShader_vs.cxx, vtkShadowMapPassShader_vs.h" 2>Build log was saved at "file://c:\Programming\VC.90\vtk\Rendering\vtkRendering.dir\Debug\BuildLog.htm" 2>vtkRendering - 1 error(s), 0 warning(s) 1>The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail. 1>Project : error PRJ0019: A tool returned an error code from "Generating vtksysProcessFwd9xEnc.c" 1>Build log was saved at "file://c:\Programming\VC.90\vtk\Utilities\kwsys\vtksys.dir\Debug\BuildLog.htm" 1>vtksys - 1 error(s), 0 warning(s) 3>------ Build started: Project: ProcessShader, Configuration: Debug x64 ------ 4>------ Build started: Project: vtkVolumeRendering, Configuration: Debug x64 ------ 4>Generating vtkVolumeTextureMapper3D_TwoDependentShadeFP.cxx, vtkVolumeTextureMapper3D_TwoDependentShadeFP.h 3>Linking... >From a quick google search this looks like a microsoft problem. I will attempt to fix this later today.. John From flfljh at gmail.com Sun May 10 21:09:03 2009 From: flfljh at gmail.com (ljh flf) Date: Mon, 11 May 2009 09:09:03 +0800 Subject: [vtkusers] Help:display chinese character Message-ID: Hi,display chinese character in vtk is messy code? Please give me a demo to process chinese character, thank you very much. -------------- next part -------------- An HTML attachment was scrubbed... URL: From msjean at gmx.de Mon May 11 04:09:09 2009 From: msjean at gmx.de (vtklearny) Date: Mon, 11 May 2009 01:09:09 -0700 (PDT) Subject: [vtkusers] vtkAssembly =>point.set(x, y, z) => refresh normals automaticly ? Message-ID: <23445046.post@talk.nabble.com> Hi vtk know-it-alls, I'm new to vtk and as the subject tells, im looking for a way to refresh normals of objects. I have not found a former post that solved my problem. Situation: ///////////////////////////////////////////// I have got a vtkAssembly and I can access down to the mapper, so that finaly by: vtkPolyData* data=mapper->GetInput(); vtkPointData* pdata=(vtkPointData*)(data->GetPointData()); data->GetPoints(); I reach the points of a triangulated mesh. Then I manipulate certain points: points->SetPoint(id,newPos); ///////////////////////////////////////////// Now my QUESTION is , how to perform an update of the normals automaticly (at best only those which need to be updated). For now I only see the change of point data in wireframe mode properly. The code I'm working on tries it like this: On contruction: ---------------------------------------------------------- vtkPolyDataNormals* normalsFilter; normalsFilter->SetInput(vtkPolyDataReader->GetOutput()); normalsFilter->ComputeCellNormalsOn(); vtkPolyDataMapper* Mapper = ... ::New(); Mapper->ScalarVisibilityOff(); Mapper->SetInput( normalsFilter->GetOutput() ); //Mapper->SetInputConnection( normalsFilter->GetOutputPort() ); vtkActor* Actor = ... ::New(); Actor->SetMapper( Mapper.GetPointer() ); ----------------------------------------------------------- in MyUpdateFunction(): ---------------------------------------------------- vtkPolyDataMapper* polyDataMapper= getPolyDataMapperFromAssembly(assembly); vtkAlgorithm* algo= polyDataMapper->GetInputConnection(0,0)->GetProducer(); //algo->Print(cout << "MapperCache::updatePolyDataMapper" << endl); vtkPolyDataNormals* normals=(vtkPolyDataNormals*)algo; //normals->Update(); //does not show any change //algo->Update(); // not even better //normals->Modified(); //Changes point data back to initial state ----------------------------------------------------- I hope you can help me with all info I could give. Thanks a lot for any help. the vtkLearny ------------------- Working on: win xp , visual studio, c++, vtk. 5.2.1 -- View this message in context: http://www.nabble.com/vtkAssembly-%3D%3Epoint.set%28x%2Cy%2Cz%29-%3D%3E-refresh-normals-automaticly---tp23445046p23445046.html Sent from the VTK - Users mailing list archive at Nabble.com. From jpedrick at gmail.com Mon May 11 11:37:45 2009 From: jpedrick at gmail.com (Joshua Pedrick) Date: Mon, 11 May 2009 11:37:45 -0400 Subject: [vtkusers] Trouble with QVTK Message-ID: <1dfc97b50905110837i56a505c6h2b61c0d3bf81f1e8@mail.gmail.com> Hi, I'm attempting to embed a VTK render window into my At app, I'm using the code below to display a cone in the window, but all I get is the background. I included the popup from the QVTK events example and I'm trying to display a cone. All I get is the background, the popup menu works, but no cone. Any clues regarding what I am doing wrong? I tried this same example without QVTK and it worked perfectly. I am using the CVS version of VTK and qt-sdk-2009.02. Regards, -Joshua void MainWindow::SetupScene() { QVTKWidget* qvtkwidget = ui.qvtkWidget; { vtkRenderWindow* renWin = vtkRenderWindow::New(); //renWin->StereoCapableWindowOn(); qvtkwidget->SetRenderWindow(renWin); renWin->Delete(); } //add a popup menu for the window and connect it to our slot QMenu* popup1 = new QMenu(qvtkwidget); popup1->addAction("Background White"); popup1->addAction("Background Black"); //popup1->addAction("Stereo Rendering"); connect(popup1, SIGNAL(triggered(QAction*)), this, SLOT(color(QAction*))); vtkEventQtSlotConnect* Connections = vtkEventQtSlotConnect::New(); Connections->Connect(qvtkwidget->GetRenderWindow()->GetInteractor(), vtkCommand::RightButtonPressEvent, this, SLOT(popup( vtkObject*, unsigned long, void*, void*, vtkCommand*)), popup1, 1.0); //Put cone in window { vtkConeSource *cone = vtkConeSource::New(); vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New(); // 3 coneMapper->SetInputConnection(cone->GetOutputPort()); vtkActor *coneActor = vtkActor::New(); coneActor->SetMapper(coneMapper); coneMapper->Delete(); vtkRenderer *ren = vtkRenderer::New(); ren->AddActor(coneActor); coneActor->Delete(); ren->SetBackground(0.3, 0.3, 0.4); ren->SetBackground2(0.9, 0.9, 1); ren->AutomaticLightCreationOn(); ren->GradientBackgroundOn(); //ren->WorldToDisplay(); qvtkwidget->GetRenderWindow()->AddRenderer(ren); qvtkwidget->GetRenderWindow()->BordersOn(); ren->Delete(); } } void MainWindow::popup(vtkObject * obj, unsigned long, void * client_data, void *, vtkCommand * command) { // A note about context menus in Qt and the QVTKWidget // You may find it easy to just do context menus on right button up, // due to the event proxy mechanism in place. // That usually works, except in some cases. // One case is where you capture context menu events that // child windows don't process. You could end up with a second // context menu after the first one. // See QVTKWidget::ContextMenuEvent enum which was added after the // writing of this example. // get interactor vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::SafeDownCast( obj); // consume event so the interactor style doesn't get it command->AbortFlagOn(); // get popup menu QMenu* popupMenu = static_cast (client_data); // get event location int* sz = iren->GetSize(); int* position = iren->GetEventPosition(); // remember to flip y QPoint pt = QPoint(position[0], sz[1] - position[1]); // map to global QPoint global_pt = popupMenu->parentWidget()->mapToGlobal(pt); // show popup menu at global point popupMenu->popup(global_pt); } void MainWindow::color(QAction* color) { QVTKWidget* qvtkwidget = ui.qvtkWidget; vtkRenderer* ren = qvtkwidget->GetRenderWindow()->GetRenderers()->GetFirstRenderer(); if (color->text() == "Background White") ren->SetBackground(1, 1, 1); else if (color->text() == "Background Black") ren->SetBackground(0, 0, 0); else if (color->text() == "Stereo Rendering") { ren->GetRenderWindow()->SetStereoRender( !ren->GetRenderWindow()->GetStereoRender()); } qvtkwidget->update(); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From public at ssbd.net Mon May 11 11:55:43 2009 From: public at ssbd.net (randomgurn) Date: Mon, 11 May 2009 08:55:43 -0700 (PDT) Subject: [vtkusers] non-manifold edges in output of vtkDecimatePro In-Reply-To: <49F997B9.4070007@vision.ee.ethz.ch> References: <49F997B9.4070007@vision.ee.ethz.ch> Message-ID: <23486156.post@talk.nabble.com> Bryn Lloyd-2 wrote: > > Hi, > > > I am using following code to decimate a surface mesh: > > vtkNew(vtkDecimatePro,decimate); > decimate->SetInput(reader->GetOutput()); > decimate->SetTargetReduction(target); > decimate->SetFeatureAngle(angle); > decimate->PreserveTopologyOn(); > decimate->SplittingOff(); > decimate->PreSplitMeshOff(); > decimate->BoundaryVertexDeletionOff(); > > > The output can be a broken surface mesh: There are non-manifold edges in > the output of vtkDecimatePro. Additionally there are duplicate > triangles. > > The input comes from running marching cubes on a vtkStructuredPoints. > According to my test routines it is a good triangle mesh (i.e. NO > non-manifold edges etc.) > > > Must I set a parameter of vtkDecimatePro differently, or is this a bug? > Is there actually a guarantee that vtkDecimatePro will not break my mesh? > > > Thanks for any help > > Bryn > Dear Bryn, I have been having similar problems, although with the vtkQuadricDecimation class. I don't know if you can move to this class, but I've bodged together http://www.nabble.com/file/p23486156/vtkQuadricDecimation.patch a fix for it. Essentially, I found that the problems arise when you remove one of the "base edges" from a triangular pyramid. Say that you've got three triangles with vertex indices:- (0,1,3), (1,2,3), (0,3,2) (I am imagining them on a Mercedes logo, with vertices 0,1,2 on the circumference and vertex 3 in the middle - but hey, that's not really important). If you collapse any of the edges (0,1), (1,2) or (2,0), the two remaining faces will be on top of each other; then VTK will remove one of them, and all manner of things start happening that I don't want. If you check for these edges, and block them from being collapsed, the mesh comes out perfectly (for my purposes, at least). I attach a http://www.nabble.com/file/p23486156/vtkQuadricDecimation.patch patch . I'm sure that somebody far better versed in VTK could do it a whole lot more efficiently (and write it in the correct style too!). In particular, it could be made more efficient by not having to create and destroy the id lists in method IsEdgeCollapsible. Regards, Andy. -- Andy Turner PhD Student Imperial College London -- View this message in context: http://www.nabble.com/non-manifold-edges-in-output-of-vtkDecimatePro-tp23315212p23486156.html Sent from the VTK - Users mailing list archive at Nabble.com. From rempler at mechbau.uni-stuttgart.de Mon May 11 11:57:21 2009 From: rempler at mechbau.uni-stuttgart.de (Hans-Uwe Rempler) Date: Mon, 11 May 2009 17:57:21 +0200 Subject: [vtkusers] [NEWBIE] shaded background etc In-Reply-To: <98296957415664418663024738116080728773-Webmail@me.com> References: <98296957415664418663024738116080728773-Webmail@me.com> Message-ID: <1242057441.11573.7.camel@gauss.mechbau.uni-stuttgart.de> Hi Andrew, Am Dienstag, den 05.05.2009, 10:26 -0700 schrieb Andrew Cunningham: > Hi, > I am a new VTK user - porting my own OpenGL based C++ scene graph to VTK to take advantage of the many powerful visualization capabilities. Unfortunately I have to keep the same 'look and feel' rather than starting with a clean slate and I am stumbling on a few things that I can't find answers to after searching MarkMail - I am trying to avoid trial-and-error! > > - Our 3D window has a shaded background (done through openGL). A search for "shaded background" showed only 1 unanswered post on this topic in 2002 and it involved modifying a core VTK class using similar OGL commands. I can't see anyway to do this easily using VTK > > - Attribute inheritance. I took a lot of advantage of "attribute inheritance" in my scene graph to control rendering. VTK does not seem to have this concept unlike most scene graphs. How do people deal with this? > > - "Sticky small axes in lower left corner". I have small XYZ axes in the lower left corner that follow the rotations of the camera view matrix. This has to be easy. In my scene graph I did this through a separate glviewport in the window, but in VTK? Maybe this thread (note the follow ups!) can help you out: http://www.vtk.org/pipermail/vtkusers/2004-February/071541.html -> see attachment. Uwe P.S.: Just ignore the annoying Gtk error... > > > Thanks > Andrew > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 -------------- A non-text attachment was scrubbed... Name: axis.jpg Type: image/jpeg Size: 43001 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: axis.py Type: text/x-python Size: 9095 bytes Desc: not available URL: From mohamed.aittayeb at optopartner.com Mon May 11 11:19:07 2009 From: mohamed.aittayeb at optopartner.com (Mohamed AIT TAYEB) Date: Mon, 11 May 2009 17:19:07 +0200 Subject: [vtkusers] Problem in VTK rendering Message-ID: <4A0841EB.80108@optopartner.com> Hello, I have gcc 4.4 with mingw 64 bits. In vtk version 5.2.1, i have this error : c:/VTK/Rendering/vtkWin32OpenGLRenderWindow.cxx: In member function 'void vtkWin32OpenGLRenderWindow::InitializeApplication()': c:/VTK/Rendering/vtkWin32OpenGLRenderWindow.cxx:707: error: 'GWL_HINSTANCE' was not declared in this scope c:/VTK/Rendering/vtkWin32OpenGLRenderWindow.cxx: In member function 'virtual void vtkWin32OpenGLRenderWindow::CreateAWindow()': c:/VTK/Rendering/vtkWin32OpenGLRenderWindow.cxx:834: error: cast from 'vtkWin32OpenGLRenderWindow*' to 'LONG' loses precision make[2]: *** [Rendering/CMakeFiles/vtkRendering.dir/vtkWin32OpenGLRenderWindow.obj] Error 1 make[1]: *** [Rendering/CMakeFiles/vtkRendering.dir/all] Error 2 make: *** [all] Error 2 Thanks for your help. -- Mohamed AIT TAYEB From andrewc at mac.com Mon May 11 12:19:06 2009 From: andrewc at mac.com (Andrew Cunningham) Date: Mon, 11 May 2009 09:19:06 -0700 Subject: [vtkusers] [NEWBIE] shaded background etc In-Reply-To: <1242057441.11573.7.camel@gauss.mechbau.uni-stuttgart.de> References: <98296957415664418663024738116080728773-Webmail@me.com> <1242057441.11573.7.camel@gauss.mechbau.uni-stuttgart.de> Message-ID: <12631718-92D1-4298-AD45-58202B8E5D55@mac.com> Hi Hans, That code looks like exactly what I want.. should be easy to make in C ++ Andrew On May 11, 2009, at 8:57 AM, Hans-Uwe Rempler wrote: > Hi Andrew, > > Am Dienstag, den 05.05.2009, 10:26 -0700 schrieb Andrew Cunningham: >> Hi, >> >> - "Sticky small axes in lower left corner". I have small XYZ axes >> in the lower left corner that follow the rotations of the camera >> view matrix. This has to be easy. In my scene graph I did this >> through a separate glviewport in the window, but in VTK? > > Maybe this thread (note the follow ups!) can help you out: > http://www.vtk.org/pipermail/vtkusers/2004-February/071541.html > > -> see attachment. > > Uwe > > P.S.: Just ignore the annoying Gtk error... > >> >> >> Thanks >> Andrew Andrew From bogdan.indy at gmail.com Mon May 11 12:55:47 2009 From: bogdan.indy at gmail.com (Bogdan) Date: Mon, 11 May 2009 16:55:47 +0000 (UTC) Subject: [vtkusers] Building 64bit vtk on Vista using Visual Studio 2008 References: <4a06eac4.0735640a.4c60.545a@mx.google.com> <387ee2020905100908k56e39d9aoa1b67c7c49805e79@mail.gmail.com> <387ee2020905100915x38ebf9d6l266bf40f78ebc161@mail.gmail.com> <387ee2020905100928k6462bb61u20d044eb1392848f@mail.gmail.com> Message-ID: > Result, It built only 1/2 of the projects and does have WIN32 defined. > ... > 1>The application has failed to start because its side-by-side > configuration is incorrect. Please see the application event log or > use the command-line sxstrace.exe tool for more detail. > 1>Project : error PRJ0019: A tool returned an error code from > "Generating vtksysProcessFwd9xEnc.c" > 1>Build log was saved at > "file://c:\Programming\VC.90 \vtk\Utilities\kwsys\vtksys.dir\Debug\BuildLog.htm" > 1>vtksys - 1 error(s), 0 warning(s) > 3>------ Build started: Project: ProcessShader, Configuration: Debug x64 ----- - > 4>------ Build started: Project: vtkVolumeRendering, Configuration: > Debug x64 ------ > 4>Generating vtkVolumeTextureMapper3D_TwoDependentShadeFP.cxx, > vtkVolumeTextureMapper3D_TwoDependentShadeFP.h > 3>Linking... Does this mean it is OK to have WIN32 during cmake configuration? PS I forgot to mention that I selected the 64 bit platform when asked by cmake. John Drescher gmail.com> writes: From JonW at pathsurg.com Mon May 11 13:30:15 2009 From: JonW at pathsurg.com (Jon Waite) Date: Mon, 11 May 2009 12:30:15 -0500 Subject: [vtkusers] Bug?:5.4.0 performance versus 5.0 Message-ID: Hello, When rendering an actor with >50,000 points with scalars on, and transparency < 1, 5.4.0 renders < 1 fps versus the same code linked to vtk 5.0 which performs normally. Attached is the example code, if run against each library, the bug is portrayed. Thanks, Jon -------------- next part -------------- A non-text attachment was scrubbed... Name: VtkScalarBug.cpp Type: application/octet-stream Size: 2325 bytes Desc: not available URL: From ayesilvtk at gmail.com Mon May 11 14:10:59 2009 From: ayesilvtk at gmail.com (vtk question) Date: Mon, 11 May 2009 20:10:59 +0200 Subject: [vtkusers] thinness change the 3D Object Message-ID: <844f23350905111110t28796b23seaef5d6be8e6bb4b@mail.gmail.com> hi! i have got 3D Object from CT Images using Marching Cubes algorithm, cutted and got the Trachea. i want to change thinness the Trachea rather 3D Object because the Object is infinitely thin. My Idea is with two actors. second Actor?s scale is %100 and first Actor?s scale (only x and y) is for example %80. both Actors are centered and fill between. my code: vtkBoxClipDataSet* clipper1 = vtkBoxClipDataSet::New(); clipper1->SetInput(marchingCubes->GetOutput()); // clipper1->GenerateClippedOutputOff(); clipper1->SetBoxClip( minpoint4[0], maxpoint4[0], minpoint4[1], maxpoint4[1], minpoint4[2], maxpoint4[2]); vtkDataSetSurfaceFilter* surface1 = vtkDataSetSurfaceFilter::New(); surface1->SetInputConnection(0, clipper1->GetOutputPort(0)); vtkPolyDataMapper* mapper1 = vtkPolyDataMapper::New(); mapper1->SetInputConnection(0, surface1->GetOutputPort(0)); vtkActor* actor1 = vtkActor::New(); vtkActor* actor2 = vtkActor::New(); actor1->SetMapper(mapper1); actor2->SetMapper(mapper1); vtkRenderer* renderer1 = vtkRenderer::New(); actor1->SetScale(0.8,0.8,1.0); actor2->SetScale(1.0,1.0,1.0); actor1->SetPosition( actor2->GetCenter()[0] - actor1->GetCenter()[0] , actor2->GetCenter()[1]-actor1->GetCenter()[1] , 0.0); // first centered over second renderer1->AddActor(actor1); renderer1->AddActor(actor2); renderer1->SetBackground(0.0, 0.5, 0.5); renWindow->AddRenderer(renderer1); Has somebody some idea for filling or thinness change? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From JonW at pathsurg.com Mon May 11 14:40:39 2009 From: JonW at pathsurg.com (Jon Waite) Date: Mon, 11 May 2009 13:40:39 -0500 Subject: [vtkusers] Bug?:5.4.0 performance versus 5.0 In-Reply-To: References: Message-ID: Hello, When rendering an actor with >50,000 points with scalars on, and transparency < 1, 5.4.0 renders < 1 fps versus the same code linked to vtk 5.0 which performs normally. ?Attached is the example code, if run against each library, the bug is portrayed. Thanks, Jon ---------------------------------- // VtkScalarBug.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "vtkRenderWindowInteractor.h" #include "vtkRenderWindow.h" #include "vtkRenderer.h" #include "vtkActor.h" #include "vtkPolyDataMapper.h" #include "vtkLookupTable.h" #include "vtkCamera.h" #include "vtkWin32OpenGLRenderWindow.h" #include "vtkWin32RenderWindowInteractor.h" #include "vtkProperty.h" #include "vtkPolyDataReader.h" #include "vtkFloatArray.h" #include "vtkPointData.h" #include "vtkPlaneSource.h" #include "vtkSphereSource.h" int _tmain(int argc, _TCHAR* argv[]) { vtkWin32OpenGLRenderWindow *renWin = vtkWin32OpenGLRenderWindow::New(); vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(renWin); iren->Initialize(); vtkRenderer *renderer = vtkRenderer::New(); renWin->AddRenderer(renderer); if(1) { if (1) { vtkSphereSource* sphere = vtkSphereSource::New(); const int res = 500; sphere->SetPhiResolution(res); sphere->SetThetaResolution(res); sphere->Update(); const double setval = 0.8; vtkPolyDataMapper* mapper = vtkPolyDataMapper::New(); mapper->SetInput(sphere->GetOutput()); sphere->Delete(); mapper->SetScalarRange(0,setval); vtkLookupTable* lut = vtkLookupTable::New(); lut->SetNumberOfColors(2); lut->Build(); lut->SetTableValue(1,setval,0,0); lut->SetTableValue(0,setval,setval,setval); mapper->SetLookupTable(lut); lut->Delete(); vtkPolyData* SpherePoly = mapper->GetInput(); int NumLiverPoints = SpherePoly->GetNumberOfPoints(); vtkFloatArray* scalars = vtkFloatArray::New(); const int fullrange = 50; const int half = fullrange/2; for (int i=0;iInsertTuple1(i,(i%fullrange)>half?0:setval); } SpherePoly->GetPointData()->SetScalars(scalars); scalars->Delete(); SpherePoly->Modified(); vtkActor* cubeA = vtkActor::New(); renderer->AddActor(cubeA); cubeA->SetMapper(mapper); cubeA->GetProperty()->SetOpacity(0.5); mapper->Delete(); cubeA->Delete(); } renderer->ResetCamera(); renderer->Render(); } iren->Start(); renderer->Delete(); renWin->Delete(); iren->Delete(); return 0; } From JonW at pathsurg.com Mon May 11 17:10:32 2009 From: JonW at pathsurg.com (Jon Waite) Date: Mon, 11 May 2009 16:10:32 -0500 Subject: [vtkusers] Bug vtkTextActor ShadowOn Message-ID: All, The text actor's shadow is not rendering correctly, creating a cropped and hard to read display. [see code below] Jon -------------------------------- #include "vtkRenderWindowInteractor.h" #include "vtkRenderWindow.h" #include "vtkRenderer.h" #include "vtkActor.h" #include "vtkWin32OpenGLRenderWindow.h" #include "vtkWin32RenderWindowInteractor.h" #include "vtkTextProperty.h" #include "vtkTextActor.h" #include "vtkCoordinate.h" int _tmain(int argc, _TCHAR* argv[]) { vtkWin32OpenGLRenderWindow *renWin = vtkWin32OpenGLRenderWindow::New(); vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(renWin); iren->Initialize(); vtkRenderer *renderer = vtkRenderer::New(); renWin->AddRenderer(renderer); if(1) { if (1) { vtkTextActor* InfoTipTextActor = vtkTextActor::New(); InfoTipTextActor->SetInput("Error"); vtkTextProperty* textprop = InfoTipTextActor->GetTextProperty(); textprop->SetColor(1,1,1); textprop->SetFontSize(16); textprop->ShadowOn(); textprop->SetJustificationToLeft(); textprop->SetVerticalJustificationToBottom(); vtkCoordinate* coord = InfoTipTextActor->GetPositionCoordinate(); coord->SetCoordinateSystemToNormalizedViewport(); coord->SetValue(0.5,0.5); renderer->AddViewProp(InfoTipTextActor); InfoTipTextActor->Delete(); } renderer->ResetCamera(); renderer->Render(); } iren->Start(); renderer->Delete(); renWin->Delete(); iren->Delete(); return 0; } From paul.jhin1 at gmail.com Mon May 11 19:54:24 2009 From: paul.jhin1 at gmail.com (Paul Jhin) Date: Mon, 11 May 2009 20:54:24 -0300 Subject: [vtkusers] vtkQuadricDecimation - Very Memory Message-ID: Hi, I'm using the filter vtkQuadricDecimation, but in Windows XP consumes a lot of memory and the program has closed. My computer have 2 GB RAM with Windows XP 32 bits. Thank's Jhin -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrewc at mac.com Mon May 11 20:13:06 2009 From: andrewc at mac.com (Andrew Cunningham) Date: Mon, 11 May 2009 17:13:06 -0700 Subject: [vtkusers] UsingGetResolveCoincidentTopologyPolygonOffsetParameters etc In-Reply-To: References: <159677669730232208107809077645550698058-Webmail@me.com> <74A486D86BE442F3A8E22C95EEC6B72D@pafec5> <2B446EFF-722F-4B1B-94AC-7DA008C24161@mac.com> Message-ID: <18FAF69C-0AA0-4ADB-BB73-7FB7C8DE5DE0@mac.com> Hi John, I am bashing my head against the proverbial wall with this one...I have added the various necessary calls to the static members of vtkMapper:: and ... no change- although the geometry is drawn as expected, no offsets are applied. Searching through the vtk code base shows only two relevant places where glPolygonOffset could be called - but isn't. - vtkOpenGLPolyDataMapper::Draw ( this method is never called, I am not clear why). A vtkOpenGLPolyDataMapper is never even created. - vtkOpenGLCoincidentTopologyResolutionPainter::RenderInternal But....vtkOpenGLCoincidentTopologyResolutionPainter gets it's information about 'CoincidentTopology' settings from a vtkInformation * object and ignores the static globals in vtkMapper. I simply wrap my vtkUnstructuredGrid in a vtkDataSetMapper. PS this is VTK 5.4 Andrew On May 9, 2009, at 4:22 PM, John Platt wrote: > Hi, > > Yes, create 2 actors. I usually add the actors to a vtkAssembly and > add the assembly to the renderer. This ensures the actors stay > together. > > HTH > > John. > > ----- Original Message ----- > From: Andrew Cunningham > To: John Platt > Sent: Saturday, May 09, 2009 4:54 PM > Subject: Re: [vtkusers] > UsingGetResolveCoincidentTopologyPolygonOffsetParameters etc > > Hi John, > Thanks for the reply - I am still a bit confused about how to use > this. I am using an unstructuredmesh to represent the FE mesh. Do I > create two actors, one with wireframe properties, and one with > filled properties... and let this setting take care of the overlay? > Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrewc at mac.com Mon May 11 21:25:48 2009 From: andrewc at mac.com (Andrew Cunningham) Date: Mon, 11 May 2009 18:25:48 -0700 Subject: [vtkusers] UsingGetResolveCoincidentTopologyPolygonOffsetParameters etc In-Reply-To: References: <159677669730232208107809077645550698058-Webmail@me.com> <74A486D86BE442F3A8E22C95EEC6B72D@pafec5> <2B446EFF-722F-4B1B-94AC-7DA008C24161@mac.com> Message-ID: Hi John, Surprisingly bashing ones head against a wall works :). I found the problem - my Init routine was in a factory object that got Initit'd a bit too late.... Andrew On May 9, 2009, at 4:22 PM, John Platt wrote: > Hi, > > Yes, create 2 actors. I usually add the actors to a vtkAssembly and > add the assembly to the renderer. This ensures the actors stay > together. > > HTH > > John. > > ----- Original Message ----- > From: Andrew Cunningham > To: John Platt > Sent: Saturday, May 09, 2009 4:54 PM > Subject: Re: [vtkusers] > UsingGetResolveCoincidentTopologyPolygonOffsetParameters etc > > Hi John, > Thanks for the reply - I am still a bit confused about how to use > this. I am using an unstructuredmesh to represent the FE mesh. Do I > create two actors, one with wireframe properties, and one with > filled properties... and let this setting take care of the overlay? > Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From murat.aydin at netcad.com.tr Tue May 12 01:54:11 2009 From: murat.aydin at netcad.com.tr (=?iso-8859-9?Q?Murat_Ayd=FDn?=) Date: Tue, 12 May 2009 08:54:11 +0300 Subject: [vtkusers] deleting unnecessary triangles from delaunay Message-ID: <002601c9d2c6$131cc560$5b01a8c0@ulusal.local> Hi, As you see in the picture, i am trying to construct volume between two planes. White lines are the planes which are constructed from unstructured points. I am using delaunay 3D and as you see in the picture, it makes convex hulls.How can i delete the unnecessary triangles to prevent convex hull? Thanks in advance. murat aydin -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: screenshot.JPG Type: image/jpeg Size: 31440 bytes Desc: not available URL: From L.J.vanRuijven at amc.uva.nl Tue May 12 02:33:31 2009 From: L.J.vanRuijven at amc.uva.nl (L.J. van Ruijven) Date: Tue, 12 May 2009 08:33:31 +0200 Subject: [vtkusers] Trouble with QVTK Message-ID: Hi Joshua, I think you forgot to connect the renderer to the renderwindow. Somewhere you should add the statement renWin->AddRenderer(ren). regards, Leo -------------- next part -------------- A non-text attachment was scrubbed... Name: L.J.vanRuijven.vcf Type: text/x-vcard Size: 261 bytes Desc: Card for "L.J. van Ruijven" URL: From blloyd at vision.ee.ethz.ch Tue May 12 02:48:18 2009 From: blloyd at vision.ee.ethz.ch (Bryn Lloyd) Date: Tue, 12 May 2009 08:48:18 +0200 Subject: [vtkusers] non-manifold edges in output of vtkDecimatePro In-Reply-To: <23486156.post@talk.nabble.com> References: <49F997B9.4070007@vision.ee.ethz.ch> <23486156.post@talk.nabble.com> Message-ID: <4A091BB2.3020301@vision.ee.ethz.ch> Hi Andy, Thanks for the patch. I tested it with three meshes that vtkQuadricDecimation breaks. Your solution does work with these examples and seems to solve the bug! It would great if this patch could enter VTK CVS. bye Bryn randomgurn wrote: > > Bryn Lloyd-2 wrote: >> Hi, >> >> >> I am using following code to decimate a surface mesh: >> >> vtkNew(vtkDecimatePro,decimate); >> decimate->SetInput(reader->GetOutput()); >> decimate->SetTargetReduction(target); >> decimate->SetFeatureAngle(angle); >> decimate->PreserveTopologyOn(); >> decimate->SplittingOff(); >> decimate->PreSplitMeshOff(); >> decimate->BoundaryVertexDeletionOff(); >> >> >> The output can be a broken surface mesh: There are non-manifold edges in >> the output of vtkDecimatePro. Additionally there are duplicate >> triangles. >> >> The input comes from running marching cubes on a vtkStructuredPoints. >> According to my test routines it is a good triangle mesh (i.e. NO >> non-manifold edges etc.) >> >> >> Must I set a parameter of vtkDecimatePro differently, or is this a bug? >> Is there actually a guarantee that vtkDecimatePro will not break my mesh? >> >> >> Thanks for any help >> >> Bryn >> > > Dear Bryn, > > I have been having similar problems, although with the > vtkQuadricDecimation class. I don't know if you can move to this class, > but I've bodged together > http://www.nabble.com/file/p23486156/vtkQuadricDecimation.patch a fix for > it. > > Essentially, I found that the problems arise when you remove one of the > "base edges" from a triangular pyramid. Say that you've got three > triangles with vertex indices:- > > (0,1,3), (1,2,3), (0,3,2) > > (I am imagining them on a Mercedes logo, with vertices 0,1,2 on the > circumference and vertex 3 in the middle - but hey, that's not really > important). > > If you collapse any of the edges (0,1), (1,2) or (2,0), the two > remaining faces will be on top of each other; then VTK will remove one > of them, and all manner of things start happening that I don't want. If > you check for these edges, and block them from being collapsed, the mesh > comes out perfectly (for my purposes, at least). > > I attach a http://www.nabble.com/file/p23486156/vtkQuadricDecimation.patch > patch . I'm sure that somebody far better versed in VTK could > do it a whole lot more efficiently (and write it in the correct style > too!). In particular, it could be made more efficient by not having to > create and destroy the id lists in method IsEdgeCollapsible. > > > Regards, > > Andy. > > > -- Andy Turner PhD Student Imperial College London > > -- ------------------------------------------------- Bryn Lloyd Computer Vision Laboratory ETH Z?rich, Sternwartstrasse 7 CH - 8092 Z?rich, Switzerland Tel: +41 44 63 26668 Fax: +41 44 63 21199 ------------------------------------------------- From jpedrick at gmail.com Tue May 12 09:36:14 2009 From: jpedrick at gmail.com (Joshua Pedrick) Date: Tue, 12 May 2009 09:36:14 -0400 Subject: [vtkusers] Trouble with QVTK In-Reply-To: References: Message-ID: <1dfc97b50905120636p259f2f33lad4cad75295ac7a3@mail.gmail.com> L.J. I think I do this in MainWindow::SetupScene() at the very end: qvtkwidget->GetRenderWindow()->AddRenderer(ren); qvtkwidget->GetRenderWindow()->BordersOn(); ren->Delete(); Is this not the correct way to add a renderer? I do get the lovely gradient background I applied to the renderer, but no actors. The gradient background makes me think the renderer is properly connected to the render window. I'm going to compile the stable version of VTK today and see how it goes. I'm really suspecting there is a bug in the CVS QVTK. Regards -Joshua 2009/5/12 L.J. van Ruijven > Hi Joshua, > > I think you forgot to connect the renderer to the renderwindow. Somewhere > you should add the statement renWin->AddRenderer(ren). > > regards, > > Leo > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From JonW at pathsurg.com Tue May 12 09:41:04 2009 From: JonW at pathsurg.com (Jon Waite) Date: Tue, 12 May 2009 08:41:04 -0500 Subject: [vtkusers] Bug?:5.4.0 performance versus 5.0 In-Reply-To: References: Message-ID: Hack. If I force the use of the old vtkOpenGLPolyDataMapper I can get around the problem but of course I am not then using the new painting mapper of vtk 5.4.0. On Mon, May 11, 2009 at 1:40 PM, Jon Waite wrote: > Hello, > > When rendering an actor with >50,000 points with scalars on, and > transparency < 1, 5.4.0 renders < 1 fps versus the same code linked to > vtk 5.0 which performs normally. ?Attached is the example code, if run > against each library, the bug is portrayed. > > Thanks, > Jon > > ---------------------------------- > > // VtkScalarBug.cpp : Defines the entry point for the console application. > // > > #include "stdafx.h" > > #include "vtkRenderWindowInteractor.h" > #include "vtkRenderWindow.h" > #include "vtkRenderer.h" > #include "vtkActor.h" > > #include "vtkPolyDataMapper.h" > #include "vtkLookupTable.h" > #include "vtkCamera.h" > > #include "vtkWin32OpenGLRenderWindow.h" > #include "vtkWin32RenderWindowInteractor.h" > > #include "vtkProperty.h" > #include "vtkPolyDataReader.h" > #include "vtkFloatArray.h" > #include "vtkPointData.h" > #include "vtkPlaneSource.h" > #include "vtkSphereSource.h" > > > int _tmain(int argc, _TCHAR* argv[]) > { > ? ? ? ?vtkWin32OpenGLRenderWindow *renWin = vtkWin32OpenGLRenderWindow::New(); > ? ? ? ?vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New(); > ? ? ? ?iren->SetRenderWindow(renWin); > ? ? ? ?iren->Initialize(); > > ? ? ? ?vtkRenderer *renderer = vtkRenderer::New(); > ? ? ? ?renWin->AddRenderer(renderer); > ? ? ? ?if(1) > ? ? ? ?{ > ? ? ? ? ? ? ? ?if (1) > ? ? ? ? ? ? ? ?{ > ? ? ? ? ? ? ? ? ? ? ? ?vtkSphereSource* sphere = vtkSphereSource::New(); > ? ? ? ? ? ? ? ? ? ? ? ?const int res = 500; > ? ? ? ? ? ? ? ? ? ? ? ?sphere->SetPhiResolution(res); > ? ? ? ? ? ? ? ? ? ? ? ?sphere->SetThetaResolution(res); > ? ? ? ? ? ? ? ? ? ? ? ?sphere->Update(); > ? ? ? ? ? ? ? ? ? ? ? ?const double setval = 0.8; > > ? ? ? ? ? ? ? ? ? ? ? ?vtkPolyDataMapper* mapper = vtkPolyDataMapper::New(); > ? ? ? ? ? ? ? ? ? ? ? ?mapper->SetInput(sphere->GetOutput()); > ? ? ? ? ? ? ? ? ? ? ? ?sphere->Delete(); > > ? ? ? ? ? ? ? ? ? ? ? ?mapper->SetScalarRange(0,setval); > > ? ? ? ? ? ? ? ? ? ? ? ?vtkLookupTable* lut = vtkLookupTable::New(); > ? ? ? ? ? ? ? ? ? ? ? ?lut->SetNumberOfColors(2); > ? ? ? ? ? ? ? ? ? ? ? ?lut->Build(); > ? ? ? ? ? ? ? ? ? ? ? ?lut->SetTableValue(1,setval,0,0); > ? ? ? ? ? ? ? ? ? ? ? ?lut->SetTableValue(0,setval,setval,setval); > > ? ? ? ? ? ? ? ? ? ? ? ?mapper->SetLookupTable(lut); > ? ? ? ? ? ? ? ? ? ? ? ?lut->Delete(); > > ? ? ? ? ? ? ? ? ? ? ? ?vtkPolyData* SpherePoly = mapper->GetInput(); > > ? ? ? ? ? ? ? ? ? ? ? ?int NumLiverPoints = SpherePoly->GetNumberOfPoints(); > ? ? ? ? ? ? ? ? ? ? ? ?vtkFloatArray* scalars = vtkFloatArray::New(); > ? ? ? ? ? ? ? ? ? ? ? ?const int fullrange = 50; > ? ? ? ? ? ? ? ? ? ? ? ?const int half = fullrange/2; > ? ? ? ? ? ? ? ? ? ? ? ?for (int i=0;i ? ? ? ? ? ? ? ? ? ? ? ?{ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?scalars->InsertTuple1(i,(i%fullrange)>half?0:setval); > ? ? ? ? ? ? ? ? ? ? ? ?} > ? ? ? ? ? ? ? ? ? ? ? ?SpherePoly->GetPointData()->SetScalars(scalars); > ? ? ? ? ? ? ? ? ? ? ? ?scalars->Delete(); > ? ? ? ? ? ? ? ? ? ? ? ?SpherePoly->Modified(); > > ? ? ? ? ? ? ? ? ? ? ? ?vtkActor* cubeA = vtkActor::New(); > ? ? ? ? ? ? ? ? ? ? ? ?renderer->AddActor(cubeA); > ? ? ? ? ? ? ? ? ? ? ? ?cubeA->SetMapper(mapper); > ? ? ? ? ? ? ? ? ? ? ? ?cubeA->GetProperty()->SetOpacity(0.5); > ? ? ? ? ? ? ? ? ? ? ? ?mapper->Delete(); > ? ? ? ? ? ? ? ? ? ? ? ?cubeA->Delete(); > ? ? ? ? ? ? ? ?} > > ? ? ? ? ? ? ? ?renderer->ResetCamera(); > ? ? ? ? ? ? ? ?renderer->Render(); > ? ? ? ?} > > ? ? ? ?iren->Start(); > > ? ? ? ?renderer->Delete(); > ? ? ? ?renWin->Delete(); > ? ? ? ?iren->Delete(); > > ? ? ? ?return 0; > } > From daviddoria at gmail.com Tue May 12 09:56:59 2009 From: daviddoria at gmail.com (David Doria) Date: Tue, 12 May 2009 09:56:59 -0400 Subject: [vtkusers] Get "goodness of fit"/error of ICP Transform Message-ID: The only function that I see is: virtual double GetMeanDistance() which tells the improvement made in the last iteration. If I want to know the overall "error" at the end of the process (ie the mean distance between all pairs of closest points), would I have to do this manually? ie. put all of the points from one set in a KDTree, and find the average closest point distance to all of the other set? It seems like that should be available in the vtkIterativeClosestPointTransform because I'm sure the points are already in a tree etc. Am I missing something? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca.ramundo at hotmail.it Tue May 12 11:23:19 2009 From: luca.ramundo at hotmail.it (Luca Ramundo) Date: Tue, 12 May 2009 17:23:19 +0200 Subject: [vtkusers] how to make transparent the background of my dicom files? Message-ID: hi all.. I'd like to know if there is a way to make transparent the background of my dicom files and then save it. In other words, I'd like to visualize only the part of the patient's body without the black background. Is there possible? I know that there is a class (vtkLookupTable) which probably can help me. I used vtk Medical example to understand a little this class, and I used SetTableValue method to set alpha value=0 but it doesn't work! Is this wrong? Is there another way to resolve my big problem? cerca thanks a lot, Luca _________________________________________________________________ Pi? di 100 Emoticon gratis per il tuo Messenger! http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: From halverson at byu.edu Tue May 12 12:12:24 2009 From: halverson at byu.edu (Peter Halverson) Date: Tue, 12 May 2009 10:12:24 -0600 Subject: [vtkusers] VTK and Numpy Message-ID: <4d1a61ba0905120912q7ee17842m5a67226a10ef8bd8@mail.gmail.com> I'm attempting to export VTK data into numpy using vtk_to_numpy. The program reads in a set of DICOM files using vtkDICOMImageReader. Filters the image using vtkContourFilter, and some other stuff and then displays the rendered solid. I would then like to export the data to Numpy so i do the following scalars=skin.GetMapper().GetInput().GetPointData().GetScalars() Which gives me the scalars that I am looking for. My question is how do get the [x,y,z] data to go with the scalars into numpy? skin.GetMapper().GetInput().GetWholeExtent() gives me the correct dimensions (0, 511, 0, 511, 0, 56) but I have exported less scalars than this... -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpedrick at gmail.com Tue May 12 13:16:41 2009 From: jpedrick at gmail.com (Joshua Pedrick) Date: Tue, 12 May 2009 13:16:41 -0400 Subject: [vtkusers] Trouble with QVTK In-Reply-To: References: <1dfc97b50905120636p259f2f33lad4cad75295ac7a3@mail.gmail.com> Message-ID: <1dfc97b50905121016t3477cfem89d7be56f689dca9@mail.gmail.com> Hello again Leo, Here's my code once again, but distilled and reordered a bit. I removed all the Deletes and whatnot. I'm still not getting anything but the gradient background. Any clues? I downloaded and compiled VTK-5.4 with QVTK, using Qt version 4.5.1 from Qt SDK 2009.02. Still no luck. So the latest VTK from CVS and version 5.4 aren't working. I can't be the only one using QVTK. I am not using cmake to build my project, could this be the problem? Are there some compiler flags I need to set for QVTK to work? Regards, -Joshua void MainWindow::SetupScene() { QVTKWidget* qvtkwidget = ui.qvtkWidget; qvtkwidget->GetRenderWindow()->DoubleBufferOff(); //Put cone in window { vtkConeSource *cone = vtkConeSource::New(); //Create Cone Mapper. vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New(); coneMapper->SetInputConnection(cone->GetOutputPort()); //Create Cone Actor vtkActor *coneActor = vtkActor::New(); coneActor->SetMapper(coneMapper); //Create Cone Renderer vtkRenderer *ren = vtkRenderer::New(); ren->SetBackground(0,0,0); ren->SetBackground2(1,1,1); ren->GradientBackgroundOn(); ren->AddActor(coneActor); qvtkwidget->GetRenderWindow()->AddRenderer(ren); } } 2009/5/12 L.J. van Ruijven > Hi Joshua, > > I allready deleted your first mail, so I cannot check the code again, but I > think here the background renderer is added. So that one is really drawn in > the render window. > But if I remember well, you created the pipeline for the cone in a separate > fragment. And in the end of this fragment you deleted the cone renderer, but > you never added it to the render window. > > regards, > > Leo. > > > ----- Original Message ----- > From: Joshua Pedrick > Date: Tuesday, May 12, 2009 3:36 pm > Subject: Re: Trouble with QVTK > To: vtkusers at vtk.org > Cc: "L.J. van Ruijven" > > > > L.J. I think I do this in MainWindow::SetupScene() at the very end: > > > > qvtkwidget->GetRenderWindow()->AddRenderer(ren); > > qvtkwidget->GetRenderWindow()->BordersOn(); > > > > ren->Delete(); > > > > Is this not the correct way to add a renderer? I do get the lovely > gradient > > background I applied to the renderer, but no actors. The gradient > background > > makes me think the renderer is properly connected to the render window. > > > > I'm going to compile the stable version of VTK today and see how it > goes. > > I'm really suspecting there is a bug in the CVS QVTK. > > > > Regards > > -Joshua > > > > 2009/5/12 L.J. van Ruijven > > > > > Hi Joshua, > > > > > > I think you forgot to connect the renderer to the renderwindow. > Somewhere > > > you should add the statement renWin->AddRenderer(ren). > > > > > > regards, > > > > > > Leo > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abdalrahman.eweiwi at googlemail.com Tue May 12 13:47:44 2009 From: abdalrahman.eweiwi at googlemail.com (abdalrahman eweiwi) Date: Tue, 12 May 2009 19:47:44 +0200 Subject: [vtkusers] best IDE for VTK and C++ under linux Message-ID: <2c86725c0905121047h22883e9bg616e451fb8c71952@mail.gmail.com> hello all i am new to vtk development and i am trying to integrate my eclipse IDE with CDT to have the autocomplete property , please if any one knows the procedure please tell me, or if you have any alternative ide which will fit well with vtk development , i would be grateful -- Regards Abdalrahman Eweiwi Msc in Media Informatics RWTH-AACHEN B-it -------------- next part -------------- An HTML attachment was scrubbed... URL: From jerome.velut at gmail.com Tue May 12 14:20:42 2009 From: jerome.velut at gmail.com (=?ISO-8859-1?B?Suly9G1l?=) Date: Tue, 12 May 2009 20:20:42 +0200 Subject: [vtkusers] best IDE for VTK and C++ under linux In-Reply-To: <2c86725c0905121047h22883e9bg616e451fb8c71952@mail.gmail.com> References: <2c86725c0905121047h22883e9bg616e451fb8c71952@mail.gmail.com> Message-ID: Hi, I didn't try it, but a friend did : the new KDevelop 4 will have this feature. This is a beta version today, but you may find easily the release schedule. Good dev, Jerome 2009/5/12 abdalrahman eweiwi > > > hello all > i am new to vtk development and i am trying to integrate my eclipse IDE > with CDT to have the autocomplete property , please if any one knows the > procedure please tell me, or if you have any alternative ide which will fit > well with vtk development , i would be grateful > -- > Regards > > Abdalrahman Eweiwi > Msc in Media Informatics > RWTH-AACHEN > B-it > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 mike.jackson at bluequartz.net Tue May 12 15:00:33 2009 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Tue, 12 May 2009 15:00:33 -0400 Subject: [vtkusers] best IDE for VTK and C++ under linux In-Reply-To: <2c86725c0905121047h22883e9bg616e451fb8c71952@mail.gmail.com> References: <2c86725c0905121047h22883e9bg616e451fb8c71952@mail.gmail.com> Message-ID: For Eclipse CDT code completion to work CDT MUST be able to find all of the include directories and files. Eclipse does this 2 ways: Automatically: CDT will scan the compile commands and look for -I flags, take the arguments from those flags and add those paths to the "Paths & Symbols" table for indexing. Manually: YOU have to add every folder that you want indexed into the "Paths & Symbols" table in the Project properties: Right click on Project->Properties->C/C++ General->Paths and Symbols. Once the entries in that table are entered correctly then you can force a rebuild of the index by again right click on the project- >Index->Rebuild Hope that helps. If you are using CMake for your project and using either the Eclipse generator or just plain makefiles then manually creating your projects then you can add "VERBOSE=1" to the "build command" in the "C/C++ Build" preferences to have cmake output the full compile command. _________________________________________________________ Mike Jackson mike.jackson at bluequartz.net BlueQuartz Software www.bluequartz.net Principal Software Engineer Dayton, Ohio On May 12, 2009, at 1:47 PM, abdalrahman eweiwi wrote: > > > hello all > i am new to vtk development and i am trying to integrate my eclipse > IDE with CDT to have the autocomplete property , please if any one > knows the procedure please tell me, or if you have any alternative > ide which will fit well with vtk development , i would be grateful > -- > Regards > > Abdalrahman Eweiwi > Msc in Media Informatics > RWTH-AACHEN > B-it > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 From emonson at cs.duke.edu Tue May 12 15:15:52 2009 From: emonson at cs.duke.edu (Eric E. Monson) Date: Tue, 12 May 2009 15:15:52 -0400 Subject: [vtkusers] VTK and Numpy In-Reply-To: <4d1a61ba0905120912q7ee17842m5a67226a10ef8bd8@mail.gmail.com> References: <4d1a61ba0905120912q7ee17842m5a67226a10ef8bd8@mail.gmail.com> Message-ID: <9CB6A811-D528-4F66-8DA3-33D22D5F93DE@cs.duke.edu> Hey Peter, Say pd is a vtkPolyData() object, then you can get the point coordinates with: vtk_to_numpy(pd.GetPoints().GetData()) -Eric ------------------------------------------------------ Eric E Monson Duke Visualization Technology Group On May 12, 2009, at 12:12 PM, Peter Halverson wrote: > I'm attempting to export VTK data into numpy using vtk_to_numpy. > The program reads in a set of DICOM files using vtkDICOMImageReader. > Filters the image using vtkContourFilter, and some other stuff and > then displays the rendered solid. I would then like to export the > data to Numpy so i do the following > scalars=skin.GetMapper().GetInput().GetPointData().GetScalars() > > Which gives me the scalars that I am looking for. My question is > how do get the [x,y,z] data to go with the scalars into numpy? > > skin.GetMapper().GetInput().GetWholeExtent() gives me the correct > dimensions (0, 511, 0, 511, 0, 56) but I have exported less scalars > than this... > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 From frencyvarghese at yahoo.com Tue May 12 16:59:40 2009 From: frencyvarghese at yahoo.com (frency v) Date: Tue, 12 May 2009 13:59:40 -0700 (PDT) Subject: [vtkusers] not able to compile this simple program Message-ID: <819368.21129.qm@web52303.mail.re2.yahoo.com> Hello everyone, I wrote this simple code but it is not getting compiled. Here is the code #include "vtkShortArray.h" int main() { short arrIn[10]; ??? const int indmax=10; ??? vtkShortArray *dataArr = vtkShortArray::New(); ?? dataArr->SetNumberOfValues(indmax); } Error message:- undefined reference to 'vtkDataArrayTemplate::Set numbervalues (long long)' Can someone compile this code in computer and let me know what is going wrong? Rgds Frency -------------- next part -------------- An HTML attachment was scrubbed... URL: From JonW at pathsurg.com Tue May 12 17:43:32 2009 From: JonW at pathsurg.com (Jon Waite) Date: Tue, 12 May 2009 16:43:32 -0500 Subject: [vtkusers] Bug vtkTextActor ShadowOn In-Reply-To: References: Message-ID: Bug found: In vtkFreeTypeUtilities::PopulateImageData, the rgb values are always set equal to the current text being rendered and ignores any previously drawn text, [like the shadow]. This results in the blended edge pixels of the foreground text to render at the full opacity where it overlaps with the shadow text. This creates an artifact of the shadowed text being colored by the shading of the foreground text. On Mon, May 11, 2009 at 4:10 PM, Jon Waite wrote: > All, > > The text actor's shadow is not rendering correctly, creating a cropped > and hard to read display. [see code below] > > Jon > > -------------------------------- > > #include "vtkRenderWindowInteractor.h" > #include "vtkRenderWindow.h" > #include "vtkRenderer.h" > #include "vtkActor.h" > #include "vtkWin32OpenGLRenderWindow.h" > #include "vtkWin32RenderWindowInteractor.h" > #include "vtkTextProperty.h" > #include "vtkTextActor.h" > #include "vtkCoordinate.h" > > int _tmain(int argc, _TCHAR* argv[]) > { > ? ? ? ?vtkWin32OpenGLRenderWindow *renWin = vtkWin32OpenGLRenderWindow::New(); > ? ? ? ?vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New(); > ? ? ? ?iren->SetRenderWindow(renWin); > ? ? ? ?iren->Initialize(); > > ? ? ? ?vtkRenderer *renderer = vtkRenderer::New(); > ? ? ? ?renWin->AddRenderer(renderer); > ? ? ? ?if(1) > ? ? ? ?{ > ? ? ? ? ? ? ? ?if (1) > ? ? ? ? ? ? ? ?{ > ? ? ? ? ? ? ? ? ? ? ? ?vtkTextActor* InfoTipTextActor = vtkTextActor::New(); > ? ? ? ? ? ? ? ? ? ? ? ?InfoTipTextActor->SetInput("Error"); > ? ? ? ? ? ? ? ? ? ? ? ?vtkTextProperty* textprop ?= InfoTipTextActor->GetTextProperty(); > ? ? ? ? ? ? ? ? ? ? ? ?textprop->SetColor(1,1,1); > ? ? ? ? ? ? ? ? ? ? ? ?textprop->SetFontSize(16); > ? ? ? ? ? ? ? ? ? ? ? ?textprop->ShadowOn(); > ? ? ? ? ? ? ? ? ? ? ? ?textprop->SetJustificationToLeft(); > ? ? ? ? ? ? ? ? ? ? ? ?textprop->SetVerticalJustificationToBottom(); > > ? ? ? ? ? ? ? ? ? ? ? ?vtkCoordinate* coord = InfoTipTextActor->GetPositionCoordinate(); > ? ? ? ? ? ? ? ? ? ? ? ?coord->SetCoordinateSystemToNormalizedViewport(); > ? ? ? ? ? ? ? ? ? ? ? ?coord->SetValue(0.5,0.5); > > ? ? ? ? ? ? ? ? ? ? ? ?renderer->AddViewProp(InfoTipTextActor); > ? ? ? ? ? ? ? ? ? ? ? ?InfoTipTextActor->Delete(); > ? ? ? ? ? ? ? ?} > > ? ? ? ? ? ? ? ?renderer->ResetCamera(); > ? ? ? ? ? ? ? ?renderer->Render(); > ? ? ? ?} > > ? ? ? ?iren->Start(); > > ? ? ? ?renderer->Delete(); > ? ? ? ?renWin->Delete(); > ? ? ? ?iren->Delete(); > > ? ? ? ?return 0; > } > From Shekhar.Chandra at sci.monash.edu.au Tue May 12 18:49:34 2009 From: Shekhar.Chandra at sci.monash.edu.au (shekharc) Date: Wed, 13 May 2009 08:49:34 +1000 Subject: [vtkusers] best IDE for VTK and C++ under linux In-Reply-To: References: <2c86725c0905121047h22883e9bg616e451fb8c71952@mail.gmail.com> Message-ID: <4A09FCFE.9050704@sci.monash.edu.au> Hi guys, The best IDE on Linux and Windows for C/C++/D is CodeBlocks IMO. For all installed libraries, auto-completion works out of the box. It is also available in Ubuntu Jaunty Package Repository. Cross platform and cross compiler makes it great from my experience. HTH Cheers Shakes Michael Jackson wrote: > For Eclipse CDT code completion to work CDT MUST be able to find all of > the include directories and files. Eclipse does this 2 ways: > Automatically: CDT will scan the compile commands and look for -I > flags, take the arguments from those flags and add those paths to the > "Paths & Symbols" table for indexing. > Manually: YOU have to add every folder that you want indexed into the > "Paths & Symbols" table in the Project properties: Right click on > Project->Properties->C/C++ General->Paths and Symbols. > > Once the entries in that table are entered correctly then you can force > a rebuild of the index by again right click on the project->Index->Rebuild > > Hope that helps. > > If you are using CMake for your project and using either the Eclipse > generator or just plain makefiles then manually creating your projects > then you can add "VERBOSE=1" to the "build command" in the "C/C++ Build" > preferences to have cmake output the full compile command. > > _________________________________________________________ > Mike Jackson mike.jackson at bluequartz.net > BlueQuartz Software www.bluequartz.net > Principal Software Engineer Dayton, Ohio > > > > On May 12, 2009, at 1:47 PM, abdalrahman eweiwi wrote: > >> >> >> hello all >> i am new to vtk development and i am trying to integrate my eclipse >> IDE with CDT to have the autocomplete property , please if any one >> knows the procedure please tell me, or if you have any alternative ide >> which will fit well with vtk development , i would be grateful >> -- >> Regards >> >> Abdalrahman Eweiwi >> Msc in Media Informatics >> RWTH-AACHEN >> B-it >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 From Shekhar.Chandra at sci.monash.edu.au Tue May 12 18:54:02 2009 From: Shekhar.Chandra at sci.monash.edu.au (shekharc) Date: Wed, 13 May 2009 08:54:02 +1000 Subject: [vtkusers] Building 64bit vtk on Vista using Visual Studio 2008 In-Reply-To: <387ee2020905100928k6462bb61u20d044eb1392848f@mail.gmail.com> References: <4a06eac4.0735640a.4c60.545a@mx.google.com> <387ee2020905100908k56e39d9aoa1b67c7c49805e79@mail.gmail.com> <387ee2020905100915x38ebf9d6l266bf40f78ebc161@mail.gmail.com> <387ee2020905100928k6462bb61u20d044eb1392848f@mail.gmail.com> Message-ID: <4A09FE0A.8020505@sci.monash.edu.au> Hi Guys, I've had no problems with building x64 VTK with Cmake 2.6.2, VTK 5.2.1, Vista Ultimate SP1, MS SDK 6.1. HTH Cheers Shakes John Drescher wrote: > On Sun, May 10, 2009 at 12:15 PM, John Drescher wrote: >>> I just opened up cmake-gui and selected Visual Studio 9 WIN64 and then >>> opened the solution in VS2008 and compiled. It is building for x64 >>> right now but did not finish yet.\ >>> >> I did not say but I did do two Configures and a Generate in >> cmake-gui.. Still building. This is on a laptop with a mechanical disk >> so it will take some time... >> > > Result, It built only 1/2 of the projects and does have WIN32 defined. > > 1>------ Build started: Project: vtksys, Configuration: Debug x64 ------ > 1>Generating vtksysProcessFwd9xEnc.c > 2>------ Build started: Project: vtkRendering, Configuration: Debug x64 ------ > 2>Generating vtkShadowMapPassShader_vs.cxx, vtkShadowMapPassShader_vs.h > 2>The application has failed to start because its side-by-side > configuration is incorrect. Please see the application event log or > use the command-line sxstrace.exe tool for more detail. > 2>Project : error PRJ0019: A tool returned an error code from > "Generating vtkShadowMapPassShader_vs.cxx, > vtkShadowMapPassShader_vs.h" > 2>Build log was saved at > "file://c:\Programming\VC.90\vtk\Rendering\vtkRendering.dir\Debug\BuildLog.htm" > 2>vtkRendering - 1 error(s), 0 warning(s) > 1>The application has failed to start because its side-by-side > configuration is incorrect. Please see the application event log or > use the command-line sxstrace.exe tool for more detail. > 1>Project : error PRJ0019: A tool returned an error code from > "Generating vtksysProcessFwd9xEnc.c" > 1>Build log was saved at > "file://c:\Programming\VC.90\vtk\Utilities\kwsys\vtksys.dir\Debug\BuildLog.htm" > 1>vtksys - 1 error(s), 0 warning(s) > 3>------ Build started: Project: ProcessShader, Configuration: Debug x64 ------ > 4>------ Build started: Project: vtkVolumeRendering, Configuration: > Debug x64 ------ > 4>Generating vtkVolumeTextureMapper3D_TwoDependentShadeFP.cxx, > vtkVolumeTextureMapper3D_TwoDependentShadeFP.h > 3>Linking... > > From a quick google search this looks like a microsoft problem. I will > attempt to fix this later today.. > > John > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers From dominik at itis.ethz.ch Tue May 12 19:00:04 2009 From: dominik at itis.ethz.ch (Dominik Szczerba) Date: Wed, 13 May 2009 01:00:04 +0200 Subject: [vtkusers] best IDE for VTK and C++ under linux In-Reply-To: <4A09FCFE.9050704@sci.monash.edu.au> References: <2c86725c0905121047h22883e9bg616e451fb8c71952@mail.gmail.com> <4A09FCFE.9050704@sci.monash.edu.au> Message-ID: <4A09FF74.3000408@itis.ethz.ch> Indeed, code::blocks is pretty good, and cross platform. Eclipse is a bit stony. Geany is an interesting lightweight option too, I just read a binary is also provided for Windows. KDevelop has been crashing for me for years, plus it is not cross platform, not even cross windows manager on linux (uses KDE lib stuff not just QT). - Dominik shekharc wrote: > Hi guys, > > The best IDE on Linux and Windows for C/C++/D is CodeBlocks IMO. > > For all installed libraries, auto-completion works out of the box. It is > also available in Ubuntu Jaunty Package Repository. > > Cross platform and cross compiler makes it great from my experience. > > HTH > Cheers > Shakes > > Michael Jackson wrote: >> For Eclipse CDT code completion to work CDT MUST be able to find all >> of the include directories and files. Eclipse does this 2 ways: >> Automatically: CDT will scan the compile commands and look for -I >> flags, take the arguments from those flags and add those paths to the >> "Paths & Symbols" table for indexing. >> Manually: YOU have to add every folder that you want indexed into >> the "Paths & Symbols" table in the Project properties: Right click on >> Project->Properties->C/C++ General->Paths and Symbols. >> >> Once the entries in that table are entered correctly then you can >> force a rebuild of the index by again right click on the >> project->Index->Rebuild >> >> Hope that helps. >> >> If you are using CMake for your project and using either the Eclipse >> generator or just plain makefiles then manually creating your projects >> then you can add "VERBOSE=1" to the "build command" in the "C/C++ >> Build" preferences to have cmake output the full compile command. >> >> _________________________________________________________ >> Mike Jackson mike.jackson at bluequartz.net >> BlueQuartz Software www.bluequartz.net >> Principal Software Engineer Dayton, Ohio >> >> >> >> On May 12, 2009, at 1:47 PM, abdalrahman eweiwi wrote: >> >>> >>> >>> hello all >>> i am new to vtk development and i am trying to integrate my eclipse >>> IDE with CDT to have the autocomplete property , please if any one >>> knows the procedure please tell me, or if you have any alternative >>> ide which will fit well with vtk development , i would be grateful >>> -- >>> Regards >>> >>> Abdalrahman Eweiwi >>> Msc in Media Informatics >>> RWTH-AACHEN >>> B-it >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://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 >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > -- Dominik Szczerba, PhD Computational Physics Group IT'IS Foundation http://www.itis.ethz.ch From darren.weber.lists at gmail.com Tue May 12 19:16:33 2009 From: darren.weber.lists at gmail.com (Darren Weber) Date: Tue, 12 May 2009 16:16:33 -0700 Subject: [vtkusers] vtk 5.4.0 FindBoost.cmake warning Message-ID: What does this mean and how is it fixed? -- Boost version: 1.38.0 -- Found the following Boost libraries: CMake Warning (dev) at CMakeLists.txt:1005 (FIND_PACKAGE): Policy CMP0011 is not set: Included scripts do automatic cmake_policy PUSH and POP. Run "cmake --help-policy CMP0011" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The included script /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMake/FindBoost.cmake affects policy settings. CMake is implying the NO_POLICY_SCOPE option for compatibility, so the effects are applied to the including context. This warning is for project developers. Use -Wno-dev to suppress it. Regards, Darren -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shekhar.Chandra at sci.monash.edu.au Tue May 12 19:18:12 2009 From: Shekhar.Chandra at sci.monash.edu.au (shekharc) Date: Wed, 13 May 2009 09:18:12 +1000 Subject: [vtkusers] best IDE for VTK and C++ under linux In-Reply-To: <4A09FF74.3000408@itis.ethz.ch> References: <2c86725c0905121047h22883e9bg616e451fb8c71952@mail.gmail.com> <4A09FCFE.9050704@sci.monash.edu.au> <4A09FF74.3000408@itis.ethz.ch> Message-ID: <4A0A03B4.5000409@sci.monash.edu.au> > Eclipse is a bit stony. KDevelop has been crashing for me > for years, plus it is not cross platform. I've had the same experience lol. Will give Geany a go too. Cheers Shakes Dominik Szczerba wrote: > Indeed, code::blocks is pretty good, and cross platform. Eclipse is a > bit stony. Geany is an interesting lightweight option too, I just read a > binary is also provided for Windows. KDevelop has been crashing for me > for years, plus it is not cross platform, not even cross windows manager > on linux (uses KDE lib stuff not just QT). > - Dominik > > shekharc wrote: >> Hi guys, >> >> The best IDE on Linux and Windows for C/C++/D is CodeBlocks IMO. >> >> For all installed libraries, auto-completion works out of the box. It >> is also available in Ubuntu Jaunty Package Repository. >> >> Cross platform and cross compiler makes it great from my experience. >> >> HTH >> Cheers >> Shakes >> >> Michael Jackson wrote: >>> For Eclipse CDT code completion to work CDT MUST be able to find all >>> of the include directories and files. Eclipse does this 2 ways: >>> Automatically: CDT will scan the compile commands and look for -I >>> flags, take the arguments from those flags and add those paths to the >>> "Paths & Symbols" table for indexing. >>> Manually: YOU have to add every folder that you want indexed into >>> the "Paths & Symbols" table in the Project properties: Right click on >>> Project->Properties->C/C++ General->Paths and Symbols. >>> >>> Once the entries in that table are entered correctly then you can >>> force a rebuild of the index by again right click on the >>> project->Index->Rebuild >>> >>> Hope that helps. >>> >>> If you are using CMake for your project and using either the Eclipse >>> generator or just plain makefiles then manually creating your >>> projects then you can add "VERBOSE=1" to the "build command" in the >>> "C/C++ Build" preferences to have cmake output the full compile command. >>> >>> _________________________________________________________ >>> Mike Jackson mike.jackson at bluequartz.net >>> BlueQuartz Software www.bluequartz.net >>> Principal Software Engineer Dayton, Ohio >>> >>> >>> >>> On May 12, 2009, at 1:47 PM, abdalrahman eweiwi wrote: >>> >>>> >>>> >>>> hello all >>>> i am new to vtk development and i am trying to integrate my eclipse >>>> IDE with CDT to have the autocomplete property , please if any one >>>> knows the procedure please tell me, or if you have any alternative >>>> ide which will fit well with vtk development , i would be grateful >>>> -- >>>> Regards >>>> >>>> Abdalrahman Eweiwi >>>> Msc in Media Informatics >>>> RWTH-AACHEN >>>> B-it >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://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 >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://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 >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 >> > From halverson at byu.edu Tue May 12 22:16:50 2009 From: halverson at byu.edu (Peter Halverson) Date: Tue, 12 May 2009 20:16:50 -0600 Subject: [vtkusers] VTK and Numpy In-Reply-To: <9CB6A811-D528-4F66-8DA3-33D22D5F93DE@cs.duke.edu> References: <4d1a61ba0905120912q7ee17842m5a67226a10ef8bd8@mail.gmail.com> <9CB6A811-D528-4F66-8DA3-33D22D5F93DE@cs.duke.edu> Message-ID: <4d1a61ba0905121916k4328ad1mb2c65493b2822af8@mail.gmail.com> Thank you for the fast response. That seems to work really well. Although it ignores my filters. My code is as follows reader=vtk.vtkDICOMImageReader() reader.SetDirectoryName('./SE1/') reader.Update() skinExtractor = vtk.vtkContourFilter() skinExtractor.SetInputConnection(reader.GetOutputPort()) skinExtractor.SetValue(SkinLow, SkinHigh) skinConnect=vtk.vtkPolyDataConnectivityFilter() skinConnect.SetExtractionModeToLargestRegion() skinConnect.SetInputConnection(skinExtractor.GetOutputPort()) skinNormals = vtk.vtkPolyDataNormals() skinNormals.SetInputConnection(skinConnect.GetOutputPort()) skinNormals.SetFeatureAngle(60.0) ar=vtk_to_numpy(skinNormals.GetOutput().GetPoints().GetData()) When I render the image (code shown below) my filters work fine and if I export it as an stl my filters work fine (code also below) [the latter being entirely unnecesarry, but a nice way to check]. As per the help files I've tried decorating the code with Update() [ i.e. skinu= skinNormals.GetOutput() skinu.Update() skinu.GetPoints().GetData() ] but that hasn't done much... #Render skinMapper = vtk.vtkPolyDataMapper() skinMapper.SetInputConnection(skinNormals.GetOutputPort()) skinMapper.ScalarVisibilityOff() skin = vtk.vtkActor() skin.SetMapper(skinMapper) #Export to STL stlout = vtk.vtkSTLWriter() stlout.SetFileName("hello.stl") stlout.SetInput(skinNormals.GetOutput()) stlout.SetFileType(2) stlout.Write() On Tue, May 12, 2009 at 1:15 PM, Eric E. Monson wrote: > Hey Peter, > > Say pd is a vtkPolyData() object, then you can get the point coordinates > with: > > vtk_to_numpy(pd.GetPoints().GetData()) > > -Eric > > ------------------------------------------------------ > Eric E Monson > Duke Visualization Technology Group > > > > On May 12, 2009, at 12:12 PM, Peter Halverson wrote: > > I'm attempting to export VTK data into numpy using vtk_to_numpy. The >> program reads in a set of DICOM files using vtkDICOMImageReader. Filters the >> image using vtkContourFilter, and some other stuff and then displays the >> rendered solid. I would then like to export the data to Numpy so i do the >> following scalars=skin.GetMapper().GetInput().GetPointData().GetScalars() >> >> Which gives me the scalars that I am looking for. My question is how do >> get the [x,y,z] data to go with the scalars into numpy? >> >> skin.GetMapper().GetInput().GetWholeExtent() gives me the correct >> dimensions (0, 511, 0, 511, 0, 56) but I have exported less scalars than >> this... >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 50295 at web.de Tue May 12 21:57:46 2009 From: 50295 at web.de (Olumide) Date: Wed, 13 May 2009 02:57:46 +0100 Subject: [vtkusers] vtkPolyDataWriter in vtkpython Message-ID: <4A0A291A.4060306@web.de> Hello, I would like to create several objects/primitives in the vtkpython, and then write them out as VTK files, without visualizing them. How can I accomplish this? I'm not problem I'm having is how to use vtkPolyDataWriter in python. Thanks, - Olumide ####################### Example ####################### #!/usr/bin/env python import vtk import time cone = vtk.vtkConeSource() cone.SetHeight( 3.0 ) cone.SetRadius( 1.0 ) cone.SetResolution( 10 ) # wite file out using vtkPolyDataWriter From paulojamorim at gmail.com Tue May 12 22:45:23 2009 From: paulojamorim at gmail.com (Paulo Henrique Junqueira Amorim) Date: Tue, 12 May 2009 23:45:23 -0300 Subject: [vtkusers] vtkPolyDataWriter in vtkpython In-Reply-To: <4A0A291A.4060306@web.de> References: <4A0A291A.4060306@web.de> Message-ID: <98e18c70905121945h2e5323d8g62ba5143d0ea80df@mail.gmail.com> Hello, Have examples in vtk page [1]. [1] - http://www.vtk.org/doc/nightly/html/c2_vtk_t_13.html import vtk import time cone = vtk.vtkConeSource() cone.SetHeight( 3.0 ) cone.SetRadius( 1.0 ) cone.SetResolution( 10 ) * #Write in file w = vtk.vtkPolyDataWriter() w.SetInput(cone.GetOutput()) w.SetFileName("junk.vtk") w.Write()* 2009/5/12 Olumide <50295 at web.de> > Hello, > > I would like to create several objects/primitives in the vtkpython, and > then write them out as VTK files, without visualizing them. How can I > accomplish this? I'm not problem I'm having is how to use vtkPolyDataWriter > in python. > > Thanks, > > - Olumide > > > ####################### Example ####################### > > > #!/usr/bin/env python > > import vtk > import time > > > cone = vtk.vtkConeSource() > cone.SetHeight( 3.0 ) > cone.SetRadius( 1.0 ) > cone.SetResolution( 10 ) > > # wite file out using vtkPolyDataWriter > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 50295 at web.de Wed May 13 00:02:14 2009 From: 50295 at web.de (Olumide) Date: Wed, 13 May 2009 05:02:14 +0100 Subject: [vtkusers] vtkPolyDataWriter in vtkpython In-Reply-To: <98e18c70905121945h2e5323d8g62ba5143d0ea80df@mail.gmail.com> References: <4A0A291A.4060306@web.de> <98e18c70905121945h2e5323d8g62ba5143d0ea80df@mail.gmail.com> Message-ID: <4A0A4646.6000307@web.de> > Have examples in vtk page [1]. > > [1] - http://www.vtk.org/doc/nightly/html/c2_vtk_t_13.html > Thanks. It worked, but I can't find that particular example on the above page. Please bear with me, but do you know if vtkpython supports the rotation of an object though an axis? I need to rotate the primitives I'll be creating around an axis, then translate them. I can't seem to find the python syntax for these operations. Thanks again. From mark.rabotnikov at philips.com Wed May 13 01:04:04 2009 From: mark.rabotnikov at philips.com (Rabotnikov, Mark) Date: Wed, 13 May 2009 07:04:04 +0200 Subject: [vtkusers] Off-screen rendering question In-Reply-To: <1ed8283f0905112058t60141a9cgdc935057b3407c22@mail.gmail.com> References: <1ed8283f0905112058t60141a9cgdc935057b3407c22@mail.gmail.com> Message-ID: It was stated before about a year, that > The current CVS version has this feature and it is used automatically if the GPU can do it. The algorithm uses the > following OpenGL extensions: > 1. GL_EXT_framebuffer_object > 2a. GL_ARB_texture_non_power_of_two or OpenGL>=2.0 2b. GL_ARB_texture_rectangle The question is if this stuff is now part of 5.4? Thank you, Mark -----Original Message----- From: Hoang Hoang [mailto:hp1711 at gmail.com] Sent: Tuesday, May 12, 2009 6:59 AM To: Rabotnikov, Mark Subject: Re: [vtkusers] Off-screen rendering question Off-screen rendering is done on CPU, I guess. 2009/5/10 Rabotnikov, Mark : > Hello, > > > > Is off-screen rendering done on GPU in version 5.4 on WinXP64, or on CPU as > in the older versions? > > > > Thank you, > > Mark > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From bogdan.indy at gmail.com Wed May 13 06:54:04 2009 From: bogdan.indy at gmail.com (Bogdan) Date: Wed, 13 May 2009 10:54:04 +0000 (UTC) Subject: [vtkusers] Building 64bit vtk on Vista using Visual Studio 2008 References: <4a06eac4.0735640a.4c60.545a@mx.google.com> <387ee2020905100908k56e39d9aoa1b67c7c49805e79@mail.gmail.com> <387ee2020905100915x38ebf9d6l266bf40f78ebc161@mail.gmail.com> <387ee2020905100928k6462bb61u20d044eb1392848f@mail.gmail.com> <4A09FE0A.8020505@sci.monash.edu.au> Message-ID: shekharc sci.monash.edu.au> writes: > > Hi Guys, > > I've had no problems with building x64 VTK with Cmake 2.6.2, VTK 5.2.1, > Vista Ultimate SP1, MS SDK 6.1. > > HTH > Cheers > Shakes > I just worried I had the options wrong for some reason(e.g., all libs had 32 suffix); I continued building anyway, ran some of the examples and the build seemed OK. Checked the binaries with depends.exe and they looked 64 bit-based. Thank you, Bogdan From david.cole at kitware.com Wed May 13 06:58:58 2009 From: david.cole at kitware.com (David Cole) Date: Wed, 13 May 2009 06:58:58 -0400 Subject: [vtkusers] Off-screen rendering question In-Reply-To: References: <1ed8283f0905112058t60141a9cgdc935057b3407c22@mail.gmail.com> Message-ID: The VTK-5-4 branch was created from CVS HEAD in early March 2009... Anything that was in CVS HEAD at the time is in the VTK-5-4 branch now. HTH, David On Wed, May 13, 2009 at 1:04 AM, Rabotnikov, Mark < mark.rabotnikov at philips.com> wrote: > It was stated before about a year, that > > > The current CVS version has this feature and it is used > automatically if the GPU can do it. The algorithm uses the > > following OpenGL extensions: > > > 1. GL_EXT_framebuffer_object > > 2a. GL_ARB_texture_non_power_of_two or OpenGL>=2.0 2b. > GL_ARB_texture_rectangle > > The question is if this stuff is now part of 5.4? > > Thank you, > Mark > > -----Original Message----- > From: Hoang Hoang [mailto:hp1711 at gmail.com] > Sent: Tuesday, May 12, 2009 6:59 AM > To: Rabotnikov, Mark > Subject: Re: [vtkusers] Off-screen rendering question > > Off-screen rendering is done on CPU, I guess. > 2009/5/10 Rabotnikov, Mark : > > Hello, > > > > > > > > Is off-screen rendering done on GPU in version 5.4 on WinXP64, or on CPU > as > > in the older versions? > > > > > > > > Thank you, > > > > Mark > > > > > > > > ________________________________ > > The information contained in this message may be confidential and legally > > protected under applicable law. The message is intended solely for the > > addressee(s). If you are not the intended recipient, you are hereby > notified > > that any use, forwarding, dissemination, or reproduction of this message > is > > strictly prohibited and may be unlawful. If you are not the intended > > recipient, please contact the sender by return e-mail and destroy all > copies > > of the original message. > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://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 > > > > > > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 paulojamorim at gmail.com Wed May 13 07:12:22 2009 From: paulojamorim at gmail.com (Paulo Henrique Junqueira Amorim) Date: Wed, 13 May 2009 08:12:22 -0300 Subject: [vtkusers] vtkPolyDataWriter in vtkpython In-Reply-To: <4A0A4646.6000307@web.de> References: <4A0A291A.4060306@web.de> <98e18c70905121945h2e5323d8g62ba5143d0ea80df@mail.gmail.com> <4A0A4646.6000307@web.de> Message-ID: <98e18c70905130412s148951cehc4436e898dacc609@mail.gmail.com> Search "vtkPolyDataWriter" in the pag. Example is tcl. yes, the wrapper to have python support. 2009/5/13 Olumide <50295 at web.de> > Have examples in vtk page [1]. >> >> [1] - http://www.vtk.org/doc/nightly/html/c2_vtk_t_13.html >> >> > Thanks. It worked, but I can't find that particular example on the above > page. > > Please bear with me, but do you know if vtkpython supports the rotation of > an object though an axis? I need to rotate the primitives I'll be creating > around an axis, then translate them. I can't seem to find the python syntax > for these operations. > > Thanks again. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shady_shidfar at yahoo.com Wed May 13 07:22:01 2009 From: shady_shidfar at yahoo.com (Shady Shidfar) Date: Wed, 13 May 2009 04:22:01 -0700 (PDT) Subject: [vtkusers] Problem with image displayed Pixels Message-ID: <257399.83054.qm@web110315.mail.gq1.yahoo.com> Hi everyone,?I'm having a problem with converting ITK image into VTK and because I'm not sure if the problem is related to ITK or VTK I'm sending this mail to both forums hoping someone can help. I'm converting my ITK image to a VTK object using itkImageToVTKImageFilter. The ?image has the origin of 0,0 and spacing 1,1. The problem is that?it seems that?the edge pixels of the image I view in VTK have spacing of 0.5,1 or 1,0.5 , So they look like a half pixel. This to me looks like a bug. I'm not sure if the problem is with pixel dimentions in VTK or ITK or it has to do with the itkImageToVTKImageFilter. I'm attaching the image file and a picture of what I view in VTK and the same image?viewed in ImageJ. It seems like the image has been slightly cropped. It can be seen that data is obviously being lost at the edges. Can someone please help me with this? Any idea what the problem is and how can I fix it. ? Thanks in advance Shaadi? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: brainCrop.tif Type: image/tiff Size: 715 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ImageJDisplay.JPG Type: image/pjpeg Size: 29341 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: VTKDisplay.JPG Type: image/pjpeg Size: 26726 bytes Desc: not available URL: From daviddoria at gmail.com Wed May 13 07:47:14 2009 From: daviddoria at gmail.com (David Doria) Date: Wed, 13 May 2009 07:47:14 -0400 Subject: [vtkusers] vtkPolyDataWriter in vtkpython In-Reply-To: <98e18c70905130412s148951cehc4436e898dacc609@mail.gmail.com> References: <4A0A291A.4060306@web.de> <98e18c70905121945h2e5323d8g62ba5143d0ea80df@mail.gmail.com> <4A0A4646.6000307@web.de> <98e18c70905130412s148951cehc4436e898dacc609@mail.gmail.com> Message-ID: On Wed, May 13, 2009 at 7:12 AM, Paulo Henrique Junqueira Amorim < paulojamorim at gmail.com> wrote: > Search "vtkPolyDataWriter" > in the pag. Example is tcl. > > yes, the wrapper to have python support. > > Here it is in python: http://www.vtk.org/Wiki/ParaView/Python_Scripting#Convert_a_File_from_PLY_to_VTP You just have to replace the ply reader source with your cone source. Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvines at arl.army.mil Wed May 13 09:04:05 2009 From: jvines at arl.army.mil (John Vines (CISD/HPCD)) Date: Wed, 13 May 2009 09:04:05 -0400 Subject: [vtkusers] embedded VTK window in PyQt application Message-ID: <4A0AC545.7070206@arl.army.mil> All, I am trying to embed a VTK renderwindow in a PyQt application and am not sure where I am going wrong. I am using VTK 5.2.1 built with QVTK support, Qt 4.3.3 and PyQt 4.3.3. Any pointers would be greatly appreciated. example python code: #!/usr/bin/env python import sys import vtk from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor from PyQt4 import Qt class test(Qt.QMainWindow): """Test class""" def __init__(self, parent=None): Qt.QMainWindow.__init__(self, parent) self.setWindowTitle(self.tr("PyQt4 VTK test")) self.workspace = Qt.QWorkspace() self.setCentralWidget(self.workspace) # create the widget self.widget = QVTKRenderWindowInteractor() self.widget.Initialize() self.widget.Start() # if you dont want the 'q' key to exit comment this. self.widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit()) self.ren = vtk.vtkRenderer() self.widget.GetRenderWindow().AddRenderer(self.ren) self.cone = vtk.vtkConeSource() self.cone.SetResolution(8) self.coneMapper = vtk.vtkPolyDataMapper() self.coneMapper.SetInput(self.cone.GetOutput()) self.coneActor = vtk.vtkActor() self.coneActor.SetMapper(self.coneMapper) self.ren.AddActor(self.coneActor) self.workspace.addWindow(self.widget) if __name__ == "__main__": app = Qt.QApplication(sys.argv) mainwindow = test() mainwindow.show() sys.exit(app.exec_()) Thanks, John From johannes.toger at med.lu.se Wed May 13 09:33:22 2009 From: johannes.toger at med.lu.se (=?ISO-8859-1?Q?Johannes_T=F6ger?=) Date: Wed, 13 May 2009 15:33:22 +0200 Subject: [vtkusers] VTK time support - how good is it? Message-ID: Hi! Our research group is considering using VTK (or some higher-level library like Mayavi/TVTK) for visualization of blood flow in the heart. Data is available as three-dimensional, time-resolved velocity fields measured using Phase Contrast MRI. Additionally, we have animated anatomical slices of the heart. All datasets are sampled over one heart beat (or a part of the heartbeat for technical reasons), but with different timesteps. For example, the velocity data might have 40 timesteps and the anatomical slices 25 or 30. This data is inherently time-resolved, so good time support is a must. I've been reading a lot about the time support in VTK, but the only thorough description I can find is an old(?) wiki post from when it was first discussed: http://www.vtk.org/Wiki/VTK/Time_Support . One paragraph in this article is particularly interesting: "Playback of an animation means varying *time*, instead of varying * timesteps*. By sampling time at regular intervals, animations can play-back at the correct rate, even if the timesteps in a dataset don't represent regular intervals. When dealing with multiple datasets, the correct data can automatically be displayed, as long as the dataset timesteps share a common reference (if they don't, simple offset and scale transformations are trivial to implement and use). In the case of a single dataset, matching the animation sample points to the timesteps in the dataset can provide backwards-compatible behavior." Now to my questions: * Is time support indeed this general in VTK? * Does it work seamlessly with the rest of VTK? * Is there a performance penalty when working with timesteps? If so, how large is it? Thank you for your attention, Johannes T?ger -------------- next part -------------- An HTML attachment was scrubbed... URL: From nkwmailinglists at gmail.com Wed May 13 10:36:33 2009 From: nkwmailinglists at gmail.com (kent williams) Date: Wed, 13 May 2009 09:36:33 -0500 Subject: [vtkusers] VTK Wrapping Problems (once again) Message-ID: <44f773f50905130736i4962f5feqc259af214d3caa6b@mail.gmail.com> I wouldn't even use VTK wrapping at all if it wasn't integral to KWWidgets. Not that it's horrible, but sometimes I get frustrated by how touchy it is, how uninformative its error messages are, and how completely un-documented it is. Below is a header file I'm trying to compile. As far as I know I'm following all the VTK wrapping rules, but it gives me this message: *** SYNTAX ERROR found in parsing the header file /scratch/kent/BT/BRAINSTracer/vtkBTPointSetWidget.h before line 30 *** Which is the first line of the second class defined. The only problem I can see -- possibly -- is that it objects to trying to wrap two classes in one file. Is THAT not permitted? It seems like I've done that before and it worked out. If I put //BTX-//ETX around the whole vtkBTPointWidget class, it doesn't throw the error And yes, I'm calling these 'Widgets' even though they don't derive from vtkAbstractWidget; I'm not sure what I gain by doing that, and I'm a little scared about what it might entail to do so directly. --------------------------------------------------------------------------------------------------vtkBTPointSetWidget.h----------------------------------------------------------------------------------------------- #if !defined(vtkBTPointSetWidget_h) #define vtkBTPointSetWidget_h #include #include class vtkViewImage; class vtkBTPointWidget : public vtkObject { public: //BTX static vtkBTPointWidget *New(); vtkTypeRevisionMacro(vtkBTPointWidget,vtkObject); void SetView(unsigned i, vtkViewImage *view); std::string GetName(); void SetName(const std::string &name); //ETX void Create(); void Hide(); void Show(); void Disable(); void Enable(); private: //BTX std::string m_Name; vtkViewImage *m_View[4]; //ETX }; class vtkBTPointSetWidget : public vtkObject { public: //BTX vtkTypeRevisionMacro(vtkBTPointSetWidget,vtkObject); typedef vtkObject SuperClass; const std::string &GetName(); void SetName(const std::string &name); //ETX static vtkBTPointSetWidget *New(); void Create(); void Hide(); void Show(); void Disable(); void Enable(); void AddPoint(); //BTX void SetView(unsigned i, vtkViewImage *view); //ETX private: //BTX vtkViewImage *m_View[4]; std::string m_Name; //ETX }; #endif // vtkBTPointSetWidget_h From kmorel at sandia.gov Wed May 13 10:36:52 2009 From: kmorel at sandia.gov (Moreland, Kenneth) Date: Wed, 13 May 2009 08:36:52 -0600 Subject: [vtkusers] VTK time support - how good is it? In-Reply-To: Message-ID: Yes, time support is indeed this general, yes it works seamlessly with the rest of VTK, and no, there is no performance penalty when working with timesteps beyond what you would have anyway iterating over the same timesteps in some other way. From your description of your data, it sounds like the VTK time support will do exactly what you want. We have since written a paper for IEEE Visualization which documents the implementation. I have added this paper to the Wiki and if you go back to the Time Support Wiki page you will see a link to download it. If you want to see a demonstration of some of the things you can do with the time support, you can review the animation we sent with the paper. I have that posted on my web site: http://www.cs.unm.edu/~kmorel/documents/TimeVis-IEEE2007.html To play with this, you may consider loading your data in ParaView. It takes advantage of the time support and will synchronize the loading of time steps based on the time stamps in the data and provides all the GUI controls to manipulate time. -Ken On 5/13/09 7:33 AM, "Johannes T?ger" wrote: Hi! Our research group is considering using VTK (or some higher-level library like Mayavi/TVTK) for visualization of blood flow in the heart. Data is available as three-dimensional, time-resolved velocity fields measured using Phase Contrast MRI. Additionally, we have animated anatomical slices of the heart. All datasets are sampled over one heart beat (or a part of the heartbeat for technical reasons), but with different timesteps. For example, the velocity data might have 40 timesteps and the anatomical slices 25 or 30. This data is inherently time-resolved, so good time support is a must. I've been reading a lot about the time support in VTK, but the only thorough description I can find is an old(?) wiki post from when it was first discussed: http://www.vtk.org/Wiki/VTK/Time_Support . One paragraph in this article is particularly interesting: "Playback of an animation means varying time, instead of varying timesteps. By sampling time at regular intervals, animations can play-back at the correct rate, even if the timesteps in a dataset don't represent regular intervals. When dealing with multiple datasets, the correct data can automatically be displayed, as long as the dataset timesteps share a common reference (if they don't, simple offset and scale transformations are trivial to implement and use). In the case of a single dataset, matching the animation sample points to the timesteps in the dataset can provide backwards-compatible behavior." Now to my questions: * Is time support indeed this general in VTK? * Does it work seamlessly with the rest of VTK? * Is there a performance penalty when working with timesteps? If so, how large is it? Thank you for your attention, Johannes T?ger **** Kenneth Moreland *** Sandia National Laboratories *********** *** *** *** email: kmorel at sandia.gov ** *** ** phone: (505) 844-8919 *** web: http://www.cs.unm.edu/~kmorel -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.cole at kitware.com Wed May 13 10:39:21 2009 From: david.cole at kitware.com (David Cole) Date: Wed, 13 May 2009 10:39:21 -0400 Subject: [vtkusers] VTK Wrapping Problems (once again) In-Reply-To: <44f773f50905130736i4962f5feqc259af214d3caa6b@mail.gmail.com> References: <44f773f50905130736i4962f5feqc259af214d3caa6b@mail.gmail.com> Message-ID: One of the assumptions in VTK wrapping is that the class name is the same as the header file name and that there is only the one class in the header file. If you want both classes wrapped, each should be in its own header file of the same name. HTH, David On Wed, May 13, 2009 at 10:36 AM, kent williams wrote: > I wouldn't even use VTK wrapping at all if it wasn't integral to > KWWidgets. Not that it's horrible, but sometimes I get frustrated by > how touchy it is, how uninformative its error messages are, and how > completely un-documented it is. > > Below is a header file I'm trying to compile. As far as I know I'm > following all the VTK wrapping rules, but it gives me this message: > *** SYNTAX ERROR found in parsing the header file > /scratch/kent/BT/BRAINSTracer/vtkBTPointSetWidget.h before line 30 *** > > Which is the first line of the second class defined. The only problem > I can see -- possibly -- is that it objects to trying to wrap two > classes in one file. Is THAT not permitted? It seems like I've done > that before and it worked out. If I put //BTX-//ETX around the whole > vtkBTPointWidget class, it doesn't throw the error > > And yes, I'm calling these 'Widgets' even though they don't derive > from vtkAbstractWidget; I'm not sure what I gain by doing that, and > I'm a little scared about what it might entail to do so directly. > > --------------------------------------------------------------------------------------------------vtkBTPointSetWidget.h----------------------------------------------------------------------------------------------- > #if !defined(vtkBTPointSetWidget_h) > #define vtkBTPointSetWidget_h > #include > #include > > class vtkViewImage; > > class vtkBTPointWidget : public vtkObject > { > public: > //BTX > static vtkBTPointWidget *New(); > vtkTypeRevisionMacro(vtkBTPointWidget,vtkObject); > void SetView(unsigned i, vtkViewImage *view); > std::string GetName(); > void SetName(const std::string &name); > //ETX > void Create(); > void Hide(); > void Show(); > void Disable(); > void Enable(); > private: > //BTX > std::string m_Name; > vtkViewImage *m_View[4]; > //ETX > }; > > class vtkBTPointSetWidget : public vtkObject > { > public: > //BTX > vtkTypeRevisionMacro(vtkBTPointSetWidget,vtkObject); > typedef vtkObject SuperClass; > const std::string &GetName(); > void SetName(const std::string &name); > //ETX > static vtkBTPointSetWidget *New(); > void Create(); > void Hide(); > void Show(); > void Disable(); > void Enable(); > void AddPoint(); > //BTX > void SetView(unsigned i, vtkViewImage *view); > //ETX > private: > //BTX > vtkViewImage *m_View[4]; > std::string m_Name; > //ETX > }; > #endif // vtkBTPointSetWidget_h > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 mcoursolle at rogue-research.com Wed May 13 08:42:32 2009 From: mcoursolle at rogue-research.com (Mathieu Coursolle) Date: Wed, 13 May 2009 08:42:32 -0400 Subject: [vtkusers] Problem with image displayed Pixels In-Reply-To: <257399.83054.qm@web110315.mail.gq1.yahoo.com> References: <257399.83054.qm@web110315.mail.gq1.yahoo.com> Message-ID: Hi VTK/ITK users, From what I understand, the origin is, by definition (VTK and ITK), the center of the first voxel. Therefore, the bounds of your image is computed as (Size - 1) * Spacing. This is well described in the ITK Software Guide. in the DataRepresentation chapter. If your think of your image as a sampled grid, then you would compute your bounds as the first and the last sample in each direction. In that context, it makes sense to have each sample the center of your pixels. I think that you can use vtkImageViewer(2) if you want to view your image as a regular image (full pixels on edges). Maybe someone could confirm that ? Thanks, Mathieu On 13-May-09, at 7:22 AM, Shady Shidfar wrote: > Hi everyone, I'm having a problem with converting ITK image into VTK > and because I'm not sure if the problem is related to ITK or VTK I'm > sending this mail to both forums hoping someone can help. > I'm converting my ITK image to a VTK object using > itkImageToVTKImageFilter. The image has the origin of 0,0 and > spacing 1,1. The problem is that it seems that the edge pixels of > the image I view in VTK have spacing of 0.5,1 or 1,0.5 , So they > look like a half pixel. This to me looks like a bug. I'm not sure if > the problem is with pixel dimentions in VTK or ITK or it has to do > with the itkImageToVTKImageFilter. I'm attaching the image file and > a picture of what I view in VTK and the same image viewed in ImageJ. > It seems like the image has been slightly cropped. It can be seen > that data is obviously being lost at the edges. Can someone please > help me with this? Any idea what the problem is and how can I fix it. > > Thanks in advance > Shaadi > > < > brainCrop > .tif > > > < > ImageJDisplay > .JPG>_______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 christopher.e.kees at usace.army.mil Wed May 13 10:58:13 2009 From: christopher.e.kees at usace.army.mil (Chris Kees) Date: Wed, 13 May 2009 09:58:13 -0500 Subject: [vtkusers] embedded VTK window in PyQt application In-Reply-To: <4A0AC545.7070206@arl.army.mil> References: <4A0AC545.7070206@arl.army.mil> Message-ID: Hey John, I had a similar problem and ended up putting the QVTKRenderWindowInteractor in a Frame. I don't have a rational explanation. I've included a modified version of your test script. Chris #!/usr/bin/env python import sys import vtk from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor from PyQt4 import Qt from PyQt4 import QtGui class test(Qt.QMainWindow): """Test class""" def __init__(self, parent=None): Qt.QMainWindow.__init__(self, parent) self.setWindowTitle(self.tr("PyQt4 VTK test")) self.workspace = Qt.QWorkspace() self.setCentralWidget(self.workspace) self.frame = QtGui.QFrame(self.workspace) self.hbox = QtGui.QHBoxLayout() # create the widget self.widget = QVTKRenderWindowInteractor(self.frame) self.widget.Initialize() self.widget.Start() # if you dont want the 'q' key to exit comment this. self.widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit()) self.cone = vtk.vtkConeSource() self.cone.SetResolution(8) self.coneMapper = vtk.vtkPolyDataMapper() self.coneMapper.SetInput(self.cone.GetOutput()) self.coneActor = vtk.vtkActor() self.coneActor.SetMapper(self.coneMapper) self.ren = vtk.vtkRenderer() self.ren.AddActor(self.coneActor) self.renWin=self.widget.GetRenderWindow() self.renWin.AddRenderer(self.ren) self.hbox.addWidget(self.widget) self.frame.setLayout(self.hbox) self.workspace.addWindow(self.frame) if __name__ == "__main__": app = Qt.QApplication(sys.argv) mainwindow = test() mainwindow.show() sys.exit(app.exec_()) On May 13, 2009, at 8:04 AM, John Vines (CISD/HPCD) wrote: > #!/usr/bin/env python > > import sys > import vtk > from vtk.qt4.QVTKRenderWindowInteractor import > QVTKRenderWindowInteractor > from PyQt4 import Qt > > class test(Qt.QMainWindow): > """Test class""" > def __init__(self, parent=None): > Qt.QMainWindow.__init__(self, parent) > self.setWindowTitle(self.tr("PyQt4 VTK test")) > self.workspace = Qt.QWorkspace() > self.setCentralWidget(self.workspace) > > # create the widget > self.widget = QVTKRenderWindowInteractor() > self.widget.Initialize() > self.widget.Start() > > # if you dont want the 'q' key to exit comment this. > self.widget.AddObserver("ExitEvent", lambda o, e, a=app: > a.quit()) > self.ren = vtk.vtkRenderer() > self.widget.GetRenderWindow().AddRenderer(self.ren) > self.cone = vtk.vtkConeSource() > self.cone.SetResolution(8) > self.coneMapper = vtk.vtkPolyDataMapper() > self.coneMapper.SetInput(self.cone.GetOutput()) > self.coneActor = vtk.vtkActor() > self.coneActor.SetMapper(self.coneMapper) > self.ren.AddActor(self.coneActor) > self.workspace.addWindow(self.widget) > > if __name__ == "__main__": > app = Qt.QApplication(sys.argv) > mainwindow = test() > mainwindow.show() > sys.exit(app.exec_()) From nkwmailinglists at gmail.com Wed May 13 11:10:07 2009 From: nkwmailinglists at gmail.com (kent williams) Date: Wed, 13 May 2009 10:10:07 -0500 Subject: [vtkusers] VTK Wrapping Problems (once again) In-Reply-To: References: <44f773f50905130736i4962f5feqc259af214d3caa6b@mail.gmail.com> Message-ID: <44f773f50905130810i1aa74f41g694bcdbb9e4eb311@mail.gmail.com> Thanks David. It's what I guessed. It didn't matter so much when all VTK wrapping was of VTK classes, and wasn't really the concern of VTK users. But with KWWidgets becoming more commonly in use, isn't it about time there was at least a short WIKI summary of how VTK Wrapping works? Whenever I have a problem with the VTK wrapping, I google "vtk tcl wrap" to try and find some help, and about 1/2 of the pages google finds are my posts to VTK-Users, asking questions about VTK Wrapping! On Wed, May 13, 2009 at 9:39 AM, David Cole wrote: > One of the assumptions in VTK wrapping is that the class name is the same as > the header file name and that there is only the one class in the header > file. > > If you want both classes wrapped, each should be in its own header file of > the same name. > > > HTH, > David > > > On Wed, May 13, 2009 at 10:36 AM, kent williams > wrote: >> >> I wouldn't even use VTK wrapping at all if it wasn't integral to >> KWWidgets. ?Not that it's horrible, but sometimes I get frustrated by >> how touchy it is, how uninformative its error messages are, and how >> completely un-documented it is. >> >> Below is a header file I'm trying to compile. ?As far as I know I'm >> following all the VTK wrapping rules, but it gives me this message: >> *** SYNTAX ERROR found in parsing the header file >> /scratch/kent/BT/BRAINSTracer/vtkBTPointSetWidget.h before line 30 *** >> >> Which is the first line of the second class defined. The only problem >> I can see -- possibly -- is that it objects to trying to wrap two >> classes in one file. ?Is THAT not permitted? It seems like I've done >> that before and it worked out. ?If I put //BTX-//ETX around the whole >> vtkBTPointWidget class, it doesn't throw the error >> >> And yes, I'm calling these 'Widgets' even though they don't derive >> from vtkAbstractWidget; I'm not sure what I gain by doing that, and >> I'm a little scared about what it might entail to do so directly. >> >> --------------------------------------------------------------------------------------------------vtkBTPointSetWidget.h----------------------------------------------------------------------------------------------- >> #if !defined(vtkBTPointSetWidget_h) >> #define vtkBTPointSetWidget_h >> #include >> #include >> >> class vtkViewImage; >> >> class vtkBTPointWidget : public vtkObject >> { >> public: >> //BTX >> ?static vtkBTPointWidget *New(); >> ?vtkTypeRevisionMacro(vtkBTPointWidget,vtkObject); >> ?void SetView(unsigned i, ?vtkViewImage *view); >> ?std::string GetName(); >> ?void SetName(const std::string &name); >> //ETX >> ?void Create(); >> ?void Hide(); >> ?void Show(); >> ?void Disable(); >> ?void Enable(); >> private: >> //BTX >> ?std::string m_Name; >> ?vtkViewImage *m_View[4]; >> //ETX >> }; >> >> class vtkBTPointSetWidget : public vtkObject >> { >> public: >> ?//BTX >> ?vtkTypeRevisionMacro(vtkBTPointSetWidget,vtkObject); >> ?typedef vtkObject SuperClass; >> ?const std::string &GetName(); >> ?void SetName(const std::string &name); >> ?//ETX >> ?static vtkBTPointSetWidget *New(); >> ?void Create(); >> ?void Hide(); >> ?void Show(); >> ?void Disable(); >> ?void Enable(); >> ?void AddPoint(); >> ?//BTX >> ?void SetView(unsigned i, ?vtkViewImage *view); >> ?//ETX >> private: >> ?//BTX >> ?vtkViewImage *m_View[4]; >> ?std::string m_Name; >> ?//ETX >> }; >> #endif // vtkBTPointSetWidget_h >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 > > From the.render.dude at gmail.com Wed May 13 11:15:14 2009 From: the.render.dude at gmail.com (Mark Bolstad) Date: Wed, 13 May 2009 11:15:14 -0400 Subject: [vtkusers] Updating an Image Cache Filter Message-ID: <82dde0905130815m1561dc90u6288adfa3bb96160@mail.gmail.com> I have a pipeline that looks like: ImageReader2->ImageMapToColors \ ImageBlender-> ImageCacheFilter->ImageActor / ImageReader2->ImageMapToColors In the application, users pick sections from a single layer from a stack of images (volume) and apply operations to them. For example, one operation may be to select a region and split into N separate areas. The changes are small relative to the size of the image volumes, So we only want to retain the modifications, and reload them into the image reader output when the user steps off and returns to the current image slice. Now while this may not be the most efficient way to do this, due to operations in the application I need to change the output data from *one* of the readers corresponding to the plane defined by the image actor as described above. We're dealing with pretty large image volumes, so we don't want to force an Update of the ImageReader. So, a couple of questions: 1. If I bash the values in reader.GetOutput() will they propagate up the pipeline? (in small tests they seem to) 2. If the answer above is yes, How do you flush the cache from the imagecachefilter? 3. If #1 is no, then am I better off just writing my own caching method, or is there a better way (there's always a better way, I want the one with the least effort). Thanks, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From bnwylie at sandia.gov Wed May 13 11:18:12 2009 From: bnwylie at sandia.gov (Wylie, Brian) Date: Wed, 13 May 2009 09:18:12 -0600 Subject: [vtkusers] vtk 5.4.0 FindBoost.cmake warning In-Reply-To: References: Message-ID: 1) This can safely be ignored 2) I think if you upgrade to CMake 2.6.4 this warning will go away. Brian Wylie - Org 1424 Sandia National Laboratories MS 1323 - Building CSRI/242 (505)844-2238 FAX(505)284-2518 _______ __ /_ __(_) /_____ _____ / / / / __/ __ `/ __ \ / / / / /_/ /_/ / / / / /_/ /_/\__/\__,_/_/ /_/ Informatics Toolkit ________________________________ From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Darren Weber Sent: Tuesday, May 12, 2009 5:17 PM To: VTK Users Subject: [vtkusers] vtk 5.4.0 FindBoost.cmake warning What does this mean and how is it fixed? -- Boost version: 1.38.0 -- Found the following Boost libraries: CMake Warning (dev) at CMakeLists.txt:1005 (FIND_PACKAGE): Policy CMP0011 is not set: Included scripts do automatic cmake_policy PUSH and POP. Run "cmake --help-policy CMP0011" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The included script /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMake/FindBoost.cmake affects policy settings. CMake is implying the NO_POLICY_SCOPE option for compatibility, so the effects are applied to the including context. This warning is for project developers. Use -Wno-dev to suppress it. Regards, Darren From bnwylie at sandia.gov Wed May 13 11:32:08 2009 From: bnwylie at sandia.gov (Wylie, Brian) Date: Wed, 13 May 2009 09:32:08 -0600 Subject: [vtkusers] embedded VTK window in PyQt application In-Reply-To: References: <4A0AC545.7070206@arl.army.mil> Message-ID: There's a gui.py example script in VTK\Examples\Infovis\Python\gui.py written by Tim Shead, that may or may not be informative.... Brian Wylie - Org 1424 Sandia National Laboratories MS 1323 - Building CSRI/242 (505)844-2238 FAX(505)284-2518 _______ __ /_ __(_) /_____ _____ / / / / __/ __ `/ __ \ / / / / /_/ /_/ / / / / /_/ /_/\__/\__,_/_/ /_/ Informatics Toolkit -----Original Message----- From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Chris Kees Sent: Wednesday, May 13, 2009 8:58 AM To: John Vines Cc: vtkusers at vtk.org Subject: Re: [vtkusers] embedded VTK window in PyQt application Hey John, I had a similar problem and ended up putting the QVTKRenderWindowInteractor in a Frame. I don't have a rational explanation. I've included a modified version of your test script. Chris #!/usr/bin/env python import sys import vtk from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor from PyQt4 import Qt from PyQt4 import QtGui class test(Qt.QMainWindow): """Test class""" def __init__(self, parent=None): Qt.QMainWindow.__init__(self, parent) self.setWindowTitle(self.tr("PyQt4 VTK test")) self.workspace = Qt.QWorkspace() self.setCentralWidget(self.workspace) self.frame = QtGui.QFrame(self.workspace) self.hbox = QtGui.QHBoxLayout() # create the widget self.widget = QVTKRenderWindowInteractor(self.frame) self.widget.Initialize() self.widget.Start() # if you dont want the 'q' key to exit comment this. self.widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit()) self.cone = vtk.vtkConeSource() self.cone.SetResolution(8) self.coneMapper = vtk.vtkPolyDataMapper() self.coneMapper.SetInput(self.cone.GetOutput()) self.coneActor = vtk.vtkActor() self.coneActor.SetMapper(self.coneMapper) self.ren = vtk.vtkRenderer() self.ren.AddActor(self.coneActor) self.renWin=self.widget.GetRenderWindow() self.renWin.AddRenderer(self.ren) self.hbox.addWidget(self.widget) self.frame.setLayout(self.hbox) self.workspace.addWindow(self.frame) if __name__ == "__main__": app = Qt.QApplication(sys.argv) mainwindow = test() mainwindow.show() sys.exit(app.exec_()) On May 13, 2009, at 8:04 AM, John Vines (CISD/HPCD) wrote: > #!/usr/bin/env python > > import sys > import vtk > from vtk.qt4.QVTKRenderWindowInteractor import > QVTKRenderWindowInteractor from PyQt4 import Qt > > class test(Qt.QMainWindow): > """Test class""" > def __init__(self, parent=None): > Qt.QMainWindow.__init__(self, parent) > self.setWindowTitle(self.tr("PyQt4 VTK test")) > self.workspace = Qt.QWorkspace() > self.setCentralWidget(self.workspace) > > # create the widget > self.widget = QVTKRenderWindowInteractor() > self.widget.Initialize() > self.widget.Start() > > # if you dont want the 'q' key to exit comment this. > self.widget.AddObserver("ExitEvent", lambda o, e, a=app: > a.quit()) > self.ren = vtk.vtkRenderer() > self.widget.GetRenderWindow().AddRenderer(self.ren) > self.cone = vtk.vtkConeSource() > self.cone.SetResolution(8) > self.coneMapper = vtk.vtkPolyDataMapper() > self.coneMapper.SetInput(self.cone.GetOutput()) > self.coneActor = vtk.vtkActor() > self.coneActor.SetMapper(self.coneMapper) > self.ren.AddActor(self.coneActor) > self.workspace.addWindow(self.widget) > > if __name__ == "__main__": > app = Qt.QApplication(sys.argv) > mainwindow = test() > mainwindow.show() > sys.exit(app.exec_()) _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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 From frencyvarghese at yahoo.com Wed May 13 11:32:37 2009 From: frencyvarghese at yahoo.com (frency v) Date: Wed, 13 May 2009 08:32:37 -0700 (PDT) Subject: [vtkusers] Can someone please correct this code Message-ID: <692338.1476.qm@web52305.mail.re2.yahoo.com> Hello everyone, I wrote this simple code but it is not getting compiled. i am getting the following error message. pls help. Error message:- undefined reference to 'vtkDataArrayTemplate::Set numbervalues (long long)' Can someone compile this code in computer and let me know what is going wrong? Rgds Frency here is the code #include "vtkShortArray.h" int main() { short arrIn[10]; ??? const int indmax=10; ??? vtkShortArray *dataArr = vtkShortArray::New(); ?? dataArr->SetNumberOfValues(indmax); } Error message:- undefined reference to 'vtkDataArrayTemplate::Set numbervalues (long long)' -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Wed May 13 11:36:46 2009 From: daviddoria at gmail.com (David Doria) Date: Wed, 13 May 2009 11:36:46 -0400 Subject: [vtkusers] Can someone please correct this code In-Reply-To: <692338.1476.qm@web52305.mail.re2.yahoo.com> References: <692338.1476.qm@web52305.mail.re2.yahoo.com> Message-ID: On Wed, May 13, 2009 at 11:32 AM, frency v wrote: > Hello everyone, > I wrote this simple code but it is not getting compiled. > i am getting the following error message. pls help. > > Error message:- undefined reference to 'vtkDataArrayTemplate::Set > numbervalues (long long)' > > Can someone compile this code in computer and let me know what is going > wrong? > > Rgds > Frency > > here is the code > > #include "vtkShortArray.h" > int main() > { short arrIn[10]; > const int indmax=10; > vtkShortArray *dataArr = vtkShortArray::New(); > dataArr->SetNumberOfValues(indmax); > } > > Error message:- undefined reference to 'vtkDataArrayTemplate::Set > numbervalues (long long)' > It compiles fine for me. Make sure you link to vtkHybrid. Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From philip.cardiff at ucd.ie Wed May 13 12:09:07 2009 From: philip.cardiff at ucd.ie (Philip Cardiff) Date: Wed, 13 May 2009 17:09:07 +0100 Subject: [vtkusers] After compiling and installing, there is no vtk binary? Message-ID: <32e879480905130909q1e16296bv58f6909ca7f62cfb@mail.gmail.com> Hi, I followed the steps to compile and install VTK from the 'Readme.html' file in the source package I downloaded. I followed the steps to compile and install, and everything seemed to go fine. But I cannot find the 'vtk' executable? The readme says it should be in the bin directory where it was complied. There directories 'bin','include' and 'lib' in the directory where I specified VTK to be installed, but the only executables in the bin directory are 'vtkEncodeString' and 'lprog'. Where is the 'vtk' executable? And tips or help are much appreciated, Philip -- Room 314, Engineering Building University College Dublin Belfield, Dublin 4 Ireland Tel (mob): 00353 86 367 2442 Tel (office): 00353 1716 1880 -------------- next part -------------- An HTML attachment was scrubbed... URL: From randall.hand at gmail.com Wed May 13 12:15:52 2009 From: randall.hand at gmail.com (Randall Hand) Date: Wed, 13 May 2009 11:15:52 -0500 Subject: [vtkusers] After compiling and installing, there is no vtk binary? In-Reply-To: <32e879480905130909q1e16296bv58f6909ca7f62cfb@mail.gmail.com> References: <32e879480905130909q1e16296bv58f6909ca7f62cfb@mail.gmail.com> Message-ID: To get the binaries, you need to enable Python or TCL Bindings, which will create either 'vtk' or 'vtkpython'. -- Randall Hand Senior Editor, http://www.VizWorld.com 601-910-6172 On Wed, May 13, 2009 at 11:09 AM, Philip Cardiff wrote: > Hi, > > I followed the steps to compile and install VTK from the 'Readme.html' file > in the source package I downloaded. > > I followed the steps to compile and install, and everything seemed to go > fine. > > But I cannot find the 'vtk' executable? > The readme says it should be in the bin directory where it was complied. > > There directories 'bin','include' and 'lib' in the directory where I > specified VTK to be installed, but the only executables in the bin directory > are 'vtkEncodeString' and 'lprog'. Where is the 'vtk' executable? > > > And tips or help are much appreciated, > Philip > > > -- > Room 314, Engineering Building > University College Dublin > Belfield, Dublin 4 > Ireland > > Tel (mob): 00353 86 367 2442 > Tel (office): 00353 1716 1880 > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 drescherjm at gmail.com Wed May 13 12:13:15 2009 From: drescherjm at gmail.com (John Drescher) Date: Wed, 13 May 2009 12:13:15 -0400 Subject: [vtkusers] After compiling and installing, there is no vtk binary? In-Reply-To: <32e879480905130909q1e16296bv58f6909ca7f62cfb@mail.gmail.com> References: <32e879480905130909q1e16296bv58f6909ca7f62cfb@mail.gmail.com> Message-ID: <387ee2020905130913g500a19c4x2abde98ee2277941@mail.gmail.com> > I followed the steps to compile and install VTK from the 'Readme.html' file > in the source package I downloaded. > I followed the steps to compile and install, and everything seemed to go > fine. > But I cannot find the 'vtk' executable? > The readme says it should be in the bin directory where it was complied. > There directories 'bin','include' and 'lib' in the directory where I > specified VTK to be installed, but the only executables in the bin directory > are 'vtkEncodeString' and 'lprog'. Where is the 'vtk' executable? > VTK is a library not an executable. There will be several executables in the bin folder but those are example programs. John From drescherjm at gmail.com Wed May 13 12:21:45 2009 From: drescherjm at gmail.com (John Drescher) Date: Wed, 13 May 2009 12:21:45 -0400 Subject: [vtkusers] After compiling and installing, there is no vtk binary? In-Reply-To: References: <32e879480905130909q1e16296bv58f6909ca7f62cfb@mail.gmail.com> Message-ID: <387ee2020905130921p3558c7a2xfdff70bedfd7e845@mail.gmail.com> On Wed, May 13, 2009 at 12:15 PM, Randall Hand wrote: > To get the binaries, you need to enable Python or TCL Bindings, which will > create either 'vtk' or 'vtkpython'. > Thanks. After I posted I thought of python.. John From 50295 at web.de Wed May 13 12:38:34 2009 From: 50295 at web.de (Olumide) Date: Wed, 13 May 2009 17:38:34 +0100 Subject: [vtkusers] vtkPolyDataWriter in vtkpython In-Reply-To: References: <4A0A291A.4060306@web.de> <98e18c70905121945h2e5323d8g62ba5143d0ea80df@mail.gmail.com> <4A0A4646.6000307@web.de> <98e18c70905130412s148951cehc4436e898dacc609@mail.gmail.com> Message-ID: <4A0AF78A.8050202@web.de> Thanks guys. How about my other question concerning weather vtkpython supports the rotation of an object though an axis? I need to rotate the primitives I'll be creating around an axis, then translate them. I can't seem to find the python syntax for these operations. From frencyvarghese at yahoo.com Wed May 13 12:39:09 2009 From: frencyvarghese at yahoo.com (frency v) Date: Wed, 13 May 2009 09:39:09 -0700 (PDT) Subject: [vtkusers] vtkusers Digest, Vol 61, Issue 13 Message-ID: <225937.24478.qm@web52308.mail.re2.yahoo.com> Thanks David, I have vtkHybrid link and i am still not able to complile. Frency Message: 14 Date: Wed, 13 May 2009 11:36:46 -0400 From: David Doria Subject: Re: [vtkusers] Can someone please correct this code Cc: vtkusers at vtk.org Message-ID: ??? Content-Type: text/plain; charset="iso-8859-1" On Wed, May 13, 2009 at 11:32 AM, frency v wrote: > Hello everyone, > I wrote this simple code but it is not getting compiled. > i am getting the following error message. pls help. > > Error message:- undefined reference to 'vtkDataArrayTemplate::Set > numbervalues (long long)' > > Can someone compile this code in computer and let me know what is going > wrong? > > Rgds > Frency > > here is the code > > #include "vtkShortArray.h" > int main() > { short arrIn[10]; >? ???const int indmax=10; >? ???vtkShortArray *dataArr = vtkShortArray::New(); >? ? dataArr->SetNumberOfValues(indmax); > } > > Error message:- undefined reference to 'vtkDataArrayTemplate::Set > numbervalues (long long)' > It compiles fine for me. Make sure you link to vtkHybrid. Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ vtkusers mailing list vtkusers at vtk.org http://www.vtk.org/mailman/listinfo/vtkusers End of vtkusers Digest, Vol 61, Issue 13 **************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From frencyvarghese at yahoo.com Wed May 13 12:41:41 2009 From: frencyvarghese at yahoo.com (frency v) Date: Wed, 13 May 2009 09:41:41 -0700 (PDT) Subject: [vtkusers] Can someone please correct this code Message-ID: <984795.22652.qm@web52312.mail.re2.yahoo.com> Hello everyone, I wrote this simple code but it is not getting compiled. i am getting the following error message. pls help. Error message:- undefined reference to 'vtkDataArrayTemplate::Set numbervalues (long long)' Can someone compile this code? and let me know what is going wrong? Rgds Frency here is the code #include "vtkShortArray.h" int main() { short arrIn[10]; ??? const int indmax=10; ??? vtkShortArray *dataArr = vtkShortArray::New(); ?? dataArr->SetNumberOfValues(indmax); } Error message:- undefined reference to 'vtkDataArrayTemplate::Set numbervalues (long long)' -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Wed May 13 12:50:52 2009 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 13 May 2009 12:50:52 -0400 Subject: [vtkusers] vtkPolyDataWriter in vtkpython In-Reply-To: <4A0AF78A.8050202@web.de> References: <4A0A291A.4060306@web.de> <98e18c70905121945h2e5323d8g62ba5143d0ea80df@mail.gmail.com> <4A0A4646.6000307@web.de> <98e18c70905130412s148951cehc4436e898dacc609@mail.gmail.com> <4A0AF78A.8050202@web.de> Message-ID: Apply a vtkTransform filter. David E DeMarle Kitware, Inc. R&D Engineer 28 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-371-3971 x109 On Wed, May 13, 2009 at 12:38 PM, Olumide <50295 at web.de> wrote: > Thanks guys. How about my other question concerning weather vtkpython > supports the rotation of an object though an axis? I need to rotate the > primitives I'll be creating around an axis, then translate them. I can't > seem to find the python syntax for these operations. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > From JonW at pathsurg.com Wed May 13 13:12:34 2009 From: JonW at pathsurg.com (Jon Waite) Date: Wed, 13 May 2009 12:12:34 -0500 Subject: [vtkusers] Can someone please correct this code In-Reply-To: <984795.22652.qm@web52312.mail.re2.yahoo.com> References: <984795.22652.qm@web52312.mail.re2.yahoo.com> Message-ID: Frency, I compiled the code fine under vtk 5.0.0 and 5.4.0. Jon On Wed, May 13, 2009 at 11:41 AM, frency v wrote: > Hello everyone, > I wrote this simple code but it is not getting compiled. > i am getting the following error message. pls help. > > Error message:- undefined reference to 'vtkDataArrayTemplate::Set > numbervalues (long long)' > > Can someone compile this code? and let me know what is going wrong? > > Rgds > Frency > > here is the code > > #include "vtkShortArray.h" > int main() > { short arrIn[10]; > ??? const int indmax=10; > ??? vtkShortArray *dataArr = vtkShortArray::New(); > ?? dataArr->SetNumberOfValues(indmax); > } > > Error message:- undefined reference to 'vtkDataArrayTemplate::Set > numbervalues (long long)' > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > From jvines at arl.army.mil Wed May 13 13:18:44 2009 From: jvines at arl.army.mil (John Vines (CISD/HPCD)) Date: Wed, 13 May 2009 13:18:44 -0400 Subject: [vtkusers] embedded VTK window in PyQt application In-Reply-To: References: <4A0AC545.7070206@arl.army.mil> Message-ID: <4A0B00F4.7090108@arl.army.mil> Chris, Thanks for the response. Yes, I tried embedding the VTK window in a QFrame too but it core dumps on my RHEL4 box? I tried your updated script and it has the same result. What OS are you on? Thanks again, John Chris Kees wrote: > Hey John, > > I had a similar problem and ended up putting the > QVTKRenderWindowInteractor in a Frame. I don't have a rational > explanation. I've included a modified version of your test script. > > Chris > #!/usr/bin/env python > > import sys > import vtk > from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor > from PyQt4 import Qt > from PyQt4 import QtGui > class test(Qt.QMainWindow): > """Test class""" > def __init__(self, parent=None): > Qt.QMainWindow.__init__(self, parent) > self.setWindowTitle(self.tr("PyQt4 VTK test")) > self.workspace = Qt.QWorkspace() > self.setCentralWidget(self.workspace) > self.frame = QtGui.QFrame(self.workspace) > self.hbox = QtGui.QHBoxLayout() > # create the widget > self.widget = QVTKRenderWindowInteractor(self.frame) > self.widget.Initialize() > self.widget.Start() > # if you dont want the 'q' key to exit comment this. > self.widget.AddObserver("ExitEvent", lambda o, e, a=app: > a.quit()) > self.cone = vtk.vtkConeSource() > self.cone.SetResolution(8) > self.coneMapper = vtk.vtkPolyDataMapper() > self.coneMapper.SetInput(self.cone.GetOutput()) > self.coneActor = vtk.vtkActor() > self.coneActor.SetMapper(self.coneMapper) > self.ren = vtk.vtkRenderer() > self.ren.AddActor(self.coneActor) > self.renWin=self.widget.GetRenderWindow() > self.renWin.AddRenderer(self.ren) > self.hbox.addWidget(self.widget) > self.frame.setLayout(self.hbox) > self.workspace.addWindow(self.frame) > > if __name__ == "__main__": > app = Qt.QApplication(sys.argv) > mainwindow = test() > mainwindow.show() > sys.exit(app.exec_()) > > On May 13, 2009, at 8:04 AM, John Vines (CISD/HPCD) wrote: > >> #!/usr/bin/env python >> >> import sys >> import vtk >> from vtk.qt4.QVTKRenderWindowInteractor import >> QVTKRenderWindowInteractor >> from PyQt4 import Qt >> >> class test(Qt.QMainWindow): >> """Test class""" >> def __init__(self, parent=None): >> Qt.QMainWindow.__init__(self, parent) >> self.setWindowTitle(self.tr("PyQt4 VTK test")) >> self.workspace = Qt.QWorkspace() >> self.setCentralWidget(self.workspace) >> >> # create the widget >> self.widget = QVTKRenderWindowInteractor() >> self.widget.Initialize() >> self.widget.Start() >> >> # if you dont want the 'q' key to exit comment this. >> self.widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit()) >> self.ren = vtk.vtkRenderer() >> self.widget.GetRenderWindow().AddRenderer(self.ren) >> self.cone = vtk.vtkConeSource() >> self.cone.SetResolution(8) >> self.coneMapper = vtk.vtkPolyDataMapper() >> self.coneMapper.SetInput(self.cone.GetOutput()) >> self.coneActor = vtk.vtkActor() >> self.coneActor.SetMapper(self.coneMapper) >> self.ren.AddActor(self.coneActor) >> self.workspace.addWindow(self.widget) >> >> if __name__ == "__main__": >> app = Qt.QApplication(sys.argv) >> mainwindow = test() >> mainwindow.show() >> sys.exit(app.exec_()) > From hossein.ghadiri at gmail.com Thu May 14 14:00:21 2009 From: hossein.ghadiri at gmail.com (Hossein Ghadiri) Date: Thu, 14 May 2009 22:30:21 +0430 Subject: [vtkusers] CMake error Message-ID: <000001c9d4bd$dc69abb0$cbd1844f@Hossein> Dears, I am trying to use CMake 2.6-patch 4 to build VTK 5.4.0, I did fully install VS8-2005, But here is error generated by CMake: Check for working C compiler: cl Check for working C compiler: cl -- broken CMake Error at C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CMakeTestCCompiler.cmake:32 (MESSAGE): The C compiler "cl" is not able to compile a simple test program. It fails with the following output: Change Dir: F:/11-Programing/ITK & VTK/vtk/source/vtk-5.4.0/built/CMakeFiles/CMakeTmp Run Build Command:E:\PROGRA~1\MICROS~1\Common7\IDE\devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec Microsoft (R) Visual Studio Version 8.0.50727.42. Copyright (C) Microsoft Corp 1984-2005. All rights reserved. The following error has occurred during XML parsing: File: F:\11-Programing\ITK & VTK\vtk\source\vtk-5.4.0\built\CMakeFiles\CMakeTmp\cmTryCompileExec.vcproj Line: 37 Column: 52 Error Message: Illegal name character. The file 'F:\11-Programing\ITK & VTK\vtk\source\vtk-5.4.0\built\CMakeFiles\CMakeTmp\cmTryCompileExec.vcproj' has failed to load. Invalid project Use: devenv [solutionfile | projectfile | anyfile.ext] [switches] The first argument for devenv is usually a solution file or project file. You can also use any other file as the first argument if you want to have the file open automatically in an editor. When you enter a project file, the IDE looks for an .sln file with the same base name as the project file in the parent directory for the project file. If no such .sln file exists, then the IDE looks for a single .sln file that references the project. If no such single .sln file exists, then the IDE creates an unsaved solution with a default .sln file name that has the same base name as the project file. Command line builds: devenv solutionfile.sln /build solutionconfig [ /project projectnameorfile [ /projectconfig name ] ] Available command line switches: /Build Builds the solution or project with the specified solution configuration. For example "Debug". If multiple platforms are possible, the configuration name must be enclosed in quotes and contain platform name. For example: "Debug|Win32". /Clean Deletes build outputs. /Command Starts the IDE and executes the command. /Deploy Builds and then deploys the specified build configuration. /Edit Opens the specified files in a running instance of this application. If there are no running instances, it will start a new instance with a simplified window layout. /LCID Sets the default language in the IDE for the UI. /Log Logs IDE activity to the specified file for troubleshooting. /NoVSIP Disables the VSIP developer's license key for VSIP testing. /Out Appends the build log to a specified file. /Project Specifies the project to build, clean, or deploy. Must be used with /Build, /Rebuild, /Clean, or /Deploy. /ProjectConfig Overrides the project configuration specified in the solution configuration. For example "Debug". If multiple platforms are possible, the configuration name must be enclosed in quotes and contain platform name. For example: "Debug|Win32". Must be used with /Project. /Rebuild Cleans and then builds the solution or project with the specified configuration. /ResetAddin Removes commands and command UI associated with the specified Add-in. /ResetSettings Restores the IDE's default settings, optionally resets to the specified VSSettings file. /ResetSkipPkgs Clears all SkipLoading tags added to VSPackages. /Run Compiles and runs the specified solution. /RunExit Compiles and runs the specified solution then closes the IDE. /SafeMode Launches the IDE in safe mode loading minimal windows. /Upgrade Upgrades the project or the solution and all projects in it. A backup of these files will be created as appropriate. Please see Help on 'Visual Studio Conversion Wizard' for more information on the backup process. Product-specific switches: /debugexe Open the specified executable to be debugged. The remainder of the command line is passed to this executable as its arguments. /useenv Use PATH, INCLUDE, LIBPATH, and LIB environment variables instead of IDE paths for VC++ builds. To attach the debugger from the command line, use: VsJITDebugger.exe -p CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:5 (PROJECT) Configuring incomplete, errors occurred! Any body can help me? Hossein -------------- next part -------------- An HTML attachment was scrubbed... URL: From darren.weber.lists at gmail.com Wed May 13 14:11:58 2009 From: darren.weber.lists at gmail.com (Darren Weber) Date: Wed, 13 May 2009 11:11:58 -0700 Subject: [vtkusers] vtk 5.4.0 FindBoost.cmake warning In-Reply-To: References: Message-ID: On Wed, May 13, 2009 at 8:18 AM, Wylie, Brian wrote: > 1) This can safely be ignored > 2) I think if you upgrade to CMake 2.6.4 this warning will go away. > > FYI, it's still around with cmake 2.6.4, i.e.: -- Boost version: 1.38.0 -- Found the following Boost libraries: CMake Warning (dev) at CMakeLists.txt:1005 (FIND_PACKAGE): Policy CMP0011 is not set: Included scripts do automatic cmake_policy PUSH and POP. Run "cmake --help-policy CMP0011" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The included script /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMake/FindBoost.cmake affects policy settings. CMake is implying the NO_POLICY_SCOPE option for compatibility, so the effects are applied to the including context. This warning is for project developers. Use -Wno-dev to suppress it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Wed May 13 14:18:59 2009 From: drescherjm at gmail.com (John Drescher) Date: Wed, 13 May 2009 14:18:59 -0400 Subject: [vtkusers] CMake error In-Reply-To: <387ee2020905131118y27315a94g6031862633ac276e@mail.gmail.com> References: <000001c9d4bd$dc69abb0$cbd1844f@Hossein> <387ee2020905131118y27315a94g6031862633ac276e@mail.gmail.com> Message-ID: <387ee2020905131118x6f05396bn434dc8e2e69eb99b@mail.gmail.com> On Wed, May 13, 2009 at 2:18 PM, John Drescher wrote: > On Thu, May 14, 2009 at 2:00 PM, Hossein Ghadiri > wrote: >> Dears, >> >> I am trying to use CMake 2.6-patch 4 to build VTK 5.4.0, >> >> I did fully install VS8-2005, >> >> But here is error generated by CMake: >> >> >> >> Check for working C compiler: cl >> >> Check for working C compiler: cl -- broken >> >> CMake Error at C:/Program Files/CMake >> 2.6/share/cmake-2.6/Modules/CMakeTestCCompiler.cmake:32 (MESSAGE): >> >> The C compiler "cl" is not able to compile a simple test program. >> >> It fails with the following output: >> >> Change Dir: F:/11-Programing/ITK & >> VTK/vtk/source/vtk-5.4.0/built/CMakeFiles/CMakeTmp >> >> Run Build Command:E:\PROGRA~1\MICROS~1\Common7\IDE\devenv.com >> >> CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec >> >> Microsoft (R) Visual Studio Version 8.0.50727.42. >> >> Copyright (C) Microsoft Corp 1984-2005. All rights reserved. >> >> The following error has occurred during XML parsing: >> >> File: F:\11-Programing\ITK & >> >> VTK\vtk\source\vtk-5.4.0\built\CMakeFiles\CMakeTmp\cmTryCompileExec.vcproj >> >> Line: 37 >> >> Column: 52 >> >> Error Message: >> >> Illegal name character. >> >> The file 'F:\11-Programing\ITK & >> >> VTK\vtk\source\vtk-5.4.0\built\CMakeFiles\CMakeTmp\cmTryCompileExec.vcproj' >> >> has failed to load. >> >> Invalid project >> >> Use: >> >> devenv [solutionfile | projectfile | anyfile.ext] [switches] >> >> The first argument for devenv is usually a solution file or project file. >> >> You can also use any other file as the first argument if you want to have >> >> the >> >> file open automatically in an editor. When you enter a project file, the >> >> IDE >> >> looks for an .sln file with the same base name as the project file in the >> >> parent directory for the project file. If no such .sln file exists, then >> >> the >> >> IDE looks for a single .sln file that references the project. If no such >> >> single >> >> .sln file exists, then the IDE creates an unsaved solution with a default >> >> .sln >> >> file name that has the same base name as the project file. >> >> Command line builds: >> >> devenv solutionfile.sln /build solutionconfig [ /project projectnameorfile >> >> [ /projectconfig name ] ] >> >> Available command line switches: >> >> /Build Builds the solution or project with the specified solution >> >> configuration. For example "Debug". If multiple platforms >> >> are possible, the configuration name must be enclosed in quotes >> >> and contain platform name. For example: "Debug|Win32". >> >> /Clean Deletes build outputs. >> >> /Command Starts the IDE and executes the command. >> >> /Deploy Builds and then deploys the specified build configuration. >> >> /Edit Opens the specified files in a running instance of this >> >> application. If there are no running instances, it will >> >> start a new instance with a simplified window layout. >> >> /LCID Sets the default language in the IDE for the UI. >> >> /Log Logs IDE activity to the specified file for troubleshooting. >> >> /NoVSIP Disables the VSIP developer's license key for VSIP testing. >> >> /Out Appends the build log to a specified file. >> >> /Project Specifies the project to build, clean, or deploy. >> >> Must be used with /Build, /Rebuild, /Clean, or /Deploy. >> >> /ProjectConfig Overrides the project configuration specified in the >> >> solution >> >> configuration. For example "Debug". If multiple platforms are >> >> possible, the configuration name must be enclosed in quotes >> >> and contain platform name. For example: "Debug|Win32". >> >> Must be used with /Project. >> >> /Rebuild Cleans and then builds the solution or project with the >> >> specified configuration. >> >> /ResetAddin Removes commands and command UI associated with the specified >> >> Add-in. >> >> /ResetSettings Restores the IDE's default settings, optionally resets to >> >> the specified VSSettings file. >> >> /ResetSkipPkgs Clears all SkipLoading tags added to VSPackages. >> >> /Run Compiles and runs the specified solution. >> >> /RunExit Compiles and runs the specified solution then closes the IDE. >> >> /SafeMode Launches the IDE in safe mode loading minimal windows. >> >> /Upgrade Upgrades the project or the solution and all projects in it. >> >> A backup of these files will be created as appropriate. Please >> >> see Help on 'Visual Studio Conversion Wizard' for more >> >> information on the backup process. >> >> Product-specific switches: >> >> /debugexe Open the specified executable to be debugged. The >> >> remainder of the command line is passed to this >> >> executable as its arguments. >> >> /useenv Use PATH, INCLUDE, LIBPATH, and LIB environment variables >> >> instead of IDE paths for VC++ builds. >> >> To attach the debugger from the command line, use: >> >> VsJITDebugger.exe -p >> >> CMake will not be able to correctly generate this project. >> >> Call Stack (most recent call first): >> >> CMakeLists.txt:5 (PROJECT) >> >> Configuring incomplete, errors occurred! >> >> >> >> Any body can help me? >> > Try it without the & symbol in the path name. > -- John M. Drescher From mike.jackson at bluequartz.net Wed May 13 14:26:03 2009 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Wed, 13 May 2009 14:26:03 -0400 Subject: [vtkusers] vtk 5.4.0 FindBoost.cmake warning In-Reply-To: References: Message-ID: <8D31F5F4-8A3F-4853-955F-CE0251E5BF57@bluequartz.net> The problem is that VTK decided to use its own implementation of FindBoost.cmake instead of relying on the one from CMake which is _kind of_ understandable. I think what _really_ needs to happen is that the VTK code needs to figure out what version of CMake is being used then only use it's own FindBoost.cmake if CMake is less than probably 2.6.3. --- Mike Jackson www.bluequartz.net On May 13, 2009, at 2:11 PM, Darren Weber wrote: > > On Wed, May 13, 2009 at 8:18 AM, Wylie, Brian > wrote: > 1) This can safely be ignored > 2) I think if you upgrade to CMake 2.6.4 this warning will go away. > > > > FYI, it's still around with cmake 2.6.4, i.e.: > > -- Boost version: 1.38.0 > -- Found the following Boost libraries: > CMake Warning (dev) at CMakeLists.txt:1005 (FIND_PACKAGE): > Policy CMP0011 is not set: Included scripts do automatic > cmake_policy PUSH > and POP. Run "cmake --help-policy CMP0011" for policy details. > Use the > cmake_policy command to set the policy and suppress this warning. > > The included script > > /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk- > devel/work/vtk-5.4/CMake/FindBoost.cmake > > affects policy settings. CMake is implying the NO_POLICY_SCOPE > option for > compatibility, so the effects are applied to the including context. > This warning is for project developers. Use -Wno-dev to suppress it. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 From christopher.e.kees at usace.army.mil Wed May 13 15:05:07 2009 From: christopher.e.kees at usace.army.mil (Chris Kees) Date: Wed, 13 May 2009 14:05:07 -0500 Subject: [vtkusers] embedded VTK window in PyQt application In-Reply-To: <4A0B00F4.7090108@arl.army.mil> References: <4A0AC545.7070206@arl.army.mil> <4A0B00F4.7090108@arl.army.mil> Message-ID: <5AAA6F8A-3193-42B1-A05B-CB406954C5AE@usace.army.mil> John, I ran on Mac OS X 10.5.6 and CentOS 5 (x86_64), which I think is equivalent to RHEL5. My vtk/qt configuration is non-standard (Qt 4.5.1, vtk-5.5), but I'm pretty sure that script should run. I've attached an old one of mine that ran fine under a "supported" vtk/qt/ python configuration. Chris -------------- next part -------------- A non-text attachment was scrubbed... Name: exercise3c.py Type: text/x-python-script Size: 2755 bytes Desc: not available URL: -------------- next part -------------- On May 13, 2009, at 12:18 PM, John Vines (CISD/HPCD) wrote: > Chris, > Thanks for the response. Yes, I tried embedding the VTK window in > a QFrame too but it core dumps on my RHEL4 box? I tried your > updated script and it has the same result. What OS are you on? > > Thanks again, > John > > Chris Kees wrote: >> Hey John, >> >> I had a similar problem and ended up putting the >> QVTKRenderWindowInteractor in a Frame. I don't have a rational >> explanation. I've included a modified version of your test script. >> >> Chris >> #!/usr/bin/env python >> >> import sys >> import vtk >> from vtk.qt4.QVTKRenderWindowInteractor import >> QVTKRenderWindowInteractor >> from PyQt4 import Qt >> from PyQt4 import QtGui >> class test(Qt.QMainWindow): >> """Test class""" >> def __init__(self, parent=None): >> Qt.QMainWindow.__init__(self, parent) >> self.setWindowTitle(self.tr("PyQt4 VTK test")) >> self.workspace = Qt.QWorkspace() >> self.setCentralWidget(self.workspace) >> self.frame = QtGui.QFrame(self.workspace) >> self.hbox = QtGui.QHBoxLayout() >> # create the widget >> self.widget = QVTKRenderWindowInteractor(self.frame) >> self.widget.Initialize() >> self.widget.Start() >> # if you dont want the 'q' key to exit comment this. >> self.widget.AddObserver("ExitEvent", lambda o, e, a=app: >> a.quit()) >> self.cone = vtk.vtkConeSource() >> self.cone.SetResolution(8) >> self.coneMapper = vtk.vtkPolyDataMapper() >> self.coneMapper.SetInput(self.cone.GetOutput()) >> self.coneActor = vtk.vtkActor() >> self.coneActor.SetMapper(self.coneMapper) >> self.ren = vtk.vtkRenderer() >> self.ren.AddActor(self.coneActor) >> self.renWin=self.widget.GetRenderWindow() >> self.renWin.AddRenderer(self.ren) >> self.hbox.addWidget(self.widget) >> self.frame.setLayout(self.hbox) >> self.workspace.addWindow(self.frame) >> >> if __name__ == "__main__": >> app = Qt.QApplication(sys.argv) >> mainwindow = test() >> mainwindow.show() >> sys.exit(app.exec_()) >> >> On May 13, 2009, at 8:04 AM, John Vines (CISD/HPCD) wrote: >> >>> #!/usr/bin/env python >>> >>> import sys >>> import vtk >>> from vtk.qt4.QVTKRenderWindowInteractor import >>> QVTKRenderWindowInteractor >>> from PyQt4 import Qt >>> >>> class test(Qt.QMainWindow): >>> """Test class""" >>> def __init__(self, parent=None): >>> Qt.QMainWindow.__init__(self, parent) >>> self.setWindowTitle(self.tr("PyQt4 VTK test")) >>> self.workspace = Qt.QWorkspace() >>> self.setCentralWidget(self.workspace) >>> >>> # create the widget >>> self.widget = QVTKRenderWindowInteractor() >>> self.widget.Initialize() >>> self.widget.Start() >>> >>> # if you dont want the 'q' key to exit comment this. >>> self.widget.AddObserver("ExitEvent", lambda o, e, a=app: >>> a.quit()) >>> self.ren = vtk.vtkRenderer() >>> self.widget.GetRenderWindow().AddRenderer(self.ren) >>> self.cone = vtk.vtkConeSource() >>> self.cone.SetResolution(8) >>> self.coneMapper = vtk.vtkPolyDataMapper() >>> self.coneMapper.SetInput(self.cone.GetOutput()) >>> self.coneActor = vtk.vtkActor() >>> self.coneActor.SetMapper(self.coneMapper) >>> self.ren.AddActor(self.coneActor) >>> self.workspace.addWindow(self.widget) >>> >>> if __name__ == "__main__": >>> app = Qt.QApplication(sys.argv) >>> mainwindow = test() >>> mainwindow.show() >>> sys.exit(app.exec_()) >> > From darren.weber.lists at gmail.com Wed May 13 15:46:12 2009 From: darren.weber.lists at gmail.com (Darren Weber) Date: Wed, 13 May 2009 12:46:12 -0700 Subject: [vtkusers] Advice on how to configure vtk 5.4.0 with mpich2 on OSX (with MacPorts) Message-ID: Hi, I need help from anyone with experience and an understanding of the MPI build for vtk. I would really appreciate advice on how to configure vtk 5.4.0 with mpich2 on OSX. There appears to be an mpi installation already on OSX (10.5.6) that cmake picks up automatically. I also have an alternate installation of mpich2 provided by MacPorts (see the postscript below for all the details of that install). I really need advice on how to change the config parameters so the build will use this alternative mpich2 installation. I can guess most of it, but a few things are not clear to me. What I can guess to change are the following, so that it will use the mpich2 install provided by MacPorts: -DVTK_USE_MPI:BOOL=ON -DMPIEXEC:FILEPATH=/opt/local/bin/mpiexec \ -DMPIEXEC_NUMPROC_FLAG:STRING=-np \ -DMPIEXEC_MAX_NUMPROCS:STRING=${nCPU} \ -DMPIEXEC_PREFLAGS:STRING= \ -DMPIEXEC_POSTFLAGS:STRING= \ -DMPI_COMPILER:FILEPATH=/opt/local/bin/mpicxx \ -DMPI_INCLUDE_PATH:STRING=/opt/local/include/mpich2 \ -DMPI_LIBRARY:FILEPATH=/opt/local/lib/libmpichcxx.dylib How are following variables set? #// MPI compilation flags (automatically determined from MPI_COMPILER) #MPI_COMPILE_FLAGS:STRING=-D_REENTRANT #// Extra MPI libraries to link against #MPI_EXTRA_LIBRARY:STRING=/usr/lib/libmpi.dylib;/usr/lib/libopen-rte.dylib;/usr/lib/libopen-pal.dylib;/usr/lib/libutil.dylib #// MPI linking flags #MPI_LINK_FLAGS:STRING=-Wl,-u,_munmap -Wl,-multiply_defined,suppress What follows is a list of all the config variable settings that are automatically determined by cmake 2.6.4, with VTK_USE_MPI turned on in the command line call to cmake (the result is a mixture of the Apple OSX mpi install and the mpich2 install from MacPorts, which is all under the /opt/local prefix -- see postscript below for details). What I don't understand is how cmake sets these variables (is there a macro for this?). In particular, I need to understand how it sets the MPI_EXTRA_LIBRARY and other compiler and link flags. I also need to understand the relationship(s) between the MPI* and the VTK_MPI* configuration variables. ##### BEGIN cmake auto config variables for MPI // Executable for running MPI programs. MPIEXEC:FILEPATH=/opt/local/bin/mpiexec // Maximum number of processors available to run MPI applications. MPIEXEC_MAX_NUMPROCS:STRING=2 // Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes. MPIEXEC_NUMPROC_FLAG:STRING=-np // These flags will come after all flags given to MPIEXEC. MPIEXEC_POSTFLAGS:STRING= // These flags will be directly before the executable that is being run by MPIEXEC. MPIEXEC_PREFLAGS:STRING= // MPI compiler. Used only to detect MPI compilation flags. MPI_COMPILER:FILEPATH=/usr/bin/mpic++ // MPI compilation flags MPI_COMPILE_FLAGS:STRING=-D_REENTRANT // Extra MPI libraries to link against MPI_EXTRA_LIBRARY:STRING=/usr/lib/libmpi.dylib;/usr/lib/libopen-rte.dylib;/usr/lib/libopen-pal.dylib;/usr/lib/libutil.dylib // MPI include path MPI_INCLUDE_PATH:STRING=/usr/include // MPI library to link against MPI_LIBRARY:FILEPATH=/usr/lib/libmpi_cxx.dylib // MPI linking flags MPI_LINK_FLAGS:STRING=-Wl,-u,_munmap -Wl,-multiply_defined,suppress ##### END cmake auto config variables for MPI* ##### BEGIN cmake auto config variables for VTK_MPI* // Path to a program. VTK_MPIRUN_EXE:FILEPATH=/opt/local/bin/mpirun // Maximum number of processors available to run parallel applications. (see /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMakeLists.txt for more info.) VTK_MPI_MAX_NUMPROCS:STRING=2 // Flag used by mpi to specify the number of processes, the next option will be the number of processes. (see /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMakeLists.txt for more info.) VTK_MPI_NUMPROC_FLAG:STRING=-np // These flags will come after all flags given to MPIRun.(see /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMakeLists.txt for more info.) VTK_MPI_POSTFLAGS:STRING= // These flags will be directly before the executable that is being run by VTK_MPIRUN_EXE. (see /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMakeLists.txt for more info.) VTK_MPI_PREFLAGS:STRING= // These flags will be directly before the number of processess flag (see /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMakeLists.txt for more info.) VTK_MPI_PRENUMPROC_FLAGS:STRING= ##### END cmake auto config variables for VTK_MPI* Thanks in advance, Darren PS, this is a content listing for the mpich2 install from MacPorts (currently mpich2 @1.0.8): Port mpich2 contains: /opt/local/bin/check_callstack /opt/local/bin/clog2_join /opt/local/bin/clog2_print /opt/local/bin/clog2_repair /opt/local/bin/clog2print /opt/local/bin/clog2TOslog2 /opt/local/bin/clogprint /opt/local/bin/clogTOslog2 /opt/local/bin/jumpshot /opt/local/bin/logconvertor /opt/local/bin/mpd /opt/local/bin/mpd.py /opt/local/bin/mpdallexit /opt/local/bin/mpdallexit.py /opt/local/bin/mpdboot /opt/local/bin/mpdboot.py /opt/local/bin/mpdcheck /opt/local/bin/mpdcheck.py /opt/local/bin/mpdchkpyver.py /opt/local/bin/mpdcleanup /opt/local/bin/mpdcleanup.py /opt/local/bin/mpdexit /opt/local/bin/mpdexit.py /opt/local/bin/mpdgdbdrv.py /opt/local/bin/mpdhelp /opt/local/bin/mpdhelp.py /opt/local/bin/mpdkilljob /opt/local/bin/mpdkilljob.py /opt/local/bin/mpdlib.py /opt/local/bin/mpdlistjobs /opt/local/bin/mpdlistjobs.py /opt/local/bin/mpdman.py /opt/local/bin/mpdringtest /opt/local/bin/mpdringtest.py /opt/local/bin/mpdroot /opt/local/bin/mpdrun /opt/local/bin/mpdrun.py /opt/local/bin/mpdsigjob /opt/local/bin/mpdsigjob.py /opt/local/bin/mpdtrace /opt/local/bin/mpdtrace.py /opt/local/bin/mpecc.in /opt/local/bin/mpefc.in /opt/local/bin/mpicc /opt/local/bin/mpich2version /opt/local/bin/mpicxx /opt/local/bin/mpiexec /opt/local/bin/mpiexec.py /opt/local/bin/mpirun /opt/local/bin/mpirun.py /opt/local/bin/parkill /opt/local/bin/rlog_check_timeorder /opt/local/bin/rlog_print /opt/local/bin/rlogprint /opt/local/bin/rlogTOslog2 /opt/local/bin/slog2filter /opt/local/bin/slog2navigator /opt/local/bin/slog2print /opt/local/bin/slog2updater /opt/local/bin/traceprint.in /opt/local/bin/traceTOslog2.in /opt/local/etc/mpe_callstack_ldflags.conf /opt/local/etc/mpe_f77env.conf /opt/local/etc/mpe_f77env.conf.in /opt/local/etc/mpe_graphics.conf /opt/local/etc/mpe_help.conf /opt/local/etc/mpe_help.conf.in /opt/local/etc/mpe_log.conf /opt/local/etc/mpe_log_postlib.conf /opt/local/etc/mpe_mpianim.conf /opt/local/etc/mpe_mpicheck.conf /opt/local/etc/mpe_mpilog.conf /opt/local/etc/mpe_mpitrace.conf /opt/local/etc/mpe_nolog.conf /opt/local/etc/mpicc.conf /opt/local/etc/mpicxx.conf /opt/local/etc/mpixxx_opts.conf /opt/local/include/mpich2/clog_commset.h /opt/local/include/mpich2/clog_const.h /opt/local/include/mpich2/clog_inttypes.h /opt/local/include/mpich2/clog_uuid.h /opt/local/include/mpich2/mpe.h /opt/local/include/mpich2/mpe_callstack.h /opt/local/include/mpich2/mpe_graphics.h /opt/local/include/mpich2/mpe_graphicsf.h /opt/local/include/mpich2/mpe_log.h /opt/local/include/mpich2/mpe_log_thread.h /opt/local/include/mpich2/mpe_logf.h /opt/local/include/mpich2/mpe_misc.h /opt/local/include/mpich2/mpe_thread.h /opt/local/include/mpich2/mpi.h /opt/local/include/mpich2/mpicxx.h /opt/local/include/mpich2/mpio.h /opt/local/include/mpich2/mpiof.h /opt/local/lib/clog2print.jar /opt/local/lib/clog2TOdrawable.jar /opt/local/lib/clog2TOslog2.jar /opt/local/lib/clogprint.jar /opt/local/lib/clogTOdrawable.jar /opt/local/lib/clogTOslog2.jar /opt/local/lib/jumpshot.jar /opt/local/lib/jumpshot_launcher.jar /opt/local/lib/libampe.a /opt/local/lib/liblmpe.a /opt/local/lib/libmpe.a /opt/local/lib/libmpe_collchk.a /opt/local/lib/libmpe_nompi.a /opt/local/lib/libmpe_nompi_null.a /opt/local/lib/libmpe_null.a /opt/local/lib/libmpich.1.1.dylib /opt/local/lib/libmpich.1.dylib /opt/local/lib/libmpich.a /opt/local/lib/libmpich.dylib /opt/local/lib/libmpichcxx.1.1.dylib /opt/local/lib/libmpichcxx.1.dylib /opt/local/lib/libmpichcxx.a /opt/local/lib/libmpichcxx.dylib /opt/local/lib/libpmpich.1.1.dylib /opt/local/lib/libpmpich.1.dylib /opt/local/lib/libpmpich.a /opt/local/lib/libpmpich.dylib /opt/local/lib/libtmpe.a /opt/local/lib/logconvertor.jar /opt/local/lib/mpe_prof.o /opt/local/lib/pkgconfig/mpich2-ch3.pc /opt/local/lib/slog2filter.jar /opt/local/lib/slog2navigator.jar /opt/local/lib/slog2printrecur.jar /opt/local/lib/slog2printserial.jar /opt/local/lib/slog2update205to206.jar /opt/local/lib/trace_rlog/libTraceInput.jnilib /opt/local/lib/trace_rlog/libTraceInput.la /opt/local/lib/traceprint.jar /opt/local/lib/traceTOslog2.jar /opt/local/sbin/mpecheckinstall /opt/local/sbin/mpetestexec /opt/local/sbin/mpetestexeclog /opt/local/sbin/mpetestlink /opt/local/sbin/mpeuninstall ... (snipped out documentation) PPS, in case it makes any difference, these are all the configure options set for vtk 5.4.0 with cmake 2.6.4: -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=/opt/local -DCMAKE_INCLUDE_PATH:PATH=/opt/local/include -DCMAKE_LIBRARY_PATH:PATH=/opt/local/lib -DCMAKE_INSTALL_NAME_DIR:STRING=/opt/local/lib/vtk-5.4 -DBUILD_DOCUMENTATION:BOOL=OFF -DVTK_DEBUG_LEAKS:BOOL=ON -DVTK_USE_CARBON:BOOL=OFF -DVTK_USE_X:BOOL=OFF -DVTK_USE_HYBRID:BOOL=ON -DVTK_USE_GUISUPPORT:BOOL=ON -DVTK_USE_INFOVIS:BOOL=ON -DVTK_USE_PARALLEL:BOOL=ON -DVTK_USE_RENDERING:BOOL=ON -DVTK_USE_VIEWS:BOOL=ON -DVTK_USE_GL2PS:BOOL=ON -DVTK_USE_N_WAY_ARRAYS:BOOL=ON -DVTK_REQUIRED_OBJCXX_FLAGS="-fobjc-gc" -DVTK_USE_COCOA:BOOL=ON -DVTK_DATA_ROOT:PATH=/opt/local/share/vtk-5.4/data -DBUILD_EXAMPLES:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_SKIP_BUILD_RPATH:BOOL=OFF -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF -DCMAKE_INSTALL_RPATH:STRING=/opt/local/lib/vtk-5.4 -DVTK_USE_RPATH:BOOL=ON -DBUILD_TESTING:BOOL=ON -DVTK_WRAP_JAVA:BOOL=ON -DVTK_WRAP_PYTHON:BOOL=ON -DVTK_NO_PYTHON_THREADS:BOOL=OFF -DPYTHON_INCLUDE_PATH:FILEPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Headers -DPYTHON_LIBRARY:FILEPATH=/opt/local/lib/libpython2.6.dylib -DPYTHON_DEBUG_LIBRARY:FILEPATH=/opt/local/lib/libpython2.6.dylib -DPYTHON_EXECUTABLE:FILEPATH=/opt/local/bin/python2.6 -DVTK_PYTHON_SETUP_ARGS:STRING=--prefix=/opt/local/Library/Frameworks/Python.framework/Versions/2.6 --root=/opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/destroot -DVTK_WRAP_TCL:BOOL=ON -DTCL_TCLSH:FILEPATH=/opt/local/bin/tclsh -DTCL_INCLUDE_PATH:PATH=/opt/local/include -DTCL_LIBRARY:FILEPATH=/opt/local/lib/libtcl.dylib -DTK_INCLUDE_PATH:PATH=/opt/local/include -DTK_LIBRARY:FILEPATH=/opt/local/lib/libtk.dylib -DVTK_USE_ODBC:BOOL=ON -DODBC_INCLUDE_DIRECTORIES:PATH=/opt/local/include -DODBC_LIBRARY:FILEPATH=/opt/local/lib/libodbc.dylib -DVTK_USE_MPI:BOOL=ON -DVTK_USE_BOOST:BOOL=ON -------------- next part -------------- An HTML attachment was scrubbed... URL: From darren.weber.lists at gmail.com Wed May 13 15:54:02 2009 From: darren.weber.lists at gmail.com (Darren Weber) Date: Wed, 13 May 2009 12:54:02 -0700 Subject: [vtkusers] Advice on how to configure vtk 5.4.0 with mpich2 on OSX (with MacPorts) In-Reply-To: References: Message-ID: In part answer to my own question, I found the module for FindMPI.cmake in /opt/local/share/cmake-2.6/Modules/FindMPI.cmake On Wed, May 13, 2009 at 12:46 PM, Darren Weber wrote: > > Hi, > > I need help from anyone with experience and an understanding of the MPI > build for vtk. I would really appreciate advice on how to configure vtk > 5.4.0 with mpich2 on OSX. There appears to be an mpi installation already > on OSX (10.5.6) that cmake picks up automatically. I also have an alternate > installation of mpich2 provided by MacPorts (see the postscript below for > all the details of that install). I really need advice on how to change the > config parameters so the build will use this alternative mpich2 > installation. I can guess most of it, but a few things are not clear to me. > > What I can guess to change are the following, so that it will use the > mpich2 install provided by MacPorts: > > -DVTK_USE_MPI:BOOL=ON > -DMPIEXEC:FILEPATH=/opt/local/bin/mpiexec \ > -DMPIEXEC_NUMPROC_FLAG:STRING=-np \ > -DMPIEXEC_MAX_NUMPROCS:STRING=${nCPU} \ > -DMPIEXEC_PREFLAGS:STRING= \ > -DMPIEXEC_POSTFLAGS:STRING= \ > -DMPI_COMPILER:FILEPATH=/opt/local/bin/mpicxx \ > -DMPI_INCLUDE_PATH:STRING=/opt/local/include/mpich2 \ > -DMPI_LIBRARY:FILEPATH=/opt/local/lib/libmpichcxx.dylib > > How are following variables set? > > #// MPI compilation flags (automatically determined from MPI_COMPILER) > #MPI_COMPILE_FLAGS:STRING=-D_REENTRANT > > #// Extra MPI libraries to link against > > #MPI_EXTRA_LIBRARY:STRING=/usr/lib/libmpi.dylib;/usr/lib/libopen-rte.dylib;/usr/lib/libopen-pal.dylib;/usr/lib/libutil.dylib > > #// MPI linking flags > #MPI_LINK_FLAGS:STRING=-Wl,-u,_munmap -Wl,-multiply_defined,suppress > > > What follows is a list of all the config variable settings that are > automatically determined by cmake 2.6.4, with VTK_USE_MPI turned on in the > command line call to cmake (the result is a mixture of the Apple OSX mpi > install and the mpich2 install from MacPorts, which is all under the > /opt/local prefix -- see postscript below for details). What I don't > understand is how cmake sets these variables (is there a macro for this?). > In particular, I need to understand how it sets the MPI_EXTRA_LIBRARY and > other compiler and link flags. I also need to understand the > relationship(s) between the MPI* and the VTK_MPI* configuration variables. > > ##### BEGIN cmake auto config variables for MPI > > // Executable for running MPI programs. > MPIEXEC:FILEPATH=/opt/local/bin/mpiexec > > // Maximum number of processors available to run MPI applications. > MPIEXEC_MAX_NUMPROCS:STRING=2 > > // Flag used by MPI to specify the number of processes for MPIEXEC; the > next option will be the number of processes. > MPIEXEC_NUMPROC_FLAG:STRING=-np > > // These flags will come after all flags given to MPIEXEC. > MPIEXEC_POSTFLAGS:STRING= > > // These flags will be directly before the executable that is being run by > MPIEXEC. > MPIEXEC_PREFLAGS:STRING= > > // MPI compiler. Used only to detect MPI compilation flags. > MPI_COMPILER:FILEPATH=/usr/bin/mpic++ > > // MPI compilation flags > MPI_COMPILE_FLAGS:STRING=-D_REENTRANT > > // Extra MPI libraries to link against > > MPI_EXTRA_LIBRARY:STRING=/usr/lib/libmpi.dylib;/usr/lib/libopen-rte.dylib;/usr/lib/libopen-pal.dylib;/usr/lib/libutil.dylib > > // MPI include path > MPI_INCLUDE_PATH:STRING=/usr/include > > // MPI library to link against > MPI_LIBRARY:FILEPATH=/usr/lib/libmpi_cxx.dylib > > // MPI linking flags > MPI_LINK_FLAGS:STRING=-Wl,-u,_munmap -Wl,-multiply_defined,suppress > > ##### END cmake auto config variables for MPI* > > ##### BEGIN cmake auto config variables for VTK_MPI* > > // Path to a program. > VTK_MPIRUN_EXE:FILEPATH=/opt/local/bin/mpirun > > // Maximum number of processors available to run parallel applications. > (see > /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMakeLists.txt > for more info.) > VTK_MPI_MAX_NUMPROCS:STRING=2 > > // Flag used by mpi to specify the number of processes, the next option > will be the number of processes. (see > /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMakeLists.txt > for more info.) > VTK_MPI_NUMPROC_FLAG:STRING=-np > > // These flags will come after all flags given to MPIRun.(see > /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMakeLists.txt > for more info.) > VTK_MPI_POSTFLAGS:STRING= > > // These flags will be directly before the executable that is being run by > VTK_MPIRUN_EXE. (see > /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMakeLists.txt > for more info.) > VTK_MPI_PREFLAGS:STRING= > > // These flags will be directly before the number of processess flag (see > /opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/vtk-5.4/CMakeLists.txt > for more info.) > VTK_MPI_PRENUMPROC_FLAGS:STRING= > > ##### END cmake auto config variables for VTK_MPI* > > > > > Thanks in advance, > Darren > > > PS, this is a content listing for the mpich2 install from MacPorts > (currently mpich2 @1.0.8): > > Port mpich2 contains: > /opt/local/bin/check_callstack > /opt/local/bin/clog2_join > /opt/local/bin/clog2_print > /opt/local/bin/clog2_repair > /opt/local/bin/clog2print > /opt/local/bin/clog2TOslog2 > /opt/local/bin/clogprint > /opt/local/bin/clogTOslog2 > /opt/local/bin/jumpshot > /opt/local/bin/logconvertor > /opt/local/bin/mpd > /opt/local/bin/mpd.py > /opt/local/bin/mpdallexit > /opt/local/bin/mpdallexit.py > /opt/local/bin/mpdboot > /opt/local/bin/mpdboot.py > /opt/local/bin/mpdcheck > /opt/local/bin/mpdcheck.py > /opt/local/bin/mpdchkpyver.py > /opt/local/bin/mpdcleanup > /opt/local/bin/mpdcleanup.py > /opt/local/bin/mpdexit > /opt/local/bin/mpdexit.py > /opt/local/bin/mpdgdbdrv.py > /opt/local/bin/mpdhelp > /opt/local/bin/mpdhelp.py > /opt/local/bin/mpdkilljob > /opt/local/bin/mpdkilljob.py > /opt/local/bin/mpdlib.py > /opt/local/bin/mpdlistjobs > /opt/local/bin/mpdlistjobs.py > /opt/local/bin/mpdman.py > /opt/local/bin/mpdringtest > /opt/local/bin/mpdringtest.py > /opt/local/bin/mpdroot > /opt/local/bin/mpdrun > /opt/local/bin/mpdrun.py > /opt/local/bin/mpdsigjob > /opt/local/bin/mpdsigjob.py > /opt/local/bin/mpdtrace > /opt/local/bin/mpdtrace.py > /opt/local/bin/mpecc.in > /opt/local/bin/mpefc.in > /opt/local/bin/mpicc > /opt/local/bin/mpich2version > /opt/local/bin/mpicxx > /opt/local/bin/mpiexec > /opt/local/bin/mpiexec.py > /opt/local/bin/mpirun > /opt/local/bin/mpirun.py > /opt/local/bin/parkill > /opt/local/bin/rlog_check_timeorder > /opt/local/bin/rlog_print > /opt/local/bin/rlogprint > /opt/local/bin/rlogTOslog2 > /opt/local/bin/slog2filter > /opt/local/bin/slog2navigator > /opt/local/bin/slog2print > /opt/local/bin/slog2updater > /opt/local/bin/traceprint.in > /opt/local/bin/traceTOslog2.in > /opt/local/etc/mpe_callstack_ldflags.conf > /opt/local/etc/mpe_f77env.conf > /opt/local/etc/mpe_f77env.conf.in > /opt/local/etc/mpe_graphics.conf > /opt/local/etc/mpe_help.conf > /opt/local/etc/mpe_help.conf.in > /opt/local/etc/mpe_log.conf > /opt/local/etc/mpe_log_postlib.conf > /opt/local/etc/mpe_mpianim.conf > /opt/local/etc/mpe_mpicheck.conf > /opt/local/etc/mpe_mpilog.conf > /opt/local/etc/mpe_mpitrace.conf > /opt/local/etc/mpe_nolog.conf > /opt/local/etc/mpicc.conf > /opt/local/etc/mpicxx.conf > /opt/local/etc/mpixxx_opts.conf > /opt/local/include/mpich2/clog_commset.h > /opt/local/include/mpich2/clog_const.h > /opt/local/include/mpich2/clog_inttypes.h > /opt/local/include/mpich2/clog_uuid.h > /opt/local/include/mpich2/mpe.h > /opt/local/include/mpich2/mpe_callstack.h > /opt/local/include/mpich2/mpe_graphics.h > /opt/local/include/mpich2/mpe_graphicsf.h > /opt/local/include/mpich2/mpe_log.h > /opt/local/include/mpich2/mpe_log_thread.h > /opt/local/include/mpich2/mpe_logf.h > /opt/local/include/mpich2/mpe_misc.h > /opt/local/include/mpich2/mpe_thread.h > /opt/local/include/mpich2/mpi.h > /opt/local/include/mpich2/mpicxx.h > /opt/local/include/mpich2/mpio.h > /opt/local/include/mpich2/mpiof.h > /opt/local/lib/clog2print.jar > /opt/local/lib/clog2TOdrawable.jar > /opt/local/lib/clog2TOslog2.jar > /opt/local/lib/clogprint.jar > /opt/local/lib/clogTOdrawable.jar > /opt/local/lib/clogTOslog2.jar > /opt/local/lib/jumpshot.jar > /opt/local/lib/jumpshot_launcher.jar > /opt/local/lib/libampe.a > /opt/local/lib/liblmpe.a > /opt/local/lib/libmpe.a > /opt/local/lib/libmpe_collchk.a > /opt/local/lib/libmpe_nompi.a > /opt/local/lib/libmpe_nompi_null.a > /opt/local/lib/libmpe_null.a > /opt/local/lib/libmpich.1.1.dylib > /opt/local/lib/libmpich.1.dylib > /opt/local/lib/libmpich.a > /opt/local/lib/libmpich.dylib > /opt/local/lib/libmpichcxx.1.1.dylib > /opt/local/lib/libmpichcxx.1.dylib > /opt/local/lib/libmpichcxx.a > /opt/local/lib/libmpichcxx.dylib > /opt/local/lib/libpmpich.1.1.dylib > /opt/local/lib/libpmpich.1.dylib > /opt/local/lib/libpmpich.a > /opt/local/lib/libpmpich.dylib > /opt/local/lib/libtmpe.a > /opt/local/lib/logconvertor.jar > /opt/local/lib/mpe_prof.o > /opt/local/lib/pkgconfig/mpich2-ch3.pc > /opt/local/lib/slog2filter.jar > /opt/local/lib/slog2navigator.jar > /opt/local/lib/slog2printrecur.jar > /opt/local/lib/slog2printserial.jar > /opt/local/lib/slog2update205to206.jar > /opt/local/lib/trace_rlog/libTraceInput.jnilib > /opt/local/lib/trace_rlog/libTraceInput.la > /opt/local/lib/traceprint.jar > /opt/local/lib/traceTOslog2.jar > /opt/local/sbin/mpecheckinstall > /opt/local/sbin/mpetestexec > /opt/local/sbin/mpetestexeclog > /opt/local/sbin/mpetestlink > /opt/local/sbin/mpeuninstall > ... (snipped out documentation) > > > > > PPS, in case it makes any difference, these are all the configure options > set for vtk 5.4.0 with cmake 2.6.4: > > -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk > -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo > -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON > -DCMAKE_INSTALL_PREFIX:PATH=/opt/local > -DCMAKE_INCLUDE_PATH:PATH=/opt/local/include > -DCMAKE_LIBRARY_PATH:PATH=/opt/local/lib > -DCMAKE_INSTALL_NAME_DIR:STRING=/opt/local/lib/vtk-5.4 > -DBUILD_DOCUMENTATION:BOOL=OFF > -DVTK_DEBUG_LEAKS:BOOL=ON > -DVTK_USE_CARBON:BOOL=OFF > -DVTK_USE_X:BOOL=OFF > -DVTK_USE_HYBRID:BOOL=ON > -DVTK_USE_GUISUPPORT:BOOL=ON > -DVTK_USE_INFOVIS:BOOL=ON > -DVTK_USE_PARALLEL:BOOL=ON > -DVTK_USE_RENDERING:BOOL=ON > -DVTK_USE_VIEWS:BOOL=ON > -DVTK_USE_GL2PS:BOOL=ON > -DVTK_USE_N_WAY_ARRAYS:BOOL=ON > -DVTK_REQUIRED_OBJCXX_FLAGS="-fobjc-gc" > -DVTK_USE_COCOA:BOOL=ON > -DVTK_DATA_ROOT:PATH=/opt/local/share/vtk-5.4/data > -DBUILD_EXAMPLES:BOOL=ON > -DBUILD_SHARED_LIBS:BOOL=ON > -DCMAKE_SKIP_BUILD_RPATH:BOOL=OFF > -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF > -DCMAKE_INSTALL_RPATH:STRING=/opt/local/lib/vtk-5.4 > -DVTK_USE_RPATH:BOOL=ON > -DBUILD_TESTING:BOOL=ON > -DVTK_WRAP_JAVA:BOOL=ON > -DVTK_WRAP_PYTHON:BOOL=ON > -DVTK_NO_PYTHON_THREADS:BOOL=OFF > > -DPYTHON_INCLUDE_PATH:FILEPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Headers > -DPYTHON_LIBRARY:FILEPATH=/opt/local/lib/libpython2.6.dylib > -DPYTHON_DEBUG_LIBRARY:FILEPATH=/opt/local/lib/libpython2.6.dylib > -DPYTHON_EXECUTABLE:FILEPATH=/opt/local/bin/python2.6 > -DVTK_PYTHON_SETUP_ARGS:STRING=--prefix=/opt/local/Library/Frameworks/Python.framework/Versions/2.6 > --root=/opt/local/var/macports/build/_Users_dweber_ports_graphics_vtk-devel/work/destroot > -DVTK_WRAP_TCL:BOOL=ON -DTCL_TCLSH:FILEPATH=/opt/local/bin/tclsh > -DTCL_INCLUDE_PATH:PATH=/opt/local/include > -DTCL_LIBRARY:FILEPATH=/opt/local/lib/libtcl.dylib > -DTK_INCLUDE_PATH:PATH=/opt/local/include > -DTK_LIBRARY:FILEPATH=/opt/local/lib/libtk.dylib > -DVTK_USE_ODBC:BOOL=ON > -DODBC_INCLUDE_DIRECTORIES:PATH=/opt/local/include > -DODBC_LIBRARY:FILEPATH=/opt/local/lib/libodbc.dylib > -DVTK_USE_MPI:BOOL=ON > -DVTK_USE_BOOST:BOOL=ON > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvines at arl.army.mil Wed May 13 16:11:52 2009 From: jvines at arl.army.mil (John Vines) Date: Wed, 13 May 2009 16:11:52 -0400 Subject: [vtkusers] embedded VTK window in PyQt application In-Reply-To: <5AAA6F8A-3193-42B1-A05B-CB406954C5AE@usace.army.mil> References: <4A0AC545.7070206@arl.army.mil> <4A0B00F4.7090108@arl.army.mil> <5AAA6F8A-3193-42B1-A05B-CB406954C5AE@usace.army.mil> Message-ID: <4A0B2988.6070500@arl.army.mil> Chris, Thanks but no luck?? I must be doing something wrong when building VTK? I'm building with Qt 4.3.3, enabled VTK_USE_GUISUPPORT and building the QVTK widget/plugin. Do you happen to have the CMakeCache.txt file for your build of VTK? Here are my errors on RHEL4 (x86_64) for the exercise3c.py example: X Error: BadWindow (invalid Window parameter) 3 Major opcode: 2 (X_ChangeWindowAttributes) Resource id: 0x1c00010 X Error: BadWindow (invalid Window parameter) 3 Major opcode: 3 (X_GetWindowAttributes) Resource id: 0x1c00010 Segmentation fault (core dumped) John Chris Kees wrote: > John, > > I ran on Mac OS X 10.5.6 and CentOS 5 (x86_64), which I think is > equivalent to RHEL5. My vtk/qt configuration is non-standard (Qt > 4.5.1, vtk-5.5), but I'm pretty sure that script should run. I've > attached an old one of mine that ran fine under a "supported" > vtk/qt/python configuration. > > Chris > ------------------------------------------------------------------------ > > > > > > On May 13, 2009, at 12:18 PM, John Vines (CISD/HPCD) wrote: > > > >> Chris, Thanks for the response. Yes, I tried embedding the VTK >> window in a QFrame too but it core dumps on my RHEL4 box? I tried >> your updated script and it has the same result. What OS are you on? >> Thanks again, John Chris Kees wrote: >>> Hey John, I had a similar problem and ended up putting the >>> QVTKRenderWindowInteractor in a Frame. I don't have a rational >>> explanation. I've included a modified version of your test script. >>> Chris #!/usr/bin/env python import sys import vtk from >>> vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor >>> from PyQt4 import Qt from PyQt4 import QtGui class >>> test(Qt.QMainWindow): """Test class""" def __init__(self, >>> parent=None): Qt.QMainWindow.__init__(self, parent) >>> self.setWindowTitle(self.tr("PyQt4 VTK test")) self.workspace >>> = Qt.QWorkspace() self.setCentralWidget(self.workspace) >>> self.frame = QtGui.QFrame(self.workspace) self.hbox = >>> QtGui.QHBoxLayout() # create the widget self.widget = >>> QVTKRenderWindowInteractor(self.frame) >>> self.widget.Initialize() self.widget.Start() # if you >>> dont want the 'q' key to exit comment this. >>> self.widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit()) >>> self.cone = vtk.vtkConeSource() >>> self.cone.SetResolution(8) self.coneMapper = >>> vtk.vtkPolyDataMapper() >>> self.coneMapper.SetInput(self.cone.GetOutput()) >>> self.coneActor = vtk.vtkActor() >>> self.coneActor.SetMapper(self.coneMapper) self.ren = >>> vtk.vtkRenderer() self.ren.AddActor(self.coneActor) >>> self.renWin=self.widget.GetRenderWindow() >>> self.renWin.AddRenderer(self.ren) >>> self.hbox.addWidget(self.widget) >>> self.frame.setLayout(self.hbox) >>> self.workspace.addWindow(self.frame) if __name__ == "__main__": >>> app = Qt.QApplication(sys.argv) mainwindow = test() >>> mainwindow.show() sys.exit(app.exec_()) On May 13, 2009, at 8:04 >>> AM, John Vines (CISD/HPCD) wrote: >>>> #!/usr/bin/env python import sys import vtk from >>>> vtk.qt4.QVTKRenderWindowInteractor import >>>> QVTKRenderWindowInteractor from PyQt4 import Qt class >>>> test(Qt.QMainWindow): """Test class""" def __init__(self, >>>> parent=None): Qt.QMainWindow.__init__(self, parent) >>>> self.setWindowTitle(self.tr("PyQt4 VTK test")) >>>> self.workspace = Qt.QWorkspace() >>>> self.setCentralWidget(self.workspace) # create the widget >>>> self.widget = QVTKRenderWindowInteractor() >>>> self.widget.Initialize() self.widget.Start() # if you >>>> dont want the 'q' key to exit comment this. >>>> self.widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit()) >>>> self.ren = vtk.vtkRenderer() >>>> self.widget.GetRenderWindow().AddRenderer(self.ren) >>>> self.cone = vtk.vtkConeSource() self.cone.SetResolution(8) >>>> self.coneMapper = vtk.vtkPolyDataMapper() >>>> self.coneMapper.SetInput(self.cone.GetOutput()) >>>> self.coneActor = vtk.vtkActor() >>>> self.coneActor.SetMapper(self.coneMapper) >>>> self.ren.AddActor(self.coneActor) >>>> self.workspace.addWindow(self.widget) if __name__ == "__main__": >>>> app = Qt.QApplication(sys.argv) mainwindow = test() >>>> mainwindow.show() sys.exit(app.exec_()) > > > From luisrpp at gmail.com Wed May 13 19:02:27 2009 From: luisrpp at gmail.com (Luis Roberto P. Paula) Date: Wed, 13 May 2009 20:02:27 -0300 Subject: [vtkusers] Zoom problem with QT 4.5 (works in previous versions of QT) Message-ID: Hi All, I have an application using QVTKWidget to display the results in a QT window. I set an interactor the get pixel values and also change the value of pixels using the mouse. Everything was ok, but now that I'm using QT 4.5, the first click of the mouse generates an effect of a zoom out in the image. I use then the mouse wheel to set the zoom to the correct place and the other clicks works fine. I have no idea what is going on. Does anybody can help me? Thanks, Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From 50295 at web.de Wed May 13 20:08:23 2009 From: 50295 at web.de (Olumide) Date: Thu, 14 May 2009 01:08:23 +0100 Subject: [vtkusers] vtkPolyDataWriter in vtkpython In-Reply-To: References: <4A0A291A.4060306@web.de> <98e18c70905121945h2e5323d8g62ba5143d0ea80df@mail.gmail.com> <4A0A4646.6000307@web.de> <98e18c70905130412s148951cehc4436e898dacc609@mail.gmail.com> <4A0AF78A.8050202@web.de> Message-ID: <4A0B60F7.4050400@web.de> > Apply a vtkTransform filter. Thanks. I have (see my attempt below -- the transform has no noticeable effect). I do not wish to visualize the data. Rather, my intention is to have the script write a VTK file. Is there comprehensive vtkpython tutorial available anywhere? The "VTK User's guide" and "Visualization toolkit" are slanted toward the C++ and Tcl APIs. Thanks. ######################################################## #!/usr/bin/env python import vtk cone = vtk.vtkConeSource() cone.SetHeight( 3.0 ) cone.SetRadius( 1.0 ) cone.SetResolution( 10 ) transform = vtk.vtkTransform() transform.Translate(3.7, 0.0, 28.37) transform.Scale(5, 5, 5) transform.RotateY(90) tpd1 = vtk.vtkTransformPolyDataFilter() tpd1.SetInputConnection(cone.GetOutputPort()) tpd1.SetTransform(transform) #Write in file w = vtk.vtkPolyDataWriter() w.SetInput(cone.GetOutput()) w.SetFileName("junk.vtk") w.Write() From 50295 at web.de Wed May 13 20:20:53 2009 From: 50295 at web.de (Olumide) Date: Thu, 14 May 2009 01:20:53 +0100 Subject: [vtkusers] vtkPolyDataWriter in vtkpython In-Reply-To: <4A0B60F7.4050400@web.de> References: <4A0A291A.4060306@web.de> <98e18c70905121945h2e5323d8g62ba5143d0ea80df@mail.gmail.com> <4A0A4646.6000307@web.de> <98e18c70905130412s148951cehc4436e898dacc609@mail.gmail.com> <4A0AF78A.8050202@web.de> <4A0B60F7.4050400@web.de> Message-ID: <4A0B63E5.4000902@web.de> Olumide wrote: >> Apply a vtkTransform filter. > > Thanks. I have (see my attempt below -- the transform has no noticeable > effect). I do not wish to visualize the data. Rather, my intention is to > have the script write a VTK file. Got it. Here's how I did it, please correct any superfluous steps: #!/usr/bin/env python import vtk cone = vtk.vtkConeSource() cone.SetHeight( 3.0 ) cone.SetRadius( 1.0 ) cone.SetResolution( 10 ) transform = vtk.vtkTransform() transform.Translate(8, 8, 8) transform.Scale(1, 2, 5) transform.RotateY(45) tpd1 = vtk.vtkTransformPolyDataFilter() tpd1.SetInputConnection(cone.GetOutputPort()) tpd1.SetTransform(transform) appendF = vtk.vtkAppendPolyData() appendF.AddInput(tpd1.GetOutput()) appendF.AddInput(cone.GetOutput()) #Write in file w = vtk.vtkPolyDataWriter() #w.SetInput(tpd1.GetOutput()) w.SetInput(appendF .GetOutput()) w.SetFileName("junk.vtk") w.Write() From flfljh at gmail.com Wed May 13 21:56:36 2009 From: flfljh at gmail.com (ljh flf) Date: Thu, 14 May 2009 09:56:36 +0800 Subject: [vtkusers] How to modify font?? Message-ID: Hi,all,I want to modify font,but there are three font in VTK. -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From hossein.ghadiri at gmail.com Fri May 15 04:27:27 2009 From: hossein.ghadiri at gmail.com (Hossein Ghadiri) Date: Fri, 15 May 2009 12:57:27 +0430 Subject: [vtkusers] IDL vs VTK-ITK Message-ID: <004301c9d536$fcf00b30$1400a8c0@Hossein> All, If some one has any experiences working with IDL, give me some notes. Are they comparable? What can do IDL that VTK-ITK can not? Is it on C++ platform or stand on another languages? Best Hossein Ghadiri -------------- next part -------------- An HTML attachment was scrubbed... URL: From nataliehapp at hotmail.com Thu May 14 04:49:23 2009 From: nataliehapp at hotmail.com (Natalie Happenhofer) Date: Thu, 14 May 2009 10:49:23 +0200 Subject: [vtkusers] convert vtkDataObject to vtkDataSet Message-ID: Hi! I?d like to convert a vtkDataObject to a vtkDataSet. As vtkDataObject is a superclass for vtkDataSet, I tried vtkDataSet* A = vtkDataSet::SafeDownCast(B); where B is a vtkDataObject, but I compiling I get the error " error: invalid conversion from 'vtkDataObject*' to 'vtkDataSet*' " Looking in the documentation, there seems to be a class called "vtkDataObjectToDataSet", which seems to be exactly what I want, but I don?t find any documentation on it or any advice how to use it. thx for help, Natalie Happenhofer _________________________________________________________________ ?Invita a todos tus amigos de una sola vez! Pru?balo ahora http://www.microsoft.com/latam/windows/windowslive/products/social-network-connector.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From ilferraresebono at hotmail.it Thu May 14 06:16:12 2009 From: ilferraresebono at hotmail.it (Giancarlo Amati) Date: Thu, 14 May 2009 12:16:12 +0200 Subject: [vtkusers] QVTK class refresh Message-ID: Hello everybody, I do really need an answer: I'm developing a software with QT + VTK, using QVTK. Now, does this plug in have aany menthod for refresshing the content? because I'm calling the Render() function of the vtkRenderer and it doesn't work, I call ResetCamera()......and it doesn't work, the only way to refresh the content is resizing the window......so that's insane if it is the only way. so, using a VTK and/or QVTK how is that possible to refresh the content? Kind Regards. Giancarlo Amati _________________________________________________________________ Resta in contatto con gli amici, comunica con Messenger! http://messenger.it/cominciaAcomunicare.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu May 14 07:11:11 2009 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 14 May 2009 07:11:11 -0400 Subject: [vtkusers] vtkPolyDataWriter in vtkpython In-Reply-To: <4A0B63E5.4000902@web.de> References: <4A0A291A.4060306@web.de> <98e18c70905121945h2e5323d8g62ba5143d0ea80df@mail.gmail.com> <4A0A4646.6000307@web.de> <98e18c70905130412s148951cehc4436e898dacc609@mail.gmail.com> <4A0AF78A.8050202@web.de> <4A0B60F7.4050400@web.de> <4A0B63E5.4000902@web.de> Message-ID: congrats! In the first program, did you forget to change the writer's input from the cone to the output of the transform filter? VTK filter's never modify their inputs directly. I think in the second program that the append filter is superfluous, unless you want both original and transformed data together for your work. David E DeMarle Kitware, Inc. R&D Engineer 28 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-371-3971 x109 On Wed, May 13, 2009 at 8:20 PM, Olumide <50295 at web.de> wrote: > Olumide wrote: >>> >>> Apply a vtkTransform filter. >> >> Thanks. I have (see my attempt below -- the transform has no noticeable >> effect). I do not wish to visualize the data. Rather, my intention is to >> have the script write a VTK file. > > Got it. Here's how I did it, please correct any superfluous steps: > > #!/usr/bin/env python > > import vtk > > cone = vtk.vtkConeSource() > cone.SetHeight( 3.0 ) > cone.SetRadius( 1.0 ) > cone.SetResolution( 10 ) > > transform = vtk.vtkTransform() > transform.Translate(8, 8, 8) > transform.Scale(1, 2, 5) > transform.RotateY(45) > tpd1 = vtk.vtkTransformPolyDataFilter() > tpd1.SetInputConnection(cone.GetOutputPort()) > tpd1.SetTransform(transform) > > appendF = vtk.vtkAppendPolyData() > appendF.AddInput(tpd1.GetOutput()) > appendF.AddInput(cone.GetOutput()) > > #Write in file > w = vtk.vtkPolyDataWriter() > #w.SetInput(tpd1.GetOutput()) > w.SetInput(appendF .GetOutput()) > w.SetFileName("junk.vtk") > w.Write() > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > From murat.aydin at netcad.com.tr Thu May 14 07:26:03 2009 From: murat.aydin at netcad.com.tr (=?iso-8859-9?Q?Murat_Ayd=FDn?=) Date: Thu, 14 May 2009 14:26:03 +0300 Subject: [vtkusers] calculating volume of unstructured grid Message-ID: <00aa01c9d486$c44915c0$5b01a8c0@ulusal.local> Hi, How could volume of a solid that is constructed from unstructured grid be calculated? Answer: We can use vtkMassProperties and ss you know vtkMassProperties gets poly data as input. So before using it we have to do some conversions. I use unstructured grids to form a volume with Delaunay3D algorithm. After that i set the output of Delaunay 3D to input of vtkGeometryFilter. vtkGeometryFilter converts data to poly data. Then i set output of vtkGeometryFilter to input of vtkTriangleFilter. Because poly data should be triangulated before vtkMassProperties. Then i set output of vtkTriangleFilter to input of vtkMassProperties. And GetVolume() method of vtkMassProperties gives the calculated volume. In a nutshell, unstructured grid -> vtkDelaunay3D -> vtkGeometryFilter -> vtkTriangleFilter -> vtkMassProperties -> volume. Hope this helps. murat aydin. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ilferraresebono at hotmail.it Thu May 14 07:31:36 2009 From: ilferraresebono at hotmail.it (Giancarlo Amati) Date: Thu, 14 May 2009 13:31:36 +0200 Subject: [vtkusers] wglMakeCurrent failed error Message-ID: Hello everybody, well...this is an error that I don't know how to manage. I have a vtkAssembly object which has a set of vtkSphereSource object part. Now, as I am doing a software for real time gesture visualization I keep the vtkAssembly object stored in a variable and using its setUserMatrix I want to update its position in the space. Now, the problem is that whenever I update/refresh the QVTK class by calling the Renderer() function of the renderer I receive this message: vtkWin32OpenglRenderWindow.cxx line 244: vtkWin32OpenglRenderwindow.cxx (01B0EE68): wglMakeCurrent failed in MakeCurrent(), error: The requested resource is in use. what does that mean? can't I update an object that is already in the pipeline? Any help is really appreciated!! Kind Regards. GC. _________________________________________________________________ Pi? di 100 Emoticon gratis per il tuo Messenger! http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: From luciangoron at gmail.com Thu May 14 08:04:31 2009 From: luciangoron at gmail.com (luciangoron) Date: Thu, 14 May 2009 05:04:31 -0700 (PDT) Subject: [vtkusers] How to delete a line ? Message-ID: <23501139.post@talk.nabble.com> I have a simple code here: I "print" 2 lines, and than I want to "delete" the first one... (I want to NOT see it anymore) #include "../common/CommonVTKRoutines.h" #include "../common/CommonANNRoutines.h" #include "../common/Common3DGeomRoutines.h" #include "../common/CommonIORoutines.h" #include "../common/CommonTerminalRoutines.h" #include "../common/ANN-VTK.h" using namespace cANN; using namespace std; int main (int argc, char** argv) { // create vtk renderer and vtk interactor // vtkRenderer *ren = vtkRenderer::New (); ren->SetBackground (0, 0, 0); vtkRenderWindowInteractor *iren = CreateRenderWindowAndInteractor (ren, "TEST", argc, argv); // first line // vtkLineSource *line1 = vtkLineSource::New(); line1->SetPoint1 (1.0, 1.0, 1.0); line1->SetPoint2 (1.5, 1.5, 1.5); vtkActor *actor1 = createActorFromDataSet (line1->GetOutput(), false); actor1->GetProperty()->SetColor (1, 0, 0); ren->AddActor(actor1); // do a refresh // iren->Render(); iren->Start(); // second line // vtkLineSource *line2 = vtkLineSource::New(); line2->SetPoint1 (0.5, 1.0, 1.5); line2->SetPoint2 (1.5, 1.0, 0.5); vtkActor *actor2 = createActorFromDataSet (line2->GetOutput(), false); actor2->GetProperty()->SetColor (0, 1, 0); ren->AddActor(actor2); // do a refresh // iren->Render(); iren->Start(); // suppose to delete de line // line1->Delete(); actor1->Delete(); // do a refresh // iren->Render(); iren->Start(); return 0; } PS : Please do not send me suggestions such as : " Why don't you color the line which you want to delete in black.. " Thanks in advance ! -- View this message in context: http://www.nabble.com/How-to-delete-a-line---tp23501139p23501139.html Sent from the VTK - Users mailing list archive at Nabble.com. From luciangoron at gmail.com Thu May 14 08:58:25 2009 From: luciangoron at gmail.com (luciangoron) Date: Thu, 14 May 2009 05:58:25 -0700 (PDT) Subject: [vtkusers] how can I visualize a circular nut with VTK ? Message-ID: <23540071.post@talk.nabble.com> http://www.nabble.com/file/p23540071/e.g.jpg e.g.jpg as in the image I uploaded... I tried to do it with help of the vtkDiskSource class.. but I could not set the center, or set the number o sides (to be smooth as a circle) I also tried using vtkRegularPolygonSource class.. by visualizing two circles (big one + small one) with the same center the big one (with bigger radius) to be at 100% Opacity ( SetOpacity(1.0) ) the small one (with smaller radius) to be at 0% Opacity ( SetOpacity(0.0) ) but the Renderer show the Opacity of the big circle... as it actually should be ! If anybody has a solution, please answer me... Thank you in advance ! -- View this message in context: http://www.nabble.com/how-can-I-visualize-a-circular-nut-with-VTK---tp23540071p23540071.html Sent from the VTK - Users mailing list archive at Nabble.com. From jerome.velut at gmail.com Thu May 14 09:00:32 2009 From: jerome.velut at gmail.com (=?ISO-8859-1?B?Suly9G1l?=) Date: Thu, 14 May 2009 15:00:32 +0200 Subject: [vtkusers] How to delete a line ? In-Reply-To: <23501139.post@talk.nabble.com> References: <23501139.post@talk.nabble.com> Message-ID: Hi, The deletion with Delete( ) won't remove the line because... the line is used by the renderer (Take a look at the object factory, garbage collector, reference counter and all these stuff). I suggest you to remove the actor from the renderer... With, for instance, ren->RemoveActor( actor1 ); Or, if you want, you can set the background color to the line color... HTH Jerome 2009/5/14 luciangoron > > I have a simple code here: > > I "print" 2 lines, and than I want to "delete" the first one... (I want to > NOT see it anymore) > > #include "../common/CommonVTKRoutines.h" > #include "../common/CommonANNRoutines.h" > #include "../common/Common3DGeomRoutines.h" > #include "../common/CommonIORoutines.h" > #include "../common/CommonTerminalRoutines.h" > #include "../common/ANN-VTK.h" > > using namespace cANN; > using namespace std; > > int main (int argc, char** argv) > { > // create vtk renderer and vtk interactor // > vtkRenderer *ren = vtkRenderer::New (); > ren->SetBackground (0, 0, 0); > vtkRenderWindowInteractor *iren = CreateRenderWindowAndInteractor (ren, > "TEST", argc, argv); > > // first line // > vtkLineSource *line1 = vtkLineSource::New(); > line1->SetPoint1 (1.0, 1.0, 1.0); > line1->SetPoint2 (1.5, 1.5, 1.5); > vtkActor *actor1 = createActorFromDataSet (line1->GetOutput(), false); > actor1->GetProperty()->SetColor (1, 0, 0); > ren->AddActor(actor1); > > // do a refresh // > iren->Render(); > iren->Start(); > > // second line // > vtkLineSource *line2 = vtkLineSource::New(); > line2->SetPoint1 (0.5, 1.0, 1.5); > line2->SetPoint2 (1.5, 1.0, 0.5); > vtkActor *actor2 = createActorFromDataSet (line2->GetOutput(), false); > actor2->GetProperty()->SetColor (0, 1, 0); > ren->AddActor(actor2); > > // do a refresh // > iren->Render(); > iren->Start(); > > // suppose to delete de line // > line1->Delete(); > actor1->Delete(); > > // do a refresh // > iren->Render(); > iren->Start(); > > return 0; > } > > PS : Please do not send me suggestions such as : > > " Why don't you color the line which you want to delete in black.. " > > Thanks in advance ! > -- > View this message in context: > http://www.nabble.com/How-to-delete-a-line---tp23501139p23501139.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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shady_shidfar at yahoo.com Thu May 14 09:19:36 2009 From: shady_shidfar at yahoo.com (Shady Shidfar) Date: Thu, 14 May 2009 06:19:36 -0700 (PDT) Subject: [vtkusers] how can I visualize a circular nut with VTK ? In-Reply-To: <23540071.post@talk.nabble.com> References: <23540071.post@talk.nabble.com> Message-ID: <102456.74628.qm@web110312.mail.gq1.yahoo.com> Hi, by setting Opacity to zero you are making your?actor invisible. Instead of doing that, change the z order of your?actors so that the small object would be displayed over the small one. Hope this helps Shaadi ________________________________ From: luciangoron To: vtkusers at vtk.org Sent: Thursday, 14 May, 2009 13:58:25 Subject: [vtkusers] how can I visualize a circular nut with VTK ? http://www.nabble.com/file/p23540071/e.g.jpg e.g.jpg as in the image I uploaded... I tried to do it with help of the vtkDiskSource class.. but I could not set the center, or set the number o sides (to be smooth as a circle) I also tried using vtkRegularPolygonSource class.. by visualizing two circles (big one + small one) with the same center the big one (with bigger radius) to be at 100% Opacity ( SetOpacity(1.0) ) the small one (with smaller radius) to be at 0% Opacity ( SetOpacity(0.0) ) but the Renderer show the Opacity of the big circle... as it actually should be ! If anybody has a solution, please answer me... Thank you in advance ! -- View this message in context: http://www.nabble.com/how-can-I-visualize-a-circular-nut-with-VTK---tp23540071p23540071.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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From clinton at elemtech.com Thu May 14 10:13:16 2009 From: clinton at elemtech.com (Clinton Stimpson) Date: Thu, 14 May 2009 08:13:16 -0600 Subject: [vtkusers] QVTK class refresh In-Reply-To: References: Message-ID: <4A0C26FC.7040401@elemtech.com> You call QVTKWidget::update() or vtkRenderWindow::Render(), not vtkRenderer::Render(). That might solve the problem with wglMakeCurrent you reported in another email. Clint Giancarlo Amati wrote: > Hello everybody, > > I do really need an answer: I'm developing a software with QT + VTK, > using QVTK. Now, does this plug in have aany menthod for refresshing > the content? because I'm calling the Render() function of the > vtkRenderer and it doesn't work, I call ResetCamera()......and it > doesn't work, the only way to refresh the content is resizing the > window......so that's insane if it is the only way. > so, using a VTK and/or QVTK how is that possible to refresh the content? > > Kind Regards. > Giancarlo Amati > > ------------------------------------------------------------------------ > Cerchi i tuoi spazi? Hotmail va oltre i 5GB. Scopri perch?! > > ------------------------------------------------------------------------ > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > From gbook at gbook.org Thu May 14 10:25:16 2009 From: gbook at gbook.org (Greg Book) Date: Thu, 14 May 2009 10:25:16 -0400 Subject: [vtkusers] picking example in C++ Message-ID: <4A0C29CC.6000304@gbook.org> I'm trying out picking and I'm looking for a picking example in C++. What would the annotatePick.tcl look like in C++? -Greg From halverson at byu.edu Thu May 14 10:52:02 2009 From: halverson at byu.edu (Peter Halverson) Date: Thu, 14 May 2009 08:52:02 -0600 Subject: [vtkusers] vtkPolyDataConnectivityFilter() doesn't filter data when passed to out Message-ID: <4d1a61ba0905140752g3eeed8e3y4bc91f180ab9037c@mail.gmail.com> I'm having some difficulty with vtkPolyDataConnectivityFilter(). VTK is able to visualize it but I can't get the data out of it. I've written a program that works as follows 1. Uses vtkDICOMImageReader() to read in a CT image and pass that to 2. vtkContourfilter() to reduce that image and pass that to 3. vtkPolyDataConnectivityFilter() to get the largest connected region and pass that to 4. vtkPolyDataNormals() which passes it to 5. vtkPolyDataMapper() and then to 6. vtkActor() which is able to render only the largest connected region (the skin in this case) When I pass the data to python using vtk_ar=vtk_to_numpy(skinactor.GetMapper().GetInput().GetPoints().GetData()) I get the output from step 2 which includes the disconnected regions. I've searched the vtk mail archives and the books but can't find out how to get the data after the ConnectivityFilter is called. I'm new to vtk, any help would be appreciated. Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From anka at bic.mni.mcgill.ca Thu May 14 11:22:19 2009 From: anka at bic.mni.mcgill.ca (Anka Kochanowska) Date: Thu, 14 May 2009 11:22:19 -0400 Subject: [vtkusers] picking example in C++ In-Reply-To: <4A0C29CC.6000304@gbook.org> References: <4A0C29CC.6000304@gbook.org> Message-ID: <4A0C372B.90301@bic.mni.mcgill.ca> Check Mark Wyszomierski's site: http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 Anka Greg Book wrote: > I'm trying out picking and I'm looking for a picking example in C++. > What would the annotatePick.tcl look like in C++? > > -Greg > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > From luciangoron at gmail.com Thu May 14 11:27:50 2009 From: luciangoron at gmail.com (luciangoron) Date: Thu, 14 May 2009 08:27:50 -0700 (PDT) Subject: [vtkusers] how can I visualize a circular nut with VTK ? In-Reply-To: <102456.74628.qm@web110312.mail.gq1.yahoo.com> References: <23540071.post@talk.nabble.com> <102456.74628.qm@web110312.mail.gq1.yahoo.com> Message-ID: <23542949.post@talk.nabble.com> Yes, but the smaller circle would be still invisible, and I would see the bigger circle below... so, I would not get the result I want (as in the e.g. jpg)... thanks anyway ! Shady Shidfar wrote: > > Hi, by setting Opacity to zero you are making your?actor invisible. > Instead of doing that, change the z order of your?actors so that the small > object would be displayed over the > small one. Hope this helps > Shaadi > > > > > ________________________________ > From: luciangoron > To: vtkusers at vtk.org > Sent: Thursday, 14 May, 2009 13:58:25 > Subject: [vtkusers] how can I visualize a circular nut with VTK ? > > > http://www.nabble.com/file/p23540071/e.g.jpg e.g.jpg > > as in the image I uploaded... > > I tried to do it with help of the vtkDiskSource class.. but I could not > set > the center, or set the number o sides (to be smooth as a circle) > > I also tried using vtkRegularPolygonSource class.. by visualizing two > circles (big one + small one) with the same center > the big one (with bigger radius) to be at 100% Opacity ( SetOpacity(1.0) ) > the small one (with smaller radius) to be at 0% Opacity ( SetOpacity(0.0) > ) > but the Renderer show the Opacity of the big circle... as it actually > should > be ! > > If anybody has a solution, please answer me... > > Thank you in advance ! > -- > View this message in context: > http://www.nabble.com/how-can-I-visualize-a-circular-nut-with-VTK---tp23540071p23540071.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 > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > -- View this message in context: http://www.nabble.com/how-can-I-visualize-a-circular-nut-with-VTK---tp23540071p23542949.html Sent from the VTK - Users mailing list archive at Nabble.com. From theodoreholden at yahoo.com Thu May 14 12:17:16 2009 From: theodoreholden at yahoo.com (Theodore Holden) Date: Thu, 14 May 2009 09:17:16 -0700 (PDT) Subject: [vtkusers] Pseudo memory leak problem with C# and vtk component Message-ID: <750235.24065.qm@web38605.mail.mud.yahoo.com> The problem I was seeing earlier involved interactors and the fact that the interactor.start function does not return, apparently ever, until the renderwindow in question is destroyed. Most of the examples I see include the creation of an interactor and the interactor.start call; in most cases the examples pop a renderwindow up as a dialog and the user gets rid of it before proceeding to a next step and there is no problem. Most examples also have vtk objects declared locally in functions called add_somethingorother_to_window and if you do that, then eliminating the interactor lines produces pathology the first time you go to do any sort of an interaction type thing (like adjusting opacity) programmatically. If you make the vtk objects class level and eliminate the interactor lines, then all problems go away. Documentation should probably include some sort of a warning about this for the benefit of people trying to use the vtk components. The same behavior occurs using either the Sourceforge or Kitware version of wrapper libraries and components. Ted -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrewc at mac.com Thu May 14 12:29:08 2009 From: andrewc at mac.com (Andrew Cunningham) Date: Thu, 14 May 2009 09:29:08 -0700 Subject: [vtkusers] Performance issue with vtkAssembly::UpdatePaths Message-ID: <40345795199149387027811360334311033546-Webmail@me.com> There is, I think , a serious o(n!) (factorial) problem with the vtkAssembly::UpdatePaths code. The problem is 1) vtkAssembly::GetMTime() recursively descends through the "scene graph" touching all nodes 2) vtkAssemblyPath::GetMTime() runs through all it's items (some of which will be vtkAssembly's ) and calls GetMTime() on each item So for example, if you have a vtkAssembly:: tree that is with various mixtures of vtkAssembly's and vtkActors. Firstly, the call this->GetMTime() causes a recursive transversal of the graph starting at 'this', calling GetMTime() on every node. This is o(n). Then, this->Paths->GetMTime() , is called. This iterates through each node of the vtkAssemblyPath calling GetMTime(). Each time it encounters a node that is a vtkAssembly, then it will trigger a recursive traversal starting at that node. The number of calls to GetMTime will be on the order of n! If you have a complex scene graph, this can actually become a huge bottleneck. Here is the code snippet. // Build the assembly paths if necessary. UpdatePaths() // is only called when the assembly is at the root // of the hierarchy; otherwise UpdatePaths() is called. void vtkAssembly::UpdatePaths() { if ( this->GetMTime() > this->PathTime || (this->Paths != NULL && this->Paths->GetMTime() > this->PathTime) ) { .... Andrew From csharma at simquest.com Thu May 14 12:14:45 2009 From: csharma at simquest.com (Cartik Sharma) Date: Thu, 14 May 2009 12:14:45 -0400 Subject: [vtkusers] IDL vs VTK-ITK In-Reply-To: <004301c9d536$fcf00b30$1400a8c0@Hossein> References: <004301c9d536$fcf00b30$1400a8c0@Hossein> Message-ID: An HTML attachment was scrubbed... URL: From ilferraresebono at hotmail.it Thu May 14 13:16:11 2009 From: ilferraresebono at hotmail.it (Giancarlo Amati) Date: Thu, 14 May 2009 19:16:11 +0200 Subject: [vtkusers] QVTK class refresh In-Reply-To: <4A0C26FC.7040401@elemtech.com> References: <4A0C26FC.7040401@elemtech.com> Message-ID: mmm well....with my QVTKWidget object, if I call update()......nothing really happens :( but at least it might be because of some bugs in my code which may be possible. At least I got rid of the wglMakeCurrent error. If I use vtkRenderwindow::Render() I got the wglMakeError error message too. Many thanks. GC. > Date: Thu, 14 May 2009 08:13:16 -0600 > From: clinton at elemtech.com > To: ilferraresebono at hotmail.it > CC: vtkusers at vtk.org > Subject: Re: [vtkusers] QVTK class refresh > > > You call QVTKWidget::update() or vtkRenderWindow::Render(), not > vtkRenderer::Render(). > That might solve the problem with wglMakeCurrent you reported in another > email. > > Clint > > Giancarlo Amati wrote: > > Hello everybody, > > > > I do really need an answer: I'm developing a software with QT + VTK, > > using QVTK. Now, does this plug in have aany menthod for refresshing > > the content? because I'm calling the Render() function of the > > vtkRenderer and it doesn't work, I call ResetCamera()......and it > > doesn't work, the only way to refresh the content is resizing the > > window......so that's insane if it is the only way. > > so, using a VTK and/or QVTK how is that possible to refresh the content? > > > > Kind Regards. > > Giancarlo Amati > > > > ------------------------------------------------------------------------ > > Cerchi i tuoi spazi? Hotmail va oltre i 5GB. Scopri perch?! > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at http://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 > > > > _________________________________________________________________ Pi? di 100 Emoticon gratis per il tuo Messenger! http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: From tfmoraes at cti.gov.br Thu May 14 14:13:48 2009 From: tfmoraes at cti.gov.br (Thiago Franco de Moraes) Date: Thu, 14 May 2009 15:13:48 -0300 Subject: [vtkusers] Merging vtkPolydatas Message-ID: <1242324828.2486.53.camel@guaxupe.localdomain> Hi All, I've created a vtkImageData based on a sequence of CT DICOM files. Then with vtkImageClip I've split it into several small vtkImageDatas. Then, each vtkImageData is processed "individually" using the following pipeline: vtkContourFilter -> vtkQuadricDecimation -> vtkTriangleFilter -> vtkSmoothPolyDataFilter -> vtkPolyDataNormals -> vtkStripper Afterwards, I have merged the resulting vtkPolyDatas using vtkAppendPolyData. However, the "intersections" (junctions) of these polydatas is very "uggly" (it is possible to see lines between them). Is there a way to merge these polydatas without these resulting marks? Best regards -- Thiago Franco de Moraes From luciangoron at gmail.com Thu May 14 14:44:20 2009 From: luciangoron at gmail.com (luciangoron) Date: Thu, 14 May 2009 11:44:20 -0700 (PDT) Subject: [vtkusers] How to delete a line ? In-Reply-To: References: <23501139.post@talk.nabble.com> Message-ID: <23546178.post@talk.nabble.com> it works ! it was so simple... jesus :) thank you very much ! -- View this message in context: http://www.nabble.com/How-to-delete-a-line---tp23501139p23546178.html Sent from the VTK - Users mailing list archive at Nabble.com. From frencyvarghese at yahoo.com Thu May 14 15:18:42 2009 From: frencyvarghese at yahoo.com (frency v) Date: Thu, 14 May 2009 12:18:42 -0700 (PDT) Subject: [vtkusers] Can someone with vtk 5.2.1 please compile this code Message-ID: <521194.9538.qm@web52309.mail.re2.yahoo.com> Hello everyone, I wrote this simple code but it is not getting compiled. i am getting the following error message. pls help. Error message:- undefined reference to 'vtkDataArrayTemplate::Set numbervalues (long long)' Can someone compile this code? and let me know what is going wrong? Rgds Frency here is the code #include "vtkShortArray.h" int main() { short arrIn[10]; ??? const int indmax=10; ??? vtkShortArray *dataArr = vtkShortArray::New(); ?? dataArr->SetNumberOfValues(indmax); } Error message:- undefined reference to 'vtkDataArrayTemplate::Set numbervalues (long long)' -------------- next part -------------- An HTML attachment was scrubbed... URL: From xf10036 at hotmail.com Thu May 14 15:31:12 2009 From: xf10036 at hotmail.com (Xiaofeng Z) Date: Thu, 14 May 2009 15:31:12 -0400 Subject: [vtkusers] How to save the updated render window Message-ID: I'm writing a short program to store a series of scences from an offscreen render window. The following is the code snippet that writes the (offscreen) render window in a series of files as the position of an object moves. for (int i=0; i<36; ++i) { cone->SetCenter(3.0-i*1.0/100.0, -1.0, 0.0); mRenWin->Render(); std::stringstream s; s << "C:\\OffScreenTest\\scence" << i << ".png"; vtkWindowToImageFilter* w2if = vtkWindowToImageFilter::New(); w2if->SetInput(mRenWin); vtkPNGWriter* wr = vtkPNGWriter::New(); wr->SetInputConnection(w2if->GetOutputPort()); wr->SetFileName(s.str().c_str()); wr->Write(); } You can see I have to create new vtkWindowToImageFilter and vtkPNGWriter objects for each iteration inside the loop to save the updated render window. Otherwise, only the screen of the first scene is saved. What did I do wrong? Thanks! Xiaofeng Zhao _________________________________________________________________ Insert movie times and more without leaving Hotmail?. http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009 -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.cole at kitware.com Thu May 14 15:37:19 2009 From: david.cole at kitware.com (David Cole) Date: Thu, 14 May 2009 15:37:19 -0400 Subject: [vtkusers] Can someone with vtk 5.2.1 please compile this code In-Reply-To: <521194.9538.qm@web52309.mail.re2.yahoo.com> References: <521194.9538.qm@web52309.mail.re2.yahoo.com> Message-ID: Please provide us with your CMakeLists.txt file for compiling this code. What OS are you using? What compiler? What version of CMake? Did you build VTK 5.2.1 yourself or did someone else build it for you? On Thu, May 14, 2009 at 3:18 PM, frency v wrote: > Hello everyone, > I wrote this simple code but it is not getting compiled. > i am getting the following error message. pls help. > > Error message:- undefined reference to 'vtkDataArrayTemplate::Set > numbervalues (long long)' > > Can someone compile this code and let me know what is going wrong? > > Rgds > Frency > > here is the code > > #include "vtkShortArray.h" > int main() > { short arrIn[10]; > const int indmax=10; > vtkShortArray *dataArr = vtkShortArray::New(); > dataArr->SetNumberOfValues(indmax); > } > > Error message:- undefined reference to 'vtkDataArrayTemplate::Set > numbervalues (long long)' > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 adzyubak at gmail.com Thu May 14 16:24:48 2009 From: adzyubak at gmail.com (Oleksandr Dzyubak) Date: Thu, 14 May 2009 15:24:48 -0500 Subject: [vtkusers] Can someone with vtk 5.2.1 please compile this code In-Reply-To: <521194.9538.qm@web52309.mail.re2.yahoo.com> References: <521194.9538.qm@web52309.mail.re2.yahoo.com> Message-ID: <4A0C7E10.8040409@gmail.com> Hi Frency, It looks like you are not linking your code with correct libs. Below are your code plus the CMakeLists.txt that I wrote to test your code. Try that and tell me how it works. ************** CMakeLists.txt ******** cmake_minimum_required(VERSION 2.6) PROJECT(simple) # Find VTK. FIND_PACKAGE(VTK REQUIRED) IF(VTK_FOUND) INCLUDE(${VTK_USE_FILE}) ELSE(VTK_FOUND) MESSAGE(FATAL_ERROR "Cannot build without VTK. Please set VTK_DIR.") ENDIF(VTK_FOUND) ADD_EXECUTABLE ( simple simple.cxx ) TARGET_LINK_LIBRARIES ( simple vtkIO ) ******************* End of CMakeLists.txt ******* ********* simple.cxx ********* #include "vtkShortArray.h" int main() { short arrIn[10]; const int indmax=10; vtkShortArray *dataArr = vtkShortArray::New(); dataArr->SetNumberOfValues(indmax); dataArr->SetValue(1, -128); std::cerr << "Good job! Value = " << dataArr->GetValue(1) << std::endl; return 0; } ********** End of simple.cxx ******** In my case the output of your program is below. dzyubak at debian-alex: /BUILD$ ./simple Good job! Value = -128 dzyubak at debian-alex: /BUILD$ Regards, Alex frency v wrote: > Hello everyone, > I wrote this simple code but it is not getting compiled. > i am getting the following error message. pls help. > > Error message:- undefined reference to > 'vtkDataArrayTemplate::Set numbervalues (long long)' > > Can someone compile this code and let me know what is going wrong? > > Rgds > Frency > > here is the code > > #include "vtkShortArray.h" > int main() > { short arrIn[10]; > const int indmax=10; > vtkShortArray *dataArr = vtkShortArray::New(); > dataArr->SetNumberOfValues(indmax); > } > > Error message:- undefined reference to > 'vtkDataArrayTemplate::Set numbervalues (long long)' > > > ------------------------------------------------------------------------ > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > From dave.demarle at kitware.com Thu May 14 19:21:14 2009 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 14 May 2009 19:21:14 -0400 Subject: [vtkusers] convert vtkDataObject to vtkDataSet In-Reply-To: References: Message-ID: The compiler error is probably caused by not #including "vtkDataSet.h". See this entry on the vtk faq: http://www.vtk.org/Wiki/VTK_FAQ#The_C.2B.2B_compiler_cannot_convert_some_pointer_type_to_another_pointer_type_in_my_little_program David E DeMarle Kitware, Inc. R&D Engineer 28 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-371-3971 x109 On Thu, May 14, 2009 at 4:49 AM, Natalie Happenhofer wrote: > error: invalid conversion from 'vtkDataObject*' to 'vtkDataSet From daviddoria at gmail.com Thu May 14 20:49:03 2009 From: daviddoria at gmail.com (David Doria) Date: Thu, 14 May 2009 20:49:03 -0400 Subject: [vtkusers] Trouble modifying vtkIterativeClosestPointTransform Message-ID: I am trying to implement the ICP improvement that only uses points which have a closest point closer than some threshold in the landmark transform. It looked like it would be easy to do - here's what I came up with. (The commented lines are what I changed.) The old version found the closest point to every point in 'a' and stored them in 'closestp'. Then it used 'a' and 'closestp' to create the landmark transform. The new version finds the closest point to every point in 'a'. If the distance is less than the threshold, it adds a[i] to 'UsedPoints' and adds the closest point to 'closestp'. It then uses 'UsedPoints' and 'closestp' to create the lankmark transform. Nothing else is changed - with the idea being that 'a' will still be what is actually getting transformed. --------------------------- vtkPoints *closestp = vtkPoints::New(); vtkPoints *UsedPoints = vtkPoints::New(); //clear the array used to create the landmark transform closestp->SetNumberOfPoints(0); UsedPoints->SetNumberOfPoints(0); // Fill closestp and UsedPoints with the closest points to each vertex in input if they are sufficiently close for(i = 0; i < nb_points; i++) { this->Locator->FindClosestPoint(a->GetPoint(i), outPoint, cell_id, sub_id, dist2); //closestp->SetPoint(i, outPoint); if(dist2 < Thresh_) { closestp->InsertNextPoint(outPoint); UsedPoints->InsertNextPoint(a->GetPoint(i)); } } // Build the landmark transform // this->LandmarkTransform->SetSourceLandmarks(a); // this->LandmarkTransform->SetTargetLandmarks(closestp); this->LandmarkTransform->SetSourceLandmarks(UsedPoints); this->LandmarkTransform->SetTargetLandmarks(closestp); this->LandmarkTransform->Update(); --------------------------- What happens is that in each iteration, the number of points used decreases until it eventually gets to zero. I am using two polydata's which are very close to each other and identical as the test source and target, so the number of points used should certainly not decrease. I have a feeling it is something to do with how the LandmarkTransform stores the vtkPoints data? Does anyone see the problem with this? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From frencyvarghese at yahoo.com Fri May 15 01:19:57 2009 From: frencyvarghese at yahoo.com (frency v) Date: Thu, 14 May 2009 22:19:57 -0700 (PDT) Subject: [vtkusers] Unable to move past ccmake configure[VTK installation 5.4, Ubuntu Intrepid...] Message-ID: <85323.32880.qm@web52306.mail.re2.yahoo.com> Hello, ??? I have hit a road block? when running ccmake configure.? The problem i get is : CMake Error: The following variables are used in this project, but they are set to NOTFOUND. ?Please set them or make sure they are set and tested correctly in the CMake files: ?OPENGL_INCLUDE_DIR (ADVANCED) I am not able to find the GL/gl.h file on my system. I have searched for it in /usr/share/doc. Nor am i able to find any gl.h file on the system(after a find on the root) Could anyone please help me in resolving this issue. What do i point the OPENGL_INCLUDE_DIR to?. Warm Regards, Frency Varghese, PS: Laptop Configuration: http://reviews.cnet.com/laptops/dell-inspiron-6000-for/4507-3121_7-31259392.html?tag=mncol;psum -------------- next part -------------- An HTML attachment was scrubbed... URL: From alucard006 at msn.com Fri May 15 04:19:15 2009 From: alucard006 at msn.com (Chris N) Date: Fri, 15 May 2009 01:19:15 -0700 Subject: [vtkusers] Eliminate Noise by ConnectivityFilter Message-ID: I am learning how to use VTK and trying to use connectivityfilter since it seems to be the best way to elimate noise. My attempt is dealing with DICOM data files, and I construct my files to give me a 3D image of a human head with only skin. Now I want to eliminate internal parts that connect to the ear & neck. I tried to use my method below with connectivityfilter on my data and the textbook's example data "headsq/quarter" but sadly I get the same result as if I never used connectivityfilter. Any advice, suggestions? Thanks in advance! My sequence is: -Read Data //CONNECTIVITY vtkConnectivityFilter *connect = vtkConnectivityFilter::New(); connect->SetInputConnection(reader->GetOutputPort()); connect->SetExtractionModeToLargestRegion(); -Skin actor -Outline actor -Apply my actors -View results _________________________________________________________________ Insert movie times and more without leaving Hotmail?. http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.arbter at isv.uni-stuttgart.de Fri May 15 04:36:18 2009 From: bruno.arbter at isv.uni-stuttgart.de (Bruno Arbter) Date: Fri, 15 May 2009 10:36:18 +0200 Subject: [vtkusers] opengl support Message-ID: <000901c9d538$377aa840$a66ff8c0$@arbter@isv.uni-stuttgart.de> Hi everybody, I'm using qt with vtk (QVTKWidget). Testing the QVTKWidget on OpenGL support with QVTKWidget::SupportsOpenGL(), I wondered that the result was 0 (false) even if the result looks fine. Same happens when testing the Medical1 example (without qt support). I already checked the OpenGL requirements from FAQ, they are fullfilled. Any idea? Is OpenGL used anyway? Thanks Bruno From murat.aydin at netcad.com.tr Fri May 15 05:22:33 2009 From: murat.aydin at netcad.com.tr (=?iso-8859-9?Q?Murat_Ayd=FDn?=) Date: Fri, 15 May 2009 12:22:33 +0300 Subject: [vtkusers] What is the function of SetSampleDimensions method of vtkVoxelModeller Message-ID: <006f01c9d53e$adeb08c0$5b01a8c0@ulusal.local> Hi, I couldnt understand the function of SetSampleDimensions method from the documentation. Can anyone explain SetSampleDimensions method of vtkVoxelModeller ? it says "Set the i-j-k dimensions on which to sample the distance function" in the documentation. Regards murat aydin -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hackbard_C at gmx.de Fri May 15 06:28:50 2009 From: Hackbard_C at gmx.de (Hackbard_C) Date: Fri, 15 May 2009 03:28:50 -0700 (PDT) Subject: [vtkusers] vtkAVIWriter Linker Error Message-ID: <23516934.post@talk.nabble.com> Hello, i wanted to generate an AVI-File, so i tried using vtkAVIWriter and vtkWindowToImageFilter, but if I compile my programm (with Visual Stido 2005) i got the following linker erros 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol _AVIStreamSetFormat at 16 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol _AVIMakeCompressedStream at 16 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol _AVISaveOptions at 20 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol _AVIFileCreateStreamA at 12 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol _AVIFileOpenA at 16 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol _AVIFileInit at 0 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol _AVIStreamWrite at 32 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol _AVIFileExit at 0 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol _AVIFileRelease at 4 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol _AVIStreamRelease at 4 I added these Libs #pragma comment(lib,"vtkCommon.lib") #pragma comment(lib,"vtkDICOMParser.lib") #pragma comment(lib,"vtkFiltering.lib") #pragma comment(lib,"vtkGenericFiltering.lib") #pragma comment(lib,"vtkGraphics.lib") #pragma comment(lib,"vtkHybrid.lib") #pragma comment(lib,"vtkIO.lib") #pragma comment(lib,"vtkImaging.lib") #pragma comment(lib,"vtkNetCDF.lib") #pragma comment(lib,"vtkRendering.lib") #pragma comment(lib,"vtkVolumeRendering.lib") #pragma comment(lib,"vtkWidgets.lib") #pragma comment(lib,"vtkexoIIc.lib") #pragma comment(lib,"vtkexpat.lib") #pragma comment(lib,"vtkfreetype.lib") #pragma comment(lib,"vtkftgl.lib") #pragma comment(lib,"vtkjpeg.lib") #pragma comment(lib,"vtkpng.lib") #pragma comment(lib,"vtksys.lib") #pragma comment(lib,"vtktiff.lib") #pragma comment(lib,"vtkzlib.lib") #pragma comment(lib,"opengl32.lib") #pragma comment(lib,"glu32.lib") Does anyone know what to do? Regards, Hackbard_C -- View this message in context: http://www.nabble.com/vtkAVIWriter-Linker-Error-tp23516934p23516934.html Sent from the VTK - Users mailing list archive at Nabble.com. From shailender.kanwar at gmail.com Fri May 15 08:34:36 2009 From: shailender.kanwar at gmail.com (Shailender Kanwar) Date: Fri, 15 May 2009 18:04:36 +0530 Subject: [vtkusers] How to get a particular plane from vtkPlaneCollection Message-ID: <94a853f60905150534g559a2188y6948ea0311b346a1@mail.gmail.com> Hi all, I am trying to create a no. of vtkplanes and store them some where for use later as section planes. I have gone through the vtkPlaneCollection class documentation, the only way I see for retrieving a particular plane from this collection is to use GetItemAsObject() and using cast to convert the returned object to vtkPlane. (am I right will that work? or would it be better to create my own map to store the planes) my another Question is regarding this function ----------- vtkPlane* vtkPlaneCollection::GetNextPlane ( vtkCollectionSimpleIterator & cookie ) Reentrant safe way to get an object in a collection. Just pass the same cookie back and forth. i have seen this function in other collections also, can someone explain with a code snippet, how exactly is this function used. thanks, Shailender -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.malaterre at gmail.com Fri May 15 09:12:26 2009 From: mathieu.malaterre at gmail.com (Mathieu Malaterre) Date: Fri, 15 May 2009 15:12:26 +0200 Subject: [vtkusers] vtkAVIWriter Linker Error In-Reply-To: <23516934.post@talk.nabble.com> References: <23516934.post@talk.nabble.com> Message-ID: On Fri, May 15, 2009 at 12:28 PM, Hackbard_C wrote: > > Hello, > > i wanted to generate an AVI-File, so i tried using vtkAVIWriter and > vtkWindowToImageFilter, but if I compile my programm (with Visual Stido > 2005) i got the following linker erros > > 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol > _AVIStreamSetFormat at 16 > 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol > _AVIMakeCompressedStream at 16 > 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol > _AVISaveOptions at 20 > 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol > _AVIFileCreateStreamA at 12 > 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol > _AVIFileOpenA at 16 > 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol > _AVIFileInit at 0 > 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol > _AVIStreamWrite at 32 > 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol > _AVIFileExit at 0 > 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol > _AVIFileRelease at 4 > 1>vtkIO.lib(vtkAVIWriter.obj) : error LNK2001: unresolved external symbol > _AVIStreamRelease at 4 > > I added these Libs > > #pragma comment(lib,"vtkCommon.lib") > #pragma comment(lib,"vtkDICOMParser.lib") > #pragma comment(lib,"vtkFiltering.lib") > #pragma comment(lib,"vtkGenericFiltering.lib") > #pragma comment(lib,"vtkGraphics.lib") > #pragma comment(lib,"vtkHybrid.lib") > #pragma comment(lib,"vtkIO.lib") > #pragma comment(lib,"vtkImaging.lib") > #pragma comment(lib,"vtkNetCDF.lib") > #pragma comment(lib,"vtkRendering.lib") > #pragma comment(lib,"vtkVolumeRendering.lib") > #pragma comment(lib,"vtkWidgets.lib") > #pragma comment(lib,"vtkexoIIc.lib") > #pragma comment(lib,"vtkexpat.lib") > #pragma comment(lib,"vtkfreetype.lib") > #pragma comment(lib,"vtkftgl.lib") > #pragma comment(lib,"vtkjpeg.lib") > #pragma comment(lib,"vtkpng.lib") > #pragma comment(lib,"vtksys.lib") > #pragma comment(lib,"vtktiff.lib") > #pragma comment(lib,"vtkzlib.lib") > #pragma comment(lib,"opengl32.lib") > #pragma comment(lib,"glu32.lib") > > Does anyone know what to do? Yes. Use cmake: find_package(VTK REQUIRED) include(${VTK_USE_FILE}) add_executable(vtkaivtool vtkaivtool.cxx) target_link_libraries(vtkaivtool vtkIO) cmake will pull all the dependencies required to link to vtkIO for you. HTH -- Mathieu From ilferraresebono at hotmail.it Fri May 15 09:25:07 2009 From: ilferraresebono at hotmail.it (Giancarlo Amati) Date: Fri, 15 May 2009 15:25:07 +0200 Subject: [vtkusers] threads and refreshing vtkRenderWindow Message-ID: Hello vtkUSERS!!! This is an ash question for only the cleverer!! :D I have a thread which modifies some data already in the vtkRenderWindow., now, the problem I have is when I want to refresh the window. I though calling something like renderWindow->Render() or renderer->render(), but I get some error messages related to "Resource already in use" and "wglMakeCurrent()" function error. Where is my mistake and any idea about how to overcome it? Kind regards. GC. _________________________________________________________________ Pi? di 30 stazioni. Ascolta la Radio su Messenger! http://messenger.it/radioMessenger.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.cole at kitware.com Fri May 15 10:19:51 2009 From: david.cole at kitware.com (David Cole) Date: Fri, 15 May 2009 10:19:51 -0400 Subject: [vtkusers] threads and refreshing vtkRenderWindow In-Reply-To: References: Message-ID: I will not claim to be cleverer, but I think I can answer the question: Your mistake is calling vtkObjects from multiple threads without synchonization objects. In general, vtkObjects are only safely accessible by one thread at a time. Multi-thread access means you will have to use some sort of mutexes or locks to guarantee that only one thread at a time will call vtkObject methods. Furthermore, you should only attempt to call Render from the main GUI thread of your application. Hope this helps, David On Fri, May 15, 2009 at 9:25 AM, Giancarlo Amati wrote: > Hello vtkUSERS!!! This is an ash question for only the cleverer!! :D > > I have a thread which modifies some data already in the vtkRenderWindow., > now, the problem I have is when I want to refresh the window. > I though calling something like renderWindow->Render() or > renderer->render(), but I get some error messages related to "Resource > already in use" and "wglMakeCurrent()" function error. > > Where is my mistake and any idea about how to overcome it? > > Kind regards. > > GC. > > ------------------------------ > Scrivi, parla e gioca con i tuoi amici! Scarica Messenger 2009! > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 clinton at elemtech.com Fri May 15 10:27:30 2009 From: clinton at elemtech.com (Clinton Stimpson) Date: Fri, 15 May 2009 08:27:30 -0600 Subject: [vtkusers] opengl support In-Reply-To: <000901c9d538$377aa840$a66ff8c0$@arbter@isv.uni-stuttgart.de> References: <000901c9d538$377aa840$a66ff8c0$@arbter@isv.uni-stuttgart.de> Message-ID: <4A0D7BD2.5000709@elemtech.com> Bruno Arbter wrote: > Hi everybody, > > I'm using qt with vtk (QVTKWidget). Testing the QVTKWidget on OpenGL support > with QVTKWidget::SupportsOpenGL(), I wondered that the result was 0 (false) > even if the result looks fine. Same happens when testing the Medical1 > example (without qt support). I already checked the OpenGL requirements from > FAQ, they are fullfilled. > > Any idea? Is OpenGL used anyway? > What platform? If its Mac, I looks like vtkCarbonRenderWindow doesn't implement SupportsOpenGL(). So it'll return 0 even though OpenGL is used. Clint From ilferraresebono at hotmail.it Fri May 15 10:59:00 2009 From: ilferraresebono at hotmail.it (Giancarlo Amati) Date: Fri, 15 May 2009 16:59:00 +0200 Subject: [vtkusers] threads and refreshing vtkRenderWindow In-Reply-To: References: Message-ID: Many thanks, what I have is a mainWindow which has functions for rendering and then a thread that calls a kind of "UpdateMy3Dobjects" function which belongs to the mainWindow object. Now, this "UpdateMy3DObjects" function works fine whenever that thread is not running while, I got the wglMakeCurrent error as soon as the thread runs the UpdateMy3Dobjects" function. So, as the UpdateMy3Dobjects function calls the RenderWindow->Render() method (renderwindow buidt in a QVTKWidget object of my GUI) calling that UpdateMy3DObject from the thread does correspond to a call form a thread different from the main one? In that case if I create a global variable, boolean for example which is true when I execute the UpdateMy3DObject function and false otherwise...would it help to synchronize these threads? I checked out on the VTK documentation and I found the vktMutexLock class....and i tried to understand the example in the documetation which is a bit difficult honestly, but,....can that class be useful for my project? many kind regards. Giancarlo Date: Fri, 15 May 2009 10:19:51 -0400 Subject: Re: [vtkusers] threads and refreshing vtkRenderWindow From: david.cole at kitware.com To: ilferraresebono at hotmail.it CC: vtkusers at vtk.org I will not claim to be cleverer, but I think I can answer the question: Your mistake is calling vtkObjects from multiple threads without synchonization objects. In general, vtkObjects are only safely accessible by one thread at a time. Multi-thread access means you will have to use some sort of mutexes or locks to guarantee that only one thread at a time will call vtkObject methods. Furthermore, you should only attempt to call Render from the main GUI thread of your application. Hope this helps,David On Fri, May 15, 2009 at 9:25 AM, Giancarlo Amati wrote: Hello vtkUSERS!!! This is an ash question for only the cleverer!! :D I have a thread which modifies some data already in the vtkRenderWindow., now, the problem I have is when I want to refresh the window. I though calling something like renderWindow->Render() or renderer->render(), but I get some error messages related to "Resource already in use" and "wglMakeCurrent()" function error. Where is my mistake and any idea about how to overcome it? Kind regards. GC. Scrivi, parla e gioca con i tuoi amici! Scarica Messenger 2009! _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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 _________________________________________________________________ Pi? di 100 Emoticon gratis per il tuo Messenger! http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.cole at kitware.com Fri May 15 11:08:20 2009 From: david.cole at kitware.com (David Cole) Date: Fri, 15 May 2009 11:08:20 -0400 Subject: [vtkusers] threads and refreshing vtkRenderWindow In-Reply-To: References: Message-ID: Are you asking us to tell you how your program is organized with respect to threads? (That's somewhat beyond the scope of the VTK mailing list.) It sounds like your project might be better off single-threaded. It would be better if you call UpdateMy3DObject from the same thread that actually does the rendering. On Fri, May 15, 2009 at 10:59 AM, Giancarlo Amati < ilferraresebono at hotmail.it> wrote: > Many thanks, > > what I have is a mainWindow which has functions for rendering and then a > thread that calls a kind of "UpdateMy3Dobjects" function which belongs to > the mainWindow object. Now, > this "UpdateMy3DObjects" function works fine whenever that thread is not > running while, I got the wglMakeCurrent error as soon as the thread runs the > UpdateMy3Dobjects" function. > So, > as the UpdateMy3Dobjects function calls the RenderWindow->Render() method > (renderwindow buidt in a QVTKWidget object of my GUI) calling that > UpdateMy3DObject from the thread does correspond to a call form a thread > different from the main one? > In that case if I create a global variable, boolean for example which is > true when I execute the UpdateMy3DObject function and false > otherwise...would it help to synchronize these threads? > > I checked out on the VTK documentation and I found the vktMutexLock > class....and i tried to understand the example in the documetation which is > a bit difficult honestly, but,....can that class be useful for my project? > > many kind regards. > Giancarlo > > ------------------------------ > Date: Fri, 15 May 2009 10:19:51 -0400 > Subject: Re: [vtkusers] threads and refreshing vtkRenderWindow > From: david.cole at kitware.com > To: ilferraresebono at hotmail.it > CC: vtkusers at vtk.org > > > I will not claim to be cleverer, but I think I can answer the question: > Your mistake is calling vtkObjects from multiple threads without > synchonization objects. In general, vtkObjects are only safely accessible by > one thread at a time. Multi-thread access means you will have to use some > sort of mutexes or locks to guarantee that only one thread at a time will > call vtkObject methods. Furthermore, you should only attempt to call Render > from the main GUI thread of your application. > > > Hope this helps, > David > > > On Fri, May 15, 2009 at 9:25 AM, Giancarlo Amati < > ilferraresebono at hotmail.it> wrote: > > Hello vtkUSERS!!! This is an ash question for only the cleverer!! :D > > I have a thread which modifies some data already in the vtkRenderWindow., > now, the problem I have is when I want to refresh the window. > I though calling something like renderWindow->Render() or > renderer->render(), but I get some error messages related to "Resource > already in use" and "wglMakeCurrent()" function error. > > Where is my mistake and any idea about how to overcome it? > > Kind regards. > > GC. > > ------------------------------ > Scrivi, parla e gioca con i tuoi amici! Scarica Messenger 2009! > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > > > ------------------------------ > Quali sono le parole pi? cliccate? Scopri la top! > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gbook at gbook.org Fri May 15 12:21:43 2009 From: gbook at gbook.org (Greg Book) Date: Fri, 15 May 2009 12:21:43 -0400 Subject: [vtkusers] wxVTKRenderWindowInteractor problem Message-ID: I'm using the wxVTKRenderWindowInteractor in my application and am getting an odd error when resizing the window. When I first start it up, everything works fine (everything being the imagePlaneWidget, picking, display, etc), but when I resize it, the content of the window is shifted down by about 20 pixels. So the mouse no longer picks correctly, and the bottom of the image is cut off. It only happens after resizing, so I'm not sure if its something in my code or in the renderwindowinteractor. There also aren't any OnSize event handlers in my program. -Greg -------------- next part -------------- An HTML attachment was scrubbed... URL: From hossein.ghadiri at gmail.com Sat May 16 13:15:30 2009 From: hossein.ghadiri at gmail.com (Hossein Ghadiri) Date: Sat, 16 May 2009 21:45:30 +0430 Subject: [vtkusers] IDL vs VTK-ITK In-Reply-To: Message-ID: <00fc01c9d649$ed9ce950$7dd1844f@Hossein> Cartik, Thanks for your info, I'm not very old in VTK/ITK, I'm C++ programmer and trying to develop a Quantitative Computed Tomography software package including a little processing & visualization. If IDL can aim me to my target easier than VTK/ITK please let me know. I found VTK using in MFC very inertial and my problems in this issue is continuing. Hossein Medical Physics PhD candidate IUMS _____ From: Cartik Sharma [mailto:csharma at simquest.com] Sent: Thursday, May 14, 2009 8:45 PM To: Hossein Ghadiri; vtkusers at vtk.org Subject: Re: [vtkusers] IDL vs VTK-ITK Hi Hossein, IDL is a useful tool geared towards medical image processing, as well as handling of large astronomical datasets. IDL is Fortran and C based so if you are a fortran programmer and interested in "lean routines" to accomplish numerical analysis then you'll like IDL. I'm an IDL programmer migrating towards ITK/VTK development. They both have their strengths. VTK has a richer set of classes, multiple intrepreted language support, strong integration from 3rd party libraries such as afsl and contributons from a wide open source community. I think I'll continue being an idl developer for prototyping programs till I fully migrate to ITK/VTK. Best regards, Cartik On Fri, 15 May 2009 12:57:27 +0430 "Hossein Ghadiri" wrote: >All, > >If some one has any experiences working with IDL, give >me some notes. > >Are they comparable? What can do IDL that VTK-ITK can >not? > >Is it on C++ platform or stand on another languages? > >Best > >Hossein Ghadiri > > > > > Cartik S. Sharma Sr. Developer SimQuest LLC (301).587.9440 extn 11 -------------- next part -------------- An HTML attachment was scrubbed... URL: From csharma at simquest.com Fri May 15 14:40:26 2009 From: csharma at simquest.com (Cartik Sharma) Date: Fri, 15 May 2009 14:40:26 -0400 Subject: [vtkusers] IDL vs VTK-ITK In-Reply-To: <00fc01c9d649$ed9ce950$7dd1844f@Hossein> References: <00fc01c9d649$ed9ce950$7dd1844f@Hossein> Message-ID: An HTML attachment was scrubbed... URL: From hossein.ghadiri at gmail.com Sun May 17 06:35:28 2009 From: hossein.ghadiri at gmail.com (Hossein Ghadiri) Date: Sun, 17 May 2009 15:05:28 +0430 Subject: [vtkusers] vtkMFCConfigure.h Message-ID: <000301c9d6db$34385a20$f571a8c0@Hossein> Dear all, When I open vtkMFC.sln in VS2005 and build it, receive below error: fatal error C1083: Cannot open include file: 'vtkMFCConfigure.h': No such file or directory: vtkMFCWindow.h Actually when I use CMake for vtk5.4.0, the Examples folder did not created in built folder, even when I did build vtk.sln(that take me about 1 hour) I had not have complete built GUI folder. So I use CMake for GUI folder separated. After that I open vtkMFC.sln, when I try to run it, I received above error. It seems the vtkMFCConfigure.h has not created from vtkMFCConfigure.h.in. Now my question is: Is there any special procedure to have built MFC examples in VTK? How can I build Examples folders of VTK (especially vtkMFC) simultaneous to other projects? Please let me know, what more should I do to make vtkMFCConfigure.h? Best Hoosein -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Sat May 16 11:24:15 2009 From: drescherjm at gmail.com (John Drescher) Date: Sat, 16 May 2009 11:24:15 -0400 Subject: [vtkusers] vtkMFCConfigure.h In-Reply-To: <000301c9d6db$34385a20$f571a8c0@Hossein> References: <000301c9d6db$34385a20$f571a8c0@Hossein> Message-ID: <387ee2020905160824w13a38eccx73753fba890fde05@mail.gmail.com> On Sun, May 17, 2009 at 6:35 AM, Hossein Ghadiri wrote: > Dear all, > > When I open vtkMFC.sln in VS2005 and build it, receive below error: > > ??????????? fatal error C1083: Cannot open include file: > 'vtkMFCConfigure.h': No such file or directory: vtkMFCWindow.h > > Actually when I use CMake for vtk5.4.0, the Examples folder did not created > in built folder, even when I did build vtk.sln(that take me ?about 1 hour) I > had not have complete built GUI folder. So I use CMake for GUI folder > separated. After that I open vtkMFC.sln, when I try to run it, I received > above error. > > It seems the vtkMFCConfigure.h has not created from vtkMFCConfigure.h.in. > > Now my question is: > > Is there any special procedure to have built MFC examples in VTK? > I would suggest reconfiguring with CMake-gui to enable the examples properly. I mean make sure that BUILD_EXAMPLES VTK_USE_GUISUPPORT and VTK_USE_MFC are all enabled. For this you will have to run configure a few times because without VTK_USE_GUISUPPORT enabled you will not have a VTK_USE_MFC option. John From gbook at gbook.org Sat May 16 19:58:28 2009 From: gbook at gbook.org (Greg Book) Date: Sat, 16 May 2009 19:58:28 -0400 Subject: [vtkusers] picking example in C++ In-Reply-To: <4A0C372B.90301@bic.mni.mcgill.ca> References: <4A0C29CC.6000304@gbook.org> <4A0C372B.90301@bic.mni.mcgill.ca> Message-ID: <4A0F5324.7050701@gbook.org> Thanks! That example was exactly what I was looking for. Anka Kochanowska wrote: > Check Mark Wyszomierski's site: > http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 > > Anka > > Greg Book wrote: >> I'm trying out picking and I'm looking for a picking example in C++. >> What would the annotatePick.tcl look like in C++? >> >> -Greg >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 >> > From gbook at gbook.org Sat May 16 20:12:12 2009 From: gbook at gbook.org (Greg Book) Date: Sat, 16 May 2009 20:12:12 -0400 Subject: [vtkusers] picking from a resliced image Message-ID: <4A0F565C.6030203@gbook.org> I'm using the vtkImagePlaneWidget to create arbitrarily resliced planes and I'm displaying the new plane as a vtkImageActor. I can do picking on the imageactor, but it doesn't give the correct 3D location in the volume data from which i can extract an intensity at that location. Does the imageactor give the picker access to the full 3D volume, or only the 2D resliced plane? Basically, how can I do picking on a resliced image? -Greg From wastrel at gmail.com Sat May 16 21:06:10 2009 From: wastrel at gmail.com (ken) Date: Sat, 16 May 2009 20:06:10 -0500 Subject: [vtkusers] issues when install vtk to Ubuntu Message-ID: The following issues came up when I tried to install vtk to an Ubuntu box, Linking CXX executable ../../../bin/GraphicsCxxTests /opt/Vtk/src/bin/libvtkRendering.a(vtkGLSLShaderProgram.o): In function `printOglError(char*, int)': vtkGLSLShaderProgram.cxx:(.text+0x162e): undefined reference to `glGetError' vtkGLSLShaderProgram.cxx:(.text+0x1663): undefined reference to `glGetError' /opt/Vtk/src/bin/libvtkRendering.a(vtkOpenGLExtensionManager.o): In function `vtkOpenGLExtensionManager::ExtensionSupported(char const*)': vtkOpenGLExtensionManager.cxx:(.text+0x4551): undefined reference to `glGetString' /opt/Vtk/src/bin/libvtkRendering.a(vtkGLSLShader.o): In function `vtkGLSLShader::SetUniformParameter(char const*, int, float const*)': vtkGLSLShader.cxx:(.text+0xe5d): undefined reference to `glGetError' vtkGLSLShader.cxx:(.text+0x1266): undefined reference to `glGetError' /opt/Vtk/src/bin/libvtkRendering.a(vtkGLSLShader.o): In function `vtkGLSLShader::SetUniformParameter(char const*, int, int const*)': vtkGLSLShader.cxx:(.text+0x140b): undefined reference to `glGetError' vtkGLSLShader.cxx:(.text+0x181a): undefined reference to `glGetError' /opt/Vtk/src/bin/libvtkRendering.a(vtkGLSLShader.o): In function `GLSLprintOglError(char const*, int)': vtkGLSLShader.cxx:(.text+0x1840): undefined reference to `glGetError' /opt/Vtk/src/bin/libvtkRendering.a(vtkGLSLShader.o):vtkGLSLShader.cxx:(.text+0x1875): more undefined references to `glGetError' follow /opt/Vtk/src/bin/libvtkRendering.a(vtkCompositePainter.o): In function `vtkCompositePainter::RenderInternal(vtkRenderer*, vtkActor*, unsigned long, bool)': vtkCompositePainter.cxx:(.text+0x562): undefined reference to `glMaterialfv' vtkCompositePainter.cxx:(.text+0x57d): undefined reference to `glMaterialfv' vtkCompositePainter.cxx:(.text+0x598): undefined reference to `glMaterialfv' /opt/Vtk/src/bin/libvtkftgl.a(FTGLPixmapFontRenderOpenGL.o): In function `FTGLPixmapFont::RenderOpenGL(wchar_t const*, FTGLRenderContext const*)': FTGLPixmapFontRenderOpenGL.cpp:(.text+0xe): undefined reference to `glPushClientAttrib' FTGLPixmapFontRenderOpenGL.cpp:(.text+0x1a): undefined reference to `glPushAttrib' FTGLPixmapFontRenderOpenGL.cpp:(.text+0x2e): undefined reference to `glPixelStorei' FTGLPixmapFontRenderOpenGL.cpp:(.text+0x3a): undefined reference to `glEnable' FTGLPixmapFontRenderOpenGL.cpp:(.text+0x4e): undefined reference to `glBlendFunc' FTGLPixmapFontRenderOpenGL.cpp:(.text+0x5a): undefined reference to `glDisable' FTGLPixmapFontRenderOpenGL.cpp:(.text+0x78): undefined reference to `glPopAttrib' FTGLPixmapFontRenderOpenGL.cpp:(.text+0x7d): undefined reference to `glPopClientAttrib' /opt/Vtk/src/bin/libvtkftgl.a(FTGLPixmapFontRenderOpenGL.o): In function `FTGLPixmapFont::RenderOpenGL(char const*, FTGLRenderContext const*)': FTGLPixmapFontRenderOpenGL.cpp:(.text+0x92): undefined reference to `glPushClientAttrib' FTGLPixmapFontRenderOpenGL.cpp:(.text+0x9e): undefined reference to `glPushAttrib' FTGLPixmapFontRenderOpenGL.cpp:(.text+0xb2): undefined reference to `glPixelStorei' FTGLPixmapFontRenderOpenGL.cpp:(.text+0xbe): undefined reference to `glEnable' FTGLPixmapFontRenderOpenGL.cpp:(.text+0xd2): undefined reference to `glBlendFunc' FTGLPixmapFontRenderOpenGL.cpp:(.text+0xde): undefined reference to `glDisable' FTGLPixmapFontRenderOpenGL.cpp:(.text+0xfc): undefined reference to `glPopAttrib' FTGLPixmapFontRenderOpenGL.cpp:(.text+0x101): undefined reference to `glPopClientAttrib' /opt/Vtk/src/bin/libvtkftgl.a(FTPixmapGlyphRenderOpenGL.o): In function `FTPixmapGlyph::RenderOpenGL(FT_Vector_ const&, FTGLRenderContext const*)': FTPixmapGlyphRenderOpenGL.cpp:(.text+0x6a): undefined reference to `glBitmap' FTPixmapGlyphRenderOpenGL.cpp:(.text+0x9c): undefined reference to `glDrawPixels' FTPixmapGlyphRenderOpenGL.cpp:(.text+0x10b): undefined reference to `glBitmap' /opt/Vtk/src/bin/libvtkftgl.a(FTPixmapGlyphRenderOpenGL.o): In function `FTPixmapGlyph::GetCurrentColorOpenGL(float*, FTGLRenderContext const*)': FTPixmapGlyphRenderOpenGL.cpp:(.text+0x127): undefined reference to `glGetFloatv' 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 Any helps will be appreciated! -------------- next part -------------- An HTML attachment was scrubbed... URL: From gnedin at fnal.gov Sat May 16 22:58:12 2009 From: gnedin at fnal.gov (Nick Gnedin) Date: Sat, 16 May 2009 21:58:12 -0500 Subject: [vtkusers] Bug?:5.4.0 performance versus 5.0 Message-ID: <29fcb80a0905161958t4c70ca85m4ef5e82caacc4ecf@mail.gmail.com> It seems that the problem is with vtkOpenGLDisplayListPainter.cxx. In your test, in the following piece of the code: // First check for the cases where all display lists (irrespective of // typeflags are obsolete. if ( // Since input changed input->GetMTime() > this->Internals->BuildTime || // actor's properties were modified actor->GetProperty()->GetMTime() > this->Internals->BuildTime || // mapper information was modified this->Information->GetMTime() > this->Internals->BuildTime) { this->Internals->ReleaseAllLists(); } the if(...) statement is always true, and the display list is always re-created, even when the input data does not change. Perhaps, input gets Modified() somewhere where it should not. That seems to me to be a plain bug in that class. Nick Gnedin From johnimager at gmail.com Sun May 17 02:14:29 2009 From: johnimager at gmail.com (JOHN ATKINSON) Date: Sun, 17 May 2009 11:44:29 +0530 Subject: [vtkusers] PET Images Message-ID: Hi All, I wan some PET images for volume rendering application.Can some one tell me the link from which I can download PET Images preferably DICOM or analyze.Thanks in Advance Regards John From Shekhar.Chandra at sci.monash.edu.au Mon May 18 02:05:45 2009 From: Shekhar.Chandra at sci.monash.edu.au (Shakes) Date: Mon, 18 May 2009 16:05:45 +1000 Subject: [vtkusers] issues when install vtk to Ubuntu In-Reply-To: References: Message-ID: <4A10FAB9.9080400@sci.monash.edu.au> Hi Have u tried to install VTK from Synaptic (VTK is in the repository). It will be much easier and will install all dependencies. Also ensure ur graphics drivers are working (type "glxinfo" in terminal). HTH Cheers Shakes ken wrote: > The following issues came up when I tried to install vtk to an Ubuntu box, > > Linking CXX executable ../../../bin/GraphicsCxxTests > /opt/Vtk/src/bin/libvtkRendering.a(vtkGLSLShaderProgram.o): In function > `printOglError(char*, int)': > vtkGLSLShaderProgram.cxx:(.text+0x162e): undefined reference to `glGetError' > vtkGLSLShaderProgram.cxx:(.text+0x1663): undefined reference to `glGetError' > /opt/Vtk/src/bin/libvtkRendering.a(vtkOpenGLExtensionManager.o): In > function `vtkOpenGLExtensionManager::ExtensionSupported(char const*)': > vtkOpenGLExtensionManager.cxx:(.text+0x4551): undefined reference to > `glGetString' > /opt/Vtk/src/bin/libvtkRendering.a(vtkGLSLShader.o): In function > `vtkGLSLShader::SetUniformParameter(char const*, int, float const*)': > vtkGLSLShader.cxx:(.text+0xe5d): undefined reference to `glGetError' > vtkGLSLShader.cxx:(.text+0x1266): undefined reference to `glGetError' > /opt/Vtk/src/bin/libvtkRendering.a(vtkGLSLShader.o): In function > `vtkGLSLShader::SetUniformParameter(char const*, int, int const*)': > vtkGLSLShader.cxx:(.text+0x140b): undefined reference to `glGetError' > vtkGLSLShader.cxx:(.text+0x181a): undefined reference to `glGetError' > /opt/Vtk/src/bin/libvtkRendering.a(vtkGLSLShader.o): In function > `GLSLprintOglError(char const*, int)': > vtkGLSLShader.cxx:(.text+0x1840): undefined reference to `glGetError' > /opt/Vtk/src/bin/libvtkRendering.a(vtkGLSLShader.o):vtkGLSLShader.cxx:(.text+0x1875): > more undefined references to `glGetError' follow > /opt/Vtk/src/bin/libvtkRendering.a(vtkCompositePainter.o): In function > `vtkCompositePainter::RenderInternal(vtkRenderer*, vtkActor*, unsigned > long, bool)': > vtkCompositePainter.cxx:(.text+0x562): undefined reference to `glMaterialfv' > vtkCompositePainter.cxx:(.text+0x57d): undefined reference to `glMaterialfv' > vtkCompositePainter.cxx:(.text+0x598): undefined reference to `glMaterialfv' > /opt/Vtk/src/bin/libvtkftgl.a(FTGLPixmapFontRenderOpenGL.o): In function > `FTGLPixmapFont::RenderOpenGL(wchar_t const*, FTGLRenderContext const*)': > FTGLPixmapFontRenderOpenGL.cpp:(.text+0xe): undefined reference to > `glPushClientAttrib' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0x1a): undefined reference to > `glPushAttrib' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0x2e): undefined reference to > `glPixelStorei' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0x3a): undefined reference to > `glEnable' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0x4e): undefined reference to > `glBlendFunc' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0x5a): undefined reference to > `glDisable' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0x78): undefined reference to > `glPopAttrib' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0x7d): undefined reference to > `glPopClientAttrib' > /opt/Vtk/src/bin/libvtkftgl.a(FTGLPixmapFontRenderOpenGL.o): In function > `FTGLPixmapFont::RenderOpenGL(char const*, FTGLRenderContext const*)': > FTGLPixmapFontRenderOpenGL.cpp:(.text+0x92): undefined reference to > `glPushClientAttrib' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0x9e): undefined reference to > `glPushAttrib' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0xb2): undefined reference to > `glPixelStorei' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0xbe): undefined reference to > `glEnable' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0xd2): undefined reference to > `glBlendFunc' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0xde): undefined reference to > `glDisable' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0xfc): undefined reference to > `glPopAttrib' > FTGLPixmapFontRenderOpenGL.cpp:(.text+0x101): undefined reference to > `glPopClientAttrib' > /opt/Vtk/src/bin/libvtkftgl.a(FTPixmapGlyphRenderOpenGL.o): In function > `FTPixmapGlyph::RenderOpenGL(FT_Vector_ const&, FTGLRenderContext const*)': > FTPixmapGlyphRenderOpenGL.cpp:(.text+0x6a): undefined reference to > `glBitmap' > FTPixmapGlyphRenderOpenGL.cpp:(.text+0x9c): undefined reference to > `glDrawPixels' > FTPixmapGlyphRenderOpenGL.cpp:(.text+0x10b): undefined reference to > `glBitmap' > /opt/Vtk/src/bin/libvtkftgl.a(FTPixmapGlyphRenderOpenGL.o): In function > `FTPixmapGlyph::GetCurrentColorOpenGL(float*, FTGLRenderContext const*)': > FTPixmapGlyphRenderOpenGL.cpp:(.text+0x127): undefined reference to > `glGetFloatv' > 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 > > Any helps will 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://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- A non-text attachment was scrubbed... Name: Shekhar_Chandra.vcf Type: text/x-vcard Size: 247 bytes Desc: not available URL: From bruno.arbter at isv.uni-stuttgart.de Mon May 18 03:04:00 2009 From: bruno.arbter at isv.uni-stuttgart.de (Bruno Arbter) Date: Mon, 18 May 2009 09:04:00 +0200 Subject: [vtkusers] opengl support In-Reply-To: <4A0D7BD2.5000709@elemtech.com> References: <000901c9d538$377aa840$a66ff8c0$@arbter@isv.uni-stuttgart.de> <4A0D7BD2.5000709@elemtech.com> Message-ID: <003a01c9d786$d2062f60$76128e20$@arbter@isv.uni-stuttgart.de> Platform is Windows Vista Business (64 bit). Bruno > -----Urspr?ngliche Nachricht----- > Von: Clinton Stimpson [mailto:clinton at elemtech.com] > Gesendet: Freitag, 15. Mai 2009 16:28 > An: Bruno Arbter > Cc: vtkusers at vtk.org > Betreff: Re: [vtkusers] opengl support > > Bruno Arbter wrote: > > Hi everybody, > > > > I'm using qt with vtk (QVTKWidget). Testing the QVTKWidget on OpenGL > support > > with QVTKWidget::SupportsOpenGL(), I wondered that the result was 0 > (false) > > even if the result looks fine. Same happens when testing the Medical1 > > example (without qt support). I already checked the OpenGL > requirements from > > FAQ, they are fullfilled. > > > > Any idea? Is OpenGL used anyway? > > > What platform? > If its Mac, I looks like vtkCarbonRenderWindow doesn't implement > SupportsOpenGL(). > So it'll return 0 even though OpenGL is used. > > Clint From hossein.ghadiri at gmail.com Tue May 19 03:37:02 2009 From: hossein.ghadiri at gmail.com (Hossein Ghadiri) Date: Tue, 19 May 2009 12:07:02 +0430 Subject: [vtkusers] vtkMFCConfigure.h In-Reply-To: <387ee2020905160824w13a38eccx73753fba890fde05@mail.gmail.com> Message-ID: <001c01c9d854$9b4c4850$f671a8c0@Hossein> Thanks for your help, I did it, I enabled BUILD_EXAMPLES, VTK_USE_GUISUPPORT and VTK_USE_MFC, now I have Examples folder in built folder inside vtk, But again I don?t have vtkMFCConfigure.h, besides VS2005 can not find vtkMFC.lib and I have: fatal error LNK1104: cannot open file 'vtkMFc.lib' When I searched my folders to find above files, there was nothing found! Here is the steps I did: 1- I downloaded vtk-5.0.2.rar & cmake-2.6.4-win32-x86.exe from website. 2- I did unzip vtk-5.0.2.rar to vtk-5.0.2 folder 3- I ran cmake-2.6.4-win32-x86.exe to install CMake program 4- I ran Cmake and assigned source and build directory like below: Source: F:/11-Programing/ITKVTK/vtk/source/vtk-5.0.2/VTK Build: F:/11-Programing/ITKVTK/vtk/source/vtk-5.0.2/VTK/built And then I push Configure button and select VS2005, after some moments the Configuring done. 5- At next step in red values in Cmake-gui, I enabled BUILD_EXAMPLES and again I pushed configure and new red lines come and I enabled VTK_USE_GUISUPPORT and repeated the procedure and then I enabled VTK_USE_MFC. 6- I pushed generate and it was done. 7- But, now, I did not have the above mentioned files. So sorry for my long letter. Hossein -----Original Message----- From: John Drescher [mailto:drescherjm at gmail.com] Sent: Saturday, May 16, 2009 7:54 PM To: Hossein Ghadiri Cc: vtkusers at vtk.org Subject: Re: [vtkusers] vtkMFCConfigure.h On Sun, May 17, 2009 at 6:35 AM, Hossein Ghadiri wrote: > Dear all, > > When I open vtkMFC.sln in VS2005 and build it, receive below error: > > ??????????? fatal error C1083: Cannot open include file: > 'vtkMFCConfigure.h': No such file or directory: vtkMFCWindow.h > > Actually when I use CMake for vtk5.4.0, the Examples folder did not created > in built folder, even when I did build vtk.sln(that take me ?about 1 hour) I > had not have complete built GUI folder. So I use CMake for GUI folder > separated. After that I open vtkMFC.sln, when I try to run it, I received > above error. > > It seems the vtkMFCConfigure.h has not created from vtkMFCConfigure.h.in. > > Now my question is: > > Is there any special procedure to have built MFC examples in VTK? > I would suggest reconfiguring with CMake-gui to enable the examples properly. I mean make sure that BUILD_EXAMPLES VTK_USE_GUISUPPORT and VTK_USE_MFC are all enabled. For this you will have to run configure a few times because without VTK_USE_GUISUPPORT enabled you will not have a VTK_USE_MFC option. John From liusaifeng at gmail.com Mon May 18 04:09:17 2009 From: liusaifeng at gmail.com (Saifeng Liu) Date: Mon, 18 May 2009 16:09:17 +0800 Subject: [vtkusers] How to display 3D RGB data with VTK? Message-ID: <8106cfac0905180109r3564e716w887322e0ef828f3f@mail.gmail.com> Hi, I have developed a program to display 3D ultrasound raw data, and everything goes well. Now I want to extend my work by displaying some 3D RGB raw data, but I failed. I have found somebody's suggestion on the mailing list, the suggestion is that, first quantizing the color to a small set of colors ,and then build a lookup table for it. I have tried this, but it does not work. Maybe I did it in a wrong way. now I have a 3D RGB raw data, and there are 3 components( the r,g,b value; 8 bit ) in each scalar, and I have successfully created a vtkImageData, and I want to display a single slice of this image data. I choose to use vtkReslice to display the sagittal, coronal and axial slices; and I choose to use vtkImagePlaneWidget to display these slices together. They all work perfectly with grey scale raw data. So how to build up a lookup table for rgb data? or how to quantizing my data to a small set of colors? Besides, can we display the data directly without building a lookup table, since the value itself is RGB value already? Thank you very much for your help. Saifeng, How I create the vtkImageData, and read in some binary data. //*********************************** vtkImageData* id = vtkImageData::New(); id->SetDimensions(256,256,256); id->SetSpacing(1,1,1); id->SetScalarTypeToUnsignedChar(); id->SetNumberOfScalarComponents(3);// the r,g,b value. id->SetOrigin(0.0,0.0,0.0); id->AllocateScalars(); //Then I fill in the image data with my raw data. ifstream infile("/home/Rawdata/rgbcube.raw",ios::in|ios::binary); int size=256*256*256*3; unsigned char *buf=new unsigned char [size]; infile.read((char *)buf,size); infile.close(); //fill in imagedata; unsigned char *ptr = (unsigned char *) id->GetScalarPointer(); int i; for(i=0;i From ilferraresebono at hotmail.it Mon May 18 05:14:08 2009 From: ilferraresebono at hotmail.it (Giancarlo Amati) Date: Mon, 18 May 2009 11:14:08 +0200 Subject: [vtkusers] threads and refreshing vtkRenderWindow In-Reply-To: References: Message-ID: Nope I don't,....I was just telling you how I did organize my code...and as you said the Render() function should be called only from the thread that the MAIN one, I was simply asking..if calling a function which belongs to the main thread (which is the Parent from the 2nd one) is the reason that generates the wglMakeCurrent error. Moreover, as the documentation about the vtkMutexLock class on the vtk website is quite poor, I was just wondering if there were any other resource. My project is mainly about a device system which tracks IReds visulalized with VTK, basically what I am doing is a real-time animation with QT and VTK. So, as I need to update the VTK scene without interfering with the QT events, the QT users group told me that the best way is to create a thread which updates the scene. But apparently this generates a wglMakeCurrent error for the reasons you told me. GC. Date: Fri, 15 May 2009 11:08:20 -0400 Subject: Re: [vtkusers] threads and refreshing vtkRenderWindow From: david.cole at kitware.com To: ilferraresebono at hotmail.it CC: vtkusers at vtk.org Are you asking us to tell you how your program is organized with respect to threads? (That's somewhat beyond the scope of the VTK mailing list.) It sounds like your project might be better off single-threaded. It would be better if you call UpdateMy3DObject from the same thread that actually does the rendering. On Fri, May 15, 2009 at 10:59 AM, Giancarlo Amati wrote: Many thanks, what I have is a mainWindow which has functions for rendering and then a thread that calls a kind of "UpdateMy3Dobjects" function which belongs to the mainWindow object. Now, this "UpdateMy3DObjects" function works fine whenever that thread is not running while, I got the wglMakeCurrent error as soon as the thread runs the UpdateMy3Dobjects" function. So, as the UpdateMy3Dobjects function calls the RenderWindow->Render() method (renderwindow buidt in a QVTKWidget object of my GUI) calling that UpdateMy3DObject from the thread does correspond to a call form a thread different from the main one? In that case if I create a global variable, boolean for example which is true when I execute the UpdateMy3DObject function and false otherwise...would it help to synchronize these threads? I checked out on the VTK documentation and I found the vktMutexLock class....and i tried to understand the example in the documetation which is a bit difficult honestly, but,....can that class be useful for my project? many kind regards. Giancarlo Date: Fri, 15 May 2009 10:19:51 -0400 Subject: Re: [vtkusers] threads and refreshing vtkRenderWindow From: david.cole at kitware.com To: ilferraresebono at hotmail.it CC: vtkusers at vtk.org I will not claim to be cleverer, but I think I can answer the question: Your mistake is calling vtkObjects from multiple threads without synchonization objects. In general, vtkObjects are only safely accessible by one thread at a time. Multi-thread access means you will have to use some sort of mutexes or locks to guarantee that only one thread at a time will call vtkObject methods. Furthermore, you should only attempt to call Render from the main GUI thread of your application. Hope this helps,David On Fri, May 15, 2009 at 9:25 AM, Giancarlo Amati wrote: Hello vtkUSERS!!! This is an ash question for only the cleverer!! :D I have a thread which modifies some data already in the vtkRenderWindow., now, the problem I have is when I want to refresh the window. I though calling something like renderWindow->Render() or renderer->render(), but I get some error messages related to "Resource already in use" and "wglMakeCurrent()" function error. Where is my mistake and any idea about how to overcome it? Kind regards. GC. Scrivi, parla e gioca con i tuoi amici! Scarica Messenger 2009! _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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 Quali sono le parole pi? cliccate? Scopri la top! _________________________________________________________________ Pi? di 100 Emoticon gratis per il tuo Messenger! http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: From Maxim.Schaefner at gmx.de Mon May 18 06:12:50 2009 From: Maxim.Schaefner at gmx.de (=?iso-8859-1?Q?=22Maxim_Sch=E4fner=22?=) Date: Mon, 18 May 2009 12:12:50 +0200 Subject: [vtkusers] ViewProps/Actors in Renderer where doublerendered, by call removeAllViewProps/Actors nothing more to see. But all thinks are done to that time in the props. And must delete them. Message-ID: <20090518101250.260030@gmx.net> Hi, I using the vtkProps to do thinks in the application, by the end of the building of the rendering, i want to delete alle these actors/viewprops, because the already done their work at that stage. But when I remove alle the props, there nothing more to see, on the window. But when I don't delete them, nothings been done a second time without my will. What can i do, to prevent the renderer to call all already done props to do their work a second time? Thanks. Maxim -- Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss f?r nur 17,95 Euro/mtl.!* http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a From emonson at cs.duke.edu Mon May 18 09:07:10 2009 From: emonson at cs.duke.edu (Eric E. Monson) Date: Mon, 18 May 2009 09:07:10 -0400 Subject: [vtkusers] VTK and Numpy In-Reply-To: <4d1a61ba0905121916k4328ad1mb2c65493b2822af8@mail.gmail.com> References: <4d1a61ba0905120912q7ee17842m5a67226a10ef8bd8@mail.gmail.com> <9CB6A811-D528-4F66-8DA3-33D22D5F93DE@cs.duke.edu> <4d1a61ba0905121916k4328ad1mb2c65493b2822af8@mail.gmail.com> Message-ID: Hey Peter, I think you really need to call Update() before your conversion to a numpy array, or the pipeline (your filters) won't execute. The writers will automatically update the pipeline before writing out their data, but the vtk_to_numpy() won't, so you'll have to call Update() explicitly before that. For example, here is basically your pipeline, but reading one of the standard VTK data sets (in case you don't have it, you can download the VTK data sets from the site http://www.vtk.org/VTK/resources/software.html ). ================= import vtk import vtk.util.numpy_support as VN reader = vtk.vtkRectilinearGridReader() reader.SetFileName('/Users/emonson/Programming/VTK_cvs/VTKData/Data/ RectGrid2.vtk') skinExtractor = vtk.vtkContourFilter() skinExtractor.SetInputConnection(reader.GetOutputPort()) skinExtractor.SetValue(0, 5.2) skinConnect=vtk.vtkPolyDataConnectivityFilter() skinConnect.SetExtractionModeToLargestRegion() skinConnect.SetInputConnection(skinExtractor.GetOutputPort()) skinNormals = vtk.vtkPolyDataNormals() skinNormals.SetInputConnection(skinConnect.GetOutputPort()) skinNormals.SetFeatureAngle(60.0) skinu = skinNormals.GetOutput() # Force the pipeline to execute skinu.Update() ar = VN.vtk_to_numpy(skinu.GetPoints().GetData()) print ar ================= Talk to you later, -Eric ------------------------------------------------------ Eric E Monson Duke Visualization Technology Group On May 12, 2009, at 10:16 PM, Peter Halverson wrote: > Thank you for the fast response. That seems to work really well. > Although it ignores my filters. My code is as follows > > reader=vtk.vtkDICOMImageReader() > reader.SetDirectoryName('./SE1/') > reader.Update() > > skinExtractor = vtk.vtkContourFilter() > skinExtractor.SetInputConnection(reader.GetOutputPort()) > skinExtractor.SetValue(SkinLow, SkinHigh) > > skinConnect=vtk.vtkPolyDataConnectivityFilter() > skinConnect.SetExtractionModeToLargestRegion() > skinConnect.SetInputConnection(skinExtractor.GetOutputPort()) > > skinNormals = vtk.vtkPolyDataNormals() > skinNormals.SetInputConnection(skinConnect.GetOutputPort()) > skinNormals.SetFeatureAngle(60.0) > > ar=vtk_to_numpy(skinNormals.GetOutput().GetPoints().GetData()) > > > When I render the image (code shown below) my filters work fine and > if I export it as an stl my filters work fine (code also below) [the > latter being entirely unnecesarry, but a nice way to check]. As per > the help files I've tried decorating the code with Update() > [ i.e. > skinu= skinNormals.GetOutput() > skinu.Update() > skinu.GetPoints().GetData() > ] > > but that hasn't done much... > > #Render > skinMapper = vtk.vtkPolyDataMapper() > skinMapper.SetInputConnection(skinNormals.GetOutputPort()) > skinMapper.ScalarVisibilityOff() > > skin = vtk.vtkActor() > skin.SetMapper(skinMapper) > > #Export to STL > stlout = vtk.vtkSTLWriter() > stlout.SetFileName("hello.stl") > stlout.SetInput(skinNormals.GetOutput()) > stlout.SetFileType(2) > stlout.Write() > > > On Tue, May 12, 2009 at 1:15 PM, Eric E. Monson > wrote: > Hey Peter, > > Say pd is a vtkPolyData() object, then you can get the point > coordinates with: > > vtk_to_numpy(pd.GetPoints().GetData()) > > -Eric > > ------------------------------------------------------ > Eric E Monson > Duke Visualization Technology Group > > > > On May 12, 2009, at 12:12 PM, Peter Halverson wrote: > > I'm attempting to export VTK data into numpy using vtk_to_numpy. > The program reads in a set of DICOM files using vtkDICOMImageReader. > Filters the image using vtkContourFilter, and some other stuff and > then displays the rendered solid. I would then like to export the > data to Numpy so i do the following > scalars=skin.GetMapper().GetInput().GetPointData().GetScalars() > > Which gives me the scalars that I am looking for. My question is > how do get the [x,y,z] data to go with the scalars into numpy? > > skin.GetMapper().GetInput().GetWholeExtent() gives me the correct > dimensions (0, 511, 0, 511, 0, 56) but I have exported less scalars > than this... > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 drescherjm at gmail.com Mon May 18 09:17:18 2009 From: drescherjm at gmail.com (John Drescher) Date: Mon, 18 May 2009 09:17:18 -0400 Subject: [vtkusers] vtkMFCConfigure.h In-Reply-To: <001c01c9d854$9b4c4850$f671a8c0@Hossein> References: <387ee2020905160824w13a38eccx73753fba890fde05@mail.gmail.com> <001c01c9d854$9b4c4850$f671a8c0@Hossein> Message-ID: <387ee2020905180617l56df3578k23580a40a53f5bf0@mail.gmail.com> On Tue, May 19, 2009 at 3:37 AM, Hossein Ghadiri wrote: > Thanks for your help, I did it, > I enabled BUILD_EXAMPLES, VTK_USE_GUISUPPORT and > VTK_USE_MFC, now I have Examples folder in built folder inside vtk, > But again I don?t have vtkMFCConfigure.h, besides VS2005 can not find > vtkMFC.lib and I have: > ? ? ? ?fatal error LNK1104: cannot open file 'vtkMFc.lib' > When I searched my folders to find above files, there was nothing found! > Here is the steps I did: > 1- I downloaded vtk-5.0.2.rar & cmake-2.6.4-win32-x86.exe from website. > 2- I did unzip vtk-5.0.2.rar to vtk-5.0.2 folder > 3- I ran cmake-2.6.4-win32-x86.exe to install CMake program > 4- I ran Cmake and assigned source and build directory like below: > ? ? ?Source: F:/11-Programing/ITKVTK/vtk/source/vtk-5.0.2/VTK > ? ? ?Build: ?F:/11-Programing/ITKVTK/vtk/source/vtk-5.0.2/VTK/built > ? And then I push Configure button and select VS2005, after some moments > the Configuring done. > 5- At next step in red values in Cmake-gui, I enabled BUILD_EXAMPLES and > again I pushed configure and new red lines come and I enabled > VTK_USE_GUISUPPORT and repeated the procedure and then I enabled > VTK_USE_MFC. > 6- I pushed generate and it was done. > 7- But, now, I did not have the above mentioned files. > Did you build vtk again? It should not take a long this time. Do not do a clean. John From emonson at cs.duke.edu Mon May 18 09:48:39 2009 From: emonson at cs.duke.edu (Eric E. Monson) Date: Mon, 18 May 2009 09:48:39 -0400 Subject: [vtkusers] vtkPolyDataConnectivityFilter() doesn't filter data when passed to out In-Reply-To: <4d1a61ba0905140752g3eeed8e3y4bc91f180ab9037c@mail.gmail.com> References: <4d1a61ba0905140752g3eeed8e3y4bc91f180ab9037c@mail.gmail.com> Message-ID: <49E396AE-744D-4068-8749-94491A9C8F20@cs.duke.edu> Hey Peter, I think the filter is working correctly. Try this modification of your earlier script. (Again, this uses a standard VTK data set.) By default I've changed the option on the connectivity filter to grab all regions, but color them by their region number. You should see two sort of parabolic-shaped regions, one red and one blue. If you comment out the "all regions" stuff and use the "largest region", you should just see the large region in the render window. You can also see that there are extra coordinate points printed out for the "all regions" case, so I think the data is getting to the numpy array correctly. =============== import vtk import vtk.util.numpy_support as VN reader = vtk.vtkRectilinearGridReader() reader.SetFileName('/Users/emonson/Programming/VTK_cvs/VTKData/Data/ RectGrid2.vtk') skinExtractor = vtk.vtkContourFilter() skinExtractor.SetInputConnection(reader.GetOutputPort()) skinExtractor.SetValue(0, 5.2) skinConnect=vtk.vtkPolyDataConnectivityFilter() skinConnect.SetInputConnection(skinExtractor.GetOutputPort()) # All Regions: skinConnect.SetExtractionModeToAllRegions() skinConnect.SetColorRegions(1) # Largest Region: # skinConnect.SetExtractionModeToLargestRegion() skinNormals = vtk.vtkPolyDataNormals() skinNormals.SetInputConnection(skinConnect.GetOutputPort()) skinNormals.SetFeatureAngle(60.0) skinMapper = vtk.vtkPolyDataMapper() skinMapper.SetInputConnection(skinNormals.GetOutputPort()) skinMapper.ScalarVisibilityOn() skinMapper.SetColorModeToMapScalars() skinMapper.SelectColorArray('scalars') skinActor = vtk.vtkActor() skinActor.SetMapper(skinMapper) skinu = skinNormals.GetOutput() # Force the pipeline to execute skinu.Update() ar = VN.vtk_to_numpy(skinu.GetPoints().GetData()) print ar ren = vtk.vtkRenderer() ren.AddActor(skinActor) renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) ren.ResetCamera() renWin.Render() iren.Initialize() iren.Start() =============== Hope this helps clear it up, -Eric ------------------------------------------------------ Eric E Monson Duke Visualization Technology Group On May 14, 2009, at 10:52 AM, Peter Halverson wrote: > I'm having some difficulty with vtkPolyDataConnectivityFilter(). > VTK is able to visualize it but I can't get the data out of it. > I've written a program that works as follows > > 1. Uses vtkDICOMImageReader() to read in a CT image and pass that to > 2. vtkContourfilter() to reduce that image and pass that to > 3. vtkPolyDataConnectivityFilter() to get the largest connected > region and pass that to > 4. vtkPolyDataNormals() which passes it to > 5. vtkPolyDataMapper() and then to > 6. vtkActor() which is able to render only the largest connected > region (the skin in this case) > > When I pass the data to python using > vtk_ar > = > vtk_to_numpy(skinactor.GetMapper().GetInput().GetPoints().GetData()) > I get the output from step 2 which includes the disconnected > regions. I've searched the vtk mail archives and the books but > can't find out how to get the data after the ConnectivityFilter is > called. I'm new to vtk, any help would be appreciated. > > Peter > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers From ronharshbarger at mmm.com Mon May 18 09:47:38 2009 From: ronharshbarger at mmm.com (ronharshbarger at mmm.com) Date: Mon, 18 May 2009 08:47:38 -0500 Subject: [vtkusers] Decided to try again! Message-ID: OK, I put this aside a while back out of frustration and a lack of available time. I have now decided to revisit VTK because I really like the renderings that I have seen. The facts: 1. I have been creating applications in MSVC++ ( MFC ) inside of visual studio for at least a decade with some success. 2. I haven't written a make file in at least 20 years.. can't remember it anyway! 3. I purchased the books "Visualization Toolkit", "Mastering CMake", and "VTK Users Guide" along with the CD from Kitware Inc. 4. I am overwhelmed and need some basic "get started" help! Yes even more basic than the "getting started" section. I suppose I've been dumbed down by the GUI interface of Visual Studio. I guess I need a "Hello World" level intro. 5. Ideally, I would like to integrate the visualization into my MFC Apps but I can deal with a separate app if necessary. SO where do I start? What do I install? (binaries, source, etc.) I see references to Tcl and Tkt, should I pursue them and abandon MSVC? Any help will be appreciated!!!! Ron H. From drescherjm at gmail.com Mon May 18 10:17:42 2009 From: drescherjm at gmail.com (John Drescher) Date: Mon, 18 May 2009 10:17:42 -0400 Subject: [vtkusers] Decided to try again! In-Reply-To: References: Message-ID: <387ee2020905180717u7a59b9fvd4a17c105f82bfe4@mail.gmail.com> On Mon, May 18, 2009 at 9:47 AM, wrote: > > OK, I put this aside a while back out of frustration and a lack of > available time. I have now decided to revisit VTK because I really like the > renderings that I have seen. > > The facts: > 1. I have been creating applications in MSVC++ ( MFC ) inside of visual > studio for at least a decade with some success. > 2. I haven't written a make file in at least 20 years.. can't remember it > anyway! > 3. I purchased the books "Visualization Toolkit", "Mastering CMake", and > "VTK Users Guide" along with the CD from Kitware Inc. > 4. I am overwhelmed and need some basic "get started" help! Yes even more > basic than the "getting started" section. I suppose I've been dumbed down > by the GUI interface of Visual Studio. I guess I need a "Hello World" level > intro. > 5. Ideally, I would like to integrate the visualization into my MFC Apps > but I can deal with a separate app if necessary. > > SO where do I start? What do I install? (binaries, source, etc.) I see > references to Tcl and Tkt, should I pursue them and abandon MSVC? > Download and install CMake-2.6.4. Then download the source for vtk-5.4. Open cmake-gui and configure vtk. Select a build folder that is not in the tree for the source. The Cmake manual should explain out of source builds read that section to understand why. After you have the paths selected click Configure Then enable VTK_USE_GUISUPPORT then Configure then enable VTK_USE_MFC. Also enable BUILD_EXAMPLES. At first only VTK_USE_GUISUPPORT will be visible after a click or two on configure (be patient it will take some time) you should have all the options avaiable. After configured finally choose Generate to generate your Visual Studio project file. And then build. Then open the project in Visual Studio and build. I recommend building the debug version at first. Then probably the releasewithdbginfo. Then open the examples in the MFC folder and try them out. When you do get around to writing applications, I highly recommend that you use CMake to generate you visual studio projects. This will greatly reduce any headaches you have dealing with linking modes and include folders since cmake manages all of this for you.. BTW, I am a 15 year MFC / windows programmer who started using vtk about 1 year ago. I am now writing cross platform Qt / vtk/itk applications daily. John From clinton at elemtech.com Mon May 18 10:52:20 2009 From: clinton at elemtech.com (Clinton Stimpson) Date: Mon, 18 May 2009 08:52:20 -0600 Subject: [vtkusers] threads and refreshing vtkRenderWindow In-Reply-To: References: Message-ID: <4A117624.7010807@elemtech.com> Have you look at this? http://doc.trolltech.com/qq/qq06-glimpsing.html It would need adjustments if using VTK instead, and I'm curious if it'll work just fine. But, first, you could try overloading QVTKWidget::paintEvent() to do nothing. Then in your QThread::run, you create all your VTK objects and do your Render() calls from there. You're getting the wglMakeCurrent error because the context is current in the main thread, and you're trying to make it current in another thread as well. That is not allowed. http://msdn.microsoft.com/en-us/library/dd374387(VS.85).aspx Clint Giancarlo Amati wrote: > Nope I don't,....I was just telling you how I did organize my > code...and as you said the Render() function should be called only > from the thread that the MAIN one, I was simply asking..if calling a > function which belongs to the main thread (which is the Parent from > the 2nd one) is the reason that generates the wglMakeCurrent error. > Moreover, as the documentation about the vtkMutexLock class on the vtk > website is quite poor, I was just wondering if there were any other > resource. > > My project is mainly about a device system which tracks IReds > visulalized with VTK, basically what I am doing is a real-time > animation with QT and VTK. So, as I need to update the VTK scene > without interfering with the QT events, the QT users group told me > that the best way is to create a thread which updates the scene. But > apparently this generates a wglMakeCurrent error for the reasons you > told me. > > > GC. > > ------------------------------------------------------------------------ > Date: Fri, 15 May 2009 11:08:20 -0400 > Subject: Re: [vtkusers] threads and refreshing vtkRenderWindow > From: david.cole at kitware.com > To: ilferraresebono at hotmail.it > CC: vtkusers at vtk.org > > Are you asking us to tell you how your program is organized with > respect to threads? (That's somewhat beyond the scope of the VTK > mailing list.) > > It sounds like your project might be better off single-threaded. > > It would be better if you call UpdateMy3DObject from the same thread > that actually does the rendering. > > > On Fri, May 15, 2009 at 10:59 AM, Giancarlo Amati > > wrote: > > Many thanks, > > what I have is a mainWindow which has functions for rendering and > then a thread that calls a kind of "UpdateMy3Dobjects" function > which belongs to the mainWindow object. Now, > this "UpdateMy3DObjects" function works fine whenever that thread > is not running while, I got the wglMakeCurrent error as soon as > the thread runs the UpdateMy3Dobjects" function. > So, > as the UpdateMy3Dobjects function calls the RenderWindow->Render() > method (renderwindow buidt in a QVTKWidget object of my GUI) > calling that UpdateMy3DObject from the thread does correspond to a > call form a thread different from the main one? > In that case if I create a global variable, boolean for example > which is true when I execute the UpdateMy3DObject function and > false otherwise...would it help to synchronize these threads? > > I checked out on the VTK documentation and I found the > vktMutexLock class....and i tried to understand the example in the > documetation which is a bit difficult honestly, but,....can that > class be useful for my project? > > many kind regards. > Giancarlo > > ------------------------------------------------------------------------ > Date: Fri, 15 May 2009 10:19:51 -0400 > Subject: Re: [vtkusers] threads and refreshing vtkRenderWindow > From: david.cole at kitware.com > To: ilferraresebono at hotmail.it > CC: vtkusers at vtk.org > > > I will not claim to be cleverer, but I think I can answer the > question: > > Your mistake is calling vtkObjects from multiple threads without > synchonization objects. In general, vtkObjects are only safely > accessible by one thread at a time. Multi-thread access means you > will have to use some sort of mutexes or locks to guarantee that > only one thread at a time will call vtkObject methods. > Furthermore, you should only attempt to call Render from the main > GUI thread of your application. > > > Hope this helps, > David > > > On Fri, May 15, 2009 at 9:25 AM, Giancarlo Amati > > > wrote: > > Hello vtkUSERS!!! This is an ash question for only the > cleverer!! :D > > I have a thread which modifies some data already in the > vtkRenderWindow., now, the problem I have is when I want to > refresh the window. > I though calling something like renderWindow->Render() or > renderer->render(), but I get some error messages related to > "Resource already in use" and "wglMakeCurrent()" function error. > > Where is my mistake and any idea about how to overcome it? > > Kind regards. > > GC. > > ------------------------------------------------------------------------ > Scrivi, parla e gioca con i tuoi amici! Scarica Messenger > 2009! > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > > > ------------------------------------------------------------------------ > Quali sono le parole pi? cliccate? Scopri la top! > > > > > ------------------------------------------------------------------------ > Quali sono le parole pi? cliccate? Scopri la top! > > ------------------------------------------------------------------------ > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > From cocoricore at gmail.com Mon May 18 12:26:27 2009 From: cocoricore at gmail.com (Corinne Tith) Date: Mon, 18 May 2009 18:26:27 +0200 Subject: [vtkusers] SelectColorArray Message-ID: Hi all, I would like to color an isosurface with scalar field. When I associate my scalars to my data set before filtering, I have no problem. To reduce time processing, I want to associate my scalars after filtering operation, but I only get grey 3D object on screen. //before filtering int nbPoints = (int)m_ImageData->GetPointData()->GetArray(0)->GetNumberOfTuples(); vtkIntArray *colorArray = vtkIntArray::New(); colorArray->SetName("colorArray"); //m_ProcessedImageData->SetScalarTypeToShort(); colorArray->SetNumberOfValues(nbPoints); int *ptrColorArray = colorArray->GetPointer(0); for( int i = 0; i < nbPoints i++){ ptrColorArray[i] = 1; // just to test } m_ImageData->GetPointData()->AddArray(colorArray); [filtering] m_Reverser->Update(); int nbPoints = (int)m_ReverseSenceFilter->GetOutput()->GetPointData()->GetArray(0)->GetNumberOfTuples(); vtkIntArray *colorArray2 = vtkIntArray::New(); colorArray2->SetName("colorArray2"); //m_ReverseSenceFilter->GetOutput()->SetScalarTypeToShort(); colorArray2->SetNumberOfValues(nbPoints); int *ptrColorArray2 = colorArray2->GetPointer(0); for(i = 0; i < 100; i++) ptrColorArray2[i] = 2; for(i = 100; i < nbPoints; i++) ptrColorArray2[i] = 4; m_ReverseSenceFilter->GetOutput()->GetPointData()->AddArray(colorArray2); m_ReverseSenceFilter->GetOutput()->GetPointData()->SetActiveScalars("colorArray2"); // render m_PolyDataMapper->ScalarVisibilityOn(); m_PolyDataMapper->SetScalarRange(0,11); m_PolyDataMapper->SetScalarModeToUseCellFieldData(); m_PolyDataMapper->SelectColorArray("colorArray2"); // my object is just grey //m_PolyDataMapper->SelectColorArray("colorArray"); // no problem if I uncomment this line My colorArray2 scalars are well add to my ReverseSenseFilter. Where is my mistake and any idea about how to overcome it? Thanks, Corinne -------------- next part -------------- An HTML attachment was scrubbed... URL: From halverson at byu.edu Mon May 18 12:37:50 2009 From: halverson at byu.edu (Peter Halverson) Date: Mon, 18 May 2009 10:37:50 -0600 Subject: [vtkusers] vtkPolyDataConnectivityFilter() doesn't filter data when passed to out In-Reply-To: <49E396AE-744D-4068-8749-94491A9C8F20@cs.duke.edu> References: <4d1a61ba0905140752g3eeed8e3y4bc91f180ab9037c@mail.gmail.com> <49E396AE-744D-4068-8749-94491A9C8F20@cs.duke.edu> Message-ID: <4d1a61ba0905180937h68deec1fhcaa4af655021fdff@mail.gmail.com> >this uses a standard vtk data set. A standard vtk dataset, absolutely brilliant (I was wondering how to demonstrate this)! I ran the code with and without the commented section. SetExtractionModeToLargestRegion() eliminates some of the data (size(ar) shrinks from 618 to 597). However, I'm not sure what it eliminates. When I plot a slice of ar (AR[2]>0.899999) I get the same plot. A link to a screen shot of python running in two seperate process (uncommented is the upper) is available at http://www.et.byu.edu/~pah32/VTK/ScreenCapture.PNG The modified code is below ========================================= cd C:\Users\Peter\Desktop\VTKTEMP import vtk import vtk.util.numpy_support as VN from pylab import * reader = vtk.vtkRectilinearGridReader() reader.SetFileName('.\RectGrid2.vtk') skinExtractor = vtk.vtkContourFilter() skinExtractor.SetInputConnection(reader.GetOutputPort()) skinExtractor.SetValue(0, 5.2) skinConnect=vtk.vtkPolyDataConnectivityFilter() skinConnect.SetInputConnection(skinExtractor.GetOutputPort()) # All Regions: skinConnect.SetExtractionModeToAllRegions() skinConnect.SetColorRegions(1) # Largest Region: skinConnect.SetExtractionModeToLargestRegion() skinNormals = vtk.vtkPolyDataNormals() skinNormals.SetInputConnection(skinConnect.GetOutputPort()) skinNormals.SetFeatureAngle(60.0) skinMapper = vtk.vtkPolyDataMapper() skinMapper.SetInputConnection(skinNormals.GetOutputPort()) skinMapper.ScalarVisibilityOn() skinMapper.SetColorModeToMapScalars() skinMapper.SelectColorArray('scalars') skinActor = vtk.vtkActor() skinActor.SetMapper(skinMapper) skinu = skinNormals.GetOutput() # Force the pipeline to execute skinu.Update() ar = VN.vtk_to_numpy(skinu.GetPoints().GetData()) #print ar temp=[] for item in ar: if item[2]>0.899999: temp+=[item] temp=array(temp) x1=temp[:,0] y1=temp[:,1] scatter(x1,y1) show() ren = vtk.vtkRenderer() ren.AddActor(skinActor) renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) ren.ResetCamera() renWin.Render() iren.Initialize() iren.Start() ========================================= Thanks for your help. On Mon, May 18, 2009 at 7:48 AM, Eric E. Monson wrote: > Hey Peter, > > I think the filter is working correctly. Try this modification of your > earlier script. (Again, this uses a standard VTK data set.) > > By default I've changed the option on the connectivity filter to grab all > regions, but color them by their region number. You should see two sort of > parabolic-shaped regions, one red and one blue. If you comment out the "all > regions" stuff and use the "largest region", you should just see the large > region in the render window. You can also see that there are extra > coordinate points printed out for the "all regions" case, so I think the > data is getting to the numpy array correctly. > > =============== > import vtk > import vtk.util.numpy_support as VN > > reader = vtk.vtkRectilinearGridReader() > > reader.SetFileName('/Users/emonson/Programming/VTK_cvs/VTKData/Data/RectGrid2.vtk') > > skinExtractor = vtk.vtkContourFilter() > skinExtractor.SetInputConnection(reader.GetOutputPort()) > skinExtractor.SetValue(0, 5.2) > > skinConnect=vtk.vtkPolyDataConnectivityFilter() > skinConnect.SetInputConnection(skinExtractor.GetOutputPort()) > > # All Regions: > skinConnect.SetExtractionModeToAllRegions() > skinConnect.SetColorRegions(1) > > # Largest Region: > # skinConnect.SetExtractionModeToLargestRegion() > > skinNormals = vtk.vtkPolyDataNormals() > skinNormals.SetInputConnection(skinConnect.GetOutputPort()) > skinNormals.SetFeatureAngle(60.0) > > skinMapper = vtk.vtkPolyDataMapper() > skinMapper.SetInputConnection(skinNormals.GetOutputPort()) > skinMapper.ScalarVisibilityOn() > skinMapper.SetColorModeToMapScalars() > skinMapper.SelectColorArray('scalars') > > skinActor = vtk.vtkActor() > skinActor.SetMapper(skinMapper) > > skinu = skinNormals.GetOutput() > # Force the pipeline to execute > skinu.Update() > > ar = VN.vtk_to_numpy(skinu.GetPoints().GetData()) > print ar > > ren = vtk.vtkRenderer() > ren.AddActor(skinActor) > renWin = vtk.vtkRenderWindow() > renWin.AddRenderer(ren) > iren = vtk.vtkRenderWindowInteractor() > iren.SetRenderWindow(renWin) > > ren.ResetCamera() > renWin.Render() > iren.Initialize() > iren.Start() > > =============== > > Hope this helps clear it up, > -Eric > > ------------------------------------------------------ > Eric E Monson > Duke Visualization Technology Group > > > > On May 14, 2009, at 10:52 AM, Peter Halverson wrote: > > I'm having some difficulty with vtkPolyDataConnectivityFilter(). VTK is >> able to visualize it but I can't get the data out of it. I've written a >> program that works as follows >> >> 1. Uses vtkDICOMImageReader() to read in a CT image and pass that to >> 2. vtkContourfilter() to reduce that image and pass that to >> 3. vtkPolyDataConnectivityFilter() to get the largest connected region and >> pass that to >> 4. vtkPolyDataNormals() which passes it to >> 5. vtkPolyDataMapper() and then to >> 6. vtkActor() which is able to render only the largest connected region >> (the skin in this case) >> >> When I pass the data to python using >> vtk_ar=vtk_to_numpy(skinactor.GetMapper().GetInput().GetPoints().GetData()) >> I get the output from step 2 which includes the disconnected regions. I've >> searched the vtk mail archives and the books but can't find out how to get >> the data after the ConnectivityFilter is called. I'm new to vtk, any help >> would be appreciated. >> >> Peter >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jinzhong76 at gmail.com Mon May 18 13:34:20 2009 From: jinzhong76 at gmail.com (Yang, Jinzhong) Date: Mon, 18 May 2009 12:34:20 -0500 Subject: [vtkusers] Problem of ShallowCopy with vtkWindowedSincPolyDataFilter Message-ID: <00c901c9d7de$e1507db0$a3f17910$@com> Hi All, I have a problem when I use ShallowCopy to copy data from the output of vtkWindowedSincPolyDataFilter. Following is my code: vtkPolyData* InterimOutput; . . vtkWindowedSincPolyDataFilter* smoother = vtkWindowedSincPolyDataFilter::New(); smoother->SetInput(InterimOutput); smoother->GenerateErrorVectorsOn(); smoother->NormalizeCoordinatesOn(); smoother->BoundarySmoothingOn(); smoother->SetNumberOfIterations(this->NumberOfSmoothingIterations); smoother->SetFeatureEdgeSmoothing(this->SmoothingFeatureEdge); smoother->SetFeatureAngle(this->SmoothingFeatureAngle); smoother->SetEdgeAngle(this->SmoothingEdgeAngle); smoother->SetPassBand(this->SmoothingPassBand); smoother->Update(); InterimOutput->Reset(); InterimOutput->ShallowCopy(smoother->GetOutput()); <--The data in smoother cannot be copied to InterimOutput While I use vtkPolyDataNormals after the smoothing, then the ShallowCopy is fine: . . vtkWindowedSincPolyDataFilter* smoother = vtkWindowedSincPolyDataFilter::New(); smoother->SetInput(InterimOutput); smoother->GenerateErrorVectorsOn(); smoother->NormalizeCoordinatesOn(); smoother->BoundarySmoothingOn(); smoother->SetNumberOfIterations(this->NumberOfSmoothingIterations); smoother->SetFeatureEdgeSmoothing(this->SmoothingFeatureEdge); smoother->SetFeatureAngle(this->SmoothingFeatureAngle); smoother->SetEdgeAngle(this->SmoothingEdgeAngle); smoother->SetPassBand(this->SmoothingPassBand); smoother->Update(); vtkPolyDataNormals * normals = vtkPolyDataNormals::New(); normals->SetInputConnection(smoother->GetOutputPort()); normals->SetFeatureAngle(this->PolyNormalsFeatureAngle); normals->Update(); InterimOutput->Reset(); InterimOutput->ShallowCopy(normals->GetOutput()); <-- The data here can be copied successfully Could anybody help me solve this problem? I need to copy the data directly from vtkWindowedSincPolyDataFilter. Thanks a lot! Jinzhong -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeff.baumes at kitware.com Mon May 18 13:45:03 2009 From: jeff.baumes at kitware.com (Jeff Baumes) Date: Mon, 18 May 2009 13:45:03 -0400 Subject: [vtkusers] Bug?:5.4.0 performance versus 5.0 In-Reply-To: <29fcb80a0905161958t4c70ca85m4ef5e82caacc4ecf@mail.gmail.com> References: <29fcb80a0905161958t4c70ca85m4ef5e82caacc4ecf@mail.gmail.com> Message-ID: <2137e33e0905181045s728b42d9u2568a057dc791ad4@mail.gmail.com> Thanks for tracking this down Nick. Can you submit a bug in the tracker for this issue including the example code to reproduce it? I don't want to lose track of this bug you found. Thanks, Jeff On Sat, May 16, 2009 at 10:58 PM, Nick Gnedin wrote: > It seems that the problem is with vtkOpenGLDisplayListPainter.cxx. In > your test, in the following piece of the code: > > // First check for the cases where all display lists (irrespective of > // typeflags are obsolete. > if ( > // Since input changed > input->GetMTime() > this->Internals->BuildTime || > // actor's properties were modified > actor->GetProperty()->GetMTime() > this->Internals->BuildTime || > // mapper information was modified > this->Information->GetMTime() > this->Internals->BuildTime) > { > this->Internals->ReleaseAllLists(); > } > > the if(...) statement is always true, and the display list is always > re-created, even when the input data does not change. Perhaps, input > gets Modified() somewhere where it should not. > > That seems to me to be a plain bug in that class. > > Nick Gnedin > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 emonson at cs.duke.edu Mon May 18 14:51:09 2009 From: emonson at cs.duke.edu (Eric E. Monson) Date: Mon, 18 May 2009 14:51:09 -0400 Subject: [vtkusers] vtkPolyDataConnectivityFilter() doesn't filter data when passed to out In-Reply-To: <4d1a61ba0905180937h68deec1fhcaa4af655021fdff@mail.gmail.com> References: <4d1a61ba0905140752g3eeed8e3y4bc91f180ab9037c@mail.gmail.com> <49E396AE-744D-4068-8749-94491A9C8F20@cs.duke.edu> <4d1a61ba0905180937h68deec1fhcaa4af655021fdff@mail.gmail.com> Message-ID: <7748A762-18D1-446E-82F3-9D9F0128CBA6@cs.duke.edu> Hey Peter, Yeah, that's weird. I was able to reproduce what you're talking about. It's really strange that the data gets passed to the numpy array but doesn't show up in the render window. Not sure what's going on... Since I didn't know about all of these options in the connectivity filter before today, I would have done something like this to extract the large region: Run the connectivity filter in the mode where it passes all regions, but assigns region IDs, and then do a threshold filter on the results. One variant of this is shown below. Beyond this you'll probably have to get someone to chime in who understands the connectivity filter better. (In my example, I used mayavi to do a 3d plot of the points to see which are passed.) =============== import vtk import vtk.util.numpy_support as VN reader = vtk.vtkRectilinearGridReader() reader.SetFileName('/Users/emonson/Programming/VTK_cvs/VTKData/Data/ RectGrid2.vtk') skinExtractor = vtk.vtkContourFilter() skinExtractor.SetInputConnection(reader.GetOutputPort()) skinExtractor.SetValue(0, 5.2) skinConnect=vtk.vtkPolyDataConnectivityFilter() skinConnect.SetInputConnection(skinExtractor.GetOutputPort()) # All Regions: skinConnect.SetExtractionModeToAllRegions() skinConnect.SetColorRegions(1) # Largest Region: # skinConnect.SetExtractionModeToLargestRegion() skinNormals = vtk.vtkPolyDataNormals() skinNormals.SetInputConnection(skinConnect.GetOutputPort()) skinNormals.SetFeatureAngle(60.0) skinThresh = vtk.vtkThresholdPoints() skinThresh.SetInputConnection(skinNormals.GetOutputPort()) skinThresh.ThresholdByLower(0.5) # only pass region id = 0 skinMapper = vtk.vtkPolyDataMapper() skinMapper.SetInputConnection(skinThresh.GetOutputPort()) skinMapper.ScalarVisibilityOn() skinMapper.SetColorModeToMapScalars() skinMapper.SelectColorArray('scalars') skinActor = vtk.vtkActor() skinActor.SetMapper(skinMapper) skinu = skinThresh.GetOutput() # Force the pipeline to execute skinu.Update() ar = VN.vtk_to_numpy(skinu.GetPoints().GetData()) # import enthought.mayavi.mlab as mlab # mlab.points3d(ar[:,0],ar[:,1],ar[:, 2],scale_mode='none',scale_factor=0.02); print ar.shape ren = vtk.vtkRenderer() ren.AddActor(skinActor) renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) ren.ResetCamera() renWin.Render() iren.Initialize() iren.Start() =============== Good luck, -Eric On May 18, 2009, at 12:37 PM, Peter Halverson wrote: > >this uses a standard vtk data set. > A standard vtk dataset, absolutely brilliant (I was wondering how to > demonstrate this)! > > I ran the code with and without the commented section. > SetExtractionModeToLargestRegion() eliminates some of the data > (size(ar) shrinks from 618 to 597). However, I'm not sure what it > eliminates. When I plot a slice of ar (AR[2]>0.899999) I get the > same plot. A link to a screen shot of python running in two > seperate process (uncommented is the upper) is available at http://www.et.byu.edu/~pah32/VTK/ScreenCapture.PNG > > The modified code is below > > ... > > Thanks for your help. > > > On Mon, May 18, 2009 at 7:48 AM, Eric E. Monson > wrote: > Hey Peter, > > I think the filter is working correctly. Try this modification of > your earlier script. (Again, this uses a standard VTK data set.) > > By default I've changed the option on the connectivity filter to > grab all regions, but color them by their region number. You should > see two sort of parabolic-shaped regions, one red and one blue. If > you comment out the "all regions" stuff and use the "largest > region", you should just see the large region in the render window. > You can also see that there are extra coordinate points printed out > for the "all regions" case, so I think the data is getting to the > numpy array correctly. > > ... > > Hope this helps clear it up, > -Eric > > ------------------------------------------------------ > Eric E Monson > Duke Visualization Technology Group > > > > On May 14, 2009, at 10:52 AM, Peter Halverson wrote: > > I'm having some difficulty with vtkPolyDataConnectivityFilter(). > VTK is able to visualize it but I can't get the data out of it. > I've written a program that works as follows > > 1. Uses vtkDICOMImageReader() to read in a CT image and pass that to > 2. vtkContourfilter() to reduce that image and pass that to > 3. vtkPolyDataConnectivityFilter() to get the largest connected > region and pass that to > 4. vtkPolyDataNormals() which passes it to > 5. vtkPolyDataMapper() and then to > 6. vtkActor() which is able to render only the largest connected > region (the skin in this case) > > When I pass the data to python using > vtk_ar > = > vtk_to_numpy(skinactor.GetMapper().GetInput().GetPoints().GetData()) > I get the output from step 2 which includes the disconnected > regions. I've searched the vtk mail archives and the books but > can't find out how to get the data after the ConnectivityFilter is > called. I'm new to vtk, any help would be appreciated. > > Peter > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ilferraresebono at hotmail.it Mon May 18 18:16:55 2009 From: ilferraresebono at hotmail.it (Giancarlo Amati) Date: Tue, 19 May 2009 00:16:55 +0200 Subject: [vtkusers] threads and refreshing vtkRenderWindow In-Reply-To: <4A117624.7010807@elemtech.com> References: <4A117624.7010807@elemtech.com> Message-ID: Many thanks!!! This morning I've actually found the solution using QT....just emitting timer events builting up a QTimer with QT and connecting my main thread to capture those events. In that case I'll call the Render() function staying in the main one.... Many thanks GC. > Date: Mon, 18 May 2009 08:52:20 -0600 > From: clinton at elemtech.com > To: ilferraresebono at hotmail.it > CC: david.cole at kitware.com; vtkusers at vtk.org > Subject: Re: [vtkusers] threads and refreshing vtkRenderWindow > > > Have you look at this? > http://doc.trolltech.com/qq/qq06-glimpsing.html > It would need adjustments if using VTK instead, and I'm curious if it'll > work just fine. > > But, first, you could try overloading QVTKWidget::paintEvent() to do > nothing. > Then in your QThread::run, you create all your VTK objects and do your > Render() calls from there. > You're getting the wglMakeCurrent error because the context is current > in the main thread, and you're trying to make it current in another > thread as well. That is not allowed. > http://msdn.microsoft.com/en-us/library/dd374387(VS.85).aspx > > Clint > > Giancarlo Amati wrote: > > Nope I don't,....I was just telling you how I did organize my > > code...and as you said the Render() function should be called only > > from the thread that the MAIN one, I was simply asking..if calling a > > function which belongs to the main thread (which is the Parent from > > the 2nd one) is the reason that generates the wglMakeCurrent error. > > Moreover, as the documentation about the vtkMutexLock class on the vtk > > website is quite poor, I was just wondering if there were any other > > resource. > > > > My project is mainly about a device system which tracks IReds > > visulalized with VTK, basically what I am doing is a real-time > > animation with QT and VTK. So, as I need to update the VTK scene > > without interfering with the QT events, the QT users group told me > > that the best way is to create a thread which updates the scene. But > > apparently this generates a wglMakeCurrent error for the reasons you > > told me. > > > > > > GC. > > > > ------------------------------------------------------------------------ > > Date: Fri, 15 May 2009 11:08:20 -0400 > > Subject: Re: [vtkusers] threads and refreshing vtkRenderWindow > > From: david.cole at kitware.com > > To: ilferraresebono at hotmail.it > > CC: vtkusers at vtk.org > > > > Are you asking us to tell you how your program is organized with > > respect to threads? (That's somewhat beyond the scope of the VTK > > mailing list.) > > > > It sounds like your project might be better off single-threaded. > > > > It would be better if you call UpdateMy3DObject from the same thread > > that actually does the rendering. > > > > > > On Fri, May 15, 2009 at 10:59 AM, Giancarlo Amati > > > wrote: > > > > Many thanks, > > > > what I have is a mainWindow which has functions for rendering and > > then a thread that calls a kind of "UpdateMy3Dobjects" function > > which belongs to the mainWindow object. Now, > > this "UpdateMy3DObjects" function works fine whenever that thread > > is not running while, I got the wglMakeCurrent error as soon as > > the thread runs the UpdateMy3Dobjects" function. > > So, > > as the UpdateMy3Dobjects function calls the RenderWindow->Render() > > method (renderwindow buidt in a QVTKWidget object of my GUI) > > calling that UpdateMy3DObject from the thread does correspond to a > > call form a thread different from the main one? > > In that case if I create a global variable, boolean for example > > which is true when I execute the UpdateMy3DObject function and > > false otherwise...would it help to synchronize these threads? > > > > I checked out on the VTK documentation and I found the > > vktMutexLock class....and i tried to understand the example in the > > documetation which is a bit difficult honestly, but,....can that > > class be useful for my project? > > > > many kind regards. > > Giancarlo > > > > ------------------------------------------------------------------------ > > Date: Fri, 15 May 2009 10:19:51 -0400 > > Subject: Re: [vtkusers] threads and refreshing vtkRenderWindow > > From: david.cole at kitware.com > > To: ilferraresebono at hotmail.it > > CC: vtkusers at vtk.org > > > > > > I will not claim to be cleverer, but I think I can answer the > > question: > > > > Your mistake is calling vtkObjects from multiple threads without > > synchonization objects. In general, vtkObjects are only safely > > accessible by one thread at a time. Multi-thread access means you > > will have to use some sort of mutexes or locks to guarantee that > > only one thread at a time will call vtkObject methods. > > Furthermore, you should only attempt to call Render from the main > > GUI thread of your application. > > > > > > Hope this helps, > > David > > > > > > On Fri, May 15, 2009 at 9:25 AM, Giancarlo Amati > > > > > wrote: > > > > Hello vtkUSERS!!! This is an ash question for only the > > cleverer!! :D > > > > I have a thread which modifies some data already in the > > vtkRenderWindow., now, the problem I have is when I want to > > refresh the window. > > I though calling something like renderWindow->Render() or > > renderer->render(), but I get some error messages related to > > "Resource already in use" and "wglMakeCurrent()" function error. > > > > Where is my mistake and any idea about how to overcome it? > > > > Kind regards. > > > > GC. > > > > ------------------------------------------------------------------------ > > Scrivi, parla e gioca con i tuoi amici! Scarica Messenger > > 2009! > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://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 > > > > > > > > ------------------------------------------------------------------------ > > Quali sono le parole pi? cliccate? Scopri la top! > > > > > > > > > > ------------------------------------------------------------------------ > > Quali sono le parole pi? cliccate? Scopri la top! > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at http://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 > > > > _________________________________________________________________ Cerca le Parole, gioca su Typectionary! http://typectionary.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From alucard006 at msn.com Tue May 19 04:44:05 2009 From: alucard006 at msn.com (Chris N) Date: Tue, 19 May 2009 01:44:05 -0700 Subject: [vtkusers] Want vtk dataset from my DICOM data Message-ID: NEW USER but I've been reading similiar problems with using vtkPolyDataConnectivityFilter with DICOM data. One person did post a solution but using the standard vtk dataset from vtkdata. Is it possible to convert my DICOM data into vtk data set so once that is done I can use my vtkPolyDataConnectivityFilter on that data set. Or does DICOMreader do convert into vtk dataset already? If that is the case how can I retieve that data? Ultimately, I'm trying to filter out data with vtkPolyDataConnectivityFilter and using my DICOM data. any help is appreciated, thanks! _________________________________________________________________ Hotmail? has a new way to see what's up with your friends. http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lars.bilke at ufz.de Tue May 19 07:05:15 2009 From: lars.bilke at ufz.de (Lars Bilke) Date: Tue, 19 May 2009 13:05:15 +0200 Subject: [vtkusers] How to run CPack on a VTK build Message-ID: Hi, I?ve successfully built VTK on Win XP with Python wrapping enabled. Now I want to make an installer of it. My understanding of CPack is to go in the build directory and run CPack like this: "cpack -G NSIS". But I always get this error: "CPack Error: CPack project name not specified" Hope you can help me, Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From madhu_lsu at yahoo.com Tue May 19 09:00:47 2009 From: madhu_lsu at yahoo.com (Madhusudhanan Balasubramanian) Date: Tue, 19 May 2009 06:00:47 -0700 (PDT) Subject: [vtkusers] vtkRenderWindowInteractor crashes in Ubuntu 9.0.4 in VMware Message-ID: <662313.19167.qm@web51708.mail.re2.yahoo.com> Hi, I have a small piece of code that uses vtkRenderWindow and vtkRenderWindowInteractor to render a volume. ?This code works fine in a host machine, but crashes (vtkRenderWindowInteractor) in a virtual machine. I am trying to compile and run this in Ubuntu 9.0.4 installed in a virtual machine (using VMware). ?As soon as I start the renderWindowInteractor, the program crashes. The virual machine has 3 GB RAM, its dual xeon processor machine with NVIDIA GeForce 8800 GTX video card. ?I have mesa and opengl libraries installed in Ubuntu. Please let me know if I need any special graphics library or drivers for using VTK in a virtual machine. Thanks so much,Madhu. -------------- next part -------------- An HTML attachment was scrubbed... URL: From liusaifeng at gmail.com Tue May 19 09:28:17 2009 From: liusaifeng at gmail.com (saifeng) Date: Tue, 19 May 2009 06:28:17 -0700 (PDT) Subject: [vtkusers] How to display 3D RGB data with VTK? In-Reply-To: <8106cfac0905180109r3564e716w887322e0ef828f3f@mail.gmail.com> References: <8106cfac0905180109r3564e716w887322e0ef828f3f@mail.gmail.com> Message-ID: <23616413.post@talk.nabble.com> The easiest way is to pass the output of vtkimagereslice or other filters to vtkImageActor. Nothing else is needed. saifeng wrote: > > Hi, > I have developed a program to display 3D ultrasound raw data, and > everything > goes well. Now I want to extend my work by displaying some 3D RGB raw > data, > but I failed. > > I have found somebody's suggestion on the mailing list, the suggestion is > that, first quantizing the color to a small set of colors ,and then build > a > lookup table for it. I have tried this, but it does not work. Maybe I did > it > in a wrong way. > > now I have a 3D RGB raw data, and there are 3 components( the r,g,b value; > 8 > bit ) in each scalar, and I have successfully created a vtkImageData, and > I > want to display a single slice of this image data. I choose to use > vtkReslice to display the sagittal, coronal and axial slices; and I choose > to use vtkImagePlaneWidget to display these slices together. They all work > perfectly with grey scale raw data. > > So how to build up a lookup table for rgb data? or how to quantizing my > data > to a small set of colors? > Besides, can we display the data directly without building a lookup table, > since the value itself is RGB value already? > > Thank you very much for your help. > > Saifeng, > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > -- View this message in context: http://www.nabble.com/How-to-display-3D-RGB-data-with-VTK--tp23592963p23616413.html Sent from the VTK - Users mailing list archive at Nabble.com. From biddisco at cscs.ch Tue May 19 10:15:33 2009 From: biddisco at cscs.ch (John Biddiscombe) Date: Tue, 19 May 2009 16:15:33 +0200 Subject: [vtkusers] How to run CPack on a VTK build In-Reply-To: References: Message-ID: <4A12BF05.4090204@cscs.ch> An HTML attachment was scrubbed... URL: From theodoreholden at yahoo.com Tue May 19 11:41:23 2009 From: theodoreholden at yahoo.com (Theodore Holden) Date: Tue, 19 May 2009 08:41:23 -0700 (PDT) Subject: [vtkusers] SourceForge dotnet cmake/VS2008 build system Message-ID: <530459.8393.qm@web38605.mail.mud.yahoo.com> Has anybody tried to build the SourceForge dotnet wrapper lib from source recently and gotten anywhere with it? Ted -------------- next part -------------- An HTML attachment was scrubbed... URL: From emonson at cs.duke.edu Tue May 19 12:37:58 2009 From: emonson at cs.duke.edu (Eric E. Monson) Date: Tue, 19 May 2009 12:37:58 -0400 Subject: [vtkusers] Want vtk dataset from my DICOM data In-Reply-To: References: Message-ID: Hey Chris, The output from the vtkDICOMImageReader is an instance of vtkImageData, so as the pipeline continues that is what is processed. In python, you can get this data by calling reader.GetOutput() or reader.GetOutputDataObject(0), and similar in C++. If you really want to save that data in another file, one option would be to use the vtkXMLImageDataWriter to write to a .vti file. Otherwise, just use the reader and feed its output port into the input port of the Contour filter as you've seen recently. If this isn't clear, just let us know more specifically what problems you're having. -Eric ------------------------------------------------------ Eric E Monson Duke Visualization Technology Group On May 19, 2009, at 4:44 AM, Chris N wrote: > NEW USER but I've been reading similiar problems with using > vtkPolyDataConnectivityFilter with DICOM data. One person did post > a solution but using the standard vtk dataset from vtkdata. Is it > possible to convert my DICOM data into vtk data set so once that is > done I can use my vtkPolyDataConnectivityFilter on that data set. > Or does DICOMreader do convert into vtk dataset already? If that is > the case how can I retieve that data? Ultimately, I'm trying to > filter out data with vtkPolyDataConnectivityFilter and using my > DICOM data. any help is appreciated, thanks! > > > Hotmail? has a new way to see what's up with your friends. Check it > out. _______________________________________________ > Powered by www.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://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From hossein.ghadiri at gmail.com Wed May 20 14:45:55 2009 From: hossein.ghadiri at gmail.com (Hossein Ghadiri) Date: Wed, 20 May 2009 23:15:55 +0430 Subject: [vtkusers] Which object of MFC is proper for 2D image view by VTK? Message-ID: <007001c9d97b$37c8a170$68d1844f@Hossein> Dear all, Which object of MFC or tools can be helpful to image viewing by VTK? Is a context or DC tool proper for this issue? Would anyone please let me know better suggestion? Hossein -------------- next part -------------- An HTML attachment was scrubbed... URL: From adzyubak at gmail.com Tue May 19 15:03:27 2009 From: adzyubak at gmail.com (Oleksandr Dzyubak) Date: Tue, 19 May 2009 14:03:27 -0500 Subject: [vtkusers] How to run CPack on a VTK build In-Reply-To: <4A12BF05.4090204@cscs.ch> References: <4A12BF05.4090204@cscs.ch> Message-ID: <4A13027F.602@gmail.com> Hi John, I followed your advice and got the errors below. ********* Start Errors ******* CPack Error: Problem running tar command: "/usr/local/bin/cmake" -E tar cfz control.tar.gz ./control ./md5sums CPack Error: Problem compressing the directory CPack Error: Error when generating package: ITK ********* End Errors ******* How can I fix it? Thanks, Alex John Biddiscombe wrote: > cpack -G NSIS -C Release > or > cpack -G NSIS -CDebug > > better? > >> Hi, >> >> I?ve successfully built VTK on Win XP with Python wrapping enabled. >> Now I want to make an installer of it. My understanding of CPack is >> to go in the build directory and run CPack like this: "cpack -G NSIS". >> But I always get this error: "CPack Error: CPack project name not >> specified" >> >> Hope you can help me, >> >> Thanks. >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> > > > -- > John Biddiscombe, email:biddisco @ cscs.ch > http://www.cscs.ch/ > CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07 > Via Cantonale, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82 > ------------------------------------------------------------------------ > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > From abdalrahman.eweiwi at googlemail.com Tue May 19 15:09:42 2009 From: abdalrahman.eweiwi at googlemail.com (abdalrahman eweiwi) Date: Tue, 19 May 2009 21:09:42 +0200 Subject: [vtkusers] small question ... how to pass data from vtkPNGreader to a vtkImageData Object ? Message-ID: <2c86725c0905191209m3e1bb5ffna55224babd8ba96a@mail.gmail.com> hello guys small question ... how to pass data from vtkPNGreader to a vtkImageData Object ? -- Regards Abdalrahman Eweiwi Msc in Media Informatics RWTH-AACHEN B-it -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Tue May 19 15:59:23 2009 From: drescherjm at gmail.com (John Drescher) Date: Tue, 19 May 2009 15:59:23 -0400 Subject: [vtkusers] Negative spacing. Is that going to get me into trouble? Message-ID: <387ee2020905191259p30850714qd9487dd4a2e29760@mail.gmail.com> I have a set of CT data where I need to load the images by ImageNumber instead of the default by PatientPosition. As a result the volume is loaded with increasing image z axis mapping to a decreasing world z axis. Loading the series with itk does not set the Direction or the Spacing of the z axes to be negative so I am setting it myself. I emailed the list a few months back about bad world coordinates: http://www.nabble.com/Transforming-image-to-world-coordinates-with-negative-z-axis-td22453066.html Initially I tried to fix this by setting the direction of the z axes to be -1 but it appears that vtk does not handle that however it appears that negative spacing in vtk is quite fine. With -2.5 for my z spacing instead of 2.5 the views are not upside down. -- John M. Drescher From daviddoria at gmail.com Tue May 19 16:10:17 2009 From: daviddoria at gmail.com (David Doria) Date: Tue, 19 May 2009 16:10:17 -0400 Subject: [vtkusers] small question ... how to pass data from vtkPNGreader to a vtkImageData Object ? In-Reply-To: <2c86725c0905191209m3e1bb5ffna55224babd8ba96a@mail.gmail.com> References: <2c86725c0905191209m3e1bb5ffna55224babd8ba96a@mail.gmail.com> Message-ID: On Tue, May 19, 2009 at 3:09 PM, abdalrahman eweiwi < abdalrahman.eweiwi at googlemail.com> wrote: > > hello guys > > small question ... how to pass data from vtkPNGreader to a vtkImageData > Object ? > -- > Regards > > Abdalrahman Eweiwi > Msc in Media Informatics > RWTH-AACHEN > B-it You mean something like this? vtkPNGReader* reader = vtkPNGReader::New(); reader->SetFileName("Test.png"); reader->Update(); vtkImageData* imagedata = reader->GetOutput(); vtkXMLImageDataWriter* writer = vtkXMLImageDataWriter::New(); writer->SetInput(imagedata); writer->SetFileName("Test.vti"); writer->Update(); What I don't understand is how to actually load this resulting file in Paraview. If I open it like I normally do vtp files, it opens in a separate window rather than in the normal "model space" where everything else opens. Anyone know how to open it as if it was a slice of a volume data set? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From nkwmailinglists at gmail.com Tue May 19 16:48:10 2009 From: nkwmailinglists at gmail.com (kent williams) Date: Tue, 19 May 2009 15:48:10 -0500 Subject: [vtkusers] [Insight-users] Negative spacing. Is that going to get me into trouble? In-Reply-To: <387ee2020905191259p30850714qd9487dd4a2e29760@mail.gmail.com> References: <387ee2020905191259p30850714qd9487dd4a2e29760@mail.gmail.com> Message-ID: <44f773f50905191348t49434c53xc0ee8aa7f78a0484@mail.gmail.com> Not to get all LOLCats on you or anything but UR DOING IT RONG. The spacing is a size in centimeters -- usually. A negative size won't do what you want. It sounds like you're using DICOM files, but you don't say so explicitly. ITK will try and recover the proper orientation in anatomical space from DICOM files. The way to handle this properly would be to change the ITK Direction Cosines for the image. It's perfectly reasonable for the slices to be ordered in the negative image direction, but you have to clue in ITK and VTK how it's oriented. The easiest way is to load the file with ITK, and then set the Direction Cosines to reflect the actual orientation of the image in 3D space. In this case you'd probably specify 1 0 0 0 1 0 0 0 -1 as the direction cosines. Then use the itk::OrientImageFilter to set its orientation to identity, which according to itk::OrientImageFilter's nomenclature is RAI. The other solution would be to read the slices in reverse order -- the itk::ImageSeriesReader allows you to customize the ordering -- you could read all the names into a std::list and then reverse the list before having the Series Reader do it's thing. On Tue, May 19, 2009 at 2:59 PM, John Drescher wrote: > I have a set of CT data where I need to load the images by ImageNumber > instead of the default by PatientPosition. As a result the volume is > loaded with increasing image z axis mapping to a decreasing world z > axis. Loading the series with itk does not set the Direction or the > Spacing of the z axes to be negative so I am setting it myself. > > I emailed the list a few months back about bad world coordinates: > http://www.nabble.com/Transforming-image-to-world-coordinates-with-negative-z-axis-td22453066.html > > Initially I tried to fix this by setting the direction of the z axes > to be -1 but it appears that vtk does not handle that however it > appears that negative spacing in vtk is quite fine. With -2.5 for my z > spacing instead of 2.5 the views are not upside down. > > -- > John M. Drescher > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.itk.org/mailman/listinfo/insight-users > From jerome.velut at gmail.com Tue May 19 16:51:39 2009 From: jerome.velut at gmail.com (=?ISO-8859-1?B?Suly9G1l?=) Date: Tue, 19 May 2009 22:51:39 +0200 Subject: [vtkusers] small question ... how to pass data from vtkPNGreader to a vtkImageData Object ? In-Reply-To: References: <2c86725c0905191209m3e1bb5ffna55224babd8ba96a@mail.gmail.com> Message-ID: Hi, David, I think that ParaView opens a 2D file in a 2D render by default. Just check the "visibility" icon (eye) in the pipeline when your 3D render window is active. It should work. if not, ask the ParaView mailing list ;) Abdalrahman, I really don't understand your question : vtkPNGReader is an vtkAlgorithm with no input and a vtkImageData output. You can then plug your reader output to any filter that takes vtkImageData as input ! What do you mean exactly by "how to pass data" ? May your formulation be more precise ? Regards, J?r?me 2009/5/19 David Doria > On Tue, May 19, 2009 at 3:09 PM, abdalrahman eweiwi < > abdalrahman.eweiwi at googlemail.com> wrote: > >> >> hello guys >> >> small question ... how to pass data from vtkPNGreader to a vtkImageData >> Object ? >> -- >> Regards >> >> Abdalrahman Eweiwi >> Msc in Media Informatics >> RWTH-AACHEN >> B-it > > > You mean something like this? > > vtkPNGReader* reader = vtkPNGReader::New(); > reader->SetFileName("Test.png"); > reader->Update(); > > vtkImageData* imagedata = reader->GetOutput(); > > vtkXMLImageDataWriter* writer = vtkXMLImageDataWriter::New(); > writer->SetInput(imagedata); > writer->SetFileName("Test.vti"); > writer->Update(); > > What I don't understand is how to actually load this resulting file in > Paraview. If I open it like I normally do vtp files, it opens in a separate > window rather than in the normal "model space" where everything else opens. > Anyone know how to open it as if it was a slice of a volume data set? > > Thanks, > > David > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Tue May 19 17:13:48 2009 From: drescherjm at gmail.com (John Drescher) Date: Tue, 19 May 2009 17:13:48 -0400 Subject: [vtkusers] [Insight-users] Negative spacing. Is that going to get me into trouble? In-Reply-To: <44f773f50905191348t49434c53xc0ee8aa7f78a0484@mail.gmail.com> References: <387ee2020905191259p30850714qd9487dd4a2e29760@mail.gmail.com> <44f773f50905191348t49434c53xc0ee8aa7f78a0484@mail.gmail.com> Message-ID: <387ee2020905191413m1cd8f969ucc09de04510ac205@mail.gmail.com> On Tue, May 19, 2009 at 4:48 PM, kent williams wrote: > Not to get all LOLCats on you or anything but UR DOING IT RONG. > > The spacing is a size in centimeters -- usually. ?A negative size > won't do what you want. > I know but that seems to work while the correct way fails.. > > It sounds like you're using DICOM files, but you don't say so > explicitly. Yes. >ITK will try and recover the proper orientation in > anatomical space from DICOM files. > > The way to handle this properly would be to change the ITK Direction > Cosines for the image. ?It's perfectly reasonable for the slices to be > ordered in the negative image direction, but you have to clue in ITK > and VTK how it's oriented. > > The easiest way is to load the file with ITK, and then set the > Direction Cosines to reflect the actual orientation of the image in 3D > space. ?In this case you'd probably specify > > 1 0 0 > 0 1 0 > 0 0 -1 > I initially did that, but vtk had the Coronal and Sagittal views upside down. Having vtk flip the output lead to problems because the display code is doing computations like the following: origin[axis] + slice * spacing[axis]; > > as the direction cosines. Then use the itk::OrientImageFilter to set > its orientation to identity, which according to > itk::OrientImageFilter's nomenclature is RAI. > > The other solution would be to read the slices in reverse order -- the > itk::ImageSeriesReader allows you to customize the ordering -- you > could read all the names into a std::list and then reverse the list > before ?having the Series Reader do it's thing. > I want the images loaded this way because I pass the image on to 2 different libraries (c array based) that requires this orientation for their processing. I could have let itk read the images in PatientPosition and flipped but I plan to eventually display the result so I wanted to keep the volume and the result in memory the same orientation.. John From karthik.krishnan at kitware.com Tue May 19 17:25:54 2009 From: karthik.krishnan at kitware.com (Karthik Krishnan) Date: Tue, 19 May 2009 17:25:54 -0400 Subject: [vtkusers] [Insight-users] Negative spacing. Is that going to get me into trouble? In-Reply-To: <387ee2020905191413m1cd8f969ucc09de04510ac205@mail.gmail.com> References: <387ee2020905191259p30850714qd9487dd4a2e29760@mail.gmail.com> <44f773f50905191348t49434c53xc0ee8aa7f78a0484@mail.gmail.com> <387ee2020905191413m1cd8f969ucc09de04510ac205@mail.gmail.com> Message-ID: <9ddb27260905191425m4d896792vf7cd4e7d17bd0754@mail.gmail.com> John: Its customary to use the camera to view the data at the desired orientation instead of changing the data. -- karthik On Tue, May 19, 2009 at 5:13 PM, John Drescher wrote: > On Tue, May 19, 2009 at 4:48 PM, kent williams > wrote: > > Not to get all LOLCats on you or anything but UR DOING IT RONG. > > > > The spacing is a size in centimeters -- usually. A negative size > > won't do what you want. > > > I know but that seems to work while the correct way fails.. > > > > > It sounds like you're using DICOM files, but you don't say so > > explicitly. > > Yes. > > >ITK will try and recover the proper orientation in > > anatomical space from DICOM files. > > > > The way to handle this properly would be to change the ITK Direction > > Cosines for the image. It's perfectly reasonable for the slices to be > > ordered in the negative image direction, but you have to clue in ITK > > and VTK how it's oriented. > > > > The easiest way is to load the file with ITK, and then set the > > Direction Cosines to reflect the actual orientation of the image in 3D > > space. In this case you'd probably specify > > > > 1 0 0 > > 0 1 0 > > 0 0 -1 > > > I initially did that, but vtk had the Coronal and Sagittal views > upside down. Having vtk flip the output lead to problems because the > display code is doing computations like the following: > > origin[axis] + slice * spacing[axis]; > > > > > as the direction cosines. Then use the itk::OrientImageFilter to set > > its orientation to identity, which according to > > itk::OrientImageFilter's nomenclature is RAI. > > > > The other solution would be to read the slices in reverse order -- the > > itk::ImageSeriesReader allows you to customize the ordering -- you > > could read all the names into a std::list and then reverse the list > > before having the Series Reader do it's thing. > > > > I want the images loaded this way because I pass the image on to 2 > different libraries (c array based) that requires this orientation for > their processing. I could have let itk read the images in > PatientPosition and flipped but I plan to eventually display the > result so I wanted to keep the volume and the result in memory the > same orientation.. > > John > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.itk.org/mailman/listinfo/insight-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Tue May 19 17:32:13 2009 From: drescherjm at gmail.com (John Drescher) Date: Tue, 19 May 2009 17:32:13 -0400 Subject: [vtkusers] [Insight-users] Negative spacing. Is that going to get me into trouble? In-Reply-To: <9ddb27260905191425m4d896792vf7cd4e7d17bd0754@mail.gmail.com> References: <387ee2020905191259p30850714qd9487dd4a2e29760@mail.gmail.com> <44f773f50905191348t49434c53xc0ee8aa7f78a0484@mail.gmail.com> <387ee2020905191413m1cd8f969ucc09de04510ac205@mail.gmail.com> <9ddb27260905191425m4d896792vf7cd4e7d17bd0754@mail.gmail.com> Message-ID: <387ee2020905191432y3bbcb284pb20b0c200a1c788d@mail.gmail.com> On Tue, May 19, 2009 at 5:25 PM, Karthik Krishnan wrote: > John: > > Its customary to use the camera to view the data at the desired orientation > instead of changing the data. > That sounds like a easy solution. I will try that. John From raashid.b at rediffmail.com Wed May 20 01:13:09 2009 From: raashid.b at rediffmail.com (Raashid Baig) Date: 20 May 2009 05:13:09 -0000 Subject: [vtkusers] Trouble coloring the vtkActors (always turns out red) Message-ID: <20090520051309.17427.qmail@f5mail-236-223.rediffmail.com> I am having trouble setting vtkActor's color. I can't figure out whats wrong with my program as the actor always turns out red no matter what color I set it to. I am using vtk5.4.0 on a linux system. Can someone please take a look at the attached files and explain what am I doing wrong ? Thanks in advance. Raashid -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CMakeLists.txt URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: profile.cxx Type: application/octet-stream Size: 1282 bytes Desc: not available URL: From lars-friedrich at gmx.net Wed May 20 02:33:11 2009 From: lars-friedrich at gmx.net (lars-friedrich) Date: Tue, 19 May 2009 23:33:11 -0700 (PDT) Subject: [vtkusers] Trouble coloring the vtkActors (always turns out red) In-Reply-To: <20090520051309.17427.qmail@f5mail-236-223.rediffmail.com> References: <20090520051309.17427.qmail@f5mail-236-223.rediffmail.com> Message-ID: <23629803.post@talk.nabble.com> Hi, try mapper->SetScalarVisibility(false); cheers, lars Raashid Baig-2 wrote: > > I am having trouble setting vtkActor's color. > I can't figure out whats wrong with my program as the actor always turns > out red no matter what color I set it to. > I am using vtk5.4.0 on a linux system. > Can someone please take a look at the attached files and explain what am I > doing wrong ? > Thanks in advance. > Raashid > PROJECT (project2) > > FIND_PACKAGE(VTK REQUIRED) > IF(NOT VTK_USE_RENDERING) > MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires > VTK_USE_RENDERING.") > ENDIF(NOT VTK_USE_RENDERING) > INCLUDE(${VTK_USE_FILE}) > > ADD_EXECUTABLE(profile profile.cxx) > TARGET_LINK_LIBRARIES(profile vtkRendering) > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > -- View this message in context: http://www.nabble.com/Trouble-coloring-the-vtkActors-%28always-turns-out-red%29-tp23629163p23629803.html Sent from the VTK - Users mailing list archive at Nabble.com. From biddisco at cscs.ch Wed May 20 02:35:18 2009 From: biddisco at cscs.ch (John Biddiscombe) Date: Wed, 20 May 2009 08:35:18 +0200 Subject: [vtkusers] How to run CPack on a VTK build In-Reply-To: <4A13027F.602@gmail.com> References: <4A12BF05.4090204@cscs.ch> <4A13027F.602@gmail.com> Message-ID: <4A13A4A6.9000000@cscs.ch> You initially staed windows and XP, but > CPack Error: Problem running tar command: "/usr/local/bin/cmake" -E > tar cfz control.tar.gz ./control ./md5sums Looks like a linux build. Have you got the dos unix tools installed in /usr/local/bin/cmake on your windows box? if not, then fix the tar program in cmake. If you have, then I can't help you. as I don't know what's wrong. JB From paul at science.uva.nl Wed May 20 03:18:15 2009 From: paul at science.uva.nl (Paul Melis) Date: Wed, 20 May 2009 09:18:15 +0200 Subject: [vtkusers] Motif not found during build Message-ID: <4A13AEB7.8070601@science.uva.nl> Hi, I'm trying to build 5.2.1 and all goes well until somewhere in the examples: gmake[5]: Entering directory `/usr/paul/vtk-5.2-build/Examples/All' Linking CXX executable /usr/paul/vtk-5.2-build/bin/Example1 /usr/bin/ld: cannot find -lXm collect2: ld returned 1 exit status Now I have (open)motif installed, and the lib is in /usr/X11R6/lib. With make VERBOSE=1 the actual link line is shown below, which indeed misses -L/usr/X11R6/lib /home/paul/local/bin/c++ -Wno-deprecated -Wno-deprecated -fPIC CMakeFiles/Example1.dir/Example1.o -o /usr/paul/vtk-5.2-build/bin/Example1 -rdynamic -L/usr/paul/vtk-5.2-build/bin -lXm -lvtkRendering -lvtkGraphics -lvtkImaging -lvtkIO -lvtkFiltering -lvtkCommon -lvtkftgl -lvtkfreetype -lGL /usr/X11R6/lib/libXt.so /usr/X11R6/lib/libSM.so /usr/X11R6/lib/libICE.so /usr/X11R6/lib/libX11.so /usr/X11R6/lib/libXext.so /usr/X11R6/lib/libXss.so /usr/X11R6/lib/libXft.so -lvtkverdict -lvtkDICOMParser -lvtkNetCDF -lvtkmetaio -lvtksqlite -lvtkpng -lvtktiff -lvtkzlib -lvtkjpeg -lvtkexpat -lvtksys -lpthread -ldl -lm -Wl,-rpath,/usr/paul/vtk-5.2-build/bin:/usr/X11R6/lib So is there any way to tell CMake where to find Motif? Or is there a switch to disable just the GUI/Motif example? Thanks, Paul From lars.bilke at ufz.de Wed May 20 03:31:47 2009 From: lars.bilke at ufz.de (Lars Bilke) Date: Wed, 20 May 2009 09:31:47 +0200 Subject: [vtkusers] How to run CPack on a VTK build In-Reply-To: <4A13A4A6.9000000@cscs.ch> References: <4A12BF05.4090204@cscs.ch> <4A13027F.602@gmail.com> <4A13A4A6.9000000@cscs.ch> Message-ID: <4A13B1E3.2050003@ufz.de> No, I?m using Windows XP, the last mail was from another person who seems to use Linux. I also tried to run "cpack -G NSIS -C Release" but I got the same error "CPack Error: CPack project name not specified". John Biddiscombe schrieb: > You initially staed windows and XP, but > >> CPack Error: Problem running tar command: "/usr/local/bin/cmake" -E >> tar cfz control.tar.gz ./control ./md5sums > > Looks like a linux build. Have you got the dos unix tools installed in > /usr/local/bin/cmake on your windows box? if not, then fix the tar > program in cmake. If you have, then I can't help you. as I don't know > what's wrong. > > JB > > -- Mit freundlichen Gr??en Lars Bilke Visualisierungszentrum / Umweltinformatik Helmholtz-Zentrum f?r Umweltforschung GmbH - UFZ Permoserstra?e 15, 04318 Leipzig Telefon: +49 (0)341 235-1881 Email: lars.bilke at ufz.de http://www.ufz.de/index.php?en=14171 From mathieu.malaterre at gmail.com Wed May 20 03:52:52 2009 From: mathieu.malaterre at gmail.com (Mathieu Malaterre) Date: Wed, 20 May 2009 09:52:52 +0200 Subject: [vtkusers] Motif not found during build In-Reply-To: <4A13AEB7.8070601@science.uva.nl> References: <4A13AEB7.8070601@science.uva.nl> Message-ID: On Wed, May 20, 2009 at 9:18 AM, Paul Melis wrote: > Hi, > > I'm trying to build 5.2.1 and all goes well until somewhere in the examples: > > gmake[5]: Entering directory `/usr/paul/vtk-5.2-build/Examples/All' > Linking CXX executable /usr/paul/vtk-5.2-build/bin/Example1 > /usr/bin/ld: cannot find -lXm > collect2: ld returned 1 exit status > > Now I have (open)motif installed, and the lib is in /usr/X11R6/lib. With > make VERBOSE=1 the actual link line is shown below, which indeed misses > -L/usr/X11R6/lib > > /home/paul/local/bin/c++ -Wno-deprecated -Wno-deprecated -fPIC > CMakeFiles/Example1.dir/Example1.o -o /usr/paul/vtk-5.2-build/bin/Example1 > -rdynamic -L/usr/paul/vtk-5.2-build/bin -lXm -lvtkRendering -lvtkGraphics > -lvtkImaging -lvtkIO -lvtkFiltering -lvtkCommon -lvtkftgl -lvtkfreetype -lGL > /usr/X11R6/lib/libXt.so /usr/X11R6/lib/libSM.so /usr/X11R6/lib/libICE.so > /usr/X11R6/lib/libX11.so /usr/X11R6/lib/libXext.so /usr/X11R6/lib/libXss.so > /usr/X11R6/lib/libXft.so -lvtkverdict -lvtkDICOMParser -lvtkNetCDF > -lvtkmetaio -lvtksqlite -lvtkpng -lvtktiff -lvtkzlib -lvtkjpeg -lvtkexpat > -lvtksys -lpthread -ldl -lm > -Wl,-rpath,/usr/paul/vtk-5.2-build/bin:/usr/X11R6/lib > > So is there any way to tell CMake where to find Motif? Or is there a switch > to disable just the GUI/Motif example? I think this used to be a bug in VTK 5.2 this has been fixed (maybe VTK 5.4 ?). 2cts -- Mathieu From stefano.trapani at cbs.cnrs.fr Tue May 19 13:07:40 2009 From: stefano.trapani at cbs.cnrs.fr (Stefano TRAPANI) Date: Tue, 19 May 2009 19:07:40 +0200 (CEST) Subject: [vtkusers] (bug?) vtkTransform.GetOrientationWXYZ segmentation fault after hand-inverting scaling Message-ID: Hi everybody Working with vtkTranform, I have come across several segmentation faults which are apparently caused by calls to the GetOrientationWXYZ method. After some tests, I realized that this happens with transforms that change the hand of space, like inversions and mirror reflections. (I define this kind of transforms by setting appropriate negative Scale parameters). A simple python example that ends up with a segmentation fault is the following: from vtk import * T = vtkTransform() T.Scale(-1,-1,-1) T.GetOrientationWXYZ() Has anybody observed a similar behaviour ? Is this a bug in GetOrientationWXYZ() ? I am using VTK 5.0.3 with Python 2.5.2 [GCC 4.3.2] from Mandriva 2009. Stefano TRAPANI Centre de Biochimie Structurale (CBS) CNRS UMR 5048; UM1; UM2; INSERM UMR 554 29 rue de Navacelles 34090 MONTPELLIER Cedex - France Tel : +33 (0)4 67 41 77 29 Fax : +33 (0)4 67 41 79 13 -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From post at rocco-gasteiger.de Wed May 20 04:20:06 2009 From: post at rocco-gasteiger.de (Rocco Gasteiger) Date: Wed, 20 May 2009 10:20:06 +0200 Subject: [vtkusers] Embedding Python QVTKRenderWindowInteractor into Qt-Enviroment Message-ID: <000f01c9d923$c84ecce0$58ec66a0$@de> Dear members, I want to render some vtk-data into a Qt-Enviroment via Python scripting. To do this, I use Qt-Designer, PyQt 4.4.4 and python binding for the vtk classes. In my old C++ implementation I use a QVTKWidget embedded into a QGroupBox for 2D/3D rendering and it works fine. For some reasons, I want to switch to do the same via python scripting. But here I have the following problem: A QVTKWidget does not exist in PyQt. So I found in a prior posting, that I have to use a QVTKRenderWindowInteractor class instead. In my python script I initialized this class with a QFrame-object, which I have defined and placed in the Qt-Designer before. It compiles correct and the render content is displayed into the QFrame-Object BUT with the wrong size. In my old C++-Implementation the size of the render window fits into the QVTKWidget according its size. Changing the size of render window by hand has no effect of the displayed render window. Can anybody give me a hint what I'm doing wrong or where my mistake is? For better understanding what I have done, I listed some code snipped from my python script below. Additionally I attached a picture of the running Qt-application. For any help I would be very appreciate. Best Regards, Rocco Gasteiger // This is the initializing part of my QVTKRenderWindowInteractor. The object "axialView" is a QFrame object // which I have defined in Qt-Designer def __init__(self, parent = None): """ Constructor """ QMainWindow.__init__(self, parent) self.setupUi(self) self.connect(self.actionOpenDICOM, QtCore.SIGNAL('triggered()'), self.loadFiles) self.axialViewerWidget = QVTKRenderWindowInteractor(self.axialView) self.axialViewerWidget.Initialize() self.axialViewerWidget.Start() self.initDatasets(); self.initSliceViews(); // Here I setup the the image viewer and its interactor. def initSliceViews(self): print 'Init Slice Views' axialViewer = vtk.vtkImageViewer2() self.axialViewer.SetInput(self.dataset) self.interactorForAxialView = vtk.vtkInteractorStyleImage() self.axialViewer.SetupInteractor(self.axialViewerWidget.GetRenderWindow().Ge tInteractor()) self.interactorForAxialView = self.axialViewer.GetInteractorStyle() self.axialViewer.SetRenderWindow(self.axialViewerWidget.GetRenderWindow()) self.axialViewerWidget.show() self.axialViewer.Render() -------------- next part -------------- A non-text attachment was scrubbed... Name: QtResult.png Type: image/png Size: 6162 bytes Desc: not available URL: From johnimager at gmail.com Wed May 20 05:01:33 2009 From: johnimager at gmail.com (JOHN ATKINSON) Date: Wed, 20 May 2009 14:31:33 +0530 Subject: [vtkusers] Volume Rendering of 64 slice MDCT Dicom Images Message-ID: Hi All, I have a DICOM data set of abdomen taken from a 64 slice MDCT .The data set has the following details . Width: 355.00 mm (512) Height: 355.00 mm (512) Depth: 185.40 mm (412) Voxel size: 0.69x0.69x0.45 Resolution: 1.442 pixels per mm Coordinate origin: 0,0,0 Bits per pixel: 16 (unsigned) Display range: -120 - 240 Number of Images : 412 I want to do volume rendering with this data set in VTK .Is there any algorithm in VTK to do this task.Can I use medical example under VTK examples directory.Medical example uses volume 16 reader ,but my data set has 2 bytes per pixel .Is volume 16 reader capable of doing this task.Please Help. From habe36 at gmail.com Wed May 20 05:03:25 2009 From: habe36 at gmail.com (ABE Hiroshi) Date: Wed, 20 May 2009 18:03:25 +0900 Subject: [vtkusers] OffScreen and blank window Message-ID: <912CF395-0850-4511-99FD-18511F01481F@gmail.com> Dear All, I am working with an application with several VTK windows. Only single VTK window is visible and the others are hidden. But it is necessary to render the hidden windows because the rendered images of the hidden windows are needed to be stored as images. So I put the "OffScreenRenderingOn" to the hidden "vtkRenderWindow"s. Actually the images are properly generated as expected. My problem is that unexpected blank windows are pop-up-ed. I believe the blank window is popup-ed when the hidden renderwindow is "Render"ed. Is there any way not to generate the blank window? My Env. is: PowerMac MDD 867MHz, MacOS X 10.4.11 ATI Radeon 9600 256MB VTK 5.4 Thank you in advance. Regards, ABE Hiroshi from Tokorozawa, JAPAN From emonson at cs.duke.edu Wed May 20 09:22:58 2009 From: emonson at cs.duke.edu (Eric E. Monson) Date: Wed, 20 May 2009 09:22:58 -0400 Subject: [vtkusers] Want vtk dataset from my DICOM data In-Reply-To: References: Message-ID: <03CBD493-DB8A-4006-A328-01745A5CEA18@cs.duke.edu> Hey Chris, Make sure you "reply to all" so that the whole list can contribute answers. First, this probably isn't causing any of your problems, but you may want to switch to the vtkPolyDataConnectivityFilter -- since the contour filter will output polygonal mesh, this filter may be optimized a bit more for that specific data type. Second, what shows up in your vtkRenderWindow? Do you see the whole contour as if you didn't even use the connectivity filter? Try setting the connectivity filter to connect->SetExtractionModeToAllRegions(); connect->SetColorRegions(1); and see if you see a lot of differently colored regions. Or, try connect->SetExtractionModeToSpecifiedRegions(); connect->AddSpecifiedRegion(0); connect->AddSpecifiedRegion(1); connect->SetColorRegions(1); and look in the render window to see if the correct subsets are being extracted. I'm sure there are a lot of people out there using this filter, so I hope someone else will chime in that knows more than me about this specific one! :) -Eric ------------------------------------------------------ Eric E Monson Duke Visualization Technology Group On May 20, 2009, at 3:59 AM, Chris N wrote: > This is my specific problem currently. I working with DICOM data > using VTK and C++. My DICOM data is a human head and I'm trying to > make my data only view skin. The problem I running into now is that > I want to eliminate the internals such as the canals for ears and > throat when I only render skin. Along with the depth I have two > plates rendered on the side of my sample head data. > > Recently I found vtkConnectivityFilter has the function to extract > the largest region and ignoring everything else. When I try to use > this class and I view the number of connected regions extracted I > only get the number 0. My data still remains the same and unaltered > as though I never used connectivityfilter. Below I just added the > only code I wrote for the vtkConnectivityFilter, maybe I missed > something there? Any suggestions? > > //vtkDICOMImageReader - using set directory name > > //vtkContourFilter - (skinExtractor) set value for skin > > //CONNECTIVITY > vtkConnectivityFilter *connect = vtkConnectivityFilter::New(); > connect->SetInputConnection(skinExtractor->GetOutputPort()); > connect->SetExtractionModeToLargestRegion(); > //NUMBER OF REGIONS > int numregion = connect->GetNumberOfExtractedRegions(); > std::cout<< "Number of Connected Regions: " << numregion < > //Window, Outline, Actor, etc. > > > > From: emonson at cs.duke.edu > To: alucard006 at msn.com > Date: Tue, 19 May 2009 12:37:58 -0400 > CC: vtkusers at vtk.org > Subject: Re: [vtkusers] Want vtk dataset from my DICOM data > > Hey Chris, > > The output from the vtkDICOMImageReader is an instance of > vtkImageData, so as the pipeline continues that is what is > processed. In python, you can get this data by calling > reader.GetOutput() or reader.GetOutputDataObject(0), and similar in C > ++. > > If you really want to save that data in another file, one option > would be to use the vtkXMLImageDataWriter to write to a .vti file. > Otherwise, just use the reader and feed its output port into the > input port of the Contour filter as you've seen recently. > > If this isn't clear, just let us know more specifically what > problems you're having. > -Eric > > ------------------------------------------------------ > Eric E Monson > Duke Visualization Technology Group > > > On May 19, 2009, at 4:44 AM, Chris N wrote: > > NEW USER but I've been reading similiar problems with using > vtkPolyDataConnectivityFilter with DICOM data. One person did post > a solution but using the standard vtk dataset from vtkdata. Is it > possible to convert my DICOM data into vtk data set so once that is > done I can use my vtkPolyDataConnectivityFilter on that data set. > Or does DICOMreader do convert into vtk dataset already? If that is > the case how can I retieve that data? Ultimately, I'm trying to > filter out data with vtkPolyDataConnectivityFilter and using my > DICOM data. any help is appreciated, thanks! > > > Hotmail? has a new way to see what's up with your friends. Check it > out. _______________________________________________ > Powered by www.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://www.vtk.org/mailman/listinfo/vtkusers > > > Windows Live?: Keep your life in sync. Check it out. -------------- next part -------------- An HTML attachment was scrubbed... URL: From drouin.simon at gmail.com Wed May 20 09:54:44 2009 From: drouin.simon at gmail.com (Simon Drouin) Date: Wed, 20 May 2009 09:54:44 -0400 Subject: [vtkusers] OffScreen and blank window In-Reply-To: <912CF395-0850-4511-99FD-18511F01481F@gmail.com> References: <912CF395-0850-4511-99FD-18511F01481F@gmail.com> Message-ID: <423e920905200654s295655a6t8c68abda6fcfd423@mail.gmail.com> I have the same problem, though it seems to be specific to OSX. On Win32, the behavior is as expected and the window doesn't show. The Mac implementation of vtkRenderWindow creates the window before checking Offscreen flag. If I understand the code (Objective C, which I don't master), the window is created, then its properties are changed to do offscreen rendering, so you get a dead window in the middle of the screen. What is worst is that the window that is originally created stays on screen even after deleting the vtkRenderWindow instance. s. On Wed, May 20, 2009 at 5:03 AM, ABE Hiroshi wrote: > Dear All, > > I am working with an application with several VTK windows. > > Only single VTK window is visible and the others are hidden. But it is > necessary to render the hidden windows because the rendered images of the > hidden windows are needed to be stored as images. > > So I put the "OffScreenRenderingOn" to the hidden "vtkRenderWindow"s. > > Actually the images are properly generated as expected. > My problem is that unexpected blank windows are pop-up-ed. I believe the > blank window is popup-ed when the hidden renderwindow is "Render"ed. > > Is there any way not to generate the blank window? > > My Env. is: > > PowerMac MDD 867MHz, > MacOS X 10.4.11 > ATI Radeon 9600 256MB > VTK 5.4 > > Thank you in advance. > > Regards, > > ABE Hiroshi > from Tokorozawa, JAPAN > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 adzyubak at gmail.com Wed May 20 10:11:43 2009 From: adzyubak at gmail.com (Oleksandr Dzyubak) Date: Wed, 20 May 2009 09:11:43 -0500 Subject: [vtkusers] How to run CPack on a VTK build In-Reply-To: <4A13A4A6.9000000@cscs.ch> References: <4A12BF05.4090204@cscs.ch> <4A13027F.602@gmail.com> <4A13A4A6.9000000@cscs.ch> Message-ID: <4A140F9F.9000309@gmail.com> Hi John, I am sorry but yes, I am an "intruder". And yes, you are right I'm running Linux. What could be a solution if it's Linux? Thanks, Alex John Biddiscombe wrote: > You initially staed windows and XP, but > >> CPack Error: Problem running tar command: "/usr/local/bin/cmake" -E >> tar cfz control.tar.gz ./control ./md5sums > > Looks like a linux build. Have you got the dos unix tools installed in > /usr/local/bin/cmake on your windows box? if not, then fix the tar > program in cmake. If you have, then I can't help you. as I don't know > what's wrong. > > JB > > From emonson at cs.duke.edu Wed May 20 12:15:20 2009 From: emonson at cs.duke.edu (Eric E. Monson) Date: Wed, 20 May 2009 12:15:20 -0400 Subject: [vtkusers] Embedding Python QVTKRenderWindowInteractor into Qt-Enviroment In-Reply-To: <000f01c9d923$c84ecce0$58ec66a0$@de> References: <000f01c9d923$c84ecce0$58ec66a0$@de> Message-ID: <9C4F69C2-CC64-41B7-B5F9-8138C1087005@cs.duke.edu> Hey Rocco, I don't know if this will help, but when I was trying to get PyQt to work initially, I came up with a kind of hacky solution that works for me. I lay out everything in Designer, just as I do when using C++, including placing a QVTKWidget in the GUI. Then, after I save the .ui file, instead of just running pyuic4 on that .ui file, I run a little python script which does that plus makes a couple substitutions in the resulting .py file. By doing this I don't have to add the QVTKRenderWindowInteractor separately in my main python program. =========== build.py #!/usr/bin/env python import os command = "pyuic4 -o temp_simpleview.py qsimpleview.ui" print 'Generating ui_simpleview.py from qsimpleview.ui' os.system(command) # Need to do some substitution in generated file to make the UI work in python # when the QVTKWidget was created to be used in C++ f = open('temp_simpleview.py', 'r') s = f.read() f.close() s = s.replace('QVTKWidget','QVTKRenderWindowInteractor') s = s.replace('from QVTK', 'from vtk.qt4.QVTK') w = open('ui_simpleview.py', 'w') w.write(s) w.close() os.remove('temp_simpleview.py') =========== Then the constructor for my base class starts like this: =========== from PyQt4 import QtCore, QtGui from ui_simpleview import Ui_MainWindow import vtk class SimpleView(QtGui.QMainWindow): def __init__(self, parent = None): QtGui.QMainWindow.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.ren = vtk.vtkRenderer() self.ui.vtkWidget.GetRenderWindow().AddRenderer(self.ren) ... =========== Hope this helps, -Eric ------------------------------------------------------ Eric E Monson Duke Visualization Technology Group On May 20, 2009, at 4:20 AM, Rocco Gasteiger wrote: > Dear members, > > I want to render some vtk-data into a Qt-Enviroment via Python > scripting. To > do this, I use Qt-Designer, PyQt 4.4.4 and python binding for the vtk > classes. In my old C++ implementation I use a QVTKWidget embedded > into a > QGroupBox for 2D/3D rendering and it works fine. For some reasons, I > want to > switch to do the same via python scripting. But here I have the > following > problem: > > A QVTKWidget does not exist in PyQt. So I found in a prior posting, > that I > have to use a QVTKRenderWindowInteractor class instead. In my python > script > I initialized this class with a QFrame-object, which I have defined > and > placed in the Qt-Designer before. It compiles correct and the render > content > is displayed into the QFrame-Object BUT with the wrong size. In my old > C++-Implementation the size of the render window fits into the > QVTKWidget > according its size. Changing the size of render window by hand has > no effect > of the displayed render window. Can anybody give me a hint what I'm > doing > wrong or where my mistake is? For better understanding what I have > done, I > listed some code snipped from my python script below. Additionally I > attached a picture of the running Qt-application. > > For any help I would be very appreciate. > Best Regards, Rocco Gasteiger > > // This is the initializing part of my QVTKRenderWindowInteractor. The > object "axialView" is a QFrame object > // which I have defined in Qt-Designer > def __init__(self, parent = None): > """ > Constructor > """ > QMainWindow.__init__(self, parent) > self.setupUi(self) > self.connect(self.actionOpenDICOM, > QtCore.SIGNAL('triggered()'), > self.loadFiles) > self.axialViewerWidget = > QVTKRenderWindowInteractor(self.axialView) > > > self.axialViewerWidget.Initialize() > self.axialViewerWidget.Start() > self.initDatasets(); > self.initSliceViews(); > > // Here I setup the the image viewer and its interactor. > def initSliceViews(self): > print 'Init Slice Views' > axialViewer = vtk.vtkImageViewer2() > self.axialViewer.SetInput(self.dataset) > > self.interactorForAxialView = vtk.vtkInteractorStyleImage() > > self > .axialViewer > .SetupInteractor(self.axialViewerWidget.GetRenderWindow().Ge > tInteractor()) > self.interactorForAxialView = > self.axialViewer.GetInteractorStyle() > > self > .axialViewer.SetRenderWindow(self.axialViewerWidget.GetRenderWindow()) > > self.axialViewerWidget.show() > self.axialViewer.Render() > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 From asinghmlists at gmail.com Wed May 20 12:20:52 2009 From: asinghmlists at gmail.com (Ashish Singh) Date: Wed, 20 May 2009 11:20:52 -0500 Subject: [vtkusers] vtkimageplanewidget with annotations Message-ID: Hi, In my application, I am reading a DICOM series and displaying the volume in coronal view. I have created a vtkimageplanewidget to represent axial slice and attached it to a slider in my user interface. The user can move the slider and change the position of this vtkimageplanewidget. I want to display the slice number beside the vtkimageplanewidget. Can anyone please guide me on doing this? Thanks, Ashish -------------- next part -------------- An HTML attachment was scrubbed... URL: From chapbe at pitt.edu Wed May 20 12:54:21 2009 From: chapbe at pitt.edu (Chapman, Brian) Date: Wed, 20 May 2009 12:54:21 -0400 Subject: [vtkusers] VTK Python Wrappers on Red Hat Message-ID: We are trying to compile VTK with Python (2.5) wrappers on a machine running Red Hat Enterprise Linux 5.2. VTK compiles and installs fine, but when within within Python I try to import vtk I get the following error: In [1]: import vtk --------------------------------------------------------------------------- Traceback (most recent call last) /home/brian/ in () /usr/local/lib/python2.5/site-packages/vtk/__init__.py in () 27 28 # Load all required kits. ---> 29 from common import * 30 from filtering import * 31 from io import * /usr/local/lib/python2.5/site-packages/vtk/common.py in () 5 6 if os.name == 'posix': ----> 7 from libvtkCommonPython import * 8 else: 9 from vtkCommonPython import * : libvtkCommonPythonD.so.5.0: cannot open shared object file: No such file or directory This library is in fact installed in /usr/local/lib -rwxr-xr-x 1 root root 5208962 May 20 11:23 libvtkCommonPythonD.so.5.0.4 lrwxrwxrwx 1 root root 28 May 20 11:23 libvtkCommonPythonD.so.5.0 -> libvtkCommonPythonD.so.5.0.4 lrwxrwxrwx 1 root root 26 May 20 11:23 libvtkCommonPythonD.so -> libvtkCommonPythonD.so.5.0 The vtk directory under site-packages also contains a libvtkCommonPython library: -rwxr-xr-x 1 root root 86742 May 20 11:11 libvtkCommonPython.so Is there something obvious we are missing in the installation process? Confused. Brian From kall at mayo.edu Wed May 20 16:17:08 2009 From: kall at mayo.edu (Kall, Bruce A.) Date: Wed, 20 May 2009 15:17:08 -0500 Subject: [vtkusers] Can a vtkActor be added to more than one renderer In-Reply-To: <44f773f50905010945p1bd041afh97d5fd85912a673a@mail.gmail.com> References: <44f773f50905010945p1bd041afh97d5fd85912a673a@mail.gmail.com> Message-ID: <4A146544.1030100@mayo.edu> I seem to be able to add some type of actors to multiple renderers (lines, image volumes etc), but not all. In particular, if I create axial, sagittal and coronal actors like in Medical3.cxx and add them all to the same rendered they work fine. If I add each one to a different renderer, they all work fine. But if I attach any one of them more than once, the displayed 'plane' shows up as all white on any renderers after the first one using it is rendered (e.g, if I attach the three image actors in 2 or more renderers, they all display fine on the first renderer, but show up as an all-white plane on any other renderers). Is there a way to use an image-type actor like these on more than one renderer at a time? Any suggestions? Thanks, Bruce kent williams wrote: > Subject line says it all. > > What I want to do: I have multiple views in separate windows. In one > view I have one or more vtkSeedWidgets. I want to display the points > from the SeedWidgets in the other views. > > What it looks like I have to do is create some geometry, add it to a > mapper, add the mapper to the actor, add the actor to the renderer for > each views. > > Can one actor be added to more than one renderer? > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > > From drescherjm at gmail.com Wed May 20 18:17:36 2009 From: drescherjm at gmail.com (John Drescher) Date: Wed, 20 May 2009 18:17:36 -0400 Subject: [vtkusers] [Insight-users] Negative spacing. Is that going to get me into trouble? In-Reply-To: <9ddb27260905191425m4d896792vf7cd4e7d17bd0754@mail.gmail.com> References: <387ee2020905191259p30850714qd9487dd4a2e29760@mail.gmail.com> <44f773f50905191348t49434c53xc0ee8aa7f78a0484@mail.gmail.com> <387ee2020905191413m1cd8f969ucc09de04510ac205@mail.gmail.com> <9ddb27260905191425m4d896792vf7cd4e7d17bd0754@mail.gmail.com> Message-ID: <387ee2020905201517u56f5f81cyf3bf44c3ece8c4ba@mail.gmail.com> > Its customary to use the camera to view the data at the desired orientation > instead of changing the data. > Thanks everyone who replied. I fixed this issue today without the negative spacing hack. I ran into trouble moving the camera so I ended up fixing the two issues that were caused after having vtk flip the z-axis. The solution was found by looking at what the vtkINRIA3D library I am using did for flipping the x axis to handle the RADIOLOGIC and NEUROLOGIC viewing conventions. John From jumpfunky at web.de Wed May 20 19:57:04 2009 From: jumpfunky at web.de (Thorsten Wagner) Date: Wed, 20 May 2009 16:57:04 -0700 (PDT) Subject: [vtkusers] vtkTIFFReader Multipage tiled TIFF Message-ID: <23634719.post@talk.nabble.com> Hello, i'm working with the vtkTIFFReader. Reading a 2D (1Page) tiled tiff works fine. But, how can i access a spezific tile or a range of tiles? Reading a multi page tiff results in a unhandled Win32-Exception. For a multi page tiff i'm tried this: vtkTIFFReader* tiffreader = vtkTIFFReader::New(); tiffreader->SetFileName("C:/ct2.tif"); tiffreader->SetFileDimensionality(3); std::cout << "Start reading" << std::endl; tiffreader->Update(); std::cout << "Reading successfull" << std::endl; The same code without "tiffreader->SetFileDimensionality(3);" works for 2D TIFF fine. Any Ideas? Regards, Thorsten -- View this message in context: http://www.nabble.com/vtkTIFFReader-Multipage-tiled-TIFF-tp23634719p23634719.html Sent from the VTK - Users mailing list archive at Nabble.com. From raashid.b at rediffmail.com Wed May 20 22:47:20 2009 From: raashid.b at rediffmail.com (Raashid Baig) Date: 21 May 2009 02:47:20 -0000 Subject: [vtkusers] Trouble coloring the vtkActors (always turns out red) Message-ID: <20090521024720.24717.qmail@f5mail-237-203.rediffmail.com> Thanks a lot Lars, It worked for me. Raashid >Hi, >try >mapper->SetScalarVisibility(false); >cheers, >lars Raashid Baig-2 wrote: > > I am having trouble setting vtkActor's color. > I can't figure out whats wrong with my program as the actor always turns > out red no matter what color I set it to. > I am using vtk5.4.0 on a linux system. > Can someone please take a look at the attached files and explain what am I > doing wrong ? > Thanks in advance. > Raashid -------------- next part -------------- An HTML attachment was scrubbed... URL: From corrieallen at gmail.com Wed May 20 23:39:29 2009 From: corrieallen at gmail.com (Corrie Allen) Date: Wed, 20 May 2009 20:39:29 -0700 Subject: [vtkusers] DEM to STL conversion Message-ID: Has anybody out there put together a program for converting digital elevation model (DEM) files into STL meshes using VTK? Thanks in advance. Corrie Corrie Allen corrieallen at gmail.com From hossein.ghadiri at gmail.com Fri May 22 02:39:23 2009 From: hossein.ghadiri at gmail.com (Hossein Ghadiri) Date: Fri, 22 May 2009 11:09:23 +0430 Subject: [vtkusers] Which object of MFC is proper for 2D image view by VTK? Message-ID: <00aa01c9daa8$13f983d0$1400a8c0@Hossein> Dear all, Which object of MFC or tools can be helpful to image viewing by VTK? Is a context or DC tool proper for this issue? Would anyone please let me know better suggestion? Hossein -------------- next part -------------- An HTML attachment was scrubbed... URL: From habe36 at gmail.com Thu May 21 04:29:55 2009 From: habe36 at gmail.com (ABE Hiroshi) Date: Thu, 21 May 2009 17:29:55 +0900 Subject: [vtkusers] OffScreen and blank window In-Reply-To: <423e920905200654s295655a6t8c68abda6fcfd423@mail.gmail.com> References: <912CF395-0850-4511-99FD-18511F01481F@gmail.com> <423e920905200654s295655a6t8c68abda6fcfd423@mail.gmail.com> Message-ID: <94068DDA-3788-4D6C-B6CE-39ABAE453F93@gmail.com> Dear Simon and all, I am using Carbon version of VTK, so the situation might be different from you, Simon. But I checked the vtkCarbonRenderWindow.cxx as you did for Cocoa version, I found CreateAWindow calls ShowWindow to display the renderwindow. So I changed the code as: vtkCarbonRenderWindow.cxx: 715 if(!this->GetOffScreenRendering() ) ShowWindow(this->RootWindow); Anyway it works as I expected, however, I am wondering if it might be fit to the spec. Any suggestion? Regards, Hiroshi ABE On 2009/05/20, at 22:54, Simon Drouin wrote: > I have the same problem, though it seems to be specific to OSX. On > Win32, the behavior is as expected and the window doesn't show. > > The Mac implementation of vtkRenderWindow creates the window before > checking Offscreen flag. If I understand the code (Objective C, > which I don't master), the window is created, then its properties > are changed to do offscreen rendering, so you get a dead window in > the middle of the screen. What is worst is that the window that is > originally created stays on screen even after deleting the > vtkRenderWindow instance. > > s. > > On Wed, May 20, 2009 at 5:03 AM, ABE Hiroshi wrote: > Dear All, > > I am working with an application with several VTK windows. > > Only single VTK window is visible and the others are hidden. But it > is necessary to render the hidden windows because the rendered > images of the hidden windows are needed to be stored as images. > > So I put the "OffScreenRenderingOn" to the hidden "vtkRenderWindow"s. > > Actually the images are properly generated as expected. > My problem is that unexpected blank windows are pop-up-ed. I > believe the blank window is popup-ed when the hidden renderwindow > is "Render"ed. > > Is there any way not to generate the blank window? > > My Env. is: > > PowerMac MDD 867MHz, > MacOS X 10.4.11 > ATI Radeon 9600 256MB > VTK 5.4 > > Thank you in advance. > > Regards, > > ABE Hiroshi > from Tokorozawa, JAPAN > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > From alucard006 at msn.com Thu May 21 05:31:49 2009 From: alucard006 at msn.com (Chris N) Date: Thu, 21 May 2009 02:31:49 -0700 Subject: [vtkusers] Want vtk dataset from my DICOM data In-Reply-To: <03CBD493-DB8A-4006-A328-01745A5CEA18@cs.duke.edu> References: <03CBD493-DB8A-4006-A328-01745A5CEA18@cs.duke.edu> Message-ID: Thanks for the help, I feel I am getting close to my answer but not quite there yet. Sorry about not "replying to all" but will do that from now. Just a quick recap trying to remove two plates & internal canal of ears & throat from human head. Using vtkPolyDataConnectivityFilter did give me some results now which is great. When I used connectivity filter I had the exact same contour. Now tried to use your suggestions with the color region but nothing ever came up for me. Also I was still seeing GetNumberOfExtractedRegions() print out a '0'. Looking through my functions I found Update() and when I use this I now get from GetNumberOfExtractedRegions() 349. By that point I tried SetExtractionModeToLargestRegion() and removed one of the plates not touching the data head. Inside the head removed everything that was not connected which is good. I attempted the color regions as you told me but since got no results for coloring regions. So now I need to come up with a solution to remove the other plate though it is touching data I need. Of course, I need think of a way to remove the canals from ears & throat also. Any suggestions, is vtkPolyDataConnectivityFilter still capable for something like that? Since I'm using vtkPolyDataConnectivityFilter::Update() & saw vtkPolyDataConnectivityFilter::Modifed(), do you know what exactly do these functions do? -Chris CC: vtkusers at vtk.org From: emonson at cs.duke.edu To: alucard006 at msn.com Subject: Re: [vtkusers] Want vtk dataset from my DICOM data Date: Wed, 20 May 2009 09:22:58 -0400 Hey Chris, Make sure you "reply to all" so that the whole list can contribute answers. First, this probably isn't causing any of your problems, but you may want to switch to the vtkPolyDataConnectivityFilter -- since the contour filter will output polygonal mesh, this filter may be optimized a bit more for that specific data type. Second, what shows up in your vtkRenderWindow? Do you see the whole contour as if you didn't even use the connectivity filter? Try setting the connectivity filter to connect->SetExtractionModeToAllRegions();connect->SetColorRegions(1); and see if you see a lot of differently colored regions. Or, try connect->SetExtractionModeToSpecifiedRegions();connect->AddSpecifiedRegion(0);connect->AddSpecifiedRegion(1);connect->SetColorRegions(1); and look in the render window to see if the correct subsets are being extracted. I'm sure there are a lot of people out there using this filter, so I hope someone else will chime in that knows more than me about this specific one! :) -Eric ------------------------------------------------------Eric E MonsonDuke Visualization Technology Group On May 20, 2009, at 3:59 AM, Chris N wrote:This is my specific problem currently. I working with DICOM data using VTK and C++. My DICOM data is a human head and I'm trying to make my data only view skin. The problem I running into now is that I want to eliminate the internals such as the canals for ears and throat when I only render skin. Along with the depth I have two plates rendered on the side of my sample head data. Recently I found vtkConnectivityFilter has the function to extract the largest region and ignoring everything else. When I try to use this class and I view the number of connected regions extracted I only get the number 0. My data still remains the same and unaltered as though I never used connectivityfilter. Below I just added the only code I wrote for the vtkConnectivityFilter, maybe I missed something there? Any suggestions? //vtkDICOMImageReader - using set directory name //vtkContourFilter - (skinExtractor) set value for skin //CONNECTIVITY vtkConnectivityFilter *connect = vtkConnectivityFilter::New(); connect->SetInputConnection(skinExtractor->GetOutputPort()); connect->SetExtractionModeToLargestRegion(); //NUMBER OF REGIONS int numregion = connect->GetNumberOfExtractedRegions(); std::cout<< "Number of Connected Regions: " << numregion < From raashid.b at rediffmail.com Thu May 21 05:53:23 2009 From: raashid.b at rediffmail.com (Raashid Baig) Date: 21 May 2009 09:53:23 -0000 Subject: [vtkusers] Trouble intializing vtkCubeAxesActor2D object Message-ID: <20090521095323.17573.qmail@f5mail-236-232.rediffmail.com> I have written a very simple code for creating an actor and assigning cube axis to it through vtkCubeAxesActor2D. But for some reason I am having trouble initializing the "vtkCubeAxesActor2D" object. While building I the following error. raashid at raashid:~/learning_qt/qt_4_3_4/Nano_demo/viewer_demo_vtk$ make Scanning dependencies of target profile [100%] Building CXX object CMakeFiles/profile.dir/profile.o Linking CXX executable profile CMakeFiles/profile.dir/profile.o: In function `main': profile.cxx:(.text+0x2da): undefined reference to `vtkCubeAxesActor2D::New()' collect2: ld returned 1 exit status make[2]: *** [profile] Error 1 make[1]: *** [CMakeFiles/profile.dir/all] Error 2 make: *** [all] Error 2 I can't figure out whats wrong with my program ? I am using vtk5.4.0 on a linux system. Can someone please take a look at the attached files and explain what am I doing wrong ? Thanks in advance. Raashid -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: profile.cxx Type: application/octet-stream Size: 1749 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CMakeLists.txt URL: From 38332115 at qq.com Thu May 21 06:18:43 2009 From: 38332115 at qq.com (higherone) Date: Thu, 21 May 2009 18:18:43 +0800 Subject: [vtkusers] why vtk is consuming so much memory? 1000 vtkActors * 300 vtkLines Message-ID: I have 1000 vtkActors, and in each vtkActor there are 300 vtkLines.when this little sample runs, it consumes about 150 Mb Memory .Is this a normal thing?If not, please tell me what is wrong, or any way to improve the performance . Thanks. my code is below. // drawlines.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "vtkPolyDataMapper.h" #include "vtkActor.h" #include "vtkRenderer.h" #include "vtkRenderWindow.h" #include "vtkRenderWindowInteractor.h" #include "vtkProperty.h" #include "vtkInteractorStyleTrackballCamera.h" #include "vtkSphereSource.h" #include "vtkPoints.h" #include "vtkPolyVertex.h" #include "vtkUnstructuredGrid.h" #include "vtkDataSetMapper.h" #include "vtkCamera.h" #include "vtkLine.h" #include "vtkAxes.h" #include "vtkTubeFilter.h" #include "vtkDoubleArray.h" #include "vtkCellData.h" #include "vtkFloatArray.h" #include "vtkLookupTable.h" int _tmain(int argc, char* argv[]) { vtkRenderer *ren=vtkRenderer::New(); for (int m=0; m<1000; m++) { vtkPoints * points = vtkPoints::New(); points->InsertPoint(0,0,0,0); points->InsertPoint(1,10,0,0); //points->InsertPoint(2,0,10,0); //points->InsertPoint(3,10,10,0); //points->InsertPoint(4,0,0,0); vtkUnstructuredGrid * grid=vtkUnstructuredGrid::New(); grid->SetPoints(points); points->Delete(); int nLineNum(300); for(int i=0;iGetPointIds()->SetNumberOfIds(2); //aline->GetPointIds()->SetId(0,i); //aline->GetPointIds()->SetId(1,i+1); aline->GetPointIds()->SetId(0,0); aline->GetPointIds()->SetId(1,1); grid->InsertNextCell(aline->GetCellType(), aline->GetPointIds()); aline->Delete(); } /*//set the color lookup table vtkLookupTable *pLookup = vtkLookupTable::New(); pLookup->SetTableRange(0, 2); pLookup->SetTableValue(0, 1, 1, 0); pLookup->SetTableValue(1, 0, 1, 1); pLookup->SetTableValue(2, 1, 0, 1); pLookup->SetNumberOfTableValues(3); //set color index for every line vtkCellData *cellData = grid->GetCellData(); vtkIntArray *colourPts = vtkIntArray::New(); for(int i=0; i InsertNextValue(0); } cellData->SetScalars(colourPts);*/ vtkDataSetMapper *map1 = vtkDataSetMapper::New(); map1->SetInput(grid); grid->Delete(); //map1->SetLookupTable(pLookup); //map1->SetScalarRange(0, 2); vtkActor *actor1 = vtkActor::New(); actor1->SetMapper(map1); actor1->GetProperty()->SetColor(0.0,0.0, 1); map1->Delete(); ren->AddActor(actor1); actor1->Delete(); } ren->SetBackground(1, 1, 1); vtkRenderWindow* win=vtkRenderWindow::New(); win->AddRenderer(ren); win->SetSize(400,400); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(win); win->Render(); iren->Start(); //iren->Initialize(); ren->Delete(); win->Delete(); iren->Delete(); return 0; } From anka at bic.mni.mcgill.ca Thu May 21 07:40:53 2009 From: anka at bic.mni.mcgill.ca (Anka Kochanowska) Date: Thu, 21 May 2009 07:40:53 -0400 Subject: [vtkusers] Can a vtkActor be added to more than one renderer In-Reply-To: <4A146544.1030100@mayo.edu> References: <44f773f50905010945p1bd041afh97d5fd85912a673a@mail.gmail.com> <4A146544.1030100@mayo.edu> Message-ID: <4A153DC5.2080305@bic.mni.mcgill.ca> Hi! I was doing the same thing and was instructed not to add the same actor to multiple renderers. http://public.kitware.com/pipermail/vtkusers/2007-January/089248.html Kall, Bruce A. wrote: > I seem to be able to add some type of actors to multiple renderers > (lines, image > volumes etc), but not all. > > In particular, if I create axial, sagittal and coronal actors like in > Medical3.cxx and > add them all to the same rendered they work fine. If I add each one > to a different > renderer, they all work fine. But if I attach any one of them more > than once, > the displayed 'plane' shows up as all white on any renderers after the > first > one using it is rendered (e.g, if I attach the three image actors in 2 > or more renderers, > they all display fine on the first renderer, but show up as an > all-white plane on > any other renderers). Is there a way to use an image-type actor like > these on more > than one renderer at a time? > > Any suggestions? > > Thanks, > Bruce > > > kent williams wrote: >> Subject line says it all. >> >> What I want to do: I have multiple views in separate windows. In one >> view I have one or more vtkSeedWidgets. I want to display the points >> from the SeedWidgets in the other views. >> >> What it looks like I have to do is create some geometry, add it to a >> mapper, add the mapper to the actor, add the actor to the renderer for >> each views. >> >> Can one actor be added to more than one renderer? >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 >> >> > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > From jpedrick at gmail.com Thu May 21 10:08:30 2009 From: jpedrick at gmail.com (Joshua Pedrick) Date: Thu, 21 May 2009 10:08:30 -0400 Subject: [vtkusers] Trouble with QVTK In-Reply-To: <1dfc97b50905121016t3477cfem89d7be56f689dca9@mail.gmail.com> References: <1dfc97b50905120636p259f2f33lad4cad75295ac7a3@mail.gmail.com> <1dfc97b50905121016t3477cfem89d7be56f689dca9@mail.gmail.com> Message-ID: <1dfc97b50905210708s27f78e57nab1af6b255b044b4@mail.gmail.com> Does anyone have a working example using QVTK + QtDesigner on Linux that I could try to compare? On Tue, May 12, 2009 at 1:16 PM, Joshua Pedrick wrote: > Hello again Leo, > Here's my code once again, but distilled and reordered a bit. I > removed all the Deletes and whatnot. I'm still not getting anything but the > gradient background. Any clues? > I downloaded and compiled VTK-5.4 with QVTK, using Qt version 4.5.1 > from Qt SDK 2009.02. Still no luck. So the latest VTK from CVS and version > 5.4 aren't working. I can't be the only one using QVTK. I am not using cmake > to build my project, could this be the problem? Are there some compiler > flags I need to set for QVTK to work? > > Regards, > -Joshua > > void MainWindow::SetupScene() > { > QVTKWidget* qvtkwidget = ui.qvtkWidget; > > qvtkwidget->GetRenderWindow()->DoubleBufferOff(); > > //Put cone in window > { > vtkConeSource *cone = vtkConeSource::New(); > > //Create Cone Mapper. > vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New(); > coneMapper->SetInputConnection(cone->GetOutputPort()); > > //Create Cone Actor > vtkActor *coneActor = vtkActor::New(); > coneActor->SetMapper(coneMapper); > > //Create Cone Renderer > vtkRenderer *ren = vtkRenderer::New(); > ren->SetBackground(0,0,0); > ren->SetBackground2(1,1,1); > ren->GradientBackgroundOn(); > > ren->AddActor(coneActor); > > qvtkwidget->GetRenderWindow()->AddRenderer(ren); > > } > > } > > 2009/5/12 L.J. van Ruijven > >> Hi Joshua, >> >> I allready deleted your first mail, so I cannot check the code again, but >> I think here the background renderer is added. So that one is really drawn >> in the render window. >> But if I remember well, you created the pipeline for the cone in a >> separate fragment. And in the end of this fragment you deleted the cone >> renderer, but you never added it to the render window. >> >> regards, >> >> Leo. >> >> >> ----- Original Message ----- >> From: Joshua Pedrick >> Date: Tuesday, May 12, 2009 3:36 pm >> Subject: Re: Trouble with QVTK >> To: vtkusers at vtk.org >> Cc: "L.J. van Ruijven" >> >> >> > L.J. I think I do this in MainWindow::SetupScene() at the very end: >> > >> > qvtkwidget->GetRenderWindow()->AddRenderer(ren); >> > qvtkwidget->GetRenderWindow()->BordersOn(); >> > >> > ren->Delete(); >> > >> > Is this not the correct way to add a renderer? I do get the lovely >> gradient >> > background I applied to the renderer, but no actors. The gradient >> background >> > makes me think the renderer is properly connected to the render window. >> > >> > I'm going to compile the stable version of VTK today and see how it >> goes. >> > I'm really suspecting there is a bug in the CVS QVTK. >> > >> > Regards >> > -Joshua >> > >> > 2009/5/12 L.J. van Ruijven >> > >> > > Hi Joshua, >> > > >> > > I think you forgot to connect the renderer to the renderwindow. >> Somewhere >> > > you should add the statement renWin->AddRenderer(ren). >> > > >> > > regards, >> > > >> > > Leo >> > > >> > > >> > > >> > >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From clinton at elemtech.com Thu May 21 10:11:30 2009 From: clinton at elemtech.com (Clinton Stimpson) Date: Thu, 21 May 2009 08:11:30 -0600 Subject: [vtkusers] OffScreen and blank window In-Reply-To: <94068DDA-3788-4D6C-B6CE-39ABAE453F93@gmail.com> References: <912CF395-0850-4511-99FD-18511F01481F@gmail.com> <423e920905200654s295655a6t8c68abda6fcfd423@mail.gmail.com> <94068DDA-3788-4D6C-B6CE-39ABAE453F93@gmail.com> Message-ID: <4A156112.9030009@elemtech.com> I see something else wrong, that needs fixed regardless of offscreen rendering. Can someone try putting this at the end of vtkCarbonRenderWindow::DestroyWindow(), and see if it helps this offscreen problem? void vtkCarbonRenderWindow::DestroyWindow() { ... ... if(this->OwnWindow && this->RootWindow) { DisposeWindow(this->RootWindow); this->RootWindow = 0; this->WindowId = 0; } this->Mapped = 0; } vtkCocoaRenderWindow needs the same fix. Thanks, Clint ABE Hiroshi wrote: > Dear Simon and all, > > I am using Carbon version of VTK, so the situation might be different > from you, Simon. > But I checked the vtkCarbonRenderWindow.cxx as you did for Cocoa > version, I found CreateAWindow calls ShowWindow to display the > renderwindow. So I changed the code as: > > vtkCarbonRenderWindow.cxx: 715 > > if(!this->GetOffScreenRendering() ) ShowWindow(this->RootWindow); > > Anyway it works as I expected, however, I am wondering if it might be > fit to the spec. > Any suggestion? > > Regards, > Hiroshi ABE > > On 2009/05/20, at 22:54, Simon Drouin wrote: > >> I have the same problem, though it seems to be specific to OSX. On >> Win32, the behavior is as expected and the window doesn't show. >> >> The Mac implementation of vtkRenderWindow creates the window before >> checking Offscreen flag. If I understand the code (Objective C, which >> I don't master), the window is created, then its properties are >> changed to do offscreen rendering, so you get a dead window in the >> middle of the screen. What is worst is that the window that is >> originally created stays on screen even after deleting the >> vtkRenderWindow instance. >> >> s. >> >> On Wed, May 20, 2009 at 5:03 AM, ABE Hiroshi wrote: >> Dear All, >> >> I am working with an application with several VTK windows. >> >> Only single VTK window is visible and the others are hidden. But it >> is necessary to render the hidden windows because the rendered images >> of the hidden windows are needed to be stored as images. >> >> So I put the "OffScreenRenderingOn" to the hidden "vtkRenderWindow"s. >> >> Actually the images are properly generated as expected. >> My problem is that unexpected blank windows are pop-up-ed. I believe >> the blank window is popup-ed when the hidden renderwindow is "Render"ed. >> >> Is there any way not to generate the blank window? >> >> My Env. is: >> >> PowerMac MDD 867MHz, >> MacOS X 10.4.11 >> ATI Radeon 9600 256MB >> VTK 5.4 >> >> Thank you in advance. >> >> Regards, >> >> ABE Hiroshi >> from Tokorozawa, JAPAN >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 From clinton at elemtech.com Thu May 21 10:16:59 2009 From: clinton at elemtech.com (Clinton Stimpson) Date: Thu, 21 May 2009 08:16:59 -0600 Subject: [vtkusers] Trouble with QVTK In-Reply-To: <1dfc97b50905210708s27f78e57nab1af6b255b044b4@mail.gmail.com> References: <1dfc97b50905120636p259f2f33lad4cad75295ac7a3@mail.gmail.com> <1dfc97b50905121016t3477cfem89d7be56f689dca9@mail.gmail.com> <1dfc97b50905210708s27f78e57nab1af6b255b044b4@mail.gmail.com> Message-ID: <4A15625B.1040303@elemtech.com> There are examples in VTK/Examples/GUI/Qt. Both SimpleView/ and Events/ have designer .ui files. Clint Joshua Pedrick wrote: > Does anyone have a working example using QVTK + QtDesigner on Linux > that I could try to compare? > > On Tue, May 12, 2009 at 1:16 PM, Joshua Pedrick > wrote: > > Hello again Leo, > Here's my code once again, but distilled and reordered a bit. > I removed all the Deletes and whatnot. I'm still not getting > anything but the gradient background. Any clues? > I downloaded and compiled VTK-5.4 with QVTK, using Qt version > 4.5.1 from Qt SDK 2009.02. Still no luck. So the latest VTK from > CVS and version 5.4 aren't working. I can't be the only one using > QVTK. I am not using cmake to build my project, could this be the > problem? Are there some compiler flags I need to set for QVTK to > work? > > > Regards, > -Joshua > > void MainWindow::SetupScene() > { > QVTKWidget* qvtkwidget = ui.qvtkWidget; > > qvtkwidget->GetRenderWindow()->DoubleBufferOff(); > > > //Put cone in window > { > vtkConeSource *cone = vtkConeSource::New(); > > //Create Cone Mapper. > vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New(); > coneMapper->SetInputConnection(cone->GetOutputPort()); > > //Create Cone Actor > > vtkActor *coneActor = vtkActor::New(); > coneActor->SetMapper(coneMapper); > > //Create Cone Renderer > vtkRenderer *ren = vtkRenderer::New(); > ren->SetBackground(0,0,0); > ren->SetBackground2(1,1,1); > ren->GradientBackgroundOn(); > > ren->AddActor(coneActor); > > qvtkwidget->GetRenderWindow()->AddRenderer(ren); > > } > > } > > 2009/5/12 L.J. van Ruijven > > > Hi Joshua, > > I allready deleted your first mail, so I cannot check the code > again, but I think here the background renderer is added. So > that one is really drawn in the render window. > But if I remember well, you created the pipeline for the cone > in a separate fragment. And in the end of this fragment you > deleted the cone renderer, but you never added it to the > render window. > > regards, > > Leo. > > > ----- Original Message ----- > From: Joshua Pedrick > > Date: Tuesday, May 12, 2009 3:36 pm > Subject: Re: Trouble with QVTK > To: vtkusers at vtk.org > Cc: "L.J. van Ruijven" > > > > > L.J. I think I do this in MainWindow::SetupScene() at the > very end: > > > > qvtkwidget->GetRenderWindow()->AddRenderer(ren); > > qvtkwidget->GetRenderWindow()->BordersOn(); > > > > ren->Delete(); > > > > Is this not the correct way to add a renderer? I do get the > lovely gradient > > background I applied to the renderer, but no actors. The > gradient background > > makes me think the renderer is properly connected to the > render window. > > > > I'm going to compile the stable version of VTK today and > see how it goes. > > I'm really suspecting there is a bug in the CVS QVTK. > > > > Regards > > -Joshua > > > > 2009/5/12 L.J. van Ruijven > > > > > > Hi Joshua, > > > > > > I think you forgot to connect the renderer to the > renderwindow. Somewhere > > > you should add the statement renWin->AddRenderer(ren). > > > > > > regards, > > > > > > Leo > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > From emonson at cs.duke.edu Thu May 21 10:55:20 2009 From: emonson at cs.duke.edu (Eric E. Monson) Date: Thu, 21 May 2009 10:55:20 -0400 Subject: [vtkusers] Want vtk dataset from my DICOM data In-Reply-To: References: <03CBD493-DB8A-4006-A328-01745A5CEA18@cs.duke.edu> Message-ID: <9EEB25C6-9C9F-454E-827B-97E983BE10DB@cs.duke.edu> Hey Chris, If the other plate is touching the data you need, you'll have to figure out another way of getting rid of that data -- the connectivity filter will see all of these touching regions as one. Do they disconnect from each other if you change slightly the value in your contour filter? If not, you'll probably have to do something like define a selection based on the physical position of the objects and extract the surface you want from the combined head/plate surface. This sort of thing is often easier in an interactive visualization, so you might want to use ParaView (or Amira, or something else) to figure this out or do some pre-processing on your data. Update() forces the pipeline to execute, which generates the real data up to that point in the pipeline. From page 24 of The VTK User's Guide (v5, 2006): "Normally, you do not need to manually invoke Update() because the filters are connected into a visualization pipeline. In this case, when the actor receives a request to render itself, it forwards the method to its mapper, and the Update() method is automatically sent through the visualization pipeline." As you saw, you sometimes need to call this manually when you're trying to get intermediate data out, so the pipeline must be executed before it necessarily gets to the stage where the actors would call Update() themselves. Modified() "updates the the internal modification time stamp for the object" (pg 181, ibid), which will tell the pipeline that this filter needs to be updated the next time the pipeline is executed. Talk to you later, -Eric On May 21, 2009, at 5:31 AM, Chris N wrote: > Thanks for the help, I feel I am getting close to my answer but not > quite there yet. Sorry about not "replying to all" but will do that > from now. Just a quick recap trying to remove two plates & internal > canal of ears & throat from human head. > > Using vtkPolyDataConnectivityFilter did give me some results now > which is great. When I used connectivity filter I had the exact > same contour. Now tried to use your suggestions with the color > region but nothing ever came up for me. Also I was still seeing > GetNumberOfExtractedRegions() print out a '0'. Looking through my > functions I found Update() and when I use this I now get from > GetNumberOfExtractedRegions() 349. By that point I tried > SetExtractionModeToLargestRegion() and removed one of the plates not > touching the data head. Inside the head removed everything that was > not connected which is good. I attempted the color regions as you > told me but since got no results for coloring regions. So now I > need to come up with a solution to remove the other plate though it > is touching data I need. Of course, I need think of a way to remove > the canals from ears & throat also. Any suggestions, is > vtkPolyDataConnectivityFilter still capable for something like that? > > Since I'm using vtkPolyDataConnectivityFilter::Update() & saw > vtkPolyDataConnectivityFilter::Modifed(), do you know what exactly > do these functions do? > > -Chris > CC: vtkusers at vtk.org > From: emonson at cs.duke.edu > To: alucard006 at msn.com > Subject: Re: [vtkusers] Want vtk dataset from my DICOM data > Date: Wed, 20 May 2009 09:22:58 -0400 > > Hey Chris, > > Make sure you "reply to all" so that the whole list can contribute > answers. > > First, this probably isn't causing any of your problems, but you may > want to switch to the vtkPolyDataConnectivityFilter -- since the > contour filter will output polygonal mesh, this filter may be > optimized a bit more for that specific data type. > > Second, what shows up in your vtkRenderWindow? Do you see the whole > contour as if you didn't even use the connectivity filter? > > Try setting the connectivity filter to > connect->SetExtractionModeToAllRegions(); > connect->SetColorRegions(1); > > and see if you see a lot of differently colored regions. Or, try > > connect->SetExtractionModeToSpecifiedRegions(); > connect->AddSpecifiedRegion(0); > connect->AddSpecifiedRegion(1); > connect->SetColorRegions(1); > > and look in the render window to see if the correct subsets are > being extracted. > > I'm sure there are a lot of people out there using this filter, so I > hope someone else will chime in that knows more than me about this > specific one! :) > > -Eric > > ------------------------------------------------------ > Eric E Monson > Duke Visualization Technology Group > > > > On May 20, 2009, at 3:59 AM, Chris N wrote: > > This is my specific problem currently. I working with DICOM data > using VTK and C++. My DICOM data is a human head and I'm trying to > make my data only view skin. The problem I running into now is that > I want to eliminate the internals such as the canals for ears and > throat when I only render skin. Along with the depth I have two > plates rendered on the side of my sample head data. > > Recently I found vtkConnectivityFilter has the function to extract > the largest region and ignoring everything else. When I try to use > this class and I view the number of connected regions extracted I > only get the number 0. My data still remains the same and unaltered > as though I never used connectivityfilter. Below I just added the > only code I wrote for the vtkConnectivityFilter, maybe I missed > something there? Any suggestions? > > //vtkDICOMImageReader - using set directory name > > //vtkContourFilter - (skinExtractor) set value for skin > > //CONNECTIVITY > vtkConnectivityFilter *connect = vtkConnectivityFilter::New(); > connect->SetInputConnection(skinExtractor->GetOutputPort()); > connect->SetExtractionModeToLargestRegion(); > //NUMBER OF REGIONS > int numregion = connect->GetNumberOfExtractedRegions(); > std::cout<< "Number of Connected Regions: " << numregion < > //Window, Outline, Actor, etc. > > > > From: emonson at cs.duke.edu > To: alucard006 at msn.com > Date: Tue, 19 May 2009 12:37:58 -0400 > CC: vtkusers at vtk.org > Subject: Re: [vtkusers] Want vtk dataset from my DICOM data > > Hey Chris, > > The output from the vtkDICOMImageReader is an instance of > vtkImageData, so as the pipeline continues that is what is > processed. In python, you can get this data by calling > reader.GetOutput() or reader.GetOutputDataObject(0), and similar in C > ++. > > If you really want to save that data in another file, one option > would be to use the vtkXMLImageDataWriter to write to a .vti file. > Otherwise, just use the reader and feed its output port into the > input port of the Contour filter as you've seen recently. > > If this isn't clear, just let us know more specifically what > problems you're having. > -Eric > > ------------------------------------------------------ > Eric E Monson > Duke Visualization Technology Group > > > On May 19, 2009, at 4:44 AM, Chris N wrote: > > NEW USER but I've been reading similiar problems with using > vtkPolyDataConnectivityFilter with DICOM data. One person did post > a solution but using the standard vtk dataset from vtkdata. Is it > possible to convert my DICOM data into vtk data set so once that is > done I can use my vtkPolyDataConnectivityFilter on that data set. > Or does DICOMreader do convert into vtk dataset already? If that is > the case how can I retieve that data? Ultimately, I'm trying to > filter out data with vtkPolyDataConnectivityFilter and using my > DICOM data. any help is appreciated, thanks! > > > Hotmail? has a new way to see what's up with your friends. Check it > out. _______________________________________________ > Powered by www.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://www.vtk.org/mailman/listinfo/vtkusers > > > Windows Live?: Keep your life in sync. Check it out. > > > Hotmail? goes with you. Get it on your BlackBerry or iPhone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From murat.aydin at netcad.com.tr Thu May 21 11:34:20 2009 From: murat.aydin at netcad.com.tr (=?iso-8859-9?Q?Murat_Ayd=FDn?=) Date: Thu, 21 May 2009 18:34:20 +0300 Subject: [vtkusers] dividing a solid into cubes Message-ID: <011f01c9da29$9c855d70$5b01a8c0@ulusal.local> Hi, I am using vtkVoxelModeller in order to divide a solid into cubes. However, vtkVoxelModeller does this in minimum bounding box of the solid. So it does extra job. i only need to make cubes from my solid of interest. i am doing some processing to extraxt my solid from the bounding box. In the picture you see the solid divided into cubes. Blue is the solid that i want. Is there an easy way to divide only my solid into cubes, not with bounding box? Or is there an easy way or filter to extract my solid. My solid is constructed with Delaunay 3D filter. Thanks in advance. murat aydin -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: wireframeVoxelModeller.png Type: image/png Size: 47319 bytes Desc: not available URL: From jpedrick at gmail.com Thu May 21 11:38:18 2009 From: jpedrick at gmail.com (Joshua Pedrick) Date: Thu, 21 May 2009 11:38:18 -0400 Subject: [vtkusers] Trouble with QVTK In-Reply-To: <4A15625B.1040303@elemtech.com> References: <1dfc97b50905120636p259f2f33lad4cad75295ac7a3@mail.gmail.com> <1dfc97b50905121016t3477cfem89d7be56f689dca9@mail.gmail.com> <1dfc97b50905210708s27f78e57nab1af6b255b044b4@mail.gmail.com> <4A15625B.1040303@elemtech.com> Message-ID: <1dfc97b50905210838g640e70cbwd7926d1a7de27c7a@mail.gmail.com> Ok, I guess I wasn't clear. I am using CentOS 5.2 64-bit. Qt sdk 2009.02 (Qt v4.5.1). I've built VTK to include GUISupport and Qt support. I've tried to replicate the GUI4 example. Using the GUI 4 example I get all the correct behavior, including changing the background, but I can not see any 3D VTK objects(cone or sphere) in the RenderWindows. I've the relevent source files. So, I was hoping for an example that actually worked or some advice as to what I have done incorrectly. Regards, -Joshua On Thu, May 21, 2009 at 10:16 AM, Clinton Stimpson wrote: > > There are examples in VTK/Examples/GUI/Qt. > Both SimpleView/ and Events/ have designer .ui files. > > Clint > > Joshua Pedrick wrote: > >> Does anyone have a working example using QVTK + QtDesigner on Linux that I >> could try to compare? >> >> On Tue, May 12, 2009 at 1:16 PM, Joshua Pedrick > jpedrick at gmail.com>> wrote: >> >> Hello again Leo, >> Here's my code once again, but distilled and reordered a bit. >> I removed all the Deletes and whatnot. I'm still not getting >> anything but the gradient background. Any clues? >> I downloaded and compiled VTK-5.4 with QVTK, using Qt version >> 4.5.1 from Qt SDK 2009.02. Still no luck. So the latest VTK from >> CVS and version 5.4 aren't working. I can't be the only one using >> QVTK. I am not using cmake to build my project, could this be the >> problem? Are there some compiler flags I need to set for QVTK to >> work? >> >> >> Regards, >> -Joshua >> >> void MainWindow::SetupScene() >> { >> QVTKWidget* qvtkwidget = ui.qvtkWidget; >> >> qvtkwidget->GetRenderWindow()->DoubleBufferOff(); >> >> >> //Put cone in window >> { >> vtkConeSource *cone = vtkConeSource::New(); >> >> //Create Cone Mapper. >> vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New(); >> coneMapper->SetInputConnection(cone->GetOutputPort()); >> >> //Create Cone Actor >> >> vtkActor *coneActor = vtkActor::New(); >> coneActor->SetMapper(coneMapper); >> >> //Create Cone Renderer >> vtkRenderer *ren = vtkRenderer::New(); >> ren->SetBackground(0,0,0); >> ren->SetBackground2(1,1,1); >> ren->GradientBackgroundOn(); >> >> ren->AddActor(coneActor); >> >> qvtkwidget->GetRenderWindow()->AddRenderer(ren); >> >> } >> >> } >> >> 2009/5/12 L.J. van Ruijven > > >> >> Hi Joshua, >> >> I allready deleted your first mail, so I cannot check the code >> again, but I think here the background renderer is added. So >> that one is really drawn in the render window. >> But if I remember well, you created the pipeline for the cone >> in a separate fragment. And in the end of this fragment you >> deleted the cone renderer, but you never added it to the >> render window. >> >> regards, >> >> Leo. >> >> >> ----- Original Message ----- >> From: Joshua Pedrick > > >> Date: Tuesday, May 12, 2009 3:36 pm >> Subject: Re: Trouble with QVTK >> To: vtkusers at vtk.org >> Cc: "L.J. van Ruijven" > > >> >> >> > L.J. I think I do this in MainWindow::SetupScene() at the >> very end: >> > >> > qvtkwidget->GetRenderWindow()->AddRenderer(ren); >> > qvtkwidget->GetRenderWindow()->BordersOn(); >> > >> > ren->Delete(); >> > >> > Is this not the correct way to add a renderer? I do get the >> lovely gradient >> > background I applied to the renderer, but no actors. The >> gradient background >> > makes me think the renderer is properly connected to the >> render window. >> > >> > I'm going to compile the stable version of VTK today and >> see how it goes. >> > I'm really suspecting there is a bug in the CVS QVTK. >> > >> > Regards >> > -Joshua >> > >> > 2009/5/12 L.J. van Ruijven > > >> > >> > > Hi Joshua, >> > > >> > > I think you forgot to connect the renderer to the >> renderwindow. Somewhere >> > > you should add the statement renWin->AddRenderer(ren). >> > > >> > > regards, >> > > >> > > Leo >> > > >> > > >> > > >> > >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 >> >> > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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: -------------- next part -------------- A non-text attachment was scrubbed... Name: MainWindow.cpp Type: application/octet-stream Size: 6157 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MainWindow.h Type: application/octet-stream Size: 627 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MainWindow.ui Type: application/x-designer Size: 2966 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ui_MainWindow.h Type: application/octet-stream Size: 6187 bytes Desc: not available URL: From gbook at gbook.org Thu May 21 13:17:13 2009 From: gbook at gbook.org (Greg Book) Date: Thu, 21 May 2009 13:17:13 -0400 Subject: [vtkusers] transparency and slowdown with vtkImagePlaneWidget Message-ID: <4A158C99.5030507@gbook.org> I'm having a transparency problem when using the vtkImagePlaneWidget... but in this case, I actually don't want to have transparency and I'm not sure why I'm suddenly getting it. I'm using the imageplanewidget to display some volume data. When I loaded the data from the VTK sample data (head) it worked fine, and each plane completely hid anything behind it. Now I'm loading a series of .bmp images into a volume and displaying it the same way. But now, the planes are all semi-transparent. It's a nice feature, but not one I want. what's going on with that? Also, I noticed a significant slowdown when moving through slices of my .bmp data instead of the VTK head data. The volume is 512x512x76, and when moving in the z direction, it is really really slow. Thanks in advance, Greg From robgolebiowski at googlemail.com Thu May 21 13:29:50 2009 From: robgolebiowski at googlemail.com (Robert Golebiowski) Date: Thu, 21 May 2009 18:29:50 +0100 Subject: [vtkusers] ImageToVTKImageFilter and RGBPixels Message-ID: <30c236e70905211029j5bffdb44ue07058fb6875c5a6@mail.gmail.com> Hi, Could anybody tell me please if ImageToVTKImageFilter supports RGBPixels ? Thanks, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From robgolebiowski at googlemail.com Thu May 21 13:29:50 2009 From: robgolebiowski at googlemail.com (Robert Golebiowski) Date: Thu, 21 May 2009 18:29:50 +0100 Subject: [vtkusers] ImageToVTKImageFilter and RGBPixels Message-ID: <30c236e70905211029j5bffdb44ue07058fb6875c5a6@mail.gmail.com> Hi, Could anybody tell me please if ImageToVTKImageFilter supports RGBPixels ? Thanks, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From robgolebiowski at googlemail.com Thu May 21 13:29:50 2009 From: robgolebiowski at googlemail.com (Robert Golebiowski) Date: Thu, 21 May 2009 18:29:50 +0100 Subject: [vtkusers] ImageToVTKImageFilter and RGBPixels Message-ID: <30c236e70905211029j5bffdb44ue07058fb6875c5a6@mail.gmail.com> Hi, Could anybody tell me please if ImageToVTKImageFilter supports RGBPixels ? Thanks, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From theodoreholden at yahoo.com Thu May 21 15:15:51 2009 From: theodoreholden at yahoo.com (Theodore Holden) Date: Thu, 21 May 2009 12:15:51 -0700 (PDT) Subject: [vtkusers] Modifying and building vtk dotnet code..... Message-ID: <385812.86783.qm@web38607.mail.mud.yahoo.com> Hi.... I need some sort of a handle into the dotnet wrapper (SourceForge) for VTK. The obvious place for it is vtkSimplePointsReader. That is provided with VTK as a model for designing readers and if I could modify and build it I could easily enough make it do what I need it to do, i.e. modify the RequestData function to take data from values already in memory rather than write and then re-read .vtk files. Nonetheless the system appears highly resistent to any attempts at modifying anything. Attempts to modify the PrintSelf function to return a recognizable string of my own choosing appear to compile and build but behave as if I had not made changes when using the function and an attempt to insert a function of my own, i.e. const char *bearFunction() { return "Bears rule!!!!"; } compiles but produces the following: Linking... vtkSimplePointsReaderDotNet.obj : error LNK2028:unresolved token (0A00036E) "public: char const * __thiscall vtkSimplePointsReader::bearFunction(void)" (?bearFunction at vtkSimplePointsReader@@$$FQAEPBDXZ) referenced in function "public: class System::String ^ __clrcall vtk::vtkSimplePointsReader::bearFunction(void)" (?bearFunction at vtkSimplePointsReader@vtk@@$$FQ$AAMP$AAVString at System@@XZ) vtkSimplePointsReaderDotNet.obj : error LNK2019: unresolved external symbol "public: char const * __thiscall vtkSimplePointsReader::bearFunction(void)" (?bearFunction at vtkSimplePointsReader@@$$FQAEPBDXZ) referenced in function "public: class System::String ^ __clrcall vtk::vtkSimplePointsReader::bearFunction(void)" (?bearFunction at vtkSimplePointsReader@vtk@@$$FQ$AAMP$AAVString at System@@XZ) D:\vtk_testing\vtk501binSS5\bin\Debug\vtkIODotNet.dll : fatal error LNK1120: 2 unresolved externals Caching metadata information for d:\vtk_testing\vtk501binss5\bin\debug\vtkcommondotnet.dll... Caching metadata information for d:\vtk_testing\vtk501binss5\bin\debug\vtkfilteringdotnet.dll... Build log was saved at "file://d:\vtk_testing\vtk501binSS5\IO\vtkIODotNet.dir\Debug\BuildLog.htm" vtkIODotNet - 3 error(s), 0 warning(s) Likewise every other thing I've tried to insert something miniscule just to convince myself I'd succeeded in modifying this thing and having it build is rejected one way or another. At least one other .h/.cxx pair contains an include for From karthik.krishnan at kitware.com Thu May 21 15:44:50 2009 From: karthik.krishnan at kitware.com (Karthik Krishnan) Date: Thu, 21 May 2009 15:44:50 -0400 Subject: [vtkusers] ImageToVTKImageFilter and RGBPixels In-Reply-To: <30c236e70905211029j5bffdb44ue07058fb6875c5a6@mail.gmail.com> References: <30c236e70905211029j5bffdb44ue07058fb6875c5a6@mail.gmail.com> Message-ID: <9ddb27260905211244p8726740j46c8ad37b9a9efb7@mail.gmail.com> Robert: No it does not. As the documentation of itk::VTKImageExport (used by the itkImageToVTKImageFilterclearly mentions : * Note that not all image types will work correctly. VTK will only * support images of 1, 2, or 3 dimensions. Scalar value types can be * one of: float, double, char, unsigned char, short, unsigned short, * int, unsigned int, long, unsigned long. * * Currently VTKImageExport does not support pixel types with multiple * components (like RGBPixel) However its not hard to do so, since the memory organization of an RGBPixel (or any multicomponent image in ITK constructed using an itk::FixedArray) is the same in ITK and VTK. Its contiguous C1 C2 .. Cn C1 C2 .. Cn ... both in ITK (itk::ImportImageContainer) and in VTK, (vtkDataArray) The following post should get you started : http://osdir.com/ml/lib.itk.user/2004-07/msg00189.html Also feel free to submit a feature request at itk.org. -- karthik On Thu, May 21, 2009 at 1:29 PM, Robert Golebiowski < robgolebiowski at googlemail.com> wrote: > Hi, > Could anybody tell me please if ImageToVTKImageFilter supports RGBPixels ? > Thanks, > Rob > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > -- Karthik Krishnan R&D Engineer, Kitware Inc. Ph: 518 881 4919 Fax: 518 371 4573 -------------- next part -------------- An HTML attachment was scrubbed... URL: From theodoreholden at yahoo.com Thu May 21 17:40:12 2009 From: theodoreholden at yahoo.com (Theodore Holden) Date: Thu, 21 May 2009 14:40:12 -0700 (PDT) Subject: [vtkusers] problem fixed... Message-ID: <531972.54722.qm@web38601.mail.mud.yahoo.com> Please ignore my earlier email; adding a class name and using a different file name seem to fix the problem. Ted -------------- next part -------------- An HTML attachment was scrubbed... URL: From wsales at gmail.com Thu May 21 20:08:20 2009 From: wsales at gmail.com (Wagner Sales) Date: Thu, 21 May 2009 21:08:20 -0300 Subject: [vtkusers] Trouble with QVTK In-Reply-To: <1dfc97b50905210838g640e70cbwd7926d1a7de27c7a@mail.gmail.com> References: <1dfc97b50905120636p259f2f33lad4cad75295ac7a3@mail.gmail.com> <1dfc97b50905121016t3477cfem89d7be56f689dca9@mail.gmail.com> <1dfc97b50905210708s27f78e57nab1af6b255b044b4@mail.gmail.com> <4A15625B.1040303@elemtech.com> <1dfc97b50905210838g640e70cbwd7926d1a7de27c7a@mail.gmail.com> Message-ID: <11b83aa60905211708v32f0ccebsac060bdc48f2d47d@mail.gmail.com> Hi Joshua, I downloaded your code and compiled. To me, at least at first impression, works fine. I see the objects, change background, etc. Regards, Wagner 2009/5/21 Joshua Pedrick : > Ok, I guess I wasn't clear. I am using CentOS 5.2 64-bit. Qt sdk 2009.02 (Qt > v4.5.1). I've built VTK to include GUISupport and Qt support. I've tried to > replicate the GUI4 example. Using the GUI 4 example I get all the correct > behavior, including changing the background, but I can not see any 3D VTK > objects(cone or sphere) in the RenderWindows. I've the relevent source > files. > > So, I was hoping for an example that actually worked or some advice as to > what I have done incorrectly. > > ?? Regards, > ??????? -Joshua > > > On Thu, May 21, 2009 at 10:16 AM, Clinton Stimpson > wrote: >> >> There are examples in VTK/Examples/GUI/Qt. >> Both SimpleView/ and Events/ have designer .ui files. >> >> Clint >> >> Joshua Pedrick wrote: >>> >>> Does anyone have a working example using QVTK + QtDesigner on Linux that >>> I could try to compare? >>> >>> On Tue, May 12, 2009 at 1:16 PM, Joshua Pedrick >> > wrote: >>> >>> ? ?Hello again Leo, >>> ? ? ? ? Here's my code once again, but distilled and reordered a bit. >>> ? ?I removed all the Deletes and whatnot. I'm still not getting >>> ? ?anything but the gradient background. Any clues? >>> ? ? ? ? I downloaded and compiled VTK-5.4 with QVTK, using Qt version >>> ? ?4.5.1 from Qt SDK 2009.02. Still no luck. So the latest VTK from >>> ? ?CVS and version 5.4 aren't working. I can't be the only one using >>> ? ?QVTK. I am not using cmake to build my project, could this be the >>> ? ?problem? Are there some compiler flags I need to set for QVTK to >>> ? ?work? >>> >>> >>> ? ? ? ? Regards, >>> ? ? ? ? ? -Joshua >>> >>> ? ?void MainWindow::SetupScene() >>> ? ?{ >>> ? ? ? ?QVTKWidget* qvtkwidget = ui.qvtkWidget; >>> >>> ? ? ? ?qvtkwidget->GetRenderWindow()->DoubleBufferOff(); >>> >>> >>> ? ? ? ?//Put cone in window >>> ? ? ? ?{ >>> ? ? ? ? ? ?vtkConeSource *cone = vtkConeSource::New(); >>> >>> ? ? ? ? ? ?//Create Cone Mapper. >>> ? ? ? ? ? ?vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New(); >>> ? ? ? ? ? ?coneMapper->SetInputConnection(cone->GetOutputPort()); >>> >>> ? ? ? ? ? ?//Create Cone Actor >>> >>> ? ? ? ? ? ?vtkActor *coneActor = vtkActor::New(); >>> ? ? ? ? ? ?coneActor->SetMapper(coneMapper); >>> >>> ? ? ? ? ? ?//Create Cone Renderer >>> ? ? ? ? ? ?vtkRenderer *ren = vtkRenderer::New(); >>> ? ? ? ? ? ?ren->SetBackground(0,0,0); >>> ? ? ? ? ? ?ren->SetBackground2(1,1,1); >>> ? ? ? ? ? ?ren->GradientBackgroundOn(); >>> >>> ? ? ? ? ? ?ren->AddActor(coneActor); >>> >>> ? ? ? ? ? ?qvtkwidget->GetRenderWindow()->AddRenderer(ren); >>> >>> ? ? ? ?} >>> >>> ? ?} >>> >>> ? ?2009/5/12 L.J. van Ruijven >> ? ?> >>> >>> ? ? ? ?Hi Joshua, >>> >>> ? ? ? ?I allready deleted your first mail, so I cannot check the code >>> ? ? ? ?again, but I think here the background renderer is added. So >>> ? ? ? ?that one is really drawn in the render window. >>> ? ? ? ?But if I remember well, you created the pipeline for the cone >>> ? ? ? ?in a separate fragment. And in the end of this fragment you >>> ? ? ? ?deleted the cone renderer, but you never added it to the >>> ? ? ? ?render window. >>> >>> ? ? ? ?regards, >>> >>> ? ? ? ?Leo. >>> >>> >>> ? ? ? ?----- Original Message ----- >>> ? ? ? ?From: Joshua Pedrick >> ? ? ? ?> >>> ? ? ? ?Date: Tuesday, May 12, 2009 3:36 pm >>> ? ? ? ?Subject: Re: Trouble with QVTK >>> ? ? ? ?To: vtkusers at vtk.org >>> ? ? ? ?Cc: "L.J. van Ruijven" >> ? ? ? ?> >>> >>> >>> ? ? ? ?> L.J. I think I do this in MainWindow::SetupScene() at the >>> ? ? ? ?very end: >>> ? ? ? ?> >>> ? ? ? ?> ? ? ? ? ? ? ? ? qvtkwidget->GetRenderWindow()->AddRenderer(ren); >>> ? ? ? ?> ? ? ? ? ? ? ? ? qvtkwidget->GetRenderWindow()->BordersOn(); >>> ? ? ? ?> >>> ? ? ? ?> ? ? ? ? ? ? ? ? ren->Delete(); >>> ? ? ? ?> >>> ? ? ? ?> ?Is this not the correct way to add a renderer? I do get the >>> ? ? ? ?lovely gradient >>> ? ? ? ?> ?background I applied to the renderer, but no actors. The >>> ? ? ? ?gradient background >>> ? ? ? ?> ?makes me think the renderer is properly connected to the >>> ? ? ? ?render window. >>> ? ? ? ?> >>> ? ? ? ?> ?I'm going to compile the stable version of VTK today and >>> ? ? ? ?see how it goes. >>> ? ? ? ?> ?I'm really suspecting there is a bug in the CVS QVTK. >>> ? ? ? ?> >>> ? ? ? ?> ? ? ? ? ? ? ? Regards >>> ? ? ? ?> ? ? ? ? ? ? ? ? ? ?-Joshua >>> ? ? ? ?> >>> ? ? ? ?> ?2009/5/12 L.J. van Ruijven >> ? ? ? ?> >>> ? ? ? ?> >>> ? ? ? ?> ?> Hi Joshua, >>> ? ? ? ?> ?> >>> ? ? ? ?> ?> I think you forgot to connect the renderer to the >>> ? ? ? ?renderwindow. Somewhere >>> ? ? ? ?> ?> you should add the statement renWin->AddRenderer(ren). >>> ? ? ? ?> ?> >>> ? ? ? ?> ?> regards, >>> ? ? ? ?> ?> >>> ? ? ? ?> ?> Leo >>> ? ? ? ?> ?> >>> ? ? ? ?> ?> >>> ? ? ? ?> ?> >>> ? ? ? ?> >>> >>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://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 >>> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > From habe36 at gmail.com Thu May 21 20:30:15 2009 From: habe36 at gmail.com (ABE Hiroshi) Date: Fri, 22 May 2009 09:30:15 +0900 Subject: [vtkusers] OffScreen and blank window In-Reply-To: <4A156112.9030009@elemtech.com> References: <912CF395-0850-4511-99FD-18511F01481F@gmail.com> <423e920905200654s295655a6t8c68abda6fcfd423@mail.gmail.com> <94068DDA-3788-4D6C-B6CE-39ABAE453F93@gmail.com> <4A156112.9030009@elemtech.com> Message-ID: <9742F5B1-6639-4CD1-BEA2-8F58074CD3B3@gmail.com> Dear Clinton and all, Thank you for your suggestion, Clinton. I put the lines in vtkCarbonRenderWindow and saw what happened. Pop-up problem was still remained. May I understand your fix is for remaining window problem? If so I cannot see the effect of the fix because I haven't any code with the problem so far. Regarding a call, DisposeWindow, I found it is called in vtkCarbonRenderWindow::Finalize(void) So I'm afraid it is not necessary in DestroyWindow. Regards, ABE Hiroshi from Tokorozawa, JAPAN On 2009/05/21, at 23:11, Clinton Stimpson wrote: > > I see something else wrong, that needs fixed regardless of > offscreen rendering. > Can someone try putting this at the end of > vtkCarbonRenderWindow::DestroyWindow(), and see if it helps this > offscreen problem? > > void vtkCarbonRenderWindow::DestroyWindow() > { > ... > ... > if(this->OwnWindow && this->RootWindow) > { > DisposeWindow(this->RootWindow); > this->RootWindow = 0; > this->WindowId = 0; > } > this->Mapped = 0; > } > > vtkCocoaRenderWindow needs the same fix. > > Thanks, > Clint > > ABE Hiroshi wrote: >> Dear Simon and all, >> >> I am using Carbon version of VTK, so the situation might be >> different from you, Simon. >> But I checked the vtkCarbonRenderWindow.cxx as you did for Cocoa >> version, I found CreateAWindow calls ShowWindow to display the >> renderwindow. So I changed the code as: >> >> vtkCarbonRenderWindow.cxx: 715 >> >> if(!this->GetOffScreenRendering() ) ShowWindow(this->RootWindow); >> >> Anyway it works as I expected, however, I am wondering if it might >> be fit to the spec. >> Any suggestion? >> >> Regards, >> Hiroshi ABE >> >> From alucard006 at msn.com Fri May 22 04:56:40 2009 From: alucard006 at msn.com (Chris N) Date: Fri, 22 May 2009 01:56:40 -0700 Subject: [vtkusers] Want vtk dataset from my DICOM data In-Reply-To: <9EEB25C6-9C9F-454E-827B-97E983BE10DB@cs.duke.edu> References: <03CBD493-DB8A-4006-A328-01745A5CEA18@cs.duke.edu> <9EEB25C6-9C9F-454E-827B-97E983BE10DB@cs.duke.edu> Message-ID: I'm going to try and see if I can find the largest connecting region per 2d image, then discard the rest. I will look into that Paraview also, heard about it but never used...yet. I also read though those pages you referenced very helpful. Thanks again. -Chris CC: vtkusers at vtk.org From: emonson at cs.duke.edu To: alucard006 at msn.com Subject: Re: [vtkusers] Want vtk dataset from my DICOM data Date: Thu, 21 May 2009 10:55:20 -0400 Hey Chris, If the other plate is touching the data you need, you'll have to figure out another way of getting rid of that data -- the connectivity filter will see all of these touching regions as one. Do they disconnect from each other if you change slightly the value in your contour filter? If not, you'll probably have to do something like define a selection based on the physical position of the objects and extract the surface you want from the combined head/plate surface. This sort of thing is often easier in an interactive visualization, so you might want to use ParaView (or Amira, or something else) to figure this out or do some pre-processing on your data. Update() forces the pipeline to execute, which generates the real data up to that point in the pipeline. From page 24 of The VTK User's Guide (v5, 2006): "Normally, you do not need to manually invoke Update() because the filters are connected into a visualization pipeline. In this case, when the actor receives a request to render itself, it forwards the method to its mapper, and the Update() method is automatically sent through the visualization pipeline." As you saw, you sometimes need to call this manually when you're trying to get intermediate data out, so the pipeline must be executed before it necessarily gets to the stage where the actors would call Update() themselves. Modified() "updates the the internal modification time stamp for the object" (pg 181, ibid), which will tell the pipeline that this filter needs to be updated the next time the pipeline is executed. Talk to you later,-Eric On May 21, 2009, at 5:31 AM, Chris N wrote:Thanks for the help, I feel I am getting close to my answer but not quite there yet. Sorry about not "replying to all" but will do that from now. Just a quick recap trying to remove two plates & internal canal of ears & throat from human head. Using vtkPolyDataConnectivityFilter did give me some results now which is great. When I used connectivity filter I had the exact same contour. Now tried to use your suggestions with the color region but nothing ever came up for me. Also I was still seeing GetNumberOfExtractedRegions() print out a '0'. Looking through my functions I found Update() and when I use this I now get from GetNumberOfExtractedRegions() 349. By that point I tried SetExtractionModeToLargestRegion() and removed one of the plates not touching the data head. Inside the head removed everything that was not connected which is good. I attempted the color regions as you told me but since got no results for coloring regions. So now I need to come up with a solution to remove the other plate though it is touching data I need. Of course, I need think of a way to remove the canals from ears & throat also. Any suggestions, is vtkPolyDataConnectivityFilter still capable for something like that? Since I'm using vtkPolyDataConnectivityFilter::Update() & saw vtkPolyDataConnectivityFilter::Modifed(), do you know what exactly do these functions do? -Chris CC: vtkusers at vtk.org From: emonson at cs.duke.edu To: alucard006 at msn.com Subject: Re: [vtkusers] Want vtk dataset from my DICOM data Date: Wed, 20 May 2009 09:22:58 -0400 Hey Chris, Make sure you "reply to all" so that the whole list can contribute answers. First, this probably isn't causing any of your problems, but you may want to switch to the vtkPolyDataConnectivityFilter -- since the contour filter will output polygonal mesh, this filter may be optimized a bit more for that specific data type. Second, what shows up in your vtkRenderWindow? Do you see the whole contour as if you didn't even use the connectivity filter? Try setting the connectivity filter to connect->SetExtractionModeToAllRegions();connect->SetColorRegions(1); and see if you see a lot of differently colored regions. Or, try connect->SetExtractionModeToSpecifiedRegions();connect->AddSpecifiedRegion(0);connect->AddSpecifiedRegion(1);connect->SetColorRegions(1); and look in the render window to see if the correct subsets are being extracted. I'm sure there are a lot of people out there using this filter, so I hope someone else will chime in that knows more than me about this specific one! :) -Eric ------------------------------------------------------Eric E MonsonDuke Visualization Technology Group On May 20, 2009, at 3:59 AM, Chris N wrote:This is my specific problem currently. I working with DICOM data using VTK and C++. My DICOM data is a human head and I'm trying to make my data only view skin. The problem I running into now is that I want to eliminate the internals such as the canals for ears and throat when I only render skin. Along with the depth I have two plates rendered on the side of my sample head data. Recently I found vtkConnectivityFilter has the function to extract the largest region and ignoring everything else. When I try to use this class and I view the number of connected regions extracted I only get the number 0. My data still remains the same and unaltered as though I never used connectivityfilter. Below I just added the only code I wrote for the vtkConnectivityFilter, maybe I missed something there? Any suggestions? //vtkDICOMImageReader - using set directory name //vtkContourFilter - (skinExtractor) set value for skin //CONNECTIVITY vtkConnectivityFilter *connect = vtkConnectivityFilter::New(); connect->SetInputConnection(skinExtractor->GetOutputPort()); connect->SetExtractionModeToLargestRegion(); //NUMBER OF REGIONS int numregion = connect->GetNumberOfExtractedRegions(); std::cout<< "Number of Connected Regions: " << numregion < From jumpfunky at web.de Fri May 22 06:41:18 2009 From: jumpfunky at web.de (Thorsten Wagner) Date: Fri, 22 May 2009 12:41:18 +0200 Subject: [vtkusers] An extension proposal for the vtkTIFFReader Message-ID: <973981424@web.de> Hi, before few days i've asked for a possibility to read a spezific page of a Multipage-TIFF File. No answers. So, i take a look at the code of the vtkTIFFReader and see that the reader reads ALL Pages. The TIFF-Format often used for reading tiled pyramidal multipage TIFF-Files in order to read only spezific pages and spezific tiles for preserve the RAM and realize "fast-zoom" operations. because only a part of the image must be readed! In the attachment is a version for reading a spezific page of a multipage TIFF. IT's only implementet for my proposes. So, if it should implementet in the vtk, there is a few things to do! In my Version i have changed/add the line: 157, 234, 1017. Furthermore i have add a method "setDesiredPage(int i)" to the vtkTIFFReader. Within the next few days i will try to manipulate the method "ReadTiles" for reading only spezific tiles of tiled tiff, so maybe i send a second version. Regards, Thorsten -------------- next part -------------- A non-text attachment was scrubbed... Name: vtkTIFFReader.zip Type: application/x-zip-compressed Size: 11968 bytes Desc: not available URL: From jpedrick at gmail.com Fri May 22 09:32:52 2009 From: jpedrick at gmail.com (Joshua Pedrick) Date: Fri, 22 May 2009 09:32:52 -0400 Subject: [vtkusers] Trouble with QVTK In-Reply-To: <11b83aa60905211708v32f0ccebsac060bdc48f2d47d@mail.gmail.com> References: <1dfc97b50905120636p259f2f33lad4cad75295ac7a3@mail.gmail.com> <1dfc97b50905121016t3477cfem89d7be56f689dca9@mail.gmail.com> <1dfc97b50905210708s27f78e57nab1af6b255b044b4@mail.gmail.com> <4A15625B.1040303@elemtech.com> <1dfc97b50905210838g640e70cbwd7926d1a7de27c7a@mail.gmail.com> <11b83aa60905211708v32f0ccebsac060bdc48f2d47d@mail.gmail.com> Message-ID: <1dfc97b50905220632s6fa7add0mfd68dc80606ec665@mail.gmail.com> Hi Wagner, I figured it would... are you running under the same environment? I can only guess I must have something configured wrong. Does anyone have a clue how I might go about debugging this on my system? OpenGL works on my system. VTK works without Qt. Qt works without VTK. Could it be the latest version of Qt breaks VTK somehow? Thanks, -Joshua On Thu, May 21, 2009 at 8:08 PM, Wagner Sales wrote: > Hi Joshua, > > I downloaded your code and compiled. To me, at least at first > impression, works fine. I see the objects, change background, etc. > > Regards, > > Wagner > > > > 2009/5/21 Joshua Pedrick : > > Ok, I guess I wasn't clear. I am using CentOS 5.2 64-bit. Qt sdk 2009.02 > (Qt > > v4.5.1). I've built VTK to include GUISupport and Qt support. I've tried > to > > replicate the GUI4 example. Using the GUI 4 example I get all the correct > > behavior, including changing the background, but I can not see any 3D VTK > > objects(cone or sphere) in the RenderWindows. I've the relevent source > > files. > > > > So, I was hoping for an example that actually worked or some advice as to > > what I have done incorrectly. > > > > Regards, > > -Joshua > > > > > > On Thu, May 21, 2009 at 10:16 AM, Clinton Stimpson > > > wrote: > >> > >> There are examples in VTK/Examples/GUI/Qt. > >> Both SimpleView/ and Events/ have designer .ui files. > >> > >> Clint > >> > >> Joshua Pedrick wrote: > >>> > >>> Does anyone have a working example using QVTK + QtDesigner on Linux > that > >>> I could try to compare? > >>> > >>> On Tue, May 12, 2009 at 1:16 PM, Joshua Pedrick >>> > wrote: > >>> > >>> Hello again Leo, > >>> Here's my code once again, but distilled and reordered a bit. > >>> I removed all the Deletes and whatnot. I'm still not getting > >>> anything but the gradient background. Any clues? > >>> I downloaded and compiled VTK-5.4 with QVTK, using Qt version > >>> 4.5.1 from Qt SDK 2009.02. Still no luck. So the latest VTK from > >>> CVS and version 5.4 aren't working. I can't be the only one using > >>> QVTK. I am not using cmake to build my project, could this be the > >>> problem? Are there some compiler flags I need to set for QVTK to > >>> work? > >>> > >>> > >>> Regards, > >>> -Joshua > >>> > >>> void MainWindow::SetupScene() > >>> { > >>> QVTKWidget* qvtkwidget = ui.qvtkWidget; > >>> > >>> qvtkwidget->GetRenderWindow()->DoubleBufferOff(); > >>> > >>> > >>> //Put cone in window > >>> { > >>> vtkConeSource *cone = vtkConeSource::New(); > >>> > >>> //Create Cone Mapper. > >>> vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New(); > >>> coneMapper->SetInputConnection(cone->GetOutputPort()); > >>> > >>> //Create Cone Actor > >>> > >>> vtkActor *coneActor = vtkActor::New(); > >>> coneActor->SetMapper(coneMapper); > >>> > >>> //Create Cone Renderer > >>> vtkRenderer *ren = vtkRenderer::New(); > >>> ren->SetBackground(0,0,0); > >>> ren->SetBackground2(1,1,1); > >>> ren->GradientBackgroundOn(); > >>> > >>> ren->AddActor(coneActor); > >>> > >>> qvtkwidget->GetRenderWindow()->AddRenderer(ren); > >>> > >>> } > >>> > >>> } > >>> > >>> 2009/5/12 L.J. van Ruijven >>> > > >>> > >>> Hi Joshua, > >>> > >>> I allready deleted your first mail, so I cannot check the code > >>> again, but I think here the background renderer is added. So > >>> that one is really drawn in the render window. > >>> But if I remember well, you created the pipeline for the cone > >>> in a separate fragment. And in the end of this fragment you > >>> deleted the cone renderer, but you never added it to the > >>> render window. > >>> > >>> regards, > >>> > >>> Leo. > >>> > >>> > >>> ----- Original Message ----- > >>> From: Joshua Pedrick >>> > > >>> Date: Tuesday, May 12, 2009 3:36 pm > >>> Subject: Re: Trouble with QVTK > >>> To: vtkusers at vtk.org > >>> Cc: "L.J. van Ruijven" >>> > > >>> > >>> > >>> > L.J. I think I do this in MainWindow::SetupScene() at the > >>> very end: > >>> > > >>> > > qvtkwidget->GetRenderWindow()->AddRenderer(ren); > >>> > qvtkwidget->GetRenderWindow()->BordersOn(); > >>> > > >>> > ren->Delete(); > >>> > > >>> > Is this not the correct way to add a renderer? I do get the > >>> lovely gradient > >>> > background I applied to the renderer, but no actors. The > >>> gradient background > >>> > makes me think the renderer is properly connected to the > >>> render window. > >>> > > >>> > I'm going to compile the stable version of VTK today and > >>> see how it goes. > >>> > I'm really suspecting there is a bug in the CVS QVTK. > >>> > > >>> > Regards > >>> > -Joshua > >>> > > >>> > 2009/5/12 L.J. van Ruijven >>> > > >>> > > >>> > > Hi Joshua, > >>> > > > >>> > > I think you forgot to connect the renderer to the > >>> renderwindow. Somewhere > >>> > > you should add the statement renWin->AddRenderer(ren). > >>> > > > >>> > > regards, > >>> > > > >>> > > Leo > >>> > > > >>> > > > >>> > > > >>> > > >>> > >>> > >>> > >>> > ------------------------------------------------------------------------ > >>> > >>> _______________________________________________ > >>> Powered by www.kitware.com > >>> > >>> Visit other Kitware open-source projects at > >>> http://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 > >>> > >> > >> > >> _______________________________________________ > >> Powered by www.kitware.com > >> > >> Visit other Kitware open-source projects at > >> http://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 > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://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 drescherjm at gmail.com Fri May 22 09:35:45 2009 From: drescherjm at gmail.com (John Drescher) Date: Fri, 22 May 2009 09:35:45 -0400 Subject: [vtkusers] Trouble with QVTK In-Reply-To: <1dfc97b50905220632s6fa7add0mfd68dc80606ec665@mail.gmail.com> References: <1dfc97b50905120636p259f2f33lad4cad75295ac7a3@mail.gmail.com> <1dfc97b50905121016t3477cfem89d7be56f689dca9@mail.gmail.com> <1dfc97b50905210708s27f78e57nab1af6b255b044b4@mail.gmail.com> <4A15625B.1040303@elemtech.com> <1dfc97b50905210838g640e70cbwd7926d1a7de27c7a@mail.gmail.com> <11b83aa60905211708v32f0ccebsac060bdc48f2d47d@mail.gmail.com> <1dfc97b50905220632s6fa7add0mfd68dc80606ec665@mail.gmail.com> Message-ID: <387ee2020905220635h2b01af6fo64af29628d06ee2b@mail.gmail.com> On Fri, May 22, 2009 at 9:32 AM, Joshua Pedrick wrote: > Hi Wagner, I figured it would... are you running under the same environment? > I can only guess I must have something configured wrong. Does anyone have a > clue how I might go about debugging this on my system? OpenGL works on my > system. VTK works without Qt. Qt works without VTK. Could it be the latest > version of Qt breaks VTK somehow? > I know Qt 4.4 works fine with vtk under 64 bit gentoo linux. I have not tried Qt 4.5 yet. John From post at rocco-gasteiger.de Fri May 22 09:44:07 2009 From: post at rocco-gasteiger.de (Rocco Gasteiger) Date: Fri, 22 May 2009 15:44:07 +0200 Subject: [vtkusers] Embedding Python QVTKRenderWindowInteractor into Qt-Enviroment In-Reply-To: <9C4F69C2-CC64-41B7-B5F9-8138C1087005@cs.duke.edu> References: <000f01c9d923$c84ecce0$58ec66a0$@de> <9C4F69C2-CC64-41B7-B5F9-8138C1087005@cs.duke.edu> Message-ID: <001e01c9dae3$615a77c0$240f6740$@de> Hi Eric, Thank you very much for your help! I post-process my compiled ui-file in that way you described and it works now! Only some minor changes were necessary: "from QVTKWidget import QVTKWidget" instead of 'from QVTK' and 'from vtk.qt4.QVTK' to 'from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor' Best regards and have a nice weekend, Rocco -----Original Message----- From: Eric E. Monson [mailto:emonson at cs.duke.edu] Sent: Wednesday, May 20, 2009 6:15 PM To: Rocco Gasteiger Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Embedding Python QVTKRenderWindowInteractor into Qt-Enviroment Hey Rocco, I don't know if this will help, but when I was trying to get PyQt to work initially, I came up with a kind of hacky solution that works for me. I lay out everything in Designer, just as I do when using C++, including placing a QVTKWidget in the GUI. Then, after I save the .ui file, instead of just running pyuic4 on that .ui file, I run a little python script which does that plus makes a couple substitutions in the resulting .py file. By doing this I don't have to add the QVTKRenderWindowInteractor separately in my main python program. =========== build.py #!/usr/bin/env python import os command = "pyuic4 -o temp_simpleview.py qsimpleview.ui" print 'Generating ui_simpleview.py from qsimpleview.ui' os.system(command) # Need to do some substitution in generated file to make the UI work in python # when the QVTKWidget was created to be used in C++ f = open('temp_simpleview.py', 'r') s = f.read() f.close() s = s.replace('QVTKWidget','QVTKRenderWindowInteractor') s = s.replace('from QVTK', 'from vtk.qt4.QVTK') w = open('ui_simpleview.py', 'w') w.write(s) w.close() os.remove('temp_simpleview.py') =========== Then the constructor for my base class starts like this: =========== from PyQt4 import QtCore, QtGui from ui_simpleview import Ui_MainWindow import vtk class SimpleView(QtGui.QMainWindow): def __init__(self, parent = None): QtGui.QMainWindow.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.ren = vtk.vtkRenderer() self.ui.vtkWidget.GetRenderWindow().AddRenderer(self.ren) ... =========== Hope this helps, -Eric ------------------------------------------------------ Eric E Monson Duke Visualization Technology Group On May 20, 2009, at 4:20 AM, Rocco Gasteiger wrote: > Dear members, > > I want to render some vtk-data into a Qt-Enviroment via Python > scripting. To > do this, I use Qt-Designer, PyQt 4.4.4 and python binding for the vtk > classes. In my old C++ implementation I use a QVTKWidget embedded > into a > QGroupBox for 2D/3D rendering and it works fine. For some reasons, I > want to > switch to do the same via python scripting. But here I have the > following > problem: > > A QVTKWidget does not exist in PyQt. So I found in a prior posting, > that I > have to use a QVTKRenderWindowInteractor class instead. In my python > script > I initialized this class with a QFrame-object, which I have defined > and > placed in the Qt-Designer before. It compiles correct and the render > content > is displayed into the QFrame-Object BUT with the wrong size. In my old > C++-Implementation the size of the render window fits into the > QVTKWidget > according its size. Changing the size of render window by hand has > no effect > of the displayed render window. Can anybody give me a hint what I'm > doing > wrong or where my mistake is? For better understanding what I have > done, I > listed some code snipped from my python script below. Additionally I > attached a picture of the running Qt-application. > > For any help I would be very appreciate. > Best Regards, Rocco Gasteiger > > // This is the initializing part of my QVTKRenderWindowInteractor. The > object "axialView" is a QFrame object > // which I have defined in Qt-Designer > def __init__(self, parent = None): > """ > Constructor > """ > QMainWindow.__init__(self, parent) > self.setupUi(self) > self.connect(self.actionOpenDICOM, > QtCore.SIGNAL('triggered()'), > self.loadFiles) > self.axialViewerWidget = > QVTKRenderWindowInteractor(self.axialView) > > > self.axialViewerWidget.Initialize() > self.axialViewerWidget.Start() > self.initDatasets(); > self.initSliceViews(); > > // Here I setup the the image viewer and its interactor. > def initSliceViews(self): > print 'Init Slice Views' > axialViewer = vtk.vtkImageViewer2() > self.axialViewer.SetInput(self.dataset) > > self.interactorForAxialView = vtk.vtkInteractorStyleImage() > > self > .axialViewer > .SetupInteractor(self.axialViewerWidget.GetRenderWindow().Ge > tInteractor()) > self.interactorForAxialView = > self.axialViewer.GetInteractorStyle() > > self > .axialViewer.SetRenderWindow(self.axialViewerWidget.GetRenderWindow()) > > self.axialViewerWidget.show() > self.axialViewer.Render() > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 From theodoreholden at yahoo.com Fri May 22 11:51:21 2009 From: theodoreholden at yahoo.com (Theodore Holden) Date: Fri, 22 May 2009 08:51:21 -0700 (PDT) Subject: [vtkusers] "unhandled exception of type 'System.IO.FileLoadException' occurred in..." Message-ID: <40833.16914.qm@web38608.mail.mud.yahoo.com> Has anybody ever seen anything like this: An unhandled exception of type 'System.IO.FileLoadException' occurred in vtkBVS1.exe Additional information: A procedure imported by 'vtkIODotNet, Version=0.0.0.0, Culture=neut This is after using CMake and VS2008 to build vtk and the SourceForge dotnet wrapper library, and adding one cxx file of my own to the build and including a line for it in the CMakeLists.txt file for VTKIO; the error occurs pretty much the first time I call any vtk function. Without adding the extraneous file this build process has worked. Ted -------------- next part -------------- An HTML attachment was scrubbed... URL: From eleftherios.garyfallidis at mrc-cbu.cam.ac.uk Fri May 22 13:17:51 2009 From: eleftherios.garyfallidis at mrc-cbu.cam.ac.uk (Eleftherios Garyfallidis) Date: Fri, 22 May 2009 18:17:51 +0100 Subject: [vtkusers] Python vtkLineSource vtkAppendPolyData Memory gets Crazy Message-ID: <4A16DE3F.7010906@mrc-cbu.cam.ac.uk> Dear vtk users, I am trying to visualise about 100.000 trajectories where each trajectory contains from 3 to 400 line segments. I tried in the beginning to use vtkPolyline but then I noticed that it would take very long time load the trajectories and also to rotate the datasets when visible. I found in your user list that people had similar problems when tried to visualise many spheres and probably that was because of the usage of many actors. The proposed solution was to use vtkAppendData and that is what I did. Unfortunately, I watched the memory increasing amazingly much and although the dataset was about 20MBytes the memory usage flew to nearly 4GBytes. I am attaching below the code snippet that shows the memory increase problem. ''' trajs is a list of list of tuples with 3 elements (x,y,z coordinates) i.e. a list of trajectories ''' trajs_no=len(trajs) cnt = 0 apd=vtk.vtkAppendPolyData() for traj in trajs: traj_no=len(traj) if traj_no > traj_thr: for i in xrange(traj_no-1): line=vtk.vtkLineSource() line.SetPoint1(traj[i]) line.SetPoint2(traj[i+1]) #line.Update() apd.AddInput(line.GetOutput()) del line cnt+=1 map = vtk.vtkPolyDataMapper() map.SetInput(apd.GetOutput()) trajsActor = vtk.vtkActor() trajsActor.SetMapper(map) I hope I am clear and that I am on the best way to visualize all these trajectories. I would very much appreciate any feedback from you guys. Thank you, Eleftherios From gbook at gbook.org Fri May 22 14:49:46 2009 From: gbook at gbook.org (Greg Book) Date: Fri, 22 May 2009 14:49:46 -0400 Subject: [vtkusers] transparency and slowdown with vtkImagePlaneWidget Message-ID: <4A16F3CA.1020100@gbook.org> I was able to figure out the slowdown problem. I had cubic filtering enabled in one of the planes. Switching it to linear filtering made it much faster. I'm still having the transparency problem though. All of the planes have the same level of transparency, which appears to be about 50%. It's neat, but I don't want it. I'm wondering if I'm mistakenly applying a filter somewhere, or not setting the texture or lighting properties correctly? The following code creates one of the 3 planes I use: vtkProperty* ipwProp = vtkProperty::New(); ipwProp->SetOpacity(1.0); ipwProp->ShadingOff(); //assign default props to the ipw's texture plane actor planeWidgetX = vtkImagePlaneWidget::New(); planeWidgetX->SetInteractor( vtkWindow); planeWidgetX->SetKeyPressActivationValue('x'); planeWidgetX->SetPicker(picker); planeWidgetX->RestrictPlaneToVolumeOn(); planeWidgetX->GetTexturePlaneProperty()->SetOpacity(1.0); planeWidgetX->GetPlaneProperty()->SetColor(1,0,0); planeWidgetX->SetTexturePlaneProperty(ipwProp); planeWidgetX->TextureInterpolateOn(); planeWidgetX->SetResliceInterpolateToLinear(); planeWidgetX->SetInput(v16->GetOutput()); planeWidgetX->SetPlaneOrientationToXAxes(); planeWidgetX->SetSliceIndex(32); planeWidgetX->DisplayTextOn(); planeWidgetX->On(); planeWidgetX->InteractionOn(); Changing the opacity value doesn't change anything though. -Greg From darren.weber.lists at gmail.com Fri May 22 20:57:35 2009 From: darren.weber.lists at gmail.com (Darren Weber) Date: Fri, 22 May 2009 17:57:35 -0700 Subject: [vtkusers] VTK Python Wrappers on Red Hat In-Reply-To: References: Message-ID: Hi Brian, I had similar problems in porting vtk 5.4.0 in macports. My solutions might work for you on linux: https://trac.macports.org/browser/trunk/dports/graphics/vtk-devel/Portfile See variant py25 and py26, where the build bin path has to be replaced with the install lib path for all the python shared libs (.dylib on OSX, .so on linux). Do you also have 'install_name_tool' on linux? Best, Darren On Wed, May 20, 2009 at 9:54 AM, Chapman, Brian wrote: > We are trying to compile VTK with Python (2.5) wrappers on a machine > running > Red Hat Enterprise Linux 5.2. VTK compiles and installs fine, but when > within within Python I try to import vtk I get the following error: > > In [1]: import vtk > --------------------------------------------------------------------------- > Traceback (most recent call last) > > /home/brian/ in () > > /usr/local/lib/python2.5/site-packages/vtk/__init__.py in () > 27 > 28 # Load all required kits. > ---> 29 from common import * > 30 from filtering import * > 31 from io import * > > /usr/local/lib/python2.5/site-packages/vtk/common.py in () > 5 > 6 if os.name == 'posix': > ----> 7 from libvtkCommonPython import * > 8 else: > 9 from vtkCommonPython import * > > : libvtkCommonPythonD.so.5.0: cannot open > shared object file: No such file or directory > > This library is in fact installed in /usr/local/lib > > -rwxr-xr-x 1 root root 5208962 May 20 11:23 libvtkCommonPythonD.so.5.0.4 > lrwxrwxrwx 1 root root 28 May 20 11:23 libvtkCommonPythonD.so.5.0 -> > libvtkCommonPythonD.so.5.0.4 > lrwxrwxrwx 1 root root 26 May 20 11:23 libvtkCommonPythonD.so -> > libvtkCommonPythonD.so.5.0 > > The vtk directory under site-packages also contains a libvtkCommonPython > library: > > -rwxr-xr-x 1 root root 86742 May 20 11:11 libvtkCommonPython.so > > Is there something obvious we are missing in the installation process? > Confused. > > Brian > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 darren.weber.lists at gmail.com Fri May 22 21:02:13 2009 From: darren.weber.lists at gmail.com (Darren Weber) Date: Fri, 22 May 2009 18:02:13 -0700 Subject: [vtkusers] VTK 5.4.0 in OSX MacPorts as vtk-devel Message-ID: VTK 5.4.0 is available in MacPorts as vtk-devel. Most of the extra features are available, including wrappers, database support, MPI, etc. No attempt yet to get Qt integration with this vtk-devel port, but some work on that was done in the vtk5 port. For the curious, this is the Portfile that defines configuration, etc. https://trac.macports.org/browser/trunk/dports/graphics/vtk-devel/Portfile Regards, Darren -------------- next part -------------- An HTML attachment was scrubbed... URL: From 38332115 at qq.com Sat May 23 00:27:04 2009 From: 38332115 at qq.com (=?gbk?B?0e+3qw==?=) Date: Sat, 23 May 2009 12:27:04 +0800 Subject: [vtkusers] changing vtkActor's color is not working. Message-ID: I use this code to change color: pActor->GetProperty()->SetColor(1.0, 0.0, 0.0); in vtkCommand::MouseMoveEvent Evernt.But is not working. what is wrong ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dreambuild at foxmail.com Sat May 23 01:14:21 2009 From: dreambuild at foxmail.com (=?gbk?B?0e+3qw==?=) Date: Sat, 23 May 2009 13:14:21 +0800 Subject: [vtkusers] How to Snap lines' end point, intersection points while moving mouse? Message-ID: I have many lines added to the scene.And I want to draw a snap rectangle when the mouse moving around any lines' end point and intersection point.Do I have to calculate these points and draw the rectangle myself.Or vtk has some support for me ? Any suggestions are appreciated.Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From e3ng163 at gmail.com Sat May 23 01:37:04 2009 From: e3ng163 at gmail.com (e3ng163 at gmail.com) Date: Sat, 23 May 2009 13:37:04 +0800 Subject: [vtkusers] hello Message-ID: <6a72b7d8381cb49de70f2e3231f434fb@app0.ucfly.com> i want to leave the mailist? From costabel at wanadoo.fr Sat May 23 05:17:52 2009 From: costabel at wanadoo.fr (Martin Costabel) Date: Sat, 23 May 2009 11:17:52 +0200 Subject: [vtkusers] VTK Python Wrappers on Red Hat In-Reply-To: References: Message-ID: <4A17BF40.9090204@wanadoo.fr> Darren Weber wrote: > > Hi Brian, > > I had similar problems in porting vtk 5.4.0 in macports. My solutions > might work for you on linux: > https://trac.macports.org/browser/trunk/dports/graphics/vtk-devel/Portfile > > See variant py25 and py26, where the build bin path has to be replaced > with the install lib path for all the python shared libs (.dylib on OSX, > .so on linux). Do you also have 'install_name_tool' on linux? There is a second alternative for working around this problem, which I consider a bug in cmake: You chose the option, together with -DVTK_USE_RPATH:BOOL=ON, -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF \ In this case, cmake uses the build path as rpath during build time, and it replaces it with the install path at installation time. It does this for all binary executables and dynamic libs, but it forgets the python modules. This is what I call a bug in cmake, and you work around it by doing the rpath replacing for the python modules "by hand" after building is finished. The alternative is to use -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \ In this case, cmake puts the install path as rpath into all binaries and dynamic libs, including the python modules, at build time. This has the advantage that the rpath does not need to be modified at install time, but it has the drawback that you get a build time crash, because the rpath is not correct during build time, and the building of some binaries crashes because they don't find the dynamic libs they should link to. My workaround is to set the environment variable export DYLD_LIBRARY_PATH=`pwd`/bin at build time, so that the dynamic libs are found by the linker. This second alternative is what I finally settled on for the Fink package of vtk54. Hopefully, in some future version of cmake, such a workaround won't be necessary, and we can use CMAKE_BUILD_WITH_INSTALL_RPATH=OFF directly. -- Martin From drescherjm at gmail.com Sat May 23 09:32:59 2009 From: drescherjm at gmail.com (John Drescher) Date: Sat, 23 May 2009 09:32:59 -0400 Subject: [vtkusers] hello In-Reply-To: <6a72b7d8381cb49de70f2e3231f434fb@app0.ucfly.com> References: <6a72b7d8381cb49de70f2e3231f434fb@app0.ucfly.com> Message-ID: <387ee2020905230632n27482ae8o95c4101b785e9679@mail.gmail.com> 2009/5/23 : > i want to leave the mailist? > Follow the link at the bottom of every email from the list.. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > -- John M. Drescher From theodoreholden at yahoo.com Sat May 23 09:37:49 2009 From: theodoreholden at yahoo.com (Theodore Holden) Date: Sat, 23 May 2009 06:37:49 -0700 (PDT) Subject: [vtkusers] wrapper libs just contain wrapper code..... Message-ID: <836867.49582.qm@web38603.mail.mud.yahoo.com> This one finally dawned on me..... the wrapper libs basically don't contain real code, just wrapping code; the real vtkio.dll has to get put in the path for anything new in it to get found, duh..... The problem vanishes when I do that. Ted -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidrpost at gmail.com Sat May 23 14:24:56 2009 From: davidrpost at gmail.com (David Post) Date: Sat, 23 May 2009 14:24:56 -0400 Subject: [vtkusers] Fwd: could not load type vtkAlgorthmOutput In-Reply-To: <1bde0a8f0903262230g5c585670u3a2b73f0d74f9d94@mail.gmail.com> References: <1bde0a8f0903262230g5c585670u3a2b73f0d74f9d94@mail.gmail.com> Message-ID: <1bde0a8f0905231124q42fb9de7vf4dea126ad7d50d7@mail.gmail.com> ---------- Forwarded message ---------- From: David Post Date: Mar 27, 2009 1:30 AM Subject: could not load type vtkAlgorthmOutput To: vtkusers at vtk.org i am trying to have a visual studio .net 2003 c++ console application for the vtk 5.0.4 cone step 1 example. windows 2 000. i get the following exception. An unhandled exception of type 'System.TypeLoadException' occurred in Unknown Module. Additional information: Could not load type vtkAlgorithmOutput from assembly cone, Version=1.0.3368.27902, Culture=neutral, PublicKeyToken=null. can someone please help me with this? david post -------------- next part -------------- An HTML attachment was scrubbed... URL: From hossein.ghadiri at gmail.com Sun May 24 14:37:06 2009 From: hossein.ghadiri at gmail.com (Hossein Ghadiri) Date: Sun, 24 May 2009 23:07:06 +0430 Subject: [vtkusers] Need published paper.. Message-ID: <000001c9dc9e$a855ab60$2bd1844f@Hossein> Dears, How can I get the below paper? "How to use ITK and MFC" by Su Y. Published in The Insight Journal - 2007 January - June. Does it need special registration? Hossein -------------- next part -------------- An HTML attachment was scrubbed... URL: From jerome.velut at gmail.com Sat May 23 15:18:50 2009 From: jerome.velut at gmail.com (=?ISO-8859-1?B?Suly9G1l?=) Date: Sat, 23 May 2009 21:18:50 +0200 Subject: [vtkusers] Need published paper.. In-Reply-To: <000001c9dc9e$a855ab60$2bd1844f@Hossein> References: <000001c9dc9e$a855ab60$2bd1844f@Hossein> Message-ID: Hi, By following the links you gave, I found a zip file that contains the paper. Jerome 2009/5/24 Hossein Ghadiri > Dears, > > How can I get the below paper? > > "How to use ITK and MFC" by Su Y. Published in *The Insight Journal*- > *2007 January - June* . > > Does it need special registration? > > > > Hossein > > > > > > > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 hossein.ghadiri at gmail.com Sun May 24 15:37:44 2009 From: hossein.ghadiri at gmail.com (Hossein Ghadiri) Date: Mon, 25 May 2009 00:07:44 +0430 Subject: [vtkusers] Need published paper.. In-Reply-To: Message-ID: <00f601c9dca7$1ff83860$2bd1844f@Hossein> Hi, Yes, but the link may be corrupted; I could not Save Target As the zip file. I get another paper from this issue but this one not! Hossein _____ From: J?r?me [mailto:jerome.velut at gmail.com] Sent: Saturday, May 23, 2009 11:49 PM To: Hossein Ghadiri Cc: vtkusers at vtk.org; insight-users at itk.org Subject: Re: [vtkusers] Need published paper.. Hi, By following the links you gave, I found a zip file that contains the paper. Jerome 2009/5/24 Hossein Ghadiri Dears, How can I get the below paper? "How to use ITK and MFC" by Su Y. Published in The Insight Journal - 2007 January - June. Does it need special registration? Hossein _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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 dean.inglis at sympatico.ca Sun May 24 11:11:44 2009 From: dean.inglis at sympatico.ca (Dean Inglis) Date: Sun, 24 May 2009 11:11:44 -0400 Subject: [vtkusers] transparency and slowdown with vtkImagePlaneWidget Message-ID: hi Greg, are your bitmaps multi- or single component images? How is ipwProp set up? Does it have its opacity set to some value other than 1? planeWidgetX->SetTexturePlaneProperty(ipwProp); Dean ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Dean Inglis, PhD ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ Center for Appendicular ~~~~~ Magnetic Resonance Imaging Studies ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 610 - 25 Charlton Ave. E. Hamilton, Ontario, L8N 1Y2 fax: (905) 521-1297 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Assistant Professor (Adjunct) Department of Civil Engineering McMaster University Hamilton, Ontario ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Software Demos: http://www.youtube.com/watch?v=_zYNtHC9-0s -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.ibanez at kitware.com Sun May 24 14:49:38 2009 From: luis.ibanez at kitware.com (Luis Ibanez) Date: Sun, 24 May 2009 14:49:38 -0400 Subject: [vtkusers] Need published paper.. In-Reply-To: <00f601c9dca7$1ff83860$2bd1844f@Hossein> References: <00f601c9dca7$1ff83860$2bd1844f@Hossein> Message-ID: <4A1996C2.2090700@kitware.com> Hi Hossein, You don't need any special registration in order to download papers from the Insight Journal The Insight Journal is a full Open Access system. Anybody can download, use and review the papers, and we don't take copyright away from authors. -- If you just go to the Paper's page: http://www.insight-journal.org/browse/publication/141 or its handle page: http://hdl.handle.net/1926/479 The only thing you need to do is to click on the ".zip" link on the right side. Do not right-click. This is not a direct link. You should left-click, because this link triggers a JavaScript routine that packages the paper for you. Please try again, following the instructions above, and let us know if you still find any problem. Thanks Luis ---------------------- Hossein Ghadiri wrote: > Hi, > > Yes, but the link may be corrupted; I could not _Save Target As_ the zip > file. > > I get another paper from this issue but this one not! > > Hossein > > > > > > ------------------------------------------------------------------------ > > *From:* J?r?me [mailto:jerome.velut at gmail.com] > *Sent:* Saturday, May 23, 2009 11:49 PM > *To:* Hossein Ghadiri > *Cc:* vtkusers at vtk.org; insight-users at itk.org > *Subject:* Re: [vtkusers] Need published paper.. > > > > Hi, > By following the links you gave, I found a zip file that contains the paper. > > Jerome > > 2009/5/24 Hossein Ghadiri > > > Dears, > > How can I get the below paper? > > "How to use ITK and MFC" by Su Y. Published in *The Insight Journal* > - *2007 January - June* > . > > Does it need special registration? > > > > Hossein > > > > > > > > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 From raf.califano at libero.it Mon May 25 05:40:40 2009 From: raf.califano at libero.it (raf.califano at libero.it) Date: Mon, 25 May 2009 11:40:40 +0200 (CEST) Subject: [vtkusers] Visualization stereoscopic Message-ID: <10256901.259911243244440041.JavaMail.defaultUser@defaultHost> Hi all, I have little experience in stereoscopic display. I have two pictures that have the image left and right image of two camera and I want to reconstruct the stereoscopic display of them (in a single image). How can I do? Thanks very much for any response. The best regards Raffaele Califano From bwiklak at gmail.com Mon May 25 06:40:25 2009 From: bwiklak at gmail.com (Bartosz Wiklak) Date: Mon, 25 May 2009 12:40:25 +0200 Subject: [vtkusers] How to smooth polygons Message-ID: <7ceac5300905250340m76591cf4i1a17b359c5371d4a@mail.gmail.com> Hi, I'm using vtkAnnotatedCubeActor to make orientation widget (similar to vtkOrientationMarkerWidget). My problem is, that the cube is ver jagged. I tried SetMultiSamples and SetAAFrames but nothing works. How to smooth polygons in VTK? Bartek From mtaverne at engits.com Mon May 25 10:01:54 2009 From: mtaverne at engits.com (Mike Taverne) Date: Mon, 25 May 2009 16:01:54 +0200 Subject: [vtkusers] vtkXMLWriter: How can I catch write errors? Message-ID: <4A1AA4D2.8010400@engits.com> Hi, I'm using vtkXMLUnstructuredGridWriter and noticed that when I call the "Write" method, it always returns 1, even if writing to the file failed because of permission problems or a non-existent path. An error code does show up in the terminal, but how can I catch it in my code? Here's the Write method, which seems to only return 0 when no input is provided: ================ int vtkXMLWriter::Write() { // Make sure we have input. if (this->GetNumberOfInputConnections(0) < 1) { vtkErrorMacro("No input provided!"); return 0; } // always write even if the data hasn't changed this->Modified(); this->Update(); return 1; } ================ From utkarsh.ayachit at kitware.com Mon May 25 10:05:48 2009 From: utkarsh.ayachit at kitware.com (Utkarsh Ayachit) Date: Mon, 25 May 2009 10:05:48 -0400 Subject: [vtkusers] vtkXMLWriter: How can I catch write errors? In-Reply-To: <4A1AA4D2.8010400@engits.com> References: <4A1AA4D2.8010400@engits.com> Message-ID: <7ba9d6a30905250705q39dc38c9l731593eb2dffc831@mail.gmail.com> Writers typically set the ErrorCode on error. Check the value returned by GetErrorCode() for errors and details about the errors. Utkarsh On Mon, May 25, 2009 at 10:01 AM, Mike Taverne wrote: > Hi, > > I'm using vtkXMLUnstructuredGridWriter and noticed that when I call the > "Write" method, it always returns 1, even if writing to the file failed > because of permission problems or a non-existent path. > An error code does show up in the terminal, but how can I catch it in my > code? > > Here's the Write method, which seems to only return 0 when no input is > provided: > ================ > int vtkXMLWriter::Write() > { > // Make sure we have input. > if (this->GetNumberOfInputConnections(0) < 1) > { > vtkErrorMacro("No input provided!"); > return 0; > } > > // always write even if the data hasn't changed > this->Modified(); > > this->Update(); > return 1; > > } > > ================ > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtaverne at engits.com Mon May 25 10:32:27 2009 From: mtaverne at engits.com (Mike Taverne) Date: Mon, 25 May 2009 16:32:27 +0200 Subject: [vtkusers] vtkXMLWriter: How can I catch write errors? In-Reply-To: <7ba9d6a30905250705q39dc38c9l731593eb2dffc831@mail.gmail.com> References: <4A1AA4D2.8010400@engits.com> <7ba9d6a30905250705q39dc38c9l731593eb2dffc831@mail.gmail.com> Message-ID: <4A1AABFB.6040406@engits.com> Thanks, it works. How can I get the error text too? Utkarsh Ayachit wrote: > Writers typically set the ErrorCode on error. Check the value returned > by GetErrorCode() for errors and details about the errors. > > Utkarsh > > On Mon, May 25, 2009 at 10:01 AM, Mike Taverne > wrote: > > Hi, > > I'm using vtkXMLUnstructuredGridWriter and noticed that when I > call the "Write" method, it always returns 1, even if writing to > the file failed because of permission problems or a non-existent path. > An error code does show up in the terminal, but how can I catch it > in my code? > > Here's the Write method, which seems to only return 0 when no > input is provided: > ================ > int vtkXMLWriter::Write() > { > // Make sure we have input. > if (this->GetNumberOfInputConnections(0) < 1) > { > vtkErrorMacro("No input provided!"); > return 0; > } > > // always write even if the data hasn't changed > this->Modified(); > > this->Update(); > return 1; > > } > > ================ > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > From massivemonkeymayhem at gmail.com Mon May 25 10:59:55 2009 From: massivemonkeymayhem at gmail.com (Paul) Date: Mon, 25 May 2009 12:29:55 -0230 Subject: [vtkusers] wxVTKRenderWindowInteractor problem In-Reply-To: References: Message-ID: <403729b40905250759n14b6d6c6jea616b5863d96536@mail.gmail.com> I'm having a similar problem. The picking is fine except that when I resize the render window in my WX application, the window will occasionally get sized about 50 pixels too large, and the bottom will be clipped. Picking seems fine, though. It only shows up when I try to run my application in Windows (native interface). Linux (using GTK) is fine. What OS are you using? Paul On Fri, May 15, 2009 at 1:51 PM, Greg Book wrote: > I'm using the wxVTKRenderWindowInteractor in my application and am getting > an odd error when resizing the window. When I first start it up, everything > works fine (everything being the imagePlaneWidget, picking, display, etc), > but when I resize it, the content of the window is shifted down by about 20 > pixels. So the mouse no longer picks correctly, and the bottom of the image > is cut off. > It only happens after resizing, so I'm not sure if its something in my code > or in the renderwindowinteractor. There also aren't any OnSize event > handlers in my program. > > -Greg > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 raf.califano at libero.it Mon May 25 11:47:05 2009 From: raf.califano at libero.it (raf.califano at libero.it) Date: Mon, 25 May 2009 17:47:05 +0200 (CEST) Subject: [vtkusers] Stereoscopic visualization Message-ID: <2353424.299731243266425168.JavaMail.defaultUser@defaultHost> Hi all, I have little experience in stereoscopic display. I have two pictures that are the image left and right image of two camera and I want to reconstruct the stereoscopic display of them (in a single image). How can I do by vtk? Thanks very much for any response. The best regards Raffaele Califano From hossein.ghadiri at gmail.com Tue May 26 13:50:54 2009 From: hossein.ghadiri at gmail.com (Hossein Ghadiri) Date: Tue, 26 May 2009 22:20:54 +0430 Subject: [vtkusers] [Insight-users] Need published paper.. In-Reply-To: <4A188023.9040002@kitware.com> Message-ID: <004e01c9de2a$8825a150$c4d1844f@Hossein> Really thanks This link helped me. My essential questions of which I can not find obvious answer are: 1- Do we need to directly use OpenGL LIBs to view and interact with images even when we are working with VTK? 2- What is better object in MFC to visualize and interact with images when we use VTK, for example which one could be better: CBitmap, CImage, or we have to use more sophisticated programming to have a GUI in MFC when using VTK/ITK? Hossein -----Original Message----- From: Julien Jomier [mailto:julien.jomier at kitware.com] Sent: Sunday, May 24, 2009 3:31 AM To: Hossein Ghadiri Cc: 'J?r?me'; insight-users at itk.org; vtkusers at vtk.org Subject: Re: [Insight-users] [vtkusers] Need published paper.. Hossein, You just need to click on the link and the browser will ask you to download the file. Otherwise you can use this link: http://www.insight-journal.org/download/fulldownload/zip/141/1/?downloadonly =1 Let us know if you have any other issues, Julien Hossein Ghadiri wrote: > Hi, > > Yes, but the link may be corrupted; I could not _Save Target As_ the zip > file. > > I get another paper from this issue but this one not! > > Hossein > > > > > > ------------------------------------------------------------------------ > > *From:* J?r?me [mailto:jerome.velut at gmail.com] > *Sent:* Saturday, May 23, 2009 11:49 PM > *To:* Hossein Ghadiri > *Cc:* vtkusers at vtk.org; insight-users at itk.org > *Subject:* Re: [vtkusers] Need published paper.. > > > > Hi, > By following the links you gave, I found a zip file that contains the paper. > > Jerome > > 2009/5/24 Hossein Ghadiri > > > Dears, > > How can I get the below paper? > > "How to use ITK and MFC" by Su Y. Published in *The Insight Journal* > - *2007 January - June* > . > > Does it need special registration? > > > > Hossein > > > > > > > > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > > > > ------------------------------------------------------------------------ > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.itk.org/mailman/listinfo/insight-users From sean at rogue-research.com Mon May 25 14:01:34 2009 From: sean at rogue-research.com (Sean McBride) Date: Mon, 25 May 2009 14:01:34 -0400 Subject: [vtkusers] VTK 5.4.0 in OSX MacPorts as vtk-devel In-Reply-To: References: Message-ID: <20090525180134.1065955824@kingu.local> On 5/22/09 6:02 PM, Darren Weber said: >VTK 5.4.0 is available in MacPorts as vtk-devel. Most of the extra features >are available, including wrappers, database support, MPI, etc. No attempt >yet to get Qt integration with this vtk-devel port, but some work on that >was done in the vtk5 port. > >For the curious, this is the Portfile that defines configuration, etc. >https://trac.macports.org/browser/trunk/dports/graphics/vtk-devel/Portfile Nice job! One thing I would suggest: build with VTK_USE_SYSTEM_ZLIB ON, you'll save a little disk space and compilation time. -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From jourdain at artenum.com Mon May 25 17:14:40 2009 From: jourdain at artenum.com (Sebastien Jourdain) Date: Mon, 25 May 2009 23:14:40 +0200 Subject: [vtkusers] VTK on Windows XP with Java wrapping In-Reply-To: References: Message-ID: Hello everyone, I was wondering if someone managed to compiled VTK on windows (With the Java wrapping) and managed to make it work on any Windows XP ? Right now, on 5 PC, it works on 2 and I get the following error on the others... Caused by: java.lang.UnstatisfiedLinkError: C:\xxx \vtkCommonJava.dll : This application could not start due to an invalide configuration. Please reinstall the software. And the problem do not come from a wrong setting of the PATH environment variable. Moreover, on windows running inside a VMWare/VirtualBox the same error occurs on the vtkRendering lib and not on the vtkCommon... Regards, Seb From jourdain at artenum.com Mon May 25 17:21:19 2009 From: jourdain at artenum.com (Sebastien Jourdain) Date: Mon, 25 May 2009 23:21:19 +0200 Subject: [vtkusers] How to contribute with a new vtkImplicitFunction ? In-Reply-To: References: Message-ID: Hello, I've developped a new vtkImplicitFunction that represent a Torus. It would be nice for the community that the default VTK package would integrate this added function. Please let me know, how I can send you the .h/.cxx files, Regards, Seb From jourdain at artenum.com Mon May 25 17:52:53 2009 From: jourdain at artenum.com (Sebastien Jourdain) Date: Mon, 25 May 2009 23:52:53 +0200 Subject: [vtkusers] Issue in running VTK with Java wrapping on Windows XP In-Reply-To: References: Message-ID: <3F7279D8-EF8C-4E1A-8538-D774A0506C8A@artenum.com> Hello everyone, I'm getting more and more troubles with VTK under windows. As I've said previously, my compiled version of VTK (with the java wrapping) do not run on all my Windows computers. So I've compiled the VTK on those computers in order to make it work. Unfortunately I get an error during the loading of the vtkRenderingJava.dll with an UnsatisfiedLinkError => Can't find dependent libraries... Any ideas ? Thanks for your help, Seb From gbook at gbook.org Mon May 25 20:20:17 2009 From: gbook at gbook.org (Greg Book) Date: Mon, 25 May 2009 20:20:17 -0400 Subject: [vtkusers] wxVTKRenderWindowInteractor problem In-Reply-To: <403729b40905250759n14b6d6c6jea616b5863d96536@mail.gmail.com> References: <403729b40905250759n14b6d6c6jea616b5863d96536@mail.gmail.com> Message-ID: <4A1B35C1.1040003@gbook.org> An HTML attachment was scrubbed... URL: From darren.weber.lists at gmail.com Mon May 25 20:38:29 2009 From: darren.weber.lists at gmail.com (Darren Weber) Date: Mon, 25 May 2009 17:38:29 -0700 Subject: [vtkusers] VTK Python Wrappers on Red Hat In-Reply-To: <4A17BF40.9090204@wanadoo.fr> References: <4A17BF40.9090204@wanadoo.fr> Message-ID: On Sat, May 23, 2009 at 2:17 AM, Martin Costabel wrote: > Darren Weber wrote: > >> >> Hi Brian, >> >> I had similar problems in porting vtk 5.4.0 in macports. My solutions >> might work for you on linux: >> https://trac.macports.org/browser/trunk/dports/graphics/vtk-devel/Portfile >> >> See variant py25 and py26, where the build bin path has to be replaced >> with the install lib path for all the python shared libs (.dylib on OSX, .so >> on linux). Do you also have 'install_name_tool' on linux? >> > > There is a second alternative for working around this problem, which I > consider a bug in cmake: > > You chose the option, together with -DVTK_USE_RPATH:BOOL=ON, > > -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF \ > > In this case, cmake uses the build path as rpath during build time, and it > replaces it with the install path at installation time. It does this for all > binary executables and dynamic libs, but it forgets the python modules. This > is what I call a bug in cmake, and you work around it by doing the rpath > replacing for the python modules "by hand" after building is finished. > > The alternative is to use > > -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \ > > In this case, cmake puts the install path as rpath into all binaries and > dynamic libs, including the python modules, at build time. This has the > advantage that the rpath does not need to be modified at install time, but > it has the drawback that you get a build time crash, because the rpath is > not correct during build time, and the building of some binaries crashes > because they don't find the dynamic libs they should link to. My workaround > is to set the environment variable > > export DYLD_LIBRARY_PATH=`pwd`/bin > > at build time, so that the dynamic libs are found by the linker. > > This second alternative is what I finally settled on for the Fink package > of vtk54. Hopefully, in some future version of cmake, such a workaround > won't be necessary, and we can use CMAKE_BUILD_WITH_INSTALL_RPATH=OFF > directly. > > -- > Martin > > I agree with everything that Martin said above, so clearly. The same problems occur with InsightToolkit (ITK) and WrapITK. In the macport Portfiles that I've worked on recently, you can see examples of all the post-install hacks required to reset the library paths. The Portfiles are pseudo tcl code, so if you set all the variables up, you could almost copy and paste the post-destroot statements into tclsh8.4 and it might work. I don't want to recommend a straight copy and paste, because macports is a peculiar beast when it comes to the installation process. The alternative is to set the DYLD... environment variables, which seems to work too. I avoided that option, only because I don't know how to interrogate these environment variables in macports during the build and install process. Without being confident that the linker could find an additional install of the libraries (somewhere from a prior install or whatever), I just opted to try and keep everything in cmake and some post install hacks to reset lib paths. It does get messy. As it is, I believe the macport Portfiles will continue to work even if cmake is fixed to resolve this problem. Anyhow, the main point is that wrapping in vtk and itk does not "obey" the install rpath settings that are applied to the c++ binaries. What a relief it would be to see that change! I have no idea how to do it, nor the time, to submit a bug report on that. Darren -------------- next part -------------- An HTML attachment was scrubbed... URL: From dean.inglis at camris.ca Mon May 25 21:05:39 2009 From: dean.inglis at camris.ca (Dean Inglis) Date: Mon, 25 May 2009 21:05:39 -0400 Subject: [vtkusers] transparency and slowdown with vtkImagePlaneWidget In-Reply-To: <4A1B3B5B.7070703@gbook.org> References: <4A1B3B5B.7070703@gbook.org> Message-ID: <3689EFB7AF1F46A2A99185AFE5017D49@Hyoid> what happens if you do comment out SetTexturePlaneProperty (ie don't use ipwProp). Dean Subject: Re: [vtkusers] transparency and slowdown with vtkImagePlaneWidget The bitmaps are RGB images, but converting to grayscale doesn't change anything. I tried PNG images and I got the same result. I tried a few different values for opacity after I last posted to the list and it did have an effect... values smaller than 1.0 made it even more transparent. I attached an image of what I'm getting with opacity of 1.0. The ipwProp is setup as below: vtkProperty* ipwProp = vtkProperty::New(); ipwProp->SetOpacity(1.0); ipwProp->ShadingOff(); planeWidgetX = vtkImagePlaneWidget::New(); planeWidgetX->SetInteractor( vtkWindow); planeWidgetX->SetKeyPressActivationValue('x'); planeWidgetX->SetPicker(picker); planeWidgetX->RestrictPlaneToVolumeOn(); planeWidgetX->GetTexturePlaneProperty()->SetOpacity(1.0); planeWidgetX->GetPlaneProperty()->SetColor(1,0,0); planeWidgetX->SetTexturePlaneProperty(ipwProp); planeWidgetX->TextureInterpolateOn(); planeWidgetX->SetResliceInterpolateToLinear(); planeWidgetX->SetInput(v16->GetOutput()); planeWidgetX->SetPlaneOrientationToXAxes(); planeWidgetX->SetSliceIndex(32); planeWidgetX->DisplayTextOn(); planeWidgetX->On(); planeWidgetX->InteractionOn(); I'm wondering if I need to convert the output of the image reader into a different vtk format? -Greg Dean Inglis wrote: hi Greg, are your bitmaps multi- or single component images? How is ipwProp set up? Does it have its opacity set to some value other than 1? planeWidgetX->SetTexturePlaneProperty(ipwProp); Dean ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Dean Inglis, PhD ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ Center for Appendicular ~~~~~ Magnetic Resonance Imaging Studies ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 610 - 25 Charlton Ave. E. Hamilton, Ontario, L8N 1Y2 fax: (905) 521-1297 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Assistant Professor (Adjunct) Department of Civil Engineering McMaster University Hamilton, Ontario ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Software Demos: http://www.youtube.com/watch?v=_zYNtHC9-0s -------------- next part -------------- An HTML attachment was scrubbed... URL: From dean.inglis at camris.ca Mon May 25 21:09:08 2009 From: dean.inglis at camris.ca (Dean Inglis) Date: Mon, 25 May 2009 21:09:08 -0400 Subject: [vtkusers] transparency and slowdown with vtkImagePlaneWidget In-Reply-To: <4A1B3B5B.7070703@gbook.org> References: <4A1B3B5B.7070703@gbook.org> Message-ID: one more thing.have you tried to configure the widget's internal vtkImageMapToColors? vtkImageMapToColors* map = planeWidgetX->GetColorMap(); map->SetOutputFormatToLuminance() etc. Dean The bitmaps are RGB images, but converting to grayscale doesn't change anything. I tried PNG images and I got the same result. I tried a few different values for opacity after I last posted to the list and it did have an effect... values smaller than 1.0 made it even more transparent. I attached an image of what I'm getting with opacity of 1.0. The ipwProp is setup as below: vtkProperty* ipwProp = vtkProperty::New(); ipwProp->SetOpacity(1.0); ipwProp->ShadingOff(); planeWidgetX = vtkImagePlaneWidget::New(); planeWidgetX->SetInteractor( vtkWindow); planeWidgetX->SetKeyPressActivationValue('x'); planeWidgetX->SetPicker(picker); planeWidgetX->RestrictPlaneToVolumeOn(); planeWidgetX->GetTexturePlaneProperty()->SetOpacity(1.0); planeWidgetX->GetPlaneProperty()->SetColor(1,0,0); planeWidgetX->SetTexturePlaneProperty(ipwProp); planeWidgetX->TextureInterpolateOn(); planeWidgetX->SetResliceInterpolateToLinear(); planeWidgetX->SetInput(v16->GetOutput()); planeWidgetX->SetPlaneOrientationToXAxes(); planeWidgetX->SetSliceIndex(32); planeWidgetX->DisplayTextOn(); planeWidgetX->On(); planeWidgetX->InteractionOn(); I'm wondering if I need to convert the output of the image reader into a different vtk format? -Greg Dean Inglis wrote: hi Greg, are your bitmaps multi- or single component images? How is ipwProp set up? Does it have its opacity set to some value other than 1? planeWidgetX->SetTexturePlaneProperty(ipwProp); Dean ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Dean Inglis, PhD ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ Center for Appendicular ~~~~~ Magnetic Resonance Imaging Studies ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 610 - 25 Charlton Ave. E. Hamilton, Ontario, L8N 1Y2 fax: (905) 521-1297 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Assistant Professor (Adjunct) Department of Civil Engineering McMaster University Hamilton, Ontario ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Software Demos: http://www.youtube.com/watch?v=_zYNtHC9-0s -------------- next part -------------- An HTML attachment was scrubbed... URL: From alucard006 at msn.com Tue May 26 03:27:21 2009 From: alucard006 at msn.com (Chris N) Date: Tue, 26 May 2009 00:27:21 -0700 Subject: [vtkusers] vtkXMLImageDataWriter, writes file? Message-ID: Hi, I'm currently trying to make use of Paraview program but I need a *.vti type file. So I'm trying to make use of vtkXMLImageDataWriter and read through its library details. I noticed they had a test file which I used it's few lines of writing out a file. Such as... //WRITER - Save the result of the filter in a file vtkXMLImageDataWriter *writer = vtkXMLImageDataWriter::New(); writer->SetInputConnection(vtkPolyDataMapper::skinMapper->GetOutputPort()); writer->SetFileName("image.vti"); writer->SetDataModeToBinary(); writer->Write(); writer->Delete(); My problem is when I run the program I don't have an image.vti file anywhere. I've scanned through my computer a few times but nothing comes up. What are some possible problems why it doesn't run? Also where would it write my file to? Can I set my directory location within the argument of SetFileName() function? Thanks Chris _________________________________________________________________ Hotmail? goes with you. http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009 -------------- next part -------------- An HTML attachment was scrubbed... URL: From shailender.kanwar at gmail.com Tue May 26 05:39:07 2009 From: shailender.kanwar at gmail.com (Shailender Kanwar) Date: Tue, 26 May 2009 15:09:07 +0530 Subject: [vtkusers] How to Render a mesh fully ? Message-ID: <94a853f60905260239x2aa1fdf1h7c8045f59cc5628b@mail.gmail.com> Hi, I am trying to render an unstructured mesh using vtkDataSetMapper. the problem is that when the mesh is rendered, only the outside surface of the mesh is shown. in wireframe, the internal cell edges are not rendered. I read in the documentation that vtkDataSetMapper shows 2d edges of a 3d cell only if they are on boundary. Is there any way to display the entire mesh in wireframe including the internal cell edges so as to be able to see the internal mesh structure ? thanks Shailender Kanwar -------------- next part -------------- An HTML attachment was scrubbed... URL: From luxtheme at yahoo.de Tue May 26 07:35:31 2009 From: luxtheme at yahoo.de (=?iso-8859-1?Q?=D6ner_F?=) Date: Tue, 26 May 2009 04:35:31 -0700 (PDT) Subject: [vtkusers] Is it possible to change size of a vtkActor2D? Message-ID: <28516.16184.qm@web24601.mail.ird.yahoo.com> Hi, I want to display analog & digital signals in a cartesian coordinate system which should be zoomable. I have tried several approaches and simply do not get further. So I need help. One of the approaches which I try is vtkActor2D. Problem is, that if I change the window size, it does not change the size of the 2D actor. First position of the 2D actor I can wonderfully set up, but position2 cannot be changed. Height and width of the 2D actor remains always constant. Is it possible to zoom with vtkActor2D? If so, how? Which additional functions do I need? .luxtheme. my code: #include "vtkRenderWindow.h" #include "vtkRenderWindowInteractor.h" #include "vtkRenderer.h" #include "vtkPolyDataMapper2D.h" #include "vtkCellArray.h" #include "vtkPoints.h" #include "vtkPolyData.h" #include "vtkActor2D.h" #include "vtkcamera.h" #include #include //random signal void random_Signal (int timeLine, int *event_array_time, int *event_array_bit, int &array_index) { srand((unsigned)time(0)); int time=0; int counter=0; int start_bit = 0; while(timeInsertNextPoint(x1,y1,0); points->InsertNextPoint(x2,y2,0); lines->InsertNextCell(2); lines->InsertCellPoint(pID); lines->InsertCellPoint(pID+1); pID+=2; } //MAIN void main() { const int events=100; int event_array_time[events]; int event_array_bit[events]; int timeLine = 2000; int array_index = 0; vtkPoints *points = vtkPoints::New(); vtkCellArray *lines = vtkCellArray::New(); int pID = 0; // generate random signal random_Signal(timeLine, event_array_time, event_array_bit, array_index); cout << "\n\nAI: " << array_index << endl; //plot signal create_Line(800.0/timeLine*event_array_time[0], 300*event_array_bit[0], //position1 800.0/timeLine*event_array_time[1], 300*event_array_bit[0], //position2 points, lines, pID); for (int i=1; iSetPoints(points); polyData->SetLines(lines); vtkPolyDataMapper2D *mapper = vtkPolyDataMapper2D::New(); mapper->SetInput(polyData); vtkActor2D *actor = vtkActor2D::New(); actor->SetMapper(mapper); //actor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport(); //OK //actor->GetPositionCoordinate()->SetValue(.2,.5); //OK actor->SetWidth(0.7); // no effect actor->SetHeight(0.1); // no effect //actor->SetPosition(0.1,0.1); //OK actor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport(); //^no effect actor->GetPosition2Coordinate()->SetValue(.2,.5); //no effect actor->SetPosition2(0.9,0.9); //no effect // Create a renderer vtkRenderer* ren = vtkRenderer::New(); ren->SetBackground(0.75,0.25,0.25); ren->AddActor(actor); ren->GetActiveCamera()->ParallelProjectionOff(); //no effect ren->GetActiveCamera()->Zoom(5); //no effect // Create a render window vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New(); vtkRenderWindow* renWin = vtkRenderWindow::New(); renWin->AddRenderer(ren); renWin->SetSize( 800,300 ); renWin->SetInteractor( iren ); iren->Initialize(); renWin->Render(); iren->Start(); //... } -------------- next part -------------- An HTML attachment was scrubbed... URL: From gbivins at objectreservoir.com Tue May 26 09:25:47 2009 From: gbivins at objectreservoir.com (Gerrick Bivins) Date: Tue, 26 May 2009 08:25:47 -0500 Subject: [vtkusers] How to Render a mesh fully ? In-Reply-To: <94a853f60905260239x2aa1fdf1h7c8045f59cc5628b@mail.gmail.com> Message-ID: Take a look at vtkExtractEdges. http://www.vtk.org/doc/release/5.2/html/a00399.html Gerrick On 5/26/09 4:39 AM, "Shailender Kanwar" wrote: > Hi, > > I am trying to render an unstructured mesh using vtkDataSetMapper. > the problem is that when the mesh is rendered, only the outside surface of the > mesh is shown. > in wireframe, the internal cell edges are not rendered. > I read in the documentation that vtkDataSetMapper shows 2d edges of a 3d cell > only if they are on boundary. > Is there any way to display the entire mesh in wireframe including the > internal cell edges so? as to be able to see the internal > mesh structure ? > > thanks > > Shailender Kanwar ? > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 dominik at itis.ethz.ch Tue May 26 10:26:00 2009 From: dominik at itis.ethz.ch (Dominik Szczerba) Date: Tue, 26 May 2009 16:26:00 +0200 Subject: [vtkusers] vtkLocal vs vtkMy Message-ID: <4A1BFBF8.5010409@itis.ethz.ch> What is the difference between vtkLocal and vtkMy then? Both seem to build independently of the original VTK tree, so what's the deal here? -- Dominik From luca.ramundo at hotmail.it Tue May 26 10:48:04 2009 From: luca.ramundo at hotmail.it (Luca Ramundo) Date: Tue, 26 May 2009 16:48:04 +0200 Subject: [vtkusers] call glColorMask from vtk Message-ID: hi all, I need your help for my great problem. I'd like to visualize a 3D object in my scene with the follow properties: It must to be invisible but not trasparence because it has to hide some object inside it. I know that there is a openGL method to do it: glColorMask(). It is used to write or not in frame buffer some color component. I'd like if there is something to resolve my problem in VTK or the way to call this openGL method from my vtk object. Thanks a lot, Luca _________________________________________________________________ Pi? di 100 Emoticon gratis per il tuo Messenger! http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: From rgolebiowski at future-processing.com Tue May 26 11:20:25 2009 From: rgolebiowski at future-processing.com (Robert Golebiowski) Date: Tue, 26 May 2009 16:20:25 +0100 Subject: [vtkusers] toolbar and vtkMFCWindow Message-ID: <30c236e70905260820u3bdcac94hf6bbcec5fac6d939@mail.gmail.com> Hi All, I?m writing an MFC application, which makes use of VTK and ITK. I managed to compile vtkMDI project from VTKExamples. I tried to add a toolbar to vtkMFCWindow and I run into some problems. In MFC toolbar should be added to a window when OnCreate event occurs. Because vtkMFCWindow creates itself (calls Create function) inside its constructor I couldn?t add OnCreate method in my class which derives from vtkMFCWindows. I had to change vtkMFCWindow class a bit. Now I can create a toolbar in OnCreate method (in my class), but I still don?t see any toolbar in my window. I wonder if there is an easier way of adding toolbars to vtkMfcWindow. I will be grateful for any help, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From rgolebiowski at future-processing.com Tue May 26 11:21:57 2009 From: rgolebiowski at future-processing.com (Robert Golebiowski) Date: Tue, 26 May 2009 16:21:57 +0100 Subject: [vtkusers] vtkMFCWindow and toolbar Message-ID: <30c236e70905260821t3da98f51vb551da7223f411f@mail.gmail.com> Hi All, I?m writing an MFC application, which makes use of VTK and ITK. I managed to compile vtkMDI project from VTKExamples. I tried to add a toolbar to vtkMFCWindow and I run into some problems. In MFC toolbar should be added to a window when OnCreate event occurs. Because vtkMFCWindow creates itself (calls Create function) inside its constructor I couldn?t add OnCreate method in my class which derives from vtkMFCWindows. I had to change vtkMFCWindow class a bit. Now I can create a toolbar in OnCreate method (in my class), but I still don?t see any toolbar in my window. I wonder if there is an easier way of adding toolbars to vtkMfcWindow. I will be grateful for any help, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From robgolebiowski at googlemail.com Tue May 26 11:22:56 2009 From: robgolebiowski at googlemail.com (Robert Golebiowski) Date: Tue, 26 May 2009 16:22:56 +0100 Subject: [vtkusers] vtkMFCWindow and toolbar Message-ID: <30c236e70905260822h59cee32fje22c2395588b4f41@mail.gmail.com> Hi All, I?m writing an MFC application, which makes use of VTK and ITK. I managed to compile vtkMDI project from VTKExamples. I tried to add a toolbar to vtkMFCWindow and I run into some problems. In MFC toolbar should be added to a window when OnCreate event occurs. Because vtkMFCWindow creates itself (calls Create function) inside its constructor I couldn?t add OnCreate method in my class which derives from vtkMFCWindows. I had to change vtkMFCWindow class a bit. Now I can create a toolbar in OnCreate method (in my class), but I still don?t see any toolbar in my window. I wonder if there is an easier way of adding toolbars to vtkMfcWindow. I will be very grateful for any help, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From clinton at elemtech.com Tue May 26 12:30:18 2009 From: clinton at elemtech.com (Clinton Stimpson) Date: Tue, 26 May 2009 10:30:18 -0600 Subject: [vtkusers] vertex arrays Message-ID: <4A1C191A.9070509@elemtech.com> Hi, I see that vtkPainterDeviceAdapter supports drawing vertex arrays, but I can't see any code in VTK that uses it. Is there a working vtkPainter that does vertex arrays? And are there thoughts of modifying vtkPolyData to have better support for vertex arrays? It would be nice to have quads and triangles separated and not copy them into their own arrays. Thanks, Clint From utkarsh.ayachit at kitware.com Tue May 26 12:45:54 2009 From: utkarsh.ayachit at kitware.com (Utkarsh Ayachit) Date: Tue, 26 May 2009 12:45:54 -0400 Subject: [vtkusers] call glColorMask from vtk In-Reply-To: References: Message-ID: <7ba9d6a30905260945s13a8cb5ag94a65a2e79a5bfc6@mail.gmail.com> Try implementing your own mapper or actor. You can make openGL calls in Render methods in these classes. Utkarsh On Tue, May 26, 2009 at 10:48 AM, Luca Ramundo wrote: > hi all, > I need your help for my great problem. I'd like to visualize a 3D object in > my scene with the follow properties: > It must to be invisible but not trasparence because it has to hide some > object inside it. > I know that there is a openGL method to do it: glColorMask(). It is used to > write or not in frame buffer some color component. > I'd like if there is something to resolve my problem in VTK or the way to > call this openGL method from my vtk object. > Thanks a lot, > Luca > ------------------------------ > Quali sono le parole pi? cliccate? Scopri la top! > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 clinton at elemtech.com Tue May 26 14:08:53 2009 From: clinton at elemtech.com (Clinton Stimpson) Date: Tue, 26 May 2009 12:08:53 -0600 Subject: [vtkusers] OffScreen and blank window In-Reply-To: <9742F5B1-6639-4CD1-BEA2-8F58074CD3B3@gmail.com> References: <912CF395-0850-4511-99FD-18511F01481F@gmail.com> <423e920905200654s295655a6t8c68abda6fcfd423@mail.gmail.com> <94068DDA-3788-4D6C-B6CE-39ABAE453F93@gmail.com> <4A156112.9030009@elemtech.com> <9742F5B1-6639-4CD1-BEA2-8F58074CD3B3@gmail.com> Message-ID: <4A1C3035.4020604@elemtech.com> Ok, that needed fixed for other reasons, and makes a difference if hardware offscreen is attempted but not supported. Apparently, hardware offscreen creates the window and leaves it. Doesn't seem like offscreen to me :) You'll have to ask Kitware why they create/leave the window for offscreen. On the Mac, I thought offscreen simply worked by creating a window and use that as the rendering target, but never show it. Clint ABE Hiroshi wrote: > Dear Clinton and all, > > Thank you for your suggestion, Clinton. > > I put the lines in vtkCarbonRenderWindow and saw what happened. > Pop-up problem was still remained. May I understand your fix is for > remaining window problem? > If so I cannot see the effect of the fix because I haven't any code > with the problem so far. > > Regarding a call, DisposeWindow, I found it is called in > vtkCarbonRenderWindow::Finalize(void) > So I'm afraid it is not necessary in DestroyWindow. > > Regards, > ABE Hiroshi > from Tokorozawa, JAPAN > > On 2009/05/21, at 23:11, Clinton Stimpson wrote: > >> >> I see something else wrong, that needs fixed regardless of offscreen >> rendering. >> Can someone try putting this at the end of >> vtkCarbonRenderWindow::DestroyWindow(), and see if it helps this >> offscreen problem? >> >> void vtkCarbonRenderWindow::DestroyWindow() >> { >> ... >> ... >> if(this->OwnWindow && this->RootWindow) >> { >> DisposeWindow(this->RootWindow); >> this->RootWindow = 0; >> this->WindowId = 0; >> } >> this->Mapped = 0; >> } >> >> vtkCocoaRenderWindow needs the same fix. >> >> Thanks, >> Clint >> >> ABE Hiroshi wrote: >>> Dear Simon and all, >>> >>> I am using Carbon version of VTK, so the situation might be >>> different from you, Simon. >>> But I checked the vtkCarbonRenderWindow.cxx as you did for Cocoa >>> version, I found CreateAWindow calls ShowWindow to display the >>> renderwindow. So I changed the code as: >>> >>> vtkCarbonRenderWindow.cxx: 715 >>> >>> if(!this->GetOffScreenRendering() ) ShowWindow(this->RootWindow); >>> >>> Anyway it works as I expected, however, I am wondering if it might >>> be fit to the spec. >>> Any suggestion? >>> >>> Regards, >>> Hiroshi ABE >>> >>> > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 From tracy.hu at yahoo.com Tue May 26 14:52:02 2009 From: tracy.hu at yahoo.com (Tracy Hu) Date: Tue, 26 May 2009 11:52:02 -0700 (PDT) Subject: [vtkusers] prevent vtkVolumeRayCastMapper from recomputing when its input is not changed Message-ID: <558912.66457.qm@web45101.mail.sp1.yahoo.com> I have a actor using vtkVolumeRayCastMapper. Whenever I manipulate the actor with mouse or just click anywhere on screen, the vtkVolumeRayCastMapper will recompute itself. I turned off its ReleaseDataFlag, but still can't stop it from recomputing. Is there a way to stop vtkVolumeRayCastMapper from doing computation when it's input is not changed? Thanks for any hint Tracy -------------- next part -------------- An HTML attachment was scrubbed... URL: From cscheid at sci.utah.edu Wed May 27 00:45:39 2009 From: cscheid at sci.utah.edu (Carlos Scheidegger) Date: Tue, 26 May 2009 22:45:39 -0600 Subject: [vtkusers] subclassing vtk classes from python works in 5.0.3 but not 5.0.4 - bug or unsupported behavior? Message-ID: <4A1CC573.6090307@sci.utah.edu> Hi, In some code we have, we use the following piece of python: class vtkImagePlaneWidget_fixed(vtk.vtkImagePlaneWidget): def SetLookupTable(self, lookup_table): self.UserControlledLookupTableOn() vtk.vtkImagePlaneWidget.SetLookupTable(self, lookup_table) description[vtkImagePlaneWidget_fixed] = vtk.vtkImagePlaneWidget This works fine in VTK 5.0.3 (in particular, in the version that ships with Ubuntu 8.10 and 8.04). However, in VTK 5.0.4, the class definition is accepted without error, but as soon as we try to reference it, we get >>> description[vtkImagePlaneWidget_fixed] = vtk.vtkImagePlaneWidget Traceback (most recent call last): File "", line 1, in AttributeError: mro Do you guys see similar behavior? Is this a bug or did it only work on previous VTK versions because of unsupported behavior? Thanks! -carlos From cscheid at sci.utah.edu Wed May 27 01:19:02 2009 From: cscheid at sci.utah.edu (Carlos Scheidegger) Date: Tue, 26 May 2009 23:19:02 -0600 Subject: [vtkusers] More on VTK 5.0.4: hashing vtk class objects broken? Message-ID: <4A1CCD46.5010207@sci.utah.edu> Here's a simpler way to trigger the issue I just mentioned. The core problem is related to generating a hash from the vtk class object. On VTK 5.0.3 (and Python 2.5.2), I get this: >>> import vtk >>> hash(vtk.vtkObject) 140169743808624 >>> id(vtk.vtkObject) 140169743808624 This seems to me the correct behavior. On VTK 5.0.4 (and Python 2.6.2), I get this: >>> hash(vtk.vtkObject) Traceback (most recent call last): File "", line 1, in AttributeError: mro >>> id(vtk.vtkObject) 3083232608L Is this an intended change? It is very convenient to use vtk classes in python dictionaries... Thanks! -carlos From ilferraresebono at hotmail.it Wed May 27 05:27:33 2009 From: ilferraresebono at hotmail.it (Giancarlo Amati) Date: Wed, 27 May 2009 11:27:33 +0200 Subject: [vtkusers] recovering vtkSpheereSource from vtkAssemply, HOW?! Message-ID: Hello vtkUsers, I have a vtkAssembly with 6 actors. each actor refers to a vtkSphereSource. Now, the AddPart of vtkAssemply takes as input an actor, so i wonder if there is any way to recover the correspondent vtkSphereSource object allocated, passing through the property collection I can get from the vtkAssembly. that's because I need to change the allocated spheres. am I complicating my life or is there any other way to do it? very kind regards. GC _________________________________________________________________ Pi? di 30 stazioni. Ascolta la Radio su Messenger! http://messenger.it/radioMessenger.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhaneshr at gmail.com Wed May 27 06:23:21 2009 From: dhaneshr at gmail.com (Dhanesh Ramachandram, PhD) Date: Wed, 27 May 2009 18:23:21 +0800 Subject: [vtkusers] VTK 5.5.0 Java wrapping build problem on Ubuntu 9.04 Message-ID: Hi all, I'm experiencing some problem at 98% when building VTK that I checked out through CVS. Here are the errors..appreciate some help pls...: [ 98%] Built target VTKJava Linking CXX executable ../../bin/VTKJavaExecutable ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtRemoveTimeOut' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtVaAppCreateShell' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtRealizeWidget' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtDestroyWidget' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtSetKeyboardFocus' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtWindow' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtAppNextEvent' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtToolkitInitialize' ../../bin/libvtkRenderingJava.so.5.5.0: undefined reference to `JAWT_GetAWT' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `applicationShellWidgetClass' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtOpenDisplay' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtDestroyApplicationContext' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtDispatchEvent' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtCreateApplicationContext' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtRemoveEventHandler' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtAddEventHandler' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtAppAddTimeOut' ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtDisplayInitialize' collect2: ld returned 1 exit status make[2]: *** [bin/VTKJavaExecutable] Error 1 make[1]: *** [Wrapping/Java/CMakeFiles/VTKJavaExecutable.dir/all] Error 2 make: *** [all] Error 2 -- Dhanesh Ramachandram Visit my Photostream : http://flickr.com/photos/dhaneshr -------------- next part -------------- An HTML attachment was scrubbed... URL: From francois.bertel at kitware.com Wed May 27 08:49:38 2009 From: francois.bertel at kitware.com (Francois Bertel) Date: Wed, 27 May 2009 08:49:38 -0400 Subject: [vtkusers] VTK 5.5.0 Java wrapping build problem on Ubuntu 9.04 In-Reply-To: References: Message-ID: Hello Dhanesh, Try this: JAVA_AWT_LIBRARY:FILEPATH=/usr/lib/jvm/java-6-sun/jre/lib/i386/libjawt.so;/usr/lib/jvm/java-6-sun/jre/lib/i386/xawt/libmawt.so The following dashboard machine (arkadia) run on Ubuntu 9.04 x86 and builds with java wrapping on: http://www.cdash.org/CDash/viewNotes.php?buildid=341695 Regards. On Wed, May 27, 2009 at 6:23 AM, Dhanesh Ramachandram, PhD wrote: > Hi all, > > I'm experiencing some problem at 98%? when building VTK that I checked out > through CVS. Here are the errors..appreciate some help pls...: > > [ 98%] Built target VTKJava > Linking CXX executable ../../bin/VTKJavaExecutable > ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtRemoveTimeOut' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to > `XtVaAppCreateShell' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtRealizeWidget' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtDestroyWidget' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to > `XtSetKeyboardFocus' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtWindow' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtAppNextEvent' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to > `XtToolkitInitialize' > ../../bin/libvtkRenderingJava.so.5.5.0: undefined reference to `JAWT_GetAWT' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to > `applicationShellWidgetClass' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtOpenDisplay' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to > `XtDestroyApplicationContext' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtDispatchEvent' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to > `XtCreateApplicationContext' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to > `XtRemoveEventHandler' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to > `XtAddEventHandler' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to `XtAppAddTimeOut' > ../../bin/libvtkRendering.so.5.5.0: undefined reference to > `XtDisplayInitialize' > collect2: ld returned 1 exit status > make[2]: *** [bin/VTKJavaExecutable] Error 1 > make[1]: *** [Wrapping/Java/CMakeFiles/VTKJavaExecutable.dir/all] Error 2 > make: *** [all] Error 2 > > > > > -- > Dhanesh Ramachandram > Visit my Photostream : > http://flickr.com/photos/dhaneshr > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > -- Fran?ois Bertel, PhD | Kitware Inc. Suite 204 1 (518) 371 3971 x113 | 28 Corporate Drive | Clifton Park NY 12065, USA From berk.geveci at kitware.com Wed May 27 09:56:02 2009 From: berk.geveci at kitware.com (Berk Geveci) Date: Wed, 27 May 2009 09:56:02 -0400 Subject: [vtkusers] More on VTK 5.0.4: hashing vtk class objects broken? In-Reply-To: <4A1CCD46.5010207@sci.utah.edu> References: <4A1CCD46.5010207@sci.utah.edu> Message-ID: <45d654b0905270656q2ddb92f5s6cfb1a9825e6b63@mail.gmail.com> This is definitely not intentional. Furthermore, I can't reproduce it on cvs head. Do you know what caused the problem between 5.0.3 and 5.0.4. Also, can you try 5.4 as I don't think we support 5.0 anymore? -berk On Wed, May 27, 2009 at 1:19 AM, Carlos Scheidegger wrote: > Here's a simpler way to trigger the issue I just mentioned. The core problem > is related to generating a hash from the vtk class object. On VTK 5.0.3 (and > Python 2.5.2), I get this: > >>>> import vtk >>>> hash(vtk.vtkObject) > 140169743808624 >>>> id(vtk.vtkObject) > 140169743808624 > > This seems to me the correct behavior. On VTK 5.0.4 (and Python 2.6.2), I > get this: > >>>> hash(vtk.vtkObject) > Traceback (most recent call last): > ?File "", line 1, in > AttributeError: mro >>>> id(vtk.vtkObject) > 3083232608L > > Is this an intended change? It is very convenient to use vtk classes in > python dictionaries... > > Thanks! > -carlos > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > From jrd5084 at psu.edu Wed May 27 14:35:02 2009 From: jrd5084 at psu.edu (John Durkin) Date: Wed, 27 May 2009 14:35:02 -0400 Subject: [vtkusers] using different values for hue and intensity Message-ID: Dear VTK users, I have vtkPolyData, which consists of points (x, y , z) along with associated scalar values that correspond to intensity. Right now I'm using a lookup table to set the hue of the points by their z value. What I want to know is if there is any way to change the intensity of the points based on the scalar value associated with the points. As far as I know vtklookuptable only takes one set of scalars and a mapper can only use one lookup table. Is there any way I can do this? Thanks, John Durkin From jpedrick at gmail.com Wed May 27 16:58:33 2009 From: jpedrick at gmail.com (Joshua Pedrick) Date: Wed, 27 May 2009 16:58:33 -0400 Subject: [vtkusers] Trouble with QVTK In-Reply-To: <4A16B4DB.6030805@elemtech.com> References: <1dfc97b50905120636p259f2f33lad4cad75295ac7a3@mail.gmail.com> <1dfc97b50905121016t3477cfem89d7be56f689dca9@mail.gmail.com> <1dfc97b50905210708s27f78e57nab1af6b255b044b4@mail.gmail.com> <4A15625B.1040303@elemtech.com> <1dfc97b50905210838g640e70cbwd7926d1a7de27c7a@mail.gmail.com> <11b83aa60905211708v32f0ccebsac060bdc48f2d47d@mail.gmail.com> <1dfc97b50905220632s6fa7add0mfd68dc80606ec665@mail.gmail.com> <4A16B4DB.6030805@elemtech.com> Message-ID: <1dfc97b50905271358y3f377295pc1c1cc45a20ee03a@mail.gmail.com> Removing the renwin->StereoCapableWindowOn() calls didn't change anything. :-/ On Fri, May 22, 2009 at 10:21 AM, Clinton Stimpson wrote: > > The code works for me too. > What if you remove both > renwin->StereoCapableWindowOn() > calls? > > Clint > > Joshua Pedrick wrote: > >> Hi Wagner, I figured it would... are you running under the same >> environment? I can only guess I must have something configured wrong. Does >> anyone have a clue how I might go about debugging this on my system? OpenGL >> works on my system. VTK works without Qt. Qt works without VTK. Could it be >> the latest version of Qt breaks VTK somehow? >> >> Thanks, >> -Joshua >> >> On Thu, May 21, 2009 at 8:08 PM, Wagner Sales > wsales at gmail.com>> wrote: >> >> Hi Joshua, >> >> I downloaded your code and compiled. To me, at least at first >> impression, works fine. I see the objects, change background, etc. >> >> Regards, >> >> Wagner >> >> >> >> 2009/5/21 Joshua Pedrick > >: >> > Ok, I guess I wasn't clear. I am using CentOS 5.2 64-bit. Qt sdk >> 2009.02 (Qt >> > v4.5.1). I've built VTK to include GUISupport and Qt support. >> I've tried to >> > replicate the GUI4 example. Using the GUI 4 example I get all >> the correct >> > behavior, including changing the background, but I can not see >> any 3D VTK >> > objects(cone or sphere) in the RenderWindows. I've the relevent >> source >> > files. >> > >> > So, I was hoping for an example that actually worked or some >> advice as to >> > what I have done incorrectly. >> > >> > Regards, >> > -Joshua >> > >> > >> > On Thu, May 21, 2009 at 10:16 AM, Clinton Stimpson >> > >> > wrote: >> >> >> >> There are examples in VTK/Examples/GUI/Qt. >> >> Both SimpleView/ and Events/ have designer .ui files. >> >> >> >> Clint >> >> >> >> Joshua Pedrick wrote: >> >>> >> >>> Does anyone have a working example using QVTK + QtDesigner on >> Linux that >> >>> I could try to compare? >> >>> >> >>> On Tue, May 12, 2009 at 1:16 PM, Joshua Pedrick >> >> >>> >> wrote: >> >>> >> >>> Hello again Leo, >> >>> Here's my code once again, but distilled and reordered >> a bit. >> >>> I removed all the Deletes and whatnot. I'm still not getting >> >>> anything but the gradient background. Any clues? >> >>> I downloaded and compiled VTK-5.4 with QVTK, using Qt >> version >> >>> 4.5.1 from Qt SDK 2009.02. Still no luck. So the latest VTK >> from >> >>> CVS and version 5.4 aren't working. I can't be the only one >> using >> >>> QVTK. I am not using cmake to build my project, could this >> be the >> >>> problem? Are there some compiler flags I need to set for >> QVTK to >> >>> work? >> >>> >> >>> >> >>> Regards, >> >>> -Joshua >> >>> >> >>> void MainWindow::SetupScene() >> >>> { >> >>> QVTKWidget* qvtkwidget = ui.qvtkWidget; >> >>> >> >>> qvtkwidget->GetRenderWindow()->DoubleBufferOff(); >> >>> >> >>> >> >>> //Put cone in window >> >>> { >> >>> vtkConeSource *cone = vtkConeSource::New(); >> >>> >> >>> //Create Cone Mapper. >> >>> vtkPolyDataMapper *coneMapper = >> vtkPolyDataMapper::New(); >> >>> coneMapper->SetInputConnection(cone->GetOutputPort()); >> >>> >> >>> //Create Cone Actor >> >>> >> >>> vtkActor *coneActor = vtkActor::New(); >> >>> coneActor->SetMapper(coneMapper); >> >>> >> >>> //Create Cone Renderer >> >>> vtkRenderer *ren = vtkRenderer::New(); >> >>> ren->SetBackground(0,0,0); >> >>> ren->SetBackground2(1,1,1); >> >>> ren->GradientBackgroundOn(); >> >>> >> >>> ren->AddActor(coneActor); >> >>> >> >>> qvtkwidget->GetRenderWindow()->AddRenderer(ren); >> >>> >> >>> } >> >>> >> >>> } >> >>> >> >>> 2009/5/12 L.J. van Ruijven > >> >>> > >> >> >>> >> >>> Hi Joshua, >> >>> >> >>> I allready deleted your first mail, so I cannot check >> the code >> >>> again, but I think here the background renderer is >> added. So >> >>> that one is really drawn in the render window. >> >>> But if I remember well, you created the pipeline for >> the cone >> >>> in a separate fragment. And in the end of this fragment you >> >>> deleted the cone renderer, but you never added it to the >> >>> render window. >> >>> >> >>> regards, >> >>> >> >>> Leo. >> >>> >> >>> >> >>> ----- Original Message ----- >> >>> From: Joshua Pedrick > >> >>> >> >> >>> Date: Tuesday, May 12, 2009 3:36 pm >> >>> Subject: Re: Trouble with QVTK >> >>> To: vtkusers at vtk.org >> > >> >>> Cc: "L.J. van Ruijven" > >> >>> > >> >> >>> >> >>> >> >>> > L.J. I think I do this in MainWindow::SetupScene() at the >> >>> very end: >> >>> > >> >>> > >> qvtkwidget->GetRenderWindow()->AddRenderer(ren); >> >>> > >> qvtkwidget->GetRenderWindow()->BordersOn(); >> >>> > >> >>> > ren->Delete(); >> >>> > >> >>> > Is this not the correct way to add a renderer? I do >> get the >> >>> lovely gradient >> >>> > background I applied to the renderer, but no actors. The >> >>> gradient background >> >>> > makes me think the renderer is properly connected to the >> >>> render window. >> >>> > >> >>> > I'm going to compile the stable version of VTK today and >> >>> see how it goes. >> >>> > I'm really suspecting there is a bug in the CVS QVTK. >> >>> > >> >>> > Regards >> >>> > -Joshua >> >>> > >> >>> > 2009/5/12 L.J. van Ruijven >> >> >>> > >> >> >>> > >> >>> > > Hi Joshua, >> >>> > > >> >>> > > I think you forgot to connect the renderer to the >> >>> renderwindow. Somewhere >> >>> > > you should add the statement renWin->AddRenderer(ren). >> >>> > > >> >>> > > regards, >> >>> > > >> >>> > > Leo >> >>> > > >> >>> > > >> >>> > > >> >>> > >> >>> >> >>> >> >>> >> >>> >> >> ------------------------------------------------------------------------ >> >>> >> >>> _______________________________________________ >> >>> Powered by www.kitware.com >> >>> >> >>> Visit other Kitware open-source projects at >> >>> http://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 >> >>> >> >> >> >> >> >> _______________________________________________ >> >> Powered by www.kitware.com >> >> >> >> Visit other Kitware open-source projects at >> >> http://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 >> > >> > >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://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 >> > >> > >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 jourdain at artenum.com Wed May 27 17:16:21 2009 From: jourdain at artenum.com (Sebastien Jourdain) Date: Wed, 27 May 2009 23:16:21 +0200 Subject: [vtkusers] Solving general issues in compiling VTK with Java Wrapping on Windows ! In-Reply-To: References: Message-ID: I've finally found a solution to my previous issues where I wanted to produced a VTK for windows with Java wrapping that could work on any Windows of the same kind. First of all : Never use Visual Studio Express (any version) if you want to distribute your code. It won't work on the targeted windows if they don't have a Visual Studio Express installed. Therefore you have to use a C++ compiler that allow redistribution of the produced binary. I've used the Borland one. But the compilation was not strait forward. I had to convert the file jawt.lib with a tool provided with borland called coff2mof and used the converted file in the CMake for the compilation. Once the compilation is done and works locally it has a great chance that it won't work on Windows that don't have C++ tools. To solved the portability issue, I've used the "Dependency Walker" tool to look into the dll files and check the missing one. And I've found that the vtkCommon was using the cc3280mt.dll that was on the computer used for the compilation but not on standard Windows. So I've added the file in my VTK package inside the bin directory with the other VTK dll's. At this point you are quite close to success ! But, on some computer you might get an error during the loading of the vtkRendering library specially if you use a script that append on the head or at the tail of the PATH the directory that contains the vtk dll before launching your java application. To solved this last error I've made a script that override the whole PATH environment variable with only the directory that own the VTK dll and a full path to the java executable of the JRE to execute my application. like : set PATH=..\vtk c:\jre1.6\bin\java -cp .;..\vtk.jar your.package.name.MainClass Instead of : set PATH=..\vtk;%PATH% java -cp .;..\vtk.jar your.package.name.MainClass And know, it works on all the 5 computer that I could used for my test. Of course I can't guaranty that it is the absolute solution, but right know, for me, it seems to work ! I would like to thanks Frederic Danesi who give me some good clues on my issues after that I've posted on the VTK mailing list. (He directly replied to me in french ;-) So, I hope this could help someone someday... Sebastien Jourdain From jourdain at artenum.com Wed May 27 17:26:35 2009 From: jourdain at artenum.com (Sebastien Jourdain) Date: Wed, 27 May 2009 23:26:35 +0200 Subject: [vtkusers] Where should I commit or send code contribution ? In-Reply-To: References: Message-ID: <058149AF-70B1-41CC-9025-6B954B79B697@artenum.com> It's a new vtk class named vtkTorus that implement vtkImplicitFunction. It's pretty easy to integrate into VTK. Just add in the CMakeList of the Filtering directory the vtkTorus.cxx entry. And of course, you will need to copy the .h and the .cxx inside the Filtering vtk directory... Thats it, nothing more, the Java wrapping works perfectly. So, what should I do to provide you that piece of code ? Regards, Sebastien Jourdain PS: I have the vtkTorusSource but only in Java. If you want, I can write it in C++ if you like... From habe36 at gmail.com Wed May 27 20:52:28 2009 From: habe36 at gmail.com (ABE Hiroshi) Date: Thu, 28 May 2009 09:52:28 +0900 Subject: [vtkusers] OffScreen and blank window In-Reply-To: <4A1C3035.4020604@elemtech.com> References: <912CF395-0850-4511-99FD-18511F01481F@gmail.com> <423e920905200654s295655a6t8c68abda6fcfd423@mail.gmail.com> <94068DDA-3788-4D6C-B6CE-39ABAE453F93@gmail.com> <4A156112.9030009@elemtech.com> <9742F5B1-6639-4CD1-BEA2-8F58074CD3B3@gmail.com> <4A1C3035.4020604@elemtech.com> Message-ID: Dear Clint and all, On 2009/05/27, at 3:08, Clinton Stimpson wrote: > > Ok, that needed fixed for other reasons, and makes a difference if > hardware offscreen is attempted but not supported. > Apparently, hardware offscreen creates the window and leaves it. > Doesn't seem like offscreen to me :) Exactly. Carbon implementation actually does, I guess. > You'll have to ask Kitware why they create/leave the window for > offscreen. > On the Mac, I thought offscreen simply worked by creating a window > and use that as the rendering target, but never show it. > I've looked into detail the code and compare the Win32RenderWindow and CarbonRenderWindow. I have not so much experiences on OpenGL so it would take more time to see. Actually, I use wxVTKRenderWindowInteractor, and my sample single window program which can switch On / Off Screen, works as expected. But multi-window (using wxNotebook) sample program doesn't render the hidden window even using OffScreen rendering of VTK (SetOffScreenRendering(1)). Any suggestions are really appreciated. Thank you in advance. Best, ABE Hiroshi from Tokorozawa, JAPAN From luca.ramundo at hotmail.it Thu May 28 04:08:35 2009 From: luca.ramundo at hotmail.it (Luca Ramundo) Date: Thu, 28 May 2009 10:08:35 +0200 Subject: [vtkusers] FW: call glColorMask from vtk In-Reply-To: <7ba9d6a30905260945s13a8cb5ag94a65a2e79a5bfc6@mail.gmail.com> References: <7ba9d6a30905260945s13a8cb5ag94a65a2e79a5bfc6@mail.gmail.com> Message-ID: From: luca.ramundo at hotmail.it To: utkarsh.ayachit at kitware.com Subject: RE: [vtkusers] call glColorMask from vtk Date: Thu, 28 May 2009 10:07:48 +0200 Hi.. I listen to your suggestion, but I think thath glColorMask can be used only after this instruction: myVtkRenderWindow->Render(); ...is it right? So glColorMash is applyed at all scene while I'd like to use glColorMask only for a particular actor (a kind of box which serves as a mask). Whath do you think about this? Thanks a lot... Luca Date: Tue, 26 May 2009 12:45:54 -0400 Subject: Re: [vtkusers] call glColorMask from vtk From: utkarsh.ayachit at kitware.com To: luca.ramundo at hotmail.it CC: vtkusers at vtk.org Try implementing your own mapper or actor. You can make openGL calls in Render methods in these classes. Utkarsh On Tue, May 26, 2009 at 10:48 AM, Luca Ramundo wrote: hi all, I need your help for my great problem. I'd like to visualize a 3D object in my scene with the follow properties: It must to be invisible but not trasparence because it has to hide some object inside it. I know that there is a openGL method to do it: glColorMask(). It is used to write or not in frame buffer some color component. I'd like if there is something to resolve my problem in VTK or the way to call this openGL method from my vtk object. Thanks a lot, Luca Quali sono le parole pi? cliccate? Scopri la top! _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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 Scrivi, parla e gioca con i tuoi amici! Scarica Messenger 2009! _________________________________________________________________ Resta in contatto con gli amici, comunica con Messenger! http://messenger.it/cominciaAcomunicare.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tonee47 at yahoo.com Thu May 28 10:02:23 2009 From: tonee47 at yahoo.com (John Eke) Date: Thu, 28 May 2009 07:02:23 -0700 (PDT) Subject: [vtkusers] vtkPicker picks an actor that isnt remotely close to the pick point In-Reply-To: <1224709598.17399.451.camel@lenovo.local.net> References: <1224266608.17399.166.camel@lenovo.local.net> <20081021214323.5C2272190@public.kitware.com> <7b3bdec70810212323m4b406af8t6d21561e85b6494c@mail.gmail.com> <20081022155316.C14D13A39@public.kitware.com> <7b3bdec70810220955h53c43f95h6e7418ec4b35c89e@mail.gmail.com> <7b3bdec70810221029j4735ae0l9e78687d06292956@mail.gmail.com> <1224709506.17399.450.camel@lenovo.local.net> <1224709598.17399.451.camel@lenovo.local.net> Message-ID: <480293.94647.qm@web38901.mail.mud.yahoo.com> Hi Guys, I have a scenario where I am trying to enable annotations on images displayed in a vtkImageActor. When I click on the image, I place a small marker at that point on the image. Now when I click on that marker, it allows me to do other things like enter notes etc. Problem is, I use vtkPicker to do the pick, and when I click on the marker it works, problem is I move several pixels AWAY from the marker and when I attempt a pick, I still pick the same marker. It seems the markers have a few pixels around them where if you click, you can still pick the actor. IS there any way to change this? Are there any params in vtkPicker I can set to make sure that the markers should ONLY be picked if the intersect DIRECTLY with the pick point? Thanks John E -------------- next part -------------- An HTML attachment was scrubbed... URL: From karthik.krishnan at kitware.com Thu May 28 10:09:25 2009 From: karthik.krishnan at kitware.com (Karthik Krishnan) Date: Thu, 28 May 2009 10:09:25 -0400 Subject: [vtkusers] Where should I commit or send code contribution ? In-Reply-To: <058149AF-70B1-41CC-9025-6B954B79B697@artenum.com> References: <058149AF-70B1-41CC-9025-6B954B79B697@artenum.com> Message-ID: <9ddb27260905280709h6bbf86f1ib17b4bff18dcfc34@mail.gmail.com> Sebastien: Thanks for your contribution. The procedure is to log a feature request at http://vtk.org/Bug which includes a patch or your classes along with a unit test that exercises each class you submit. Thanks -- Karthik Krishnan R&D Engineer, Kitware Inc. Ph: 518 881 4919 Fax: 518 371 4573 On Wed, May 27, 2009 at 5:26 PM, Sebastien Jourdain wrote: > It's a new vtk class named vtkTorus that implement vtkImplicitFunction. > > It's pretty easy to integrate into VTK. Just add in the CMakeList of the > Filtering directory the vtkTorus.cxx entry. And of course, you will need to > copy the .h and the .cxx inside the Filtering vtk directory... Thats it, > nothing more, the Java wrapping works perfectly. > > So, what should I do to provide you that piece of code ? > > Regards, > > Sebastien Jourdain > > PS: I have the vtkTorusSource but only in Java. If you want, I can write it > in C++ if you like..._______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 Thu May 28 11:57:37 2009 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 28 May 2009 11:57:37 -0400 Subject: [vtkusers] [vtk-developers] rotate/zoom applied on one actor In-Reply-To: <002b01c9df9f$449bb8e0$a500a8c0@olympe.local> References: <002b01c9df9f$449bb8e0$a500a8c0@olympe.local> Message-ID: Yes. Use vtkInteractorStyle[Trackball|Joystick]actor. You should be able to do that interactively simply by hitting 'a' which switches the from 'c'amera to 'a'ctor. (see vtkInteractorStyleSwitch). David E DeMarle Kitware, Inc. R&D Engineer 28 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-371-3971 x109 On Thu, May 28, 2009 at 10:19 AM, toulgen wrote: > > > Hi, > > > > In vtkRenderer I have two actors: actor1 and actor2. > > > > My code: > > vtkRenderer *aRenderer = vtkRenderer::New(); > > vtkRenderWindow *renWin = vtkRenderWindow::New(); > > vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); > > > > > > renWin->AddRenderer(aRenderer); > > iren->SetRenderWindow(renWin); > > > > ? > > aRenderer->AddActor(actor1); > > aRenderer->AddActor(actor2); > > ? > > > > > > iren->Initialize(); > > iren->Start(); > > > > > > It is possible to rotate/zoom only one actor with mouse? > > For example, rotate/zoom the Actor1 and the Actor2 is visible but the > rotation/zoom applied with mouse is not applied on this actor. > > > > Thx > > ToulGen > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtk-developers > > > From nkwmailinglists at gmail.com Thu May 28 14:32:21 2009 From: nkwmailinglists at gmail.com (kent williams) Date: Thu, 28 May 2009 13:32:21 -0500 Subject: [vtkusers] vtkPicker picks an actor that isnt remotely close to the pick point In-Reply-To: <480293.94647.qm@web38901.mail.mud.yahoo.com> References: <1224266608.17399.166.camel@lenovo.local.net> <20081021214323.5C2272190@public.kitware.com> <7b3bdec70810212323m4b406af8t6d21561e85b6494c@mail.gmail.com> <20081022155316.C14D13A39@public.kitware.com> <7b3bdec70810220955h53c43f95h6e7418ec4b35c89e@mail.gmail.com> <7b3bdec70810221029j4735ae0l9e78687d06292956@mail.gmail.com> <1224709506.17399.450.camel@lenovo.local.net> <1224709598.17399.451.camel@lenovo.local.net> <480293.94647.qm@web38901.mail.mud.yahoo.com> Message-ID: <44f773f50905281132n44d50ddu6f22c3a69a86f563@mail.gmail.com> the vtkPicker class lets you set the tolerance, for picking. The default tolerance is apparently a bit too loose for your taste. >From the documentation: > virtual void vtkPicker::SetTolerance(double) [virtual] > > Specify tolerance for performing pick operation. Tolerance is specified as fraction of rendering window size. > (Rendering window size is measured across diagonal.) The way this works is a little squirrelly, because you probably care about a maximum distance from the exact pixel center, in pixels. But this function wants a fraction of the window size (as measured diagonally), which you'll have to compute based on the window geometry. And if your window can be resized, you'll have to watch for resize events and update the picker tolerance. But the reason you can pick a few voxels away from the particular voxel is that it's tricky to pick small features with the mouse pointer. If you set the tolerance too low, it will make it rough for users to pick anything. On Thu, May 28, 2009 at 9:02 AM, John Eke wrote: > Hi Guys, > > I have a scenario where I am trying to enable annotations on images > displayed in a vtkImageActor. When I click on the image, I place a small > marker at that point on the image. Now when I click on that marker, it > allows me to do other things like enter notes etc. > > Problem is, I use vtkPicker to do the pick, and when I click on the marker > it works, problem is I move several pixels AWAY from the marker and when I > attempt a pick, I still pick the same marker. It seems the markers have a > few pixels around them where if you click, you can still pick the actor. IS > there any way to change this? Are there any params in vtkPicker I can set to > make sure that the markers should ONLY be picked if the intersect DIRECTLY > with the pick point? > > Thanks > > John E > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > From nkwmailinglists at gmail.com Thu May 28 14:41:11 2009 From: nkwmailinglists at gmail.com (kent williams) Date: Thu, 28 May 2009 13:41:11 -0500 Subject: [vtkusers] [Insight-users] Need published paper.. In-Reply-To: <004e01c9de2a$8825a150$c4d1844f@Hossein> References: <4A188023.9040002@kitware.com> <004e01c9de2a$8825a150$c4d1844f@Hossein> Message-ID: <44f773f50905281141r137d4c77na7c339cbc5d1e7e2@mail.gmail.com> 1. VTK is a portable high-level graphics library. Normally you never interact with OpenGL -- you use the VTK API to do rendering independent of the underlying graphics language. The VTK API is system-independent -- the same VTK Code works on Windows, Mac OS X, Linux, SGI, Sun etc. 2. Using a combination of VTK with Tcl and the Tk system, you can write applications that will run without changes on all supported platforms. It is possible to use VTK with several GUI libraries, like wxWindows, Qt, and KWWidgets. It is also possible to hook into non-portable systems like MFC. Look at the VTK examples in VTK/Examples/GUI/Win32/vtkMFC for how it is possible to integrate VTK into MFC applications. On Tue, May 26, 2009 at 12:50 PM, Hossein Ghadiri wrote: > Really thanks > This link helped me. > My essential questions of which I can not find obvious answer are: > 1- Do we need to directly use OpenGL LIBs to view and interact with images > even when we are working with VTK? > 2- What is better object in MFC to visualize and interact with images when > we use VTK, for example which one could be better: CBitmap, CImage, or we > have to use more sophisticated programming to have a GUI in MFC when using > VTK/ITK? > > Hossein > > > -----Original Message----- > From: Julien Jomier [mailto:julien.jomier at kitware.com] > Sent: Sunday, May 24, 2009 3:31 AM > To: Hossein Ghadiri > Cc: 'J?r?me'; insight-users at itk.org; vtkusers at vtk.org > Subject: Re: [Insight-users] [vtkusers] Need published paper.. > > Hossein, > > You just need to click on the link and the browser will ask you to > download the file. Otherwise you can use this link: > > http://www.insight-journal.org/download/fulldownload/zip/141/1/?downloadonly > =1 > > > Let us know if you have any other issues, > Julien > > Hossein Ghadiri wrote: >> Hi, >> >> Yes, but the link may be corrupted; I could not _Save Target As_ the zip >> file. >> >> I get another paper from this issue but this one not! >> >> Hossein >> >> >> >> >> >> ------------------------------------------------------------------------ >> >> *From:* J?r?me [mailto:jerome.velut at gmail.com] >> *Sent:* Saturday, May 23, 2009 11:49 PM >> *To:* Hossein Ghadiri >> *Cc:* vtkusers at vtk.org; insight-users at itk.org >> *Subject:* Re: [vtkusers] Need published paper.. >> >> >> >> Hi, >> By following the links you gave, I found a zip file that contains the > paper. >> >> Jerome >> >> 2009/5/24 Hossein Ghadiri > > >> >> Dears, >> >> How can I get the below paper? >> >> ? ?"How to use ITK and MFC" by Su Y. Published in *The Insight Journal* >> - *2007 January - June* >> . >> >> Does it need special registration? >> >> >> >> Hossein >> >> >> >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 >> >> >> >> >> ------------------------------------------------------------------------ >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://www.itk.org/mailman/listinfo/insight-users > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.itk.org/mailman/listinfo/insight-users > From nkwmailinglists at gmail.com Thu May 28 14:49:53 2009 From: nkwmailinglists at gmail.com (kent williams) Date: Thu, 28 May 2009 13:49:53 -0500 Subject: [vtkusers] vtkXMLImageDataWriter, writes file? In-Reply-To: References: Message-ID: <44f773f50905281149m2bae2671l672ba8b2248bf434@mail.gmail.com> If you specify a relative path (i.e. a path not beginning with '/') writing a file relative to the current working directory. This isn't a VTK thing, it's pretty much universal to all operating systems. And to specify where to write a file, you'd prepend the filename with that directory path. There are a number of platform-independent path functions available in Kitware's kwsys library -- this shows up as vtksys in VTK. The vtksys::SystemTools class has a number of path manipulation tools that make dealing with this sort of thing a little easier. On Tue, May 26, 2009 at 2:27 AM, Chris N wrote: > Hi, > > I'm currently trying to make use of Paraview program but I need a *.vti type > file.? So I'm trying to make use of vtkXMLImageDataWriter and read through > its library details.? I noticed they had a test file which I used it's few > lines of writing out a file.? Such as... > > ??? //WRITER - Save the result of the filter in a file > ??? vtkXMLImageDataWriter *writer = vtkXMLImageDataWriter::New(); > > writer->SetInputConnection(vtkPolyDataMapper::skinMapper->GetOutputPort()); > ??? writer->SetFileName("image.vti"); > ??? writer->SetDataModeToBinary(); > ??? writer->Write(); > ??? writer->Delete(); > > My problem is when I run the program I don't have an image.vti file > anywhere.? I've scanned through my computer a few times but nothing comes > up.? What are some possible problems why it doesn't run?? Also where would > it write my file to?? Can I set my directory location within the argument of > SetFileName() function?? Thanks > > Chris > > ________________________________ > Hotmail? goes with you. Get it on your BlackBerry or iPhone. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > From nkwmailinglists at gmail.com Thu May 28 15:03:10 2009 From: nkwmailinglists at gmail.com (kent williams) Date: Thu, 28 May 2009 14:03:10 -0500 Subject: [vtkusers] recovering vtkSpheereSource from vtkAssemply, HOW?! In-Reply-To: References: Message-ID: <44f773f50905281203r85f5249v97585ef6c7fba752@mail.gmail.com> I don't know what you mean by 'change the allocated spheres.' If you mean e.g. change the radius of a sphere in the assembly, if you keep a pointer to the SphereSource, you can change its radius and call Update and I believe it will propogate the fact that it has changed up the pipeline, triggering re-rendering of the view. If you mean set the actors to use new, different geometry, then you use vtkCollection::NewIterator() to step through the actors and do whatever you want to with them. On Wed, May 27, 2009 at 4:27 AM, Giancarlo Amati wrote: > Hello vtkUsers, > > I have a vtkAssembly with 6 actors. each actor refers to a vtkSphereSource. > Now, > the AddPart of vtkAssemply takes as input an actor, so i wonder if there is > any way to recover > the correspondent vtkSphereSource object allocated, passing through the > property collection I can get from the vtkAssembly. > that's because I need to change the allocated spheres. > > am I complicating my life or is there any other way to do it? > > very kind regards. > GC > > ________________________________ > Scrivi, parla e gioca con i tuoi amici! Scarica Messenger 2009! > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > From kall at mayo.edu Thu May 28 15:21:32 2009 From: kall at mayo.edu (Kall, Bruce A.) Date: Thu, 28 May 2009 14:21:32 -0500 Subject: [vtkusers] Volume Rendering clipping and ImageReslice Message-ID: <4A1EE43C.6040802@mayo.edu> I can successfully use the vtkPlane SetPlane and SetOrigin functions to clip a volume rendering at the location and angle I want to. I know want to put in my clipped model a 'slice' from my original volume in the exact same location/orientation as the clip plane. I've played around with vtkImageReslice, but can't seem to figure out the correct way to go from specifying the plane orientation and location using a normal and point in the model coordinates (used by SetPlane() and SetOrigin() for vtkPlane) to specify the same plane orientation and location to use in ImageReslice so that the resultant slice is along the same plane and location as the clip plane. Does anyone have an example of clipping a volume rendering with a vtkPlane and then sticking in an oblique image cut at the same angle/location so it lines up on the clipping plane in the rendered scene? To clip I use: clipping_plane->SetNormal(nx,ny,nz); clipping_plane->SetOrigin(x3d,y3d,z3d); I do have the 4x4 transform that I've computed the normal (nx,ny,nz) from. I do want the 'reslice' to be of the same 'size' as the original 3d volume (e.g, 512pixels by 512 pixels which each have a uniform voxel size of 1.1mm^3). Is there something better to use that vtkImageReslice? Thanks, Bruce From esgourit at Central.UH.EDU Thu May 28 15:37:44 2009 From: esgourit at Central.UH.EDU (Sgouritsa, Eleni ) Date: Thu, 28 May 2009 14:37:44 -0500 Subject: [vtkusers] interactive window/level in polydata Message-ID: <13960CF0B0069549A81551320E2F6779019F92E1@EX1SERVER2.cougarnet.uh.edu> Hello, I am visualizing a 3D mesh (polydata) with colors based on the Scalars of the polydata. I was wondering if there is a way to interactively change window/level similar to what is happening using the right mouse button in the class vtkImagePlaneWidget. Regards, Lena -------------- next part -------------- An HTML attachment was scrubbed... URL: From nkwmailinglists at gmail.com Thu May 28 16:15:58 2009 From: nkwmailinglists at gmail.com (kent williams) Date: Thu, 28 May 2009 15:15:58 -0500 Subject: [vtkusers] interactive window/level in polydata In-Reply-To: <13960CF0B0069549A81551320E2F6779019F92E1@EX1SERVER2.cougarnet.uh.edu> References: <13960CF0B0069549A81551320E2F6779019F92E1@EX1SERVER2.cougarnet.uh.edu> Message-ID: <44f773f50905281315n37dac20bn5edfcbaa40c074b@mail.gmail.com> My short answer is 'I don't know' -- but I think what you'd need to do is to add an observer to the RenderWindowInteractor, and change the lighting for the renderer. Or something like that. On Thu, May 28, 2009 at 2:37 PM, Sgouritsa, Eleni wrote: > Hello, > I am visualizing a 3D mesh (polydata) with colors based on the Scalars of > the polydata. I was wondering if there is a way to interactively change > window/level similar to what is happening using the right mouse button in > the class vtkImagePlaneWidget. > > Regards, > Lena > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > From jourdain at artenum.com Thu May 28 18:36:53 2009 From: jourdain at artenum.com (Sebastien Jourdain) Date: Fri, 29 May 2009 00:36:53 +0200 Subject: [vtkusers] Where should I commit or send code contribution ? In-Reply-To: <9ddb27260905280709h6bbf86f1ib17b4bff18dcfc34@mail.gmail.com> References: <058149AF-70B1-41CC-9025-6B954B79B697@artenum.com> <9ddb27260905280709h6bbf86f1ib17b4bff18dcfc34@mail.gmail.com> Message-ID: <8852FF91-94C2-4C59-A070-E4B1C9E68ADB@artenum.com> Done, it's available here : http://vtk.org/Bug/view.php?id=9080 You are welcome ! Sebastien On 28 mai 09, at 16:09, Karthik Krishnan wrote: > Sebastien: > > Thanks for your contribution. The procedure is to log a feature > request at http://vtk.org/Bug which includes a patch or your classes > along with a unit test that exercises each class you submit. > > Thanks > > > -- > Karthik Krishnan > R&D Engineer, > Kitware Inc. > Ph: 518 881 4919 > Fax: 518 371 4573 > > > On Wed, May 27, 2009 at 5:26 PM, Sebastien Jourdain > wrote: > It's a new vtk class named vtkTorus that implement > vtkImplicitFunction. > > It's pretty easy to integrate into VTK. Just add in the CMakeList of > the Filtering directory the vtkTorus.cxx entry. And of course, you > will need to copy the .h and the .cxx inside the Filtering vtk > directory... Thats it, nothing more, the Java wrapping works > perfectly. > > So, what should I do to provide you that piece of code ? > > Regards, > > Sebastien Jourdain > > PS: I have the vtkTorusSource but only in Java. If you want, I can > write it in C++ if you > like..._______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > > From darren.weber.lists at gmail.com Thu May 28 21:17:06 2009 From: darren.weber.lists at gmail.com (Darren Weber) Date: Thu, 28 May 2009 18:17:06 -0700 Subject: [vtkusers] How to build libraries for both 32-bit and 64-bit architectures In-Reply-To: References: <67F08092-7233-45D1-9840-45CA6E248A5D@mac.com> <48DFD08B.6020206@wanadoo.fr> <48DFDD4C.5000407@wanadoo.fr> <39EEE583-DC7A-4E23-8B27-06AF89B6EBFF@mac.com> <20080929150618.1759000977@kingu.local> Message-ID: On Mon, Sep 29, 2008 at 8:18 AM, Elvis Dowson wrote: > Hi Sean, Thanks for the advice, it really does reflect > what I've just discovered. Trying to get things to move to 64-bits on a new > Mac OS X 10.5.x installation is quite involved. > > I had more problems trying to compile the snapshot version of Qt-4.5.x for > 64-bits, so I'm going to wait till they release the official version and > then try the Cocoa bindings. > > On Sep 29, 2008, at 7:06 PM, Sean McBride wrote: > > > > However, perhaps you are doing too many things at once. Although both > VTK and Cocoa support 64 bit, they are both much better tested in 32 > bit. I would suggest working only in 32 bit. Are you using 64 bit > because it was the only way to get Cocoa support with the new Qt? I > suspect Qt is also much better tested in 32 bit. Considering you are > using a new Qt with experimental Cocoa support, adding 64 bit into the > mix will only complicate things. > > > Yes, as I'm discovering right now. For the moment, I'm going to make do > with Carbon support and try to get things to work in 32-bits. > > > > Also, are you building libjpeg and libpng for VTK's sake? It would be > simpler to just use the versions that come with VTK itself, instead of > trying to use separate versions. Just building VTK with default > settings will use the built-in versions of those libs. > > > Actually, I needed this for grass-6.4.x, which requires that I install the > following libraries > > proj-4.6.0 > gdal-1.5.2 > libjpeg-6b > libtiff-3.8.2 > libpng-1.2.31 > fftw-2.1.5 > > So, I got stuck with libjpeg-6b, which I understand is problematic to > compile for 64-bits for some reason. > Looks like grass, in some form, is ported in MacPorts: [ dweber at X ~ ]$ port info grass grass @6.3.0 (gis) Variants: darwin_9, mysql5, postgresql83, sqlite3, universal GRASS is a Geographic Information System (GIS) used for geospatial data management and analysis. Homepage: http://grass.osgeo.org Library Dependencies: fftw, freetype, gdal, geos, jpeg, libpng, openmotif, proj, tk Platforms: darwin Maintainers: nomaintainer at macports.org I've done a lot of work to get vtk-devel into Macports too. You might learn a few things from the MacPorts port files, see: https://trac.macports.org/browser -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhaneshr at gmail.com Fri May 29 01:11:54 2009 From: dhaneshr at gmail.com (Dhanesh Ramachandram, PhD) Date: Fri, 29 May 2009 13:11:54 +0800 Subject: [vtkusers] Problems in VTK Java & Linux Message-ID: We're trying to port an Eclipse RCP application which uses VTK and ITK wrapped as plug-ins from Windows to Linux (Ubuntu 9.04). We've completed the initial steps of building the Linux shared libraries of VTK and ITK with Java Wrapping enabled. When our application tries to access VTK libraries, it seems that there is a problem. We have set the appropriate LD_LIBRARY_PATH etc... What can be the issue here ? It seems that in Linux, the shared libraries have the prefix 'lib' (ex: "libvtkCommonJava.so") but somehow, from the error messages, it seems that the wrapping procedure results in code that tries to access the library "vtkCommonJava". Could this be the problem ? Here's the error we get: Java.lang.UnsatisfiedLinkError: no vtkCommonJava in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at vtk.vtkPanel.(vtkPanel.java:26) at com.dvtrs.main.viewer.view3DVTK.createPartControl(view3DVTK.java:201) at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:371) at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:230) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594) at org.eclipse.ui.internal.Perspective.showView(Perspective.java:2131) at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1062) at org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.java:3773) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3770) at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3746) at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:165) at org.eclipse.ui.handlers.ShowViewHandler.openOther(ShowViewHandler.java:109) at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:77) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:281) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:247) at org.eclipse.ui.internal.ShowViewMenu$3.run(ShowViewMenu.java:134) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at com.dvtrs.main.MainApplication.start(MainApplication.java:24) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) at org.eclipse.equinox.launcher.Main.main(Main.java:1212) -- Dhanesh Ramachandram Visit my Photostream : http://flickr.com/photos/dhaneshr From bouzim at gmail.com Fri May 29 02:58:48 2009 From: bouzim at gmail.com (Denis Barbier) Date: Fri, 29 May 2009 08:58:48 +0200 Subject: [vtkusers] Problems in VTK Java & Linux In-Reply-To: References: Message-ID: <7b3bdec70905282358n38edb98bifccd559d773d3569@mail.gmail.com> On 2009/5/29 Dhanesh Ramachandram wrote: > We're trying to port an Eclipse RCP application which uses VTK and ITK > wrapped as plug-ins from Windows to Linux (Ubuntu 9.04). We've > completed the initial steps of building the Linux shared libraries of > VTK and ITK with Java Wrapping enabled. When our application tries to > access VTK libraries, it seems that there is a problem. We have set > the appropriate LD_LIBRARY_PATH etc... > What can be the issue here ? ?It seems that in Linux, the shared > libraries have the prefix 'lib' (ex: "libvtkCommonJava.so") but > somehow, from the error messages, it seems that the wrapping procedure > results in code that tries to access the library "vtkCommonJava". > Could this be the problem ? [...] No, "lib" is automatically prepended (and ".so" appended too). To debug this problem, you can add a static block static { System.out.println(System.getProperty("java.library.path")); } in a class to check java.library.path, maybe this property is modified when eclipse is launched. You can also check that $ ldd /path/to/libvtkCommonJava.so does not print any "not found" message. Denis From pbruyant at yahoo.com Fri May 29 03:36:16 2009 From: pbruyant at yahoo.com (Philippe Bruyant) Date: Fri, 29 May 2009 00:36:16 -0700 (PDT) Subject: [vtkusers] Which voxels are in any given object ? Message-ID: <582117.6133.qm@web110410.mail.gq1.yahoo.com> Hi there, I would like to import in a VTK scene objects stored in a VRML file, and I plan to use C++ class vtkVRMLImporter. Then, I would like to know which voxel belongs to which object, or alternatively the list of the voxels in any given object. How can I do this ? TIA, Phil -------------- next part -------------- An HTML attachment was scrubbed... URL: From puneet0288 at gmail.com Fri May 29 03:36:28 2009 From: puneet0288 at gmail.com (puneet agrawal) Date: Fri, 29 May 2009 13:06:28 +0530 Subject: [vtkusers] reg:vtkRayCastmapper Message-ID: <3e9fecde0905290036tc29cfa5t506625c545c3fcd0@mail.gmail.com> hii, I am working on volume rendering by using vtk.I use this vtkRayCastMapper but i need more quality in term of smoothness.Can anybody help me what i can do. and also is this vtk raycast mapper use super sampling or not and vtkEdge ray cast mapper is just give the spped up or it will also improve the quality of re From daviddoria at gmail.com Fri May 29 07:41:25 2009 From: daviddoria at gmail.com (David Doria) Date: Fri, 29 May 2009 07:41:25 -0400 Subject: [vtkusers] Close a rendering window? Message-ID: I would like to display some graphical content, then when the user presses 'q' for quit, the code execution continues after closing the window. vtkRenderWindow* renWin = vtkRenderWindow::New(); renWin->AddRenderer( ren ); renWin->SetSize( 800, 600); // Create an interactor vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New(); renWin->SetInteractor( iren ); vtkInteractorStyleTrackballCamera* style = vtkInteractorStyleTrackballCamera::New(); iren->SetInteractorStyle( style ); // Initialize and enter interactive mode iren->Initialize(); iren->Start(); //CLOSE THE WINDOW //continue with non-graphical code for(unsigned int i = 0; i < 1e5; i++) { std::cout << i << std::endl; } I didn't see any methods for closing the window in vtkRenderWindowInteractor or vtkRenderWindow - did I miss them? Or is this not a common thing to do? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From dreambuild at foxmail.com Fri May 29 07:43:05 2009 From: dreambuild at foxmail.com (=?gbk?B?0e+3qw==?=) Date: Fri, 29 May 2009 19:43:05 +0800 Subject: [vtkusers] DO I have to use vtkRenderWindow::Render() when I want to change an Actor's color? Message-ID: Hi, I use vtkUnstructuredGrid to Show lines.when I pick a cell, I want to change the cell's color.I know how to change it, but I don't know how to ask the render to update its new color.I used the vtkUnstructuredGrid 's modified().But it does nothing .I have to use vtkRenderWindow::Render() to render whole scene.it is really slow. How to update only the changed actor? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhaneshr at gmail.com Fri May 29 08:43:35 2009 From: dhaneshr at gmail.com (Dhanesh Ramachandram, PhD) Date: Fri, 29 May 2009 20:43:35 +0800 Subject: [vtkusers] Problems in VTK Java & Linux In-Reply-To: References: Message-ID: I just realised that I had enabled "RPATH" during compilation. Could this be the source of the problem ? On Fri, May 29, 2009 at 1:11 PM, Dhanesh Ramachandram, PhD wrote: > We're trying to port an Eclipse RCP application which uses VTK and ITK > wrapped as plug-ins from Windows to Linux (Ubuntu 9.04). We've > completed the initial steps of building the Linux shared libraries of > VTK and ITK with Java Wrapping enabled. When our application tries to > access VTK libraries, it seems that there is a problem. We have set > the appropriate LD_LIBRARY_PATH etc... > What can be the issue here ? ?It seems that in Linux, the shared > libraries have the prefix 'lib' (ex: "libvtkCommonJava.so") but > somehow, from the error messages, it seems that the wrapping procedure > results in code that tries to access the library "vtkCommonJava". > Could this be the problem ? > > Here's the error we get: > Java.lang.UnsatisfiedLinkError: no vtkCommonJava in java.library.path > ? ? ? ?at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709) > ? ? ? ?at java.lang.Runtime.loadLibrary0(Runtime.java:823) > ? ? ? ?at java.lang.System.loadLibrary(System.java:1030) > ? ? ? ?at vtk.vtkPanel.(vtkPanel.java:26) > ? ? ? ?at com.dvtrs.main.viewer.view3DVTK.createPartControl(view3DVTK.java:201) > ? ? ? ?at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:371) > ? ? ? ?at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:230) > ? ? ? ?at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594) > ? ? ? ?at org.eclipse.ui.internal.Perspective.showView(Perspective.java:2131) > ? ? ? ?at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1062) > ? ? ? ?at org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.java:3773) > ? ? ? ?at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) > ? ? ? ?at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3770) > ? ? ? ?at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3746) > ? ? ? ?at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:165) > ? ? ? ?at org.eclipse.ui.handlers.ShowViewHandler.openOther(ShowViewHandler.java:109) > ? ? ? ?at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:77) > ? ? ? ?at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:281) > ? ? ? ?at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) > ? ? ? ?at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) > ? ? ? ?at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) > ? ? ? ?at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:247) > ? ? ? ?at org.eclipse.ui.internal.ShowViewMenu$3.run(ShowViewMenu.java:134) > ? ? ? ?at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) > ? ? ? ?at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583) > ? ? ? ?at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500) > ? ? ? ?at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) > ? ? ? ?at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) > ? ? ? ?at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158) > ? ? ? ?at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401) > ? ? ? ?at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033) > ? ? ? ?at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384) > ? ? ? ?at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348) > ? ? ? ?at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200) > ? ? ? ?at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495) > ? ? ? ?at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) > ? ? ? ?at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490) > ? ? ? ?at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) > ? ? ? ?at com.dvtrs.main.MainApplication.start(MainApplication.java:24) > ? ? ? ?at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) > ? ? ? ?at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) > ? ? ? ?at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) > ? ? ? ?at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386) > ? ? ? ?at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) > ? ? ? ?at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > ? ? ? ?at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > ? ? ? ?at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > ? ? ? ?at java.lang.reflect.Method.invoke(Method.java:597) > ? ? ? ?at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) > ? ? ? ?at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) > ? ? ? ?at org.eclipse.equinox.launcher.Main.run(Main.java:1236) > ? ? ? ?at org.eclipse.equinox.launcher.Main.main(Main.java:1212) > > > > -- > Dhanesh Ramachandram > Visit my Photostream : > http://flickr.com/photos/dhaneshr > -- Dhanesh Ramachandram Visit my Photostream : http://flickr.com/photos/dhaneshr From iconme at 163.com Fri May 29 10:21:59 2009 From: iconme at 163.com (iconme) Date: Fri, 29 May 2009 22:21:59 +0800 (CST) Subject: [vtkusers] Problem about vtkImageViewer2 when using itk+vtk+Qt Message-ID: <19600087.366981243606919466.JavaMail.coremail@bj163app124.163.com> Dear all: I'm now using QT+ITK+VTK combination. I loaded a 3D image of analyze format using itk and change it to vtk image, and I'd like to show the slices in a qvtkWidget by vtkImageViewer2. The pipeline is as below: itkImageFileReader->itkImageToVTKImageFilter->vtkImageViewer2 The problem is I always get a core dump when I interact with the slice like moving mouse on it. I don't know why exactly. Since when I just use itk+vtk without using qt, it seems fine, and when I change to import a raw data just using vtk+qt combination, it seems still fine. I believe it has something to do with interactor style or sth, but I'm not sure. Can anybody help me out here? I'm exausted about it. Thank you in advance!Below are my codes: typedef signed short InputPixelType; typedef unsigned char MaskPixelType; const unsigned int Dimension = 3; typedef itk::Image< InputPixelType, Dimension > InputImageType; typedef itk::Image< MaskPixelType, Dimension > MaskImageType; typedef itk::ImageFileReader< InputImageType > ReaderType; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName( "/home/cliff/research/digimouse/ct_380x992x208.hdr" ); reader->Update(); typedef itk::VTKImageExport< InputImageType > ExportFilter1Type; ExportFilter1Type::Pointer itkExporter1 = ExportFilter1Type::New(); itkExporter1->SetInput( reader->GetOutput() ); // Create the vtkImageImport and connect it to the // itk::VTKImageExport instance. vtkImageImport* vtkImporter1 = vtkImageImport::New(); ConnectPipelines(itkExporter1, vtkImporter1); vtkImporter1->Update(); vtkSmartPointer image = vtkSmartPointer::New(); image = vtkImporter1->GetOutput(); image -> Update(); vtkImageViewer2 *viewer = vtkImageViewer2::New(); vtkInteractorStyleImage * interactorStyle = vtkInteractorStyleImage::New(); interactorStyle->AutoAdjustCameraClippingRangeOff(); interactorStyle -> SetInteractor(qvtkWidget->GetInteractor()); interactorStyle = viewer->GetInteractorStyle(); qvtkWidget->GetInteractor()->SetInteractorStyle( interactorStyle ); viewer->SetupInteractor(qvtkWidget->GetInteractor()); viewer->SetInput(image); viewer->SetSliceOrientationToXY(); viewer->SetSlice(50); viewer->UpdateDisplayExtent(); viewer->Render(); viewer->SetColorWindow(255); viewer->SetColorLevel(128); viewer->SetRenderWindow(renWin); viewer->SetRenderer(renderer); // Set the background to something grayish renderer->SetBackground(0.4392, 0.5020, 0.5647); //renderer->SetActiveCamera(camera); renderer->ResetCamera(); //renderer->ResetCameraClippingRange (); qvtkWidget->GetRenderWindow()->Render(); -------------- next part -------------- An HTML attachment was scrubbed... URL: From saaketjalan at gmail.com Fri May 29 11:00:25 2009 From: saaketjalan at gmail.com (Saket Jalan) Date: Fri, 29 May 2009 20:30:25 +0530 Subject: [vtkusers] How to view slices from Volume Data Message-ID: <93a377ec0905290800i4bdd6794tbe6f1a0037ff864e@mail.gmail.com> Hi... I m completely new to VTK. and i need to view slices of a vtk format file along the three orthogonal axes both in 2D and 3D view using a c++ program Please help me regarding that,,,remember me a completely dummy... -- Saket -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Fri May 29 11:06:40 2009 From: drescherjm at gmail.com (John Drescher) Date: Fri, 29 May 2009 11:06:40 -0400 Subject: [vtkusers] How to view slices from Volume Data In-Reply-To: <93a377ec0905290800i4bdd6794tbe6f1a0037ff864e@mail.gmail.com> References: <93a377ec0905290800i4bdd6794tbe6f1a0037ff864e@mail.gmail.com> Message-ID: <387ee2020905290806s68dc5defp31093ae0ce41978e@mail.gmail.com> On Fri, May 29, 2009 at 11:00 AM, Saket Jalan wrote: > Hi... > > I m completely new to VTK. and i need to view slices of a vtk format file > along the three orthogonal axes both in 2D and 3D view using a c++ program > Please help me regarding that,,,remember me a completely dummy... > Check out http://www-sop.inria.fr/asclepios/software/vtkINRIA3D/ This really helped me a lot in displaying CT Images in Coronal, Axial and Sagittal views. John From julien.finet at kitware.com Fri May 29 11:19:53 2009 From: julien.finet at kitware.com (Julien Finet) Date: Fri, 29 May 2009 11:19:53 -0400 Subject: [vtkusers] How to view slices from Volume Data In-Reply-To: <387ee2020905290806s68dc5defp31093ae0ce41978e@mail.gmail.com> References: <93a377ec0905290800i4bdd6794tbe6f1a0037ff864e@mail.gmail.com> <387ee2020905290806s68dc5defp31093ae0ce41978e@mail.gmail.com> Message-ID: <5b9fa8230905290819g4366de72mcfb1553855c746b@mail.gmail.com> Hi Saket, There are a lot of useful examples in the VTK/Examples directory... Give a look at the ImageSlicing example in VTK/Examples/ImageProcessing. Regards, Julien. On Fri, May 29, 2009 at 11:06 AM, John Drescher wrote: > On Fri, May 29, 2009 at 11:00 AM, Saket Jalan > wrote: > > Hi... > > > > I m completely new to VTK. and i need to view slices of a vtk format file > > along the three orthogonal axes both in 2D and 3D view using a c++ > program > > Please help me regarding that,,,remember me a completely dummy... > > > > Check out > > http://www-sop.inria.fr/asclepios/software/vtkINRIA3D/ > > This really helped me a lot in displaying CT Images in Coronal, Axial > and Sagittal views. > > John > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From blloyd at vision.ee.ethz.ch Fri May 29 11:37:58 2009 From: blloyd at vision.ee.ethz.ch (Bryn Lloyd) Date: Fri, 29 May 2009 17:37:58 +0200 Subject: [vtkusers] Problem about vtkImageViewer2 when using itk+vtk+Qt In-Reply-To: <19600087.366981243606919466.JavaMail.coremail@bj163app124.163.com> References: <19600087.366981243606919466.JavaMail.coremail@bj163app124.163.com> Message-ID: <4A200156.60905@vision.ee.ethz.ch> This is not answering your question, but maybe it is of interest: I have written a small extension to vtkImageViewer2, which has keyboard observers to change between slices of the 3D image. Additionally, I have added the functionality to select seed points by clicking on the image (much like ImageViewer in ITK-Applications). This is very useful, e.g. in segmentation algorithms. Finally, I use the vtkKWImageIO and vtkKWImage classes from the Insight Journal, which interface ITK in quite a nice way, so I can load all ITK readable images and directly connect the output to the viewer. Have a look here: http://people.ee.ethz.ch/~blloyd/ImageViewer/ An example application is: test-ImageViewer.cxx The usage (keys to change slices/select points etc.) is described a bit in the header file: ImageViewer.h Cheers Bryn iconme wrote: > Dear all: > I'm now using QT+ITK+VTK combination. I loaded a 3D image of analyze > format using itk and change it to vtk image, and I'd like to show the > slices in a qvtkWidget by vtkImageViewer2. The pipeline is as below: > itkImageFileReader->itkImageToVTKImageFilter->vtkImageViewer2 > The problem is I always get a core dump when I interact with the slice > like moving mouse on it. I don't know why exactly. Since when I just use > itk+vtk without using qt, it seems fine, and when I change to import a > raw data just using vtk+qt combination, it seems still fine. I believe > it has something to do with interactor style or sth, but I'm not sure. > Can anybody help me out here? I'm exausted about it. Thank you in > advance!Below are my codes: > > typedef signed short InputPixelType; > typedef unsigned char MaskPixelType; > const unsigned int Dimension = 3; > typedef itk::Image< InputPixelType, Dimension > InputImageType; > typedef itk::Image< MaskPixelType, Dimension > MaskImageType; > > typedef itk::ImageFileReader< InputImageType > ReaderType; > > ReaderType::Pointer reader = ReaderType::New(); > reader->SetFileName( > "/home/cliff/research/digimouse/ct_380x992x208.hdr" ); > reader->Update(); > typedef itk::VTKImageExport< InputImageType > ExportFilter1Type; > ExportFilter1Type::Pointer itkExporter1 = ExportFilter1Type::New(); > itkExporter1->SetInput( reader->GetOutput() ); > > // Create the vtkImageImport and connect it to the > // itk::VTKImageExport instance. > vtkImageImport* vtkImporter1 = vtkImageImport::New(); > ConnectPipelines(itkExporter1, vtkImporter1); > > vtkImporter1->Update(); > > vtkSmartPointer image = > vtkSmartPointer::New(); > image = vtkImporter1->GetOutput(); > image -> Update(); > > vtkImageViewer2 *viewer = vtkImageViewer2::New(); > vtkInteractorStyleImage * interactorStyle = > vtkInteractorStyleImage::New(); > interactorStyle->AutoAdjustCameraClippingRangeOff(); > interactorStyle -> SetInteractor(qvtkWidget->GetInteractor()); > interactorStyle = viewer->GetInteractorStyle(); > qvtkWidget->GetInteractor()->SetInteractorStyle( interactorStyle ); > viewer->SetupInteractor(qvtkWidget->GetInteractor()); > viewer->SetInput(image); > viewer->SetSliceOrientationToXY(); > viewer->SetSlice(50); > viewer->UpdateDisplayExtent(); > viewer->Render(); > > viewer->SetColorWindow(255); > viewer->SetColorLevel(128); > viewer->SetRenderWindow(renWin); > viewer->SetRenderer(renderer); > > // Set the background to something grayish > renderer->SetBackground(0.4392, 0.5020, 0.5647); > //renderer->SetActiveCamera(camera); > renderer->ResetCamera(); > //renderer->ResetCameraClippingRange (); > qvtkWidget->GetRenderWindow()->Render(); > > > > ------------------------------------------------------------------------ > ?????????? ?????????????????? > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 -- ------------------------------------------------- Bryn Lloyd Computer Vision Laboratory ETH Z??rich, Sternwartstrasse 7 CH - 8092 Z??rich, Switzerland Tel: +41 44 63 26668 Fax: +41 44 63 21199 ------------------------------------------------- From dhaneshr at gmail.com Fri May 29 12:42:10 2009 From: dhaneshr at gmail.com (Dhanesh Ramachandram, PhD) Date: Sat, 30 May 2009 00:42:10 +0800 Subject: [vtkusers] Problems in VTK Java & Linux In-Reply-To: References: Message-ID: Hi again Denis, Actually I solved this issue by explicitly setting the environment variable LD_LIBRARY within the Eclipse IDE. However, I had earlier deleted by VTKBuild folder and re-configured CMake. Somehow at 100% I get this following error: [100%] Built target VTKJava Linking CXX executable ../../bin/VTKJavaExecutable ../../bin/libvtkRenderingJava.so.5.5.0: undefined reference to `JAWT_GetAWT' collect2: ld returned 1 exit status make[2]: *** [bin/VTKJavaExecutable] Error 1 make[1]: *** [Wrapping/Java/CMakeFiles/VTKJavaExecutable.dir/all] Error 2 make: *** [all] Error 2 I tried Googling but cannot get a reliable solution. On Fri, May 29, 2009 at 1:11 PM, Dhanesh Ramachandram, PhD wrote: > We're trying to port an Eclipse RCP application which uses VTK and ITK > wrapped as plug-ins from Windows to Linux (Ubuntu 9.04). We've > completed the initial steps of building the Linux shared libraries of > VTK and ITK with Java Wrapping enabled. When our application tries to > access VTK libraries, it seems that there is a problem. We have set > the appropriate LD_LIBRARY_PATH etc... > What can be the issue here ? ?It seems that in Linux, the shared > libraries have the prefix 'lib' (ex: "libvtkCommonJava.so") but > somehow, from the error messages, it seems that the wrapping procedure > results in code that tries to access the library "vtkCommonJava". > Could this be the problem ? > > Here's the error we get: > Java.lang.UnsatisfiedLinkError: no vtkCommonJava in java.library.path > ? ? ? ?at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709) > ? ? ? ?at java.lang.Runtime.loadLibrary0(Runtime.java:823) > ? ? ? ?at java.lang.System.loadLibrary(System.java:1030) > ? ? ? ?at vtk.vtkPanel.(vtkPanel.java:26) > ? ? ? ?at com.dvtrs.main.viewer.view3DVTK.createPartControl(view3DVTK.java:201) > ? ? ? ?at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:371) > ? ? ? ?at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:230) > ? ? ? ?at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594) > ? ? ? ?at org.eclipse.ui.internal.Perspective.showView(Perspective.java:2131) > ? ? ? ?at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1062) > ? ? ? ?at org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.java:3773) > ? ? ? ?at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) > ? ? ? ?at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3770) > ? ? ? ?at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3746) > ? ? ? ?at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:165) > ? ? ? ?at org.eclipse.ui.handlers.ShowViewHandler.openOther(ShowViewHandler.java:109) > ? ? ? ?at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:77) > ? ? ? ?at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:281) > ? ? ? ?at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) > ? ? ? ?at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) > ? ? ? ?at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) > ? ? ? ?at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:247) > ? ? ? ?at org.eclipse.ui.internal.ShowViewMenu$3.run(ShowViewMenu.java:134) > ? ? ? ?at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) > ? ? ? ?at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583) > ? ? ? ?at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500) > ? ? ? ?at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) > ? ? ? ?at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) > ? ? ? ?at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158) > ? ? ? ?at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401) > ? ? ? ?at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033) > ? ? ? ?at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384) > ? ? ? ?at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348) > ? ? ? ?at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200) > ? ? ? ?at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495) > ? ? ? ?at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) > ? ? ? ?at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490) > ? ? ? ?at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) > ? ? ? ?at com.dvtrs.main.MainApplication.start(MainApplication.java:24) > ? ? ? ?at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) > ? ? ? ?at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) > ? ? ? ?at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) > ? ? ? ?at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386) > ? ? ? ?at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) > ? ? ? ?at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > ? ? ? ?at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > ? ? ? ?at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > ? ? ? ?at java.lang.reflect.Method.invoke(Method.java:597) > ? ? ? ?at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) > ? ? ? ?at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) > ? ? ? ?at org.eclipse.equinox.launcher.Main.run(Main.java:1236) > ? ? ? ?at org.eclipse.equinox.launcher.Main.main(Main.java:1212) > > > > -- > Dhanesh Ramachandram > Visit my Photostream : > http://flickr.com/photos/dhaneshr > -- Dhanesh Ramachandram Visit my Photostream : http://flickr.com/photos/dhaneshr From hobbsk at ohiou.edu Fri May 29 12:47:19 2009 From: hobbsk at ohiou.edu (Kevin H. Hobbs) Date: Fri, 29 May 2009 12:47:19 -0400 Subject: [vtkusers] Dashboard no longer shows locally modified files Message-ID: <1243615640.7158.17.camel@gargon.hooperlab> I have a local modification to Rendering/vtkOpenGLRenderWindow.cxx on one of my workstations. This machine runs the nightly Dashboard. CDash used to report that I had the local modifications. As of the 18th it stopped : http://www.cdash.org/CDash/buildSummary.php?buildid=338927 Last night's LastUpdate_20090529-0200.log lists the file as modified. M Rendering/vtkOpenGLRenderWindow.cxx The same goes for ParaView. The change keeps saved images of the scene from being garbled. Index: Rendering/vtkOpenGLRenderWindow.cxx =================================================================== RCS file: /cvsroot/VTK/VTK/Rendering/vtkOpenGLRenderWindow.cxx,v retrieving revision 1.104 diff -u -8 -p -r1.104 vtkOpenGLRenderWindow.cxx --- Rendering/vtkOpenGLRenderWindow.cxx 4 Dec 2008 19:05:20 -0000 1.104 +++ Rendering/vtkOpenGLRenderWindow.cxx 29 May 2009 16:31:50 -0000 @@ -502,17 +502,17 @@ int vtkOpenGLRenderWindow::GetPixelData( } else { glReadBuffer(static_cast(this->GetBackLeftBuffer())); } glDisable( GL_SCISSOR_TEST ); -#if defined(sparc) && !defined(GL_VERSION_1_2) +//#if defined(sparc) && !defined(GL_VERSION_1_2) // We need to read the image data one row at a time and convert it // from RGBA to RGB to get around a bug in Sun OpenGL 1.1 long xloop, yloop; unsigned char *buffer; unsigned char *p_data = NULL; buffer = new unsigned char [4*(x_hi - x_low + 1)]; p_data = data; @@ -525,30 +525,30 @@ int vtkOpenGLRenderWindow::GetPixelData( { *p_data = buffer[xloop*4]; p_data++; *p_data = buffer[xloop*4+1]; p_data++; *p_data = buffer[xloop*4+2]; p_data++; } } delete [] buffer; -#else +/*#else // If the Sun bug is ever fixed, then we could use the following // technique which provides a vast speed improvement on the SGI // Turn of texturing in case it is on - some drivers have a problem // getting / setting pixels with texturing enabled. glDisable( GL_TEXTURE_2D ); // Calling pack alignment ensures that we can grab the any size window glPixelStorei( GL_PACK_ALIGNMENT, 1 ); glReadPixels(x_low, y_low, x_hi-x_low+1, y_hi-y_low+1, GL_RGB, GL_UNSIGNED_BYTE, data); #endif - +*/ if (glGetError() != GL_NO_ERROR) { return VTK_ERROR; } else { return VTK_OK; } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From zibalmail at gmail.com Fri May 29 12:51:21 2009 From: zibalmail at gmail.com (Gabriele) Date: Fri, 29 May 2009 18:51:21 +0200 Subject: [vtkusers] can't write obj files Message-ID: <4A201289.8020703@gmail.com> Hello, I have spent a few hours already on this thing and I can't really understand why it does not work. I am trying to save an .obj file using vtkObjExporter, but only the mtl file is saved, no .obj. I include a simple function that should, in my humble opinion, read an obj file and just save it with a different name, but again only stores the .mtl file. Can anyone guess what's wrong? Thanks a lot, G #include #include #include #include #include #include void tryIO(std::string& name){ vtkOBJReader *myObjReader; myObjReader = vtkOBJReader::New(); myObjReader->SetFileName(name.c_str()); myObjReader->Update(); vtkPolyData* model = vtkPolyData::New(); model->DeepCopy(myObjReader->GetOutput()); myObjReader->Delete(); vtkOBJExporter* objExporter = vtkOBJExporter::New(); std::string outName(name.substr(0, name.find_last_of('.'))); outName += "_processed"; objExporter->SetFilePrefix(outName.c_str()); //set renderer to the read model vtkRenderer *renderer; renderer = vtkRenderer::New(); vtkPolyDataMapper *myDataMapper = vtkPolyDataMapper::New(); myDataMapper->SetInput(model); vtkActor *myActor = vtkActor::New(); myActor->SetMapper(myDataMapper); //assign our actor to the renderer renderer->AddActor(myActor); vtkRenderWindow *renWin = vtkRenderWindow::New(); renWin->AddRenderer(renderer); objExporter->SetRenderWindow(renWin); objExporter->Write(); objExporter->Delete(); renWin->Delete(); renderer->Delete(); myDataMapper->Delete(); myActor->Delete(); } int main(int argc, char* argv[]){ std::string objName(argv[1]); tryIO( objName ); } From daviddoria at gmail.com Fri May 29 13:33:10 2009 From: daviddoria at gmail.com (David Doria) Date: Fri, 29 May 2009 13:33:10 -0400 Subject: [vtkusers] can't write obj files In-Reply-To: <4A201289.8020703@gmail.com> References: <4A201289.8020703@gmail.com> Message-ID: Gabriele, I am still not sure why this is not included - you can use my WriteAPolyData function that I cut out/modified from the vtkOBJExporter. Replace vtkOBJExporter.cxx/h in VTK/Rendering - then see WriteOBJ.cpp for an example. http://www.rpi.edu/~doriad/OBJWriter/ Maybe someone with write access can commit this? Thanks, David On Fri, May 29, 2009 at 12:51 PM, Gabriele wrote: > Hello, > > I have spent a few hours already on this thing and I can't really > understand why it does not work. > > I am trying to save an .obj file using vtkObjExporter, but only the mtl > file is saved, no .obj. > > I include a simple function that should, in my humble opinion, read an obj > file and just save it with a different name, but again only stores the .mtl > file. Can anyone guess what's wrong? > > Thanks a lot, > G > > > #include > #include > #include > #include > #include > #include > > > void tryIO(std::string& name){ > > vtkOBJReader *myObjReader; > myObjReader = vtkOBJReader::New(); > myObjReader->SetFileName(name.c_str()); myObjReader->Update(); > vtkPolyData* model = vtkPolyData::New(); > model->DeepCopy(myObjReader->GetOutput()); > myObjReader->Delete(); > vtkOBJExporter* objExporter = vtkOBJExporter::New(); > std::string outName(name.substr(0, name.find_last_of('.'))); > outName += "_processed"; > objExporter->SetFilePrefix(outName.c_str()); > //set renderer to the read model > vtkRenderer *renderer; > renderer = vtkRenderer::New(); > vtkPolyDataMapper *myDataMapper = vtkPolyDataMapper::New(); > myDataMapper->SetInput(model); > vtkActor *myActor = vtkActor::New(); > myActor->SetMapper(myDataMapper); > //assign our actor to the renderer > renderer->AddActor(myActor); > vtkRenderWindow *renWin = vtkRenderWindow::New(); > renWin->AddRenderer(renderer); > objExporter->SetRenderWindow(renWin); > objExporter->Write(); > objExporter->Delete(); renWin->Delete(); > renderer->Delete(); > myDataMapper->Delete(); > myActor->Delete(); > } > > > > > int main(int argc, char* argv[]){ > std::string objName(argv[1]); > tryIO( objName ); > > } > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 tavares at fe.up.pt Fri May 29 14:24:11 2009 From: tavares at fe.up.pt (=?iso-8859-1?Q?Jo=E3o_Manuel_R._S._Tavares?=) Date: Fri, 29 May 2009 19:24:11 +0100 Subject: [vtkusers] =?iso-8859-1?q?Symposium_=22Computational_Methods_for_?= =?iso-8859-1?q?Image_Processing_and_Analysis=22_within_the_30=B0_C?= =?iso-8859-1?q?ILAMCE=2C_Brazil_-_Announce_=26_Call_for_Papers?= Message-ID: <071901c9e08a$a9d7f160$fd87d420$@up.pt> **************************************************************************** ******************************** Symposium ?Computational Methods for Image Processing and Analysis? 30th edition of the Iberian-Latin-American Congress on Computational Methods in Engineering (30? CILAMCE) http://eventos.nacad.ufrj.br/ (Our apologies for cross-posting. We appreciate if you kindly distribute this information by your co-workers and colleagues.) **************************************************************************** ******************************** Dear Colleague, Within the 30th edition of the Iberian-Latin-American Congress on Computational Methods in Engineering (30? CILAMCE), to be held in Arma??o de B?zios, RJ, Brazil, in November 08 to 11, 2009, we are organizing the Symposium ?Computational Methods for Image Processing and Analysis?. The main goal of the Symposium ?Computational Methods for Image Processing and Analysis? is to bring together specialists from various fields associated to Computational Vision, Computational Methods, Mathematics, Informatics, Statistics, Medical Imaging, and Industry, among others, providing a forum for presentation and discussion of issues related to Computational Methods for Image Processing and Image Analysis with the purpose of identifying the major lines of development for the near future. Another important challenge of this Symposium is to establish a connection between researchers and end-users from diverse fields. Due to your research activities in the related fields, we are pleased to invite you to submit your work and participate in the Symposium ?Computational Methods for Image Processing and Analysis?. Topics of interest include (but are not restricted to): - Image Acquisition, Restoring, Compression, Segmentation and Description; - Objects Tracking, Matching, Reconstruction and Registration; - Medical Imaging; - Visualization Enhancement; - Visual Inspection; - Non Destructive Testing; - Simulation and Animation; - Software Development for Image Processing and Analysis; - Grid Computing in Image Processing and Analysis; - Applications of Image Processing and Analysis. Important dates and Instructions: - Deadline for Abstract submission: June 15, 2009 - Notification of Abstract acceptance: June 30, 2009 - Deadline for completed manuscript: July 31, 2009 - Deadline for manuscript revision: August 31, 2009 - To submit your contribution, you should access the conference website at http://eventos.nacad.ufrj.br/, follow the authors? instructions and select the Symposium ?Computational Methods for Image Processing and Analysis?. With kind regards, Yours sincerely, The Organizers, Jo?o Manuel R. S. Tavares (tavares at fe.up.pt), University of Porto, Porto, Portugal Todd Pataky (Todd.Pataky at liverpool.ac.uk), University of Liverpool, UK Aledir Silveira Pereira (aledir at ibilce.unesp.br), UNESP ? S?o Paulo State University, Brazil Norian Marranghello (norian at ibilce.unesp.br), UNESP - S?o Paulo State University, Brazil Alex Fernando de Ara?jo (fa.alex at gmail.com), UNESP ? S?o Paulo State University, Brazil Victor H. C. Albuquerque (victor120585 at yahoo.com.br), Federal University of Para?ba, Brazil From heiland at indiana.edu Fri May 29 15:53:39 2009 From: heiland at indiana.edu (Randy Heiland) Date: Fri, 29 May 2009 15:53:39 -0400 Subject: [vtkusers] just want ImageData formatting Message-ID: <7CCF7A50-60C3-4912-9192-2E948B64EAC4@indiana.edu> I'd like to be able to write out files in the VTK (XML) ImageData format from my app, but without the need for all of VTK. Suggestions? Or is simply culling the relevant files the proper approach? thanks, Randy From nrannou at bwh.harvard.edu Fri May 29 16:37:09 2009 From: nrannou at bwh.harvard.edu (Nicolas RANNOU) Date: Fri, 29 May 2009 16:37:09 -0400 Subject: [vtkusers] Extract on slice from a volume then display it Message-ID: <7e021f1115aad1a03c387c93de97b8e3@bwh.harvard.edu> Hello, I'm currently trying to extract a slice from a 3d volume then to display it in a window but it doesn't work. I proceed exactly the same way as in VTK/Example/ImageProcessing/Cxx/ImageSliceing.cxx . In my window, I just get a black background. (my input image is in grey levels) If I add a color to the background, my window stays black. So I assume that the actor is there but is not well displayed. Does anybody have any idea? Thanks for the help, Nicolas My code: /--------------------------------------------------------------------------------/ vtkEMSegmentMRMLManager *mrmlManager = this->GetGUI()->GetMRMLManager(); vtkMRMLVolumeNode* volumeNode = mrmlManager->GetVolumeNode(target_vol_id); vtkImageData* inputImage = volumeNode->GetImageData(); int extent[6]; double spacing[3]; double origin[3]; inputImage->GetWholeExtent(extent); inputImage->GetSpacing(spacing); inputImage->GetOrigin(origin); double center[3]; center[0] = origin[0] + spacing[0] * 0.5 * (extent[0] + extent[1]); center[1] = origin[1] + spacing[1] * 0.5 * (extent[2] + extent[3]); center[2] = origin[2] + spacing[2] * 0.5 * (extent[4] + extent[5]); // Matrices for axial, coronal, sagittal, oblique view orientations static double coronalElements[16] = { 1, 0, 0, 0, 0, 0, 1, 0, 0,-1, 0, 0, 0, 0, 0, 1 }; // Set the slice orientation vtkMatrix4x4 *resliceAxes = vtkMatrix4x4::New(); resliceAxes->DeepCopy(coronalElements); // Set the point through which to slice resliceAxes->SetElement(0, 3, center[0]); resliceAxes->SetElement(1, 3, center[1]); resliceAxes->SetElement(2, 3, center[2]); // Extract a slice in the desired orientation vtkImageReslice *reslice = vtkImageReslice::New(); reslice->SetInput(volumeNode->GetImageData()); reslice->SetOutputDimensionality(2); reslice->SetResliceAxes(resliceAxes); reslice->SetInterpolationModeToLinear(); // Create a greyscale lookup table vtkLookupTable *table = vtkLookupTable::New(); table->SetRange(0, 2000); // image intensity range table->SetValueRange(0.0, 1.0); // from black to white table->SetSaturationRange(0.0, 0.0); // no color saturation table->SetRampToLinear(); table->Build(); // Map the image through the lookup table vtkImageMapToColors *color = vtkImageMapToColors::New(); color->SetLookupTable(table); color->SetInput(inputImage);//reslice->GetOutput()); // Display the image vtkImageActor *actor = vtkImageActor::New(); actor->SetInput(color->GetOutput()); vtkRenderer *renderer = vtkRenderer::New(); renderer->AddActor(actor); vtkRenderWindow *window = vtkRenderWindow::New(); window->AddRenderer(renderer); window->Render(); /--------------------------------------------------------------------------------/ From jinzhong76 at gmail.com Fri May 29 18:41:28 2009 From: jinzhong76 at gmail.com (Jinzhong Yang) Date: Fri, 29 May 2009 17:41:28 -0500 Subject: [vtkusers] Volume of a closed surface Message-ID: <9190305b0905291541v4335abd3tffe456476ecfd364@mail.gmail.com> Hi All, Is there any filter in VTK to compute the volume of a closed surface denoted by vtkPolyData? Any suggestion to estimate the volume is also welcomed. I would like the method for computing the volume to be very fast. Thanks, Jinzhong From joeymu at gmail.com Fri May 29 18:54:48 2009 From: joeymu at gmail.com (Joey Mukherjee) Date: Fri, 29 May 2009 17:54:48 -0500 Subject: [vtkusers] Flicker on Mac OS X/QVTK app Message-ID: <415758d20905291554r3e654ffdrb8018340a29bc6ef@mail.gmail.com> I recently upgraded VTK to the latest version and on my Mac OS X PPC box, I get a flicker on the output window. Sometimes I see other miscellaneous "junk" in the VTK window as well. The picture is there, but it just flickers continuously. This is with a Qt app using Qt v4.5.1. It also occurred with Qt v4.4.2. I do not embed the QVTK window in my application; it's an independent window, in case that makes a difference. I am also compiling using Carbon. Does anyone have the same problem or any ideas on how to fix? With the examples, I get these errors: open SpecularSpheres.app/ 2009-05-29 17:41:31.930 open[14271] CFLog (0): CFMessagePort: bootstrap_register(): failed 1100 (0x44c), port = 0x2303, name = 'Processes-0.11534337' See /usr/include/servers/bootstrap_defs.h for the error codes. 2009-05-29 17:41:32.117 open[14271] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (Processes-0.11534337) CFMessagePortCreateLocal failed (name = Processes-0.11534337 error = 0) Abort ./RGrid 2009-05-29 17:42:14.133 RGrid[14273] CFLog (0): CFMessagePort: bootstrap_register(): failed 1100 (0x44c), port = 0x2003, name = 'Processes-0.11665409' See /usr/include/servers/bootstrap_defs.h for the error codes. 2009-05-29 17:42:14.134 RGrid[14273] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (Processes-0.11665409) CFMessagePortCreateLocal failed (name = Processes-0.11665409 error = 0) Abort Thanks for any advice! Joey From machavez at estudiantes.uci.cu Fri May 29 22:43:03 2009 From: machavez at estudiantes.uci.cu (Miguel Angel Chavez Alfonso) Date: Fri, 29 May 2009 22:43:03 -0400 (CDT) Subject: [vtkusers] points inside a vtkXYPlotActor Message-ID: <31081371.2578901243651383065.JavaMail.root@zimbra2.uci.cu> Hello people. How can I put and display a single point in a vtkXYPlotActor. I am working with c++ and qt From frederic.danesi at dinccs.com Sat May 30 06:06:51 2009 From: frederic.danesi at dinccs.com (Frederic Danesi) Date: Sat, 30 May 2009 12:06:51 +0200 Subject: [vtkusers] Volume of a closed surface In-Reply-To: <9190305b0905291541v4335abd3tffe456476ecfd364@mail.gmail.com> References: <9190305b0905291541v4335abd3tffe456476ecfd364@mail.gmail.com> Message-ID: <002a01c9e10e$5fe9a830$1fbcf890$@danesi@dinccs.com> Take a look at vtkMassProperties::GetVolume() ... Fred. Cordialement, F.Danesi -- Responsable D?veloppement Informatique et Travail Collaboratif D?partement DINCCS (D?partement Ing?nierie Num?rique, Conception Collaborative et Simulation) MICADO / DINCCS P?le de Haute Technologie, BP 90005 08005 Charleville-M?zi?res Cedex Tel. : +33 (0) 3.24.41.69.55 / +33 (0) 6.62.76.13.32 Email : frederic.danesi at dinccs.com Web : www.afmicado.com / www.dinccs.com -----Message d'origine----- De?: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] De la part de Jinzhong Yang Envoy??: samedi 30 mai 2009 00:41 ??: vtkusers at vtk.org Objet?: [vtkusers] Volume of a closed surface Hi All, Is there any filter in VTK to compute the volume of a closed surface denoted by vtkPolyData? Any suggestion to estimate the volume is also welcomed. I would like the method for computing the volume to be very fast. Thanks, Jinzhong _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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 Ce message entrant est certifi? sans virus connu. Analyse effectu?e par AVG - www.avg.fr Version: 8.5.339 / Base de donn?es virale: 270.12.44/2140 - Date: 05/28/09 18:09:00 From david.cole at kitware.com Sat May 30 11:00:21 2009 From: david.cole at kitware.com (David Cole) Date: Sat, 30 May 2009 11:00:21 -0400 Subject: [vtkusers] Dashboard no longer shows locally modified files In-Reply-To: <1243615640.7158.17.camel@gargon.hooperlab> References: <1243615640.7158.17.camel@gargon.hooperlab> Message-ID: Looks like you changed from CMake 2.6.3 to 2.6.4 after the May 18th submission... We are investigating... Is the file also listed as modified in the "Update.xml" file in the build tree's Testing/200905xx-xxxx directory? Could you forward both of those files to me off list? Thanks, David On Fri, May 29, 2009 at 12:47 PM, Kevin H. Hobbs wrote: > I have a local modification to Rendering/vtkOpenGLRenderWindow.cxx on > one of my workstations. > > This machine runs the nightly Dashboard. > > CDash used to report that I had the local modifications. > > As of the 18th it stopped : > > http://www.cdash.org/CDash/buildSummary.php?buildid=338927 > > > Last night's LastUpdate_20090529-0200.log lists the file as modified. > > M Rendering/vtkOpenGLRenderWindow.cxx > > The same goes for ParaView. > > The change keeps saved images of the scene from being garbled. > > Index: Rendering/vtkOpenGLRenderWindow.cxx > =================================================================== > RCS file: /cvsroot/VTK/VTK/Rendering/vtkOpenGLRenderWindow.cxx,v > retrieving revision 1.104 > diff -u -8 -p -r1.104 vtkOpenGLRenderWindow.cxx > --- Rendering/vtkOpenGLRenderWindow.cxx 4 Dec 2008 19:05:20 -0000 > 1.104 > +++ Rendering/vtkOpenGLRenderWindow.cxx 29 May 2009 16:31:50 -0000 > @@ -502,17 +502,17 @@ int vtkOpenGLRenderWindow::GetPixelData( > } > else > { > glReadBuffer(static_cast(this->GetBackLeftBuffer())); > } > > glDisable( GL_SCISSOR_TEST ); > > -#if defined(sparc) && !defined(GL_VERSION_1_2) > +//#if defined(sparc) && !defined(GL_VERSION_1_2) > // We need to read the image data one row at a time and convert it > // from RGBA to RGB to get around a bug in Sun OpenGL 1.1 > long xloop, yloop; > unsigned char *buffer; > unsigned char *p_data = NULL; > > buffer = new unsigned char [4*(x_hi - x_low + 1)]; > p_data = data; > @@ -525,30 +525,30 @@ int vtkOpenGLRenderWindow::GetPixelData( > { > *p_data = buffer[xloop*4]; p_data++; > *p_data = buffer[xloop*4+1]; p_data++; > *p_data = buffer[xloop*4+2]; p_data++; > } > } > > delete [] buffer; > -#else > +/*#else > // If the Sun bug is ever fixed, then we could use the following > // technique which provides a vast speed improvement on the SGI > > // Turn of texturing in case it is on - some drivers have a problem > // getting / setting pixels with texturing enabled. > glDisable( GL_TEXTURE_2D ); > > // Calling pack alignment ensures that we can grab the any size window > glPixelStorei( GL_PACK_ALIGNMENT, 1 ); > glReadPixels(x_low, y_low, x_hi-x_low+1, y_hi-y_low+1, GL_RGB, > GL_UNSIGNED_BYTE, data); > #endif > - > +*/ > if (glGetError() != GL_NO_ERROR) > { > return VTK_ERROR; > } > else > { > return VTK_OK; > } > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 zibalmail at gmail.com Sat May 30 12:28:26 2009 From: zibalmail at gmail.com (Gabriele) Date: Sat, 30 May 2009 18:28:26 +0200 Subject: [vtkusers] can't write obj files In-Reply-To: References: <4A201289.8020703@gmail.com> Message-ID: <4A215EAA.3020000@gmail.com> Thanks David, So, is this a known bug? Recompiling with your patch is not that easy for me as I am on a managed machine. I have just tried to compile VTK on my home directory and everything seemed to go fine, but when I later tried to compile my application (which uses vtk), I get all sort of undefined reference errors at link time, mainly opengl related... I'll keep trying, but if anyone has a guess it'll be highly appreciated. Cheers, G David Doria wrote: > Gabriele, > I am still not sure why this is not included - you can use my > WriteAPolyData function that I cut out/modified from the vtkOBJExporter. > Replace vtkOBJExporter.cxx/h in VTK/Rendering - then see WriteOBJ.cpp > for an example. > > http://www.rpi.edu/~doriad/OBJWriter/ > > > Maybe someone with write access can commit this? > > Thanks, > > David > > > On Fri, May 29, 2009 at 12:51 PM, Gabriele > wrote: > > Hello, > > I have spent a few hours already on this thing and I can't really > understand why it does not work. > > I am trying to save an .obj file using vtkObjExporter, but only > the mtl file is saved, no .obj. > > I include a simple function that should, in my humble opinion, > read an obj file and just save it with a different name, but again > only stores the .mtl file. Can anyone guess what's wrong? > > Thanks a lot, > G > > > #include > #include > #include > #include > #include > #include > > > void tryIO(std::string& name){ > > vtkOBJReader *myObjReader; > myObjReader = vtkOBJReader::New(); > myObjReader->SetFileName(name.c_str()); myObjReader->Update(); > vtkPolyData* model = vtkPolyData::New(); > model->DeepCopy(myObjReader->GetOutput()); > myObjReader->Delete(); > vtkOBJExporter* objExporter = vtkOBJExporter::New(); > std::string outName(name.substr(0, name.find_last_of('.'))); > outName += "_processed"; > objExporter->SetFilePrefix(outName.c_str()); > //set renderer to the read model > vtkRenderer *renderer; > renderer = vtkRenderer::New(); > vtkPolyDataMapper *myDataMapper = vtkPolyDataMapper::New(); > myDataMapper->SetInput(model); > vtkActor *myActor = vtkActor::New(); > myActor->SetMapper(myDataMapper); > //assign our actor to the renderer > renderer->AddActor(myActor); > vtkRenderWindow *renWin = vtkRenderWindow::New(); > renWin->AddRenderer(renderer); > objExporter->SetRenderWindow(renWin); > objExporter->Write(); > objExporter->Delete(); renWin->Delete(); > renderer->Delete(); > myDataMapper->Delete(); > myActor->Delete(); > } > > > > > int main(int argc, char* argv[]){ > std::string objName(argv[1]); > tryIO( objName ); > > } > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 > > > ------------------------------------------------------------------------ > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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 > From daviddoria at gmail.com Sat May 30 13:34:10 2009 From: daviddoria at gmail.com (David Doria) Date: Sat, 30 May 2009 13:34:10 -0400 Subject: [vtkusers] can't write obj files In-Reply-To: <4A215EAA.3020000@gmail.com> References: <4A201289.8020703@gmail.com> <4A215EAA.3020000@gmail.com> Message-ID: On Sat, May 30, 2009 at 12:28 PM, Gabriele wrote: > Thanks David, > > So, is this a known bug? > > Recompiling with your patch is not that easy for me as I am on a managed > machine. I have just tried to compile VTK on my home directory and > everything seemed to go fine, but when I later tried to compile my > application (which uses vtk), I get all sort of undefined reference errors > at link time, mainly opengl related... > > I'll keep trying, but if anyone has a guess it'll be highly appreciated. > > Cheers, > G > > Gabriele - It's not a bug - it seems like it has been left out on purpose since vtkOBJWriter does not exist. We'll leave it to the experts to explain why, but it seems to me that OBJ is a very commonly used format that it would be convenient to be able to read and write to. I'd say you have to change your PATH to reflect the new location of your vtk libraries, are you using window or linux? In linux you'd put something like this in your ~/.bashrc : export VTK_DIR="/home/your_user_name/bin/VTK" I don't know why the linking errors would be openGL specific though. Can you show us the exact errors you are getting? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From zibalmail at gmail.com Sat May 30 14:04:29 2009 From: zibalmail at gmail.com (Gabriele Fanelli) Date: Sat, 30 May 2009 20:04:29 +0200 Subject: [vtkusers] can't write obj files In-Reply-To: References: <4A201289.8020703@gmail.com> <4A215EAA.3020000@gmail.com> Message-ID: <4A21752D.8020902@gmail.com> HI David, I see, there is no actual implementation of vtkOBJWriter, I should have noticed that. But as you say, obj is a pretty common format so it would be nice to have the possibility to write such files. Thanks for the help, I eventually managed to make things work with your code and compiling vtk as shared libraries. I still don't know why it did not work when compiled statically, but as long as it works now I am happy :). Cheers, Gabriele David Doria wrote: > > On Sat, May 30, 2009 at 12:28 PM, Gabriele > wrote: > > Thanks David, > > So, is this a known bug? > > Recompiling with your patch is not that easy for me as I am on a > managed machine. I have just tried to compile VTK on my home > directory and everything seemed to go fine, but when I later tried > to compile my application (which uses vtk), I get all sort of > undefined reference errors at link time, mainly opengl related... > > I'll keep trying, but if anyone has a guess it'll be highly > appreciated. > > Cheers, > G > > > Gabriele - > > It's not a bug - it seems like it has been left out on purpose since > vtkOBJWriter does not exist. We'll leave it to the experts to explain > why, but it seems to me that OBJ is a very commonly used format that > it would be convenient to be able to read and write to. > > I'd say you have to change your PATH to reflect the new location of > your vtk libraries, are you using window or linux? In linux you'd put > something like this in your ~/.bashrc : > > export VTK_DIR="/home/your_user_name/bin/VTK" > > I don't know why the linking errors would be openGL specific though. > Can you show us the exact errors you are getting? > > Thanks, > > David > ------------------------------------------------------------------------ > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > From theodoreholden at yahoo.com Sat May 30 19:32:48 2009 From: theodoreholden at yahoo.com (Theodore Holden) Date: Sat, 30 May 2009 16:32:48 -0700 (PDT) Subject: [vtkusers] redirecting outputwindow to a file in dotnet with SourceForge wrapper lib Message-ID: <45229.19036.qm@web38607.mail.mud.yahoo.com> This might save somebody the trouble of figuring out the syntax for doing this in dotnet... fow = new vtkFileOutputWindow(); fow.SetFileName("c:\\temp\\vtklogname.txt"); vtkOutputWindow.SetInstance(fow); Ted -------------- next part -------------- An HTML attachment was scrubbed... URL: From theodoreholden at yahoo.com Sat May 30 19:52:11 2009 From: theodoreholden at yahoo.com (Theodore Holden) Date: Sat, 30 May 2009 16:52:11 -0700 (PDT) Subject: [vtkusers] loading arrays to a vtkStructuredPoints object Message-ID: <270705.52087.qm@web38605.mail.mud.yahoo.com> Hi, If this one rings any bells for anybody I'd appreciate hearing about it. I have an application with which a user will repeatedly open an application specific file which includes volume data, and use vtk code to put that data on the screen; the application file also contains other kinds of data with which other things are being done so that using a .vtk file would not help anything. What I'd like to do is eliminate having to write my own data to a .vtk file and then re-read it. I can do that by using a vtkStructuredPoints object directly rather than using vtkStructuredPointsReader, and setting the data for that object directly including adding individual data points by calling SetScalarComponentFromFloat. Nonetheless that is not as fast as I'd like since it amounts to calling a wrapped function several million times, literally. What I've tried to do is reduce wrapped calls to one by making up my own load method for the vtkStructuredPoints class in the Filtering section thus: in vtkFiltering: void vtkStructuredPoints::loadByteArray(int Width, int Height, int NumSlices, float *bdata ) { int SliceSize; float vv; int i, j, k, ii, jj, kk; int x, y, z; SliceSize = Width * Height; for (z = 0; z < NumSlices; z++) { for (y = 0; y < Height; y++) { for (x = 0; x < Width; x++) { ii = z * SliceSize + y * Width + x; this->SetScalarComponentFromFloat(x, y, z, 0, bdata[ii]); } } } } That gets translated via the SourceForge wrapping software and cmake into: in vtkFilteringDotNet: void vtkStructuredPoints::loadByteArray(int Width, int Height, int NumSlices, array^ bdata) { pin_ptr bdataPin = &bdata[0]; float* nativebdataPin = bdataPin; vtk::ConvertManagedToNative<::vtkStructuredPoints>(m_instance)->loadByteArray(Width, Height, NumSlices, nativebdataPin); } That compiles and builds, and the VS intellisense understands it and indicates that the input array is float[], and you'd think it would work. Nonetheless when I try to use it I get a no-such-method exception. I'll be looking at this one a bit more this coming week; again if anybody has any suggestions or anything, I'm all ears. Ted -------------- next part -------------- An HTML attachment was scrubbed... URL: From hobbsk at ohiou.edu Sun May 31 08:41:10 2009 From: hobbsk at ohiou.edu (Kevin H. Hobbs) Date: Sun, 31 May 2009 08:41:10 -0400 Subject: [vtkusers] Dashboard no longer shows locally modified files In-Reply-To: References: <1243615640.7158.17.camel@gargon.hooperlab> Message-ID: <4A227AE6.3080706@ohiou.edu> David Cole wrote: > Looks like you changed from CMake 2.6.3 to 2.6.4 after the May 18th > submission... Yup : [kevin at murron kitware]$ sudo grep cmake /var/log/yum.log Jan 16 22:40:37 Updated: cmake.x86_64 2.6.2-3.fc10 Mar 25 23:41:30 Updated: cmake.x86_64 2.6.3-3.fc10 May 22 11:21:52 Updated: cmake.x86_64 2.6.4-1.fc10 I forgot why I switched from the nightly cvs version of cmake... > > We are investigating... Is the file also listed as modified in the > "Update.xml" file in the build tree's Testing/200905xx-xxxx directory? > No : [kevin at murron 20090531-0200]$ grep vtkOpenGLRenderWindow.cxx Update.xml [kevin at murron 20090531-0200]$ > Could you forward both of those files to me off list? Yes of course. > > Thanks, > David > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 259 bytes Desc: OpenPGP digital signature URL: From tonee47 at yahoo.com Sun May 31 10:34:36 2009 From: tonee47 at yahoo.com (John Eke) Date: Sun, 31 May 2009 07:34:36 -0700 (PDT) Subject: [vtkusers] vtkPicker picks an actor that isnt remotely close to the pick point In-Reply-To: <44f773f50905281132n44d50ddu6f22c3a69a86f563@mail.gmail.com> References: <1224266608.17399.166.camel@lenovo.local.net> <20081021214323.5C2272190@public.kitware.com> <7b3bdec70810212323m4b406af8t6d21561e85b6494c@mail.gmail.com> <20081022155316.C14D13A39@public.kitware.com> <7b3bdec70810220955h53c43f95h6e7418ec4b35c89e@mail.gmail.com> <7b3bdec70810221029j4735ae0l9e78687d06292956@mail.gmail.com> <1224709506.17399.450.camel@lenovo.local.net> <1224709598.17399.451.camel@lenovo.local.net> <480293.94647.qm@web38901.mail.mud.yahoo.com> <44f773f50905281132n44d50ddu6f22c3a69a86f563@mail.gmail.com> Message-ID: <822742.29853.qm@web38904.mail.mud.yahoo.com> Thanks a lot! That worked. What I need is for there to be no tolerance AT ALL, regardless of the size of the render window. Is there a fixed value I can set for this effect? I tried zero, and that didnt work. - John E ________________________________ From: kent williams To: John Eke Cc: vtkusers at vtk.org Sent: Thursday, May 28, 2009 2:32:21 PM Subject: Re: [vtkusers] vtkPicker picks an actor that isnt remotely close to the pick point the vtkPicker class lets you set the tolerance, for picking. The default tolerance is apparently a bit too loose for your taste. >From the documentation: > virtual void vtkPicker::SetTolerance(double) [virtual] > > Specify tolerance for performing pick operation. Tolerance is specified as fraction of rendering window size. > (Rendering window size is measured across diagonal.) The way this works is a little squirrelly, because you probably care about a maximum distance from the exact pixel center, in pixels. But this function wants a fraction of the window size (as measured diagonally), which you'll have to compute based on the window geometry. And if your window can be resized, you'll have to watch for resize events and update the picker tolerance. But the reason you can pick a few voxels away from the particular voxel is that it's tricky to pick small features with the mouse pointer. If you set the tolerance too low, it will make it rough for users to pick anything. On Thu, May 28, 2009 at 9:02 AM, John Eke wrote: > Hi Guys, > > I have a scenario where I am trying to enable annotations on images > displayed in a vtkImageActor. When I click on the image, I place a small > marker at that point on the image. Now when I click on that marker, it > allows me to do other things like enter notes etc. > > Problem is, I use vtkPicker to do the pick, and when I click on the marker > it works, problem is I move several pixels AWAY from the marker and when I > attempt a pick, I still pick the same marker. It seems the markers have a > few pixels around them where if you click, you can still pick the actor. IS > there any way to change this? Are there any params in vtkPicker I can set to > make sure that the markers should ONLY be picked if the intersect DIRECTLY > with the pick point? > > Thanks > > John E > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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 nasil122002 at yahoo.de Sun May 31 16:22:24 2009 From: nasil122002 at yahoo.de (Yusuf OEZBEK) Date: Sun, 31 May 2009 20:22:24 +0000 (GMT) Subject: [vtkusers] VolumeRendering Problem In-Reply-To: References: Message-ID: <234712.15083.qm@web28204.mail.ukl.yahoo.com> Hello! I wanted my watershed-segmentation result (from ITK) through vtkVolumeProMapper 3D So make a 3D volume. I have used vtkVolumeProMapper and vtkVolume. But I always get the error "undefined reference to vtkVolumeProMapper". Where is my mistake? I would be glad if you can help. Thank you! My code: void MIRCIT::imageDisplayingWatershed(){ this->displayImage3D->show(); this->displayImage3D->redraw(); typedef unsigned char PixelType; const unsigned int Dimension = 3; typedef itk::OrientedImage< PixelType, Dimension > ImageType; typedef itk::ImageSeriesReader< ImageType > ReaderType; ReaderType::Pointer reader = ReaderType::New(); typedef itk::GDCMImageIO ImageIOType; ImageIOType::Pointer dicomIO = ImageIOType::New(); reader->SetImageIO( dicomIO ); typedef itk::GDCMSeriesFileNames NamesGeneratorType; NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New(); nameGenerator->SetUseSeriesDetails( true ); nameGenerator->AddSeriesRestriction("0008|0021" ); nameGenerator->SetDirectory( selectedDirectory); typedef std::vector< std::string > SeriesIdContainer; const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs(); SeriesIdContainer::const_iterator seriesItr = seriesUID.begin(); SeriesIdContainer::const_iterator seriesEnd = seriesUID.end(); while( seriesItr != seriesEnd ) { seriesItr++; } std::string seriesIdentifier; seriesIdentifier = seriesUID.begin()->c_str(); typedef std::vector< std::string > FileNamesContainer; FileNamesContainer fileNames; fileNames = nameGenerator->GetFileNames( seriesIdentifier ); reader->SetFileNames( fileNames ); reader->Update(); typedef float InternalPixelType; typedef itk::RGBPixel RGBPixelType; typedef itk::Image< RGBPixelType, Dimension > RGBImageType; typedef itk::ImageFileWriter< RGBImageType > WriterType; typedef itk::WatershedImageFilter< ImageType > WatershedFilterType; typedef itk::Functor::ScalarToRGBPixelFunctor< unsigned long> ColorMapFunctorType; typedef WatershedFilterType::OutputImageType LabeledImageType; typedef itk::UnaryFunctorImageFilter ColorMapFilterType; typedef itk::ImageToVTKImageFilter ConnectorType; typedef itk::GradientMagnitudeImageFilter GradientMagnitudeFilterType; GradientMagnitudeFilterType::Pointer magnitudeFilter = GradientMagnitudeFilterType::New(); magnitudeFilter->SetInput(reader->GetOutput()); WatershedFilterType::Pointer watershedFilter = WatershedFilterType::New(); watershedFilter->SetInput( magnitudeFilter->GetOutput() ); watershedFilter->SetLevel(this->sliderLevelWatershed->value()); watershedFilter->SetThreshold(this->sliderLevelWatershed->value()); ColorMapFilterType::Pointer colorMapFilter = ColorMapFilterType::New(); colorMapFilter->SetInput( watershedFilter->GetOutput() ); ConnectorType::Pointer connector = ConnectorType::New(); connector->SetInput(watershedFilter->GetOutput()); vtkImageShiftScale *shift = vtkImageShiftScale::New(); shift->SetInput(connector->GetOutput()); shift->SetOutputScalarTypeToUnsignedChar(); vtkVolumeProMapper *mapperb = vtkVolumeProMapper::New(); mapperb->SetInputConnection(shift->GetOutputPort()); vtkVolume *volumeb = vtkVolume::New(); volumeb->SetMapper(mapperb); camera3D = vtkCamera::New(); camera3D->SetViewUp(0, 0, -1); camera3D->SetPosition(0, 1, 0); camera3D->SetFocalPoint(0, 0, 0); camera3D->ComputeViewPlaneNormal(); camera3D->Azimuth(20); renderer3DWaterShed = vtkRenderer::New(); renderWindow3DWaterShed = vtkRenderWindow::New(); renderWindow3DWaterShed->AddRenderer(renderer3DWaterShed); displayImage3D->SetRenderWindow(renderWindow3DWaterShed); displayImage3D->SetInteractorStyle(mode3DWaterShed); displayImage3D->Initialize(); renderer3DWaterShed->AddViewProp(volumeb); renderer3DWaterShed->SetActiveCamera(camera3D); renderer3DWaterShed->ResetCamera(); camera3D->Dolly(1.3); renderer3DWaterShed->ResetCameraClippingRange(); renderer3DWaterShed->Render(); this->displayImage3D->show(); this->displayImage3D->redraw(); WriterType::Pointer writer = WriterType::New(); writer->SetInput( colorMapFilter->GetOutput() ); writer->SetFileName("fds.tiff" ); writer->Update(); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From nasil122002 at yahoo.de Sun May 31 16:24:55 2009 From: nasil122002 at yahoo.de (Yusuf OEZBEK) Date: Sun, 31 May 2009 20:24:55 +0000 (GMT) Subject: [vtkusers] VolumeRendering Problem Message-ID: <179262.80387.qm@web28209.mail.ukl.yahoo.com> Hello! I wanted my watershed-segmentation result (from ITK) through vtkVolumeProMapper 3D So make a volume. I have used vtkVolumeProMapper and vtkVolume. But I always get the error "undefined reference to vtkVolumeProMapper". Where is my mistake? I would be glad if you can help. Thank you! My code: void MIRCIT::imageDisplayingWatershed(){ this->displayImage3D->show(); this->displayImage3D->redraw(); typedef unsigned char PixelType; const unsigned int Dimension = 3; typedef itk::OrientedImage< PixelType, Dimension > ImageType; typedef itk::ImageSeriesReader< ImageType > ReaderType; ReaderType::Pointer reader = ReaderType::New(); typedef itk::GDCMImageIO ImageIOType; ImageIOType::Pointer dicomIO = ImageIOType::New(); reader->SetImageIO( dicomIO ); typedef itk::GDCMSeriesFileNames NamesGeneratorType; NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New(); nameGenerator->SetUseSeriesDetails( true ); nameGenerator->AddSeriesRestriction("0008|0021" ); nameGenerator->SetDirectory( selectedDirectory); typedef std::vector< std::string > SeriesIdContainer; const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs(); SeriesIdContainer::const_iterator seriesItr = seriesUID.begin(); SeriesIdContainer::const_iterator seriesEnd = seriesUID.end(); while( seriesItr != seriesEnd ) { seriesItr++; } std::string seriesIdentifier; seriesIdentifier = seriesUID.begin()->c_str(); typedef std::vector< std::string > FileNamesContainer; FileNamesContainer fileNames; fileNames = nameGenerator->GetFileNames( seriesIdentifier ); reader->SetFileNames( fileNames ); reader->Update(); typedef float InternalPixelType; typedef itk::RGBPixel RGBPixelType; typedef itk::Image< RGBPixelType, Dimension > RGBImageType; typedef itk::ImageFileWriter< RGBImageType > WriterType; typedef itk::WatershedImageFilter< ImageType > WatershedFilterType; typedef itk::Functor::ScalarToRGBPixelFunctor< unsigned long> ColorMapFunctorType; typedef WatershedFilterType::OutputImageType LabeledImageType; typedef itk::UnaryFunctorImageFilter ColorMapFilterType; typedef itk::ImageToVTKImageFilter ConnectorType; typedef itk::GradientMagnitudeImageFilter GradientMagnitudeFilterType; GradientMagnitudeFilterType::Pointer magnitudeFilter = GradientMagnitudeFilterType::New(); magnitudeFilter->SetInput(reader->GetOutput()); WatershedFilterType::Pointer watershedFilter = WatershedFilterType::New(); watershedFilter->SetInput( magnitudeFilter->GetOutput() ); watershedFilter->SetLevel(this->sliderLevelWatershed->value()); watershedFilter->SetThreshold(this->sliderLevelWatershed->value()); ColorMapFilterType::Pointer colorMapFilter = ColorMapFilterType::New(); colorMapFilter->SetInput( watershedFilter->GetOutput() ); ConnectorType::Pointer connector = ConnectorType::New(); connector->SetInput(watershedFilter->GetOutput()); vtkImageShiftScale *shift = vtkImageShiftScale::New(); shift->SetInput(connector->GetOutput()); shift->SetOutputScalarTypeToUnsignedChar(); vtkVolumeProMapper *mapperb = vtkVolumeProMapper::New(); mapperb->SetInputConnection(shift->GetOutputPort()); vtkVolume *volumeb = vtkVolume::New(); volumeb->SetMapper(mapperb); camera3D = vtkCamera::New(); camera3D->SetViewUp(0, 0, -1); camera3D->SetPosition(0, 1, 0); camera3D->SetFocalPoint(0, 0, 0); camera3D->ComputeViewPlaneNormal(); camera3D->Azimuth(20); renderer3DWaterShed = vtkRenderer::New(); renderWindow3DWaterShed = vtkRenderWindow::New(); renderWindow3DWaterShed->AddRenderer(renderer3DWaterShed); displayImage3D->SetRenderWindow(renderWindow3DWaterShed); displayImage3D->SetInteractorStyle(mode3DWaterShed); displayImage3D->Initialize(); renderer3DWaterShed->AddViewProp(volumeb); renderer3DWaterShed->SetActiveCamera(camera3D); renderer3DWaterShed->ResetCamera(); camera3D->Dolly(1.3); renderer3DWaterShed->ResetCameraClippingRange(); renderer3DWaterShed->Render(); this->displayImage3D->show(); this->displayImage3D->redraw(); WriterType::Pointer writer = WriterType::New(); writer->SetInput( colorMapFilter->GetOutput() ); writer->SetFileName("fds.tiff" ); writer->Update(); } -------------- next part -------------- An HTML attachment was scrubbed... URL: