From khademi at cse.shirazu.ac.ir Thu May 1 00:08:07 2008 From: khademi at cse.shirazu.ac.ir (Somayeh Khademi) Date: Thu, 1 May 2008 08:38:07 +0430 (IRDT) Subject: [vtkusers] Can anyone help me? Message-ID: <36698.80.191.119.211.1209614887.squirrel@mail.cse.shirazu.ac.ir> -- Hello every body, I`m using python in linux.I want to use vtkmpeg2writer or vtkffmpegwriter in my project for capture and save movie. but I don`t know how can I add these libs to my project that work. I configure vtkpmeg2writer with cmake and make it.I use vtk4.2 libraries in my project and now I want add this vtkmpeg2writer lib to existing vtk lib in my project. what changes I need to do in existing vtk lib that I can use this new lib? Do anyone have any idea about this? -------------------------------------------------------------------------- This E-mail has been sent using CSE webmail [http://www.cse.shirazu.ac.ir] If you are not intended recipient of this E-mail, please inform the sender and Delete it from your box immediately. From a.albert at jacobs-university.de Thu May 1 07:56:22 2008 From: a.albert at jacobs-university.de (Adrian Albert) Date: Thu, 1 May 2008 13:56:22 +0200 Subject: [vtkusers] 2D projections of 3D vtkImageData Message-ID: <2cd88c320805010456s1530537do47f00a2ed4beba98@mail.gmail.com> Dear All I was wondering if there is a specialized class for making 2D projections out of 3D data, or more general to make N-1 D projections from N D data. Thus from a 1D line one would get a point, from a 2D image on would get a 1D line, and from a 3D volume one would get a 2D image. Any ideas? best, Adrian -- --------------------------------------------------- Adrian Albert School of Engineering and Science Jacobs University Bremen Germany Tel.: 00494212003258 -------------- next part -------------- An HTML attachment was scrubbed... URL: From louxkr at gmail.com Thu May 1 08:20:39 2008 From: louxkr at gmail.com (Kerry Loux) Date: Thu, 1 May 2008 08:20:39 -0400 Subject: [vtkusers] vtkProp3D rotations order Message-ID: <65c344fe0805010520q1a76de74n709befb2343563eb@mail.gmail.com> Hello all, I have an actor that I'm trying to orient in my renderWindow using the vtkActor::SetOrientation(double, double, double) method. The documentation for this method (I think this is actually found in vtkActor's parent, vtkProp3D) says the rotations are performed as Z, X, Y. When I give it the proper angles for this scenario, the orientation is off quite a bit. When I give it the angles that are correct for a rotation order of X, Y, Z, then it orients the actor correctly. I used MATLAB to check my math, and I think the math is OK. Has anyone else experienced this? Is the documentation wrong? I'm using VTK 5.0.4 under MSW. Thanks, Kerry -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Thu May 1 09:20:20 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Thu, 01 May 2008 08:20:20 -0500 Subject: [vtkusers] 2D projections of 3D vtkImageData In-Reply-To: <2cd88c320805010456s1530537do47f00a2ed4beba98@mail.gmail.com> References: <2cd88c320805010456s1530537do47f00a2ed4beba98@mail.gmail.com> Message-ID: <4819C394.7020706@cfdrc.com> Have you looked at vtkCutter: http://www.vtk.org/doc/release/5.0/html/a01277.html? - Amy Adrian Albert wrote: > Dear All > > I was wondering if there is a specialized class for making 2D > projections out of 3D data, or more general to make N-1 D projections > from N D data. Thus from a 1D line one would get a point, from a 2D > image on would get a 1D line, and from a 3D volume one would get a 2D > image. > > Any ideas? > > best, > Adrian > > -- > --------------------------------------------------- > Adrian Albert > School of Engineering and Science > Jacobs University Bremen > Germany > Tel.: 00494212003258 > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From ahs at cfdrc.com Thu May 1 09:23:06 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Thu, 01 May 2008 08:23:06 -0500 Subject: [vtkusers] vtkProp3D rotations order In-Reply-To: <65c344fe0805010520q1a76de74n709befb2343563eb@mail.gmail.com> References: <65c344fe0805010520q1a76de74n709befb2343563eb@mail.gmail.com> Message-ID: <4819C43A.4030903@cfdrc.com> Hi Kerry, Here's the code for the vtkProp3D::SetOrientation method. The rotations are indeed done in the Z, X, Y order. void vtkProp3D::SetOrientation (double x,double y,double z) { // compute the orientation of the transformation matrix // as is done in GetOrientation to make sure we are consistent this->Transform->GetOrientation(this->Orientation); if (x == this->Orientation[0] && y == this->Orientation[1] && z == this->Orientation[2]) { return; } this->IsIdentity = 0; // store the coordinates this->Orientation[0] = x; this->Orientation[1] = y; this->Orientation[2] = z; vtkDebugMacro(<< " Orientation set to ( " << this->Orientation[0] << ", " << this->Orientation[1] << ", " << this->Orientation[2] << ")\n"); this->Transform->Identity(); this->Transform->PreMultiply (); this->Transform->RotateZ(this->Orientation[2]); this->Transform->RotateX(this->Orientation[0]); this->Transform->RotateY(this->Orientation[1]); this->Modified(); } - Amy Kerry Loux wrote: > Hello all, > > I have an actor that I'm trying to orient in my renderWindow using the > vtkActor::SetOrientation(double, double, double) method. The > documentation for this method (I think this is actually found in > vtkActor's parent, vtkProp3D) says the rotations are performed as Z, > X, Y. When I give it the proper angles for this scenario, the > orientation is off quite a bit. When I give it the angles that are > correct for a rotation order of X, Y, Z, then it orients the actor > correctly. I used MATLAB to check my math, and I think the math is > OK. Has anyone else experienced this? Is the documentation wrong? > I'm using VTK 5.0.4 under MSW. > > Thanks, > > Kerry > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From ahs at cfdrc.com Thu May 1 11:40:14 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Thu, 01 May 2008 10:40:14 -0500 Subject: [vtkusers] 2D projections of 3D vtkImageData In-Reply-To: <2cd88c320805010813o4f013486q2dd9b9da08d6d2ad@mail.gmail.com> References: <2cd88c320805010456s1530537do47f00a2ed4beba98@mail.gmail.com> <4819C394.7020706@cfdrc.com> <2cd88c320805010813o4f013486q2dd9b9da08d6d2ad@mail.gmail.com> Message-ID: <4819E45E.8090607@cfdrc.com> Hi Adrian, I'm copying this back to the vtkusers list so other people can see this clarification and help you find a solution. Please keep the discussion on the list. Thanks, Amy Adrian Albert wrote: > Hi Amy, > > > thanks again for replying! > In fact, by projection I meant accumulating all data values from a N D > object onto a N-1 D object. For example, for the 2D->1D case, this > would mean accumulating (e.g., summing) all the values on the vertical > axis from the 2D image corresponding to a certain value on the > horizontal axis. The final image will be 1D and would store for each > value on the horizontal axis the sum of the values corresponding to > this value from the initial 2D image. > > In my case, I have a vtkImageData containing a 3D histogram (histogram > depending on 3 variables) obtained with vtkImageAccumulate, which I > would like to make 2D (i.e., get a 2D projection of it). > > I am browsing through the documentation, but so far I haven't found > what I need.... > > > Adrian > > On Thu, May 1, 2008 at 3:20 PM, Amy Squillacote > wrote: > > Have you looked at vtkCutter: > http://www.vtk.org/doc/release/5.0/html/a01277.html? > > - Amy > > Adrian Albert wrote: > > Dear All > > I was wondering if there is a specialized class for making 2D > projections out of 3D data, or more general to make N-1 D > projections from N D data. Thus from a 1D line one would get a > point, from a 2D image on would get a 1D line, and from a 3D > volume one would get a 2D image. > > Any ideas? > > best, > Adrian > > -- > --------------------------------------------------- > Adrian Albert > School of Engineering and Science > Jacobs University Bremen > Germany > Tel.: 00494212003258 > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > > -- > Amy Squillacote Phone: (256) 726-4839 > Computer Scientist Fax: (256) 726-4806 > CFD Research Corporation Web: http://www.cfdrc.com > 215 Wynn Drive, Suite 501 > Huntsville, AL 35805 > > > > > > -- > --------------------------------------------------- > Adrian Albert > School of Engineering and Science > Jacobs University Bremen > Germany > Tel.: 00494212003258 -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From david.cole at kitware.com Thu May 1 13:11:18 2008 From: david.cole at kitware.com (David Cole) Date: Thu, 1 May 2008 13:11:18 -0400 Subject: [vtkusers] Reference Count = 2 after Constuctor In-Reply-To: <43a689850804281509h7c760383yf368d4730c4efc98@mail.gmail.com> References: <43a689850804281509h7c760383yf368d4730c4efc98@mail.gmail.com> Message-ID: It's because you are calling this->SetNumberOfInputPorts(0); in your constructor. Your parent class sets it to 1. When you call this, you get connected to the default executive that's created by the parent class and form a "reference loop". This is ok and expected, though. If you call: vtkH5PolyDataReader* reader = vtkH5PolyDataReader::New(); reader->Print(cout); reader->Delete(); your reader will be deleted even though in the middle it has a ref count of 2... Set breakpoints (or put "cout <<" stuff) in the constructor / destructor for this simple case to prove it to yourself. HTH, David On Mon, Apr 28, 2008 at 6:09 PM, Mike Jackson wrote: > I have a class that I am writing that inherits from > vtkPolyDataAlgorithm. After calling: > > vtkH5PolyDataReader* reader = vtkH5PolyDataReader::New(); > the reference count is 2. Shouldn't it be 1? I have another generic > class the inherits from vtkObject and running the same basic test > gives me a reference count of 1. What might be some reasons why my ref > count is 2? I think this is causing other problems in my code. > > Here is my constructor: > > vtkCxxRevisionMacro(vtkH5PolyDataReader, "1.0"); > vtkStandardNewMacro(vtkH5PolyDataReader); > > vtkH5PolyDataReader::vtkH5PolyDataReader() > { > this->FileName = NULL; > this->SetNumberOfInputPorts(0); > } > > I also have the following in the header: > > public: > static vtkH5PolyDataReader *New(); > > protected: > vtkH5PolyDataReader(); > ~ vtkH5PolyDataReader(); > > > Thanks for any help on this. > -- > Mike Jackson > imikejackson _at_ gee-mail dot com > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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 doug.hackworth at vanderbilt.edu Thu May 1 15:49:01 2008 From: doug.hackworth at vanderbilt.edu (Doug Hackworth) Date: Thu, 01 May 2008 14:49:01 -0500 Subject: [vtkusers] AddObserver with Python Message-ID: <481A1EAD.2020909@vanderbilt.edu> Greetings, all. I am wanting to do something like the following: import vtk (...) planewidget = vtk.vtkImplicitPlaneWidget() (...) planewidget.AddObserver("EndInteractionEvent", MyCallbackFunction) and I want MyCallbackFunction() to be passed some arguments, i.e. my data: def MyCallbackFunction(PlaneWidget, Polydata, BoundaryConditions): (...) From what I've read at least in the C++ documentation, the proper way to do this is to subclass vtkCommand and store the call data in the subclass, then pass an instance of this new class to AddObserver, etc. The trouble is, I can't seem to locate the vtkCommand class in the Python bindings... Is there supposed to be some other way to do it for Python? It seems like the only other option for MyCallbackFunction() to have access to my data is to have the data be global objects, which I'd vastly prefer not to do. Insights, anyone? Also: When I run my program with the plane widget implemented as above, the widget seems to work fine, but I get the error: TypeError: MyCallbackFunction() takes exactly 3 arguments (2 given) Which two arguments are getting passed automatically? Can I add more? Thanks, Doug From ken.urish at gmail.com Thu May 1 17:40:49 2008 From: ken.urish at gmail.com (Ken Urish) Date: Thu, 1 May 2008 17:40:49 -0400 Subject: [vtkusers] ImageReslice question - Grad student in need of graduation! Message-ID: Help! Ive been stuck on this for a while now. I am viewing a 3d dicom image slice by slice based off teh the "ImageReslice1.cxx" example with teh imageReslice class. I am trying to pick 3d points on the image. I can pick x,y points fine. BUt I have no way to figure out where I am on teh z-axis. Ive been having trouble so Ive just been trying to get the program to output the z-slice I am on when I hit a right mouse click. It give me a number that does not change and is incorrect. I threw an actor into the callback to see if I could call "GetZSlice" but this always gives me a "0". Similarly if I try to see my bounds or set bounds off the actor, nothing works. Ive lost a week on this really simple step and it driving me up the wall. Thanks --Ken-- The code for the callback is below. // The mouse motion callback, to turn "Slicing" on and off class vtkImageInteractionCallback : public vtkCommand { public: static vtkImageInteractionCallback *New() { return new vtkImageInteractionCallback; }; vtkImageInteractionCallback() { this->Slicing = 0; this->ImageReslice = 0; this->Interactor = 0; }; void SetImageReslice(vtkImageReslice *reslice) { this->ImageReslice = reslice; }; void SetACtor(vtkImageActor *actor) { this->Actor = actor; }; vtkImageReslice *GetImageReslice() { return this->ImageReslice; }; vtkImageActor *GetImageActor() { return this->Actor; }; void SetInteractor(vtkRenderWindowInteractor *interactor) { this->Interactor = interactor; }; vtkRenderWindowInteractor *GetInteractor() { return this->Interactor; }; virtual void Execute(vtkObject *, unsigned long event, void *) { vtkRenderWindowInteractor *interactor = this->GetInteractor(); int lastPos[2]; interactor->GetLastEventPosition(lastPos); int currPos[2]; interactor->GetEventPosition(currPos); if (event == vtkCommand::LeftButtonPressEvent) { this->Slicing = 1; } else if (event == vtkCommand::LeftButtonReleaseEvent) { this->Slicing = 0; } else if (event == vtkCommand::MouseMoveEvent) { if (this->Slicing) { vtkImageReslice *reslice = this->ImageReslice; // Increment slice position by deltaY of mouse int deltaY = lastPos[1] - currPos[1]; reslice->GetOutput()->UpdateInformation(); double sliceSpacing = reslice->GetOutput()->GetSpacing()[2]; vtkMatrix4x4 *matrix = reslice->GetResliceAxes(); // move the center point that we are slicing through double point[4]; double center[4]; point[0] = 0.0; point[1] = 0.0; point[2] = sliceSpacing * deltaY; point[3] = 1.0; matrix->MultiplyPoint(point, center); matrix->SetElement(0, 3, center[0]); matrix->SetElement(1, 3, center[1]); matrix->SetElement(2, 3, center[2]); int z = actor->GetZSlice(); interactor->Render(); } else { vtkInteractorStyle *style = vtkInteractorStyle::SafeDownCast( interactor->GetInteractorStyle()); if (style) { style->OnMouseMove(); } } } }; From a.albert at jacobs-university.de Thu May 1 17:55:04 2008 From: a.albert at jacobs-university.de (Adrian Albert) Date: Thu, 1 May 2008 23:55:04 +0200 Subject: [vtkusers] display image with vtkImageViewer Message-ID: <2cd88c320805011455w2218c189n598a5576e64ac47c@mail.gmail.com> Hi All I was wondering what does one need to do to make vtkImageViewer work, since I am following the examples in the documentation, and I get no result. My data is a 2D vtkImageData object of dimensions (2x2x1) (so 4 boxes), with 4 non-zero entries, with values: 2D Slice value at 0 0: 3376 2D Slice value at 0 1: 305194 2D Slice value at 1 0: 334 2D Slice value at 1 1: 811 I'd like to render this image on the screen, but I only get a black output with my code: vtkImageViewer *viewer = vtkImageViewer::New(); viewer->SetInput (my2DSlice); viewer->SetZSlice (0); // viewer->SetColorWindow(0.5); viewer->SetColorLevel (0.001); viewer->Render (); What is the problem here? I know that one value is way larger than the others, but it should appear darker or lighter, and the others should be still visible. Any ideas and hints will be appreciated. Best, Adrian -- --------------------------------------------------- Adrian Albert School of Engineering and Science Jacobs University Bremen Germany Tel.: 00494212003258 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerdmeiser at yahoo.com Thu May 1 19:09:45 2008 From: gerdmeiser at yahoo.com (Gerd Meiser) Date: Thu, 1 May 2008 18:09:45 -0500 (CDT) Subject: [vtkusers] paraview: black 3D view Message-ID: <604322.50577.qm@web46101.mail.sp1.yahoo.com> Hello! I have a problem with paraview on a linux machine (ubuntu 7.04) with matrox g440 graphics card. The 3D view (right half of the paraview window) remains black no matter which dataset is loaded. The data is definitely loaded (correct values in the information tab) and can be displayed on another machine without problems. Similary Mayavi doesn't display any 3D graphics. Here the view is not black, but it is not updated at all, so that other windows which are moved across the 3D display area leave traces behind in this area. Surprisingly, other self-compiled VTK applications and OpenGL applications (for example glgears) run without problems (well, to be exact: the display is not always updated under the mouse cursor, so that sometimes a single, ugly, box appears shortly, but besides this the output is fine). Has anybody ever seen similar problems? Obviously some graphics drivers or settings are wrong. But I don't have enough experience to know which information you might need to analyze what's wrong. Any ideas? Regards, G. Meiser ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From prabhu at aero.iitb.ac.in Fri May 2 00:42:53 2008 From: prabhu at aero.iitb.ac.in (Prabhu Ramachandran) Date: Fri, 02 May 2008 10:12:53 +0530 Subject: [vtkusers] VTK, Python, and Qt4 In-Reply-To: References: Message-ID: <481A9BCD.3090807@aero.iitb.ac.in> Doug Hackworth wrote: > "RuntimeError: the PyQt4.QtCore and qt modules both wrap the QObject class" > > Here is what I'm importing: > > import sys > import vtk > import qt > from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor I am no Qt expert but IIRC qt4 is not to be used with Qt (which is why you have a separate qt4 package). You have to use qt4 in its entirety instead of the older qt3. cheers, prabhu From beromuald at wanadoo.fr Fri May 2 02:54:21 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Fri, 2 May 2008 08:54:21 +0200 (CEST) Subject: [vtkusers] ImageReslice question - Grad student in need of graduation! Message-ID: <28886677.339081209711261227.JavaMail.www@wwinf1a01> Hi Ken, Maybe this can help you ==>? http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 Bye > Message du 01/05/08 23:41 > De : "Ken Urish" > A : vtkusers at vtk.org > Copie ? : > Objet : [vtkusers] ImageReslice question - Grad student in need ofgraduation! > > Help! > > Ive been stuck on this for a while now. I am viewing a 3d dicom image > slice by slice based off teh the "ImageReslice1.cxx" example with teh > imageReslice class. > I am trying to pick 3d points on the image. I can pick x,y points > fine. BUt I have no way to figure out where I am on teh z-axis. > > Ive been having trouble so Ive just been trying to get the program to > output the z-slice I am on when I hit a right mouse click. It give me > a number that does not change and is incorrect. > > I threw an actor into the callback to see if I could call "GetZSlice" > but this always gives me a "0". Similarly if I try to see my bounds or > set bounds off the actor, nothing works. Ive lost a week on this > really simple step and it driving me up the wall. > > > Thanks > --Ken-- > > > The code for the callback is below. > > > // The mouse motion callback, to turn "Slicing" on and off > class vtkImageInteractionCallback : public vtkCommand > { > public: > > static vtkImageInteractionCallback *New() { > return new vtkImageInteractionCallback; }; > > vtkImageInteractionCallback() { > this->Slicing = 0; > this->ImageReslice = 0; > this->Interactor = 0; }; > > void SetImageReslice(vtkImageReslice *reslice) { > this->ImageReslice = reslice; }; > > void SetACtor(vtkImageActor *actor) { > this->Actor = actor; }; > > vtkImageReslice *GetImageReslice() { > return this->ImageReslice; }; > > vtkImageActor *GetImageActor() { > return this->Actor; }; > > > void SetInteractor(vtkRenderWindowInteractor *interactor) { > this->Interactor = interactor; }; > > vtkRenderWindowInteractor *GetInteractor() { > return this->Interactor; }; > > virtual void Execute(vtkObject *, unsigned long event, void *) > { > vtkRenderWindowInteractor *interactor = this->GetInteractor(); > > int lastPos[2]; > interactor->GetLastEventPosition(lastPos); > int currPos[2]; > interactor->GetEventPosition(currPos); > > if (event == vtkCommand::LeftButtonPressEvent) > { > this->Slicing = 1; > } > else if (event == vtkCommand::LeftButtonReleaseEvent) > { > this->Slicing = 0; > } > else if (event == vtkCommand::MouseMoveEvent) > { > if (this->Slicing) > { > vtkImageReslice *reslice = this->ImageReslice; > > // Increment slice position by deltaY of mouse > int deltaY = lastPos[1] - currPos[1]; > > reslice->GetOutput()->UpdateInformation(); > double sliceSpacing = reslice->GetOutput()->GetSpacing()[2]; > vtkMatrix4x4 *matrix = reslice->GetResliceAxes(); > // move the center point that we are slicing through > double point[4]; > double center[4]; > point[0] = 0.0; > point[1] = 0.0; > point[2] = sliceSpacing * deltaY; > point[3] = 1.0; > matrix->MultiplyPoint(point, center); > matrix->SetElement(0, 3, center[0]); > matrix->SetElement(1, 3, center[1]); > matrix->SetElement(2, 3, center[2]); > int z = actor->GetZSlice(); > interactor->Render(); > } > else > { > vtkInteractorStyle *style = vtkInteractorStyle::SafeDownCast( > interactor->GetInteractorStyle()); > if (style) > { > style->OnMouseMove(); > } > } > } > }; > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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 c.p.botha at tudelft.nl Fri May 2 03:02:06 2008 From: c.p.botha at tudelft.nl (Charl Botha) Date: Fri, 2 May 2008 09:02:06 +0200 Subject: [vtkusers] AddObserver with Python In-Reply-To: <481A1EAD.2020909@vanderbilt.edu> References: <481A1EAD.2020909@vanderbilt.edu> Message-ID: <31ddba770805020002o2bdf771mf6b3c6773ca3a264@mail.gmail.com> On Thu, May 1, 2008 at 9:49 PM, Doug Hackworth wrote: > Also: When I run my program with the plane widget implemented as above, > the widget seems to work fine, but I get the error: > > TypeError: MyCallbackFunction() takes exactly 3 arguments (2 given) > > Which two arguments are getting passed automatically? Can I add more? The two arguments are object_binding and event_name. If you really need to send more data in, you could for example inject variables into the object namespace. For example: my_object.some_string = 'hello world' my_object.AddObserver('SomeEvent', MyCallbackFunction) def MyCallbackFunction(object_binding, event_name): print object_binding.some_string You could also use a lambda statement in your AddObserver call to pass things through that are already defined at that time: some_string = 'hello world' my_object.AddObserver('SomeEvent', lambda o, e, mystring=some_string: MyCallbackFunction(o,e,mystring)) Good luck, Charl Botha From a.albert at jacobs-university.de Fri May 2 07:30:18 2008 From: a.albert at jacobs-university.de (Adrian Albert) Date: Fri, 2 May 2008 13:30:18 +0200 Subject: [vtkusers] error in vtkXYPlotActor? Message-ID: <2cd88c320805020430x7c82a6b4m687131a9fd9541c1@mail.gmail.com> Dear All, I was wondering if there was a bug in vtkXYPlotActor that doesn't allow one to plot field data (2 components) by specifying that the x axis should get the values from component 0 and the y axis from component 1 of the field. My code is at the end of this email. It seems that vtkXYPlotActor doesn't do what it should when I tell it to use component 0 as x values and component 1 as y values. Maybe I am doing something wrong? Please advise! Many thanks, Adrian vtkImageData *myPlot = vtkImageData::New (); myPlot->SetNumberOfScalarComponents (2); myPlot->Initialize(); myPlot->SetSpacing(1.0, 0.0, 0.0); myPlot->SetDimensions (v->GetNumberOfTuples (), 1, 1); myPlot->SetOrigin(1.0, 0.0, 0.0); myPlot->GetPointData ()->SetScalars (g); vtkXYPlotActor* profile = vtkXYPlotActor::New(); profile->AddInput(myPlot); profile->SetPlotColor (1, 1, 0, 0); profile->SetPlotColor (0, 0, 0, 1); profile->GetPositionCoordinate()->SetValue( 0.05, 0.05, 0); profile->GetPosition2Coordinate()->SetValue( 0.95, 0.95, 0); profile->SetNumberOfXLabels(10); profile->SetDataObjectXComponent (0, 0); profile->SetDataObjectYComponent (0, 1); profile->SetXValuesToValue (); profile->SetPointComponent (0, 1); profile->SetTitle( "g(v)" ); profile->SetXTitle( "v"); profile->SetYTitle( "g(v)"); profile->GetProperty()->SetColor( 0, 0, 0); profile->GetProperty()->SetLineWidth( 2); profile->SetLabelFormat("%g"); vtkTextProperty* tprop = profile->GetTitleTextProperty(); tprop->SetColor(0.02,0.06,0.62); tprop->SetFontFamilyToArial(); tprop->SetFontSize (30); profile->SetAxisTitleTextProperty(tprop); profile->SetAxisLabelTextProperty(tprop); profile->SetTitleTextProperty(tprop); -- --------------------------------------------------- Adrian Albert School of Engineering and Science Jacobs University Bremen Germany Tel.: 00494212003258 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tavares at fe.up.pt Fri May 2 09:51:26 2008 From: tavares at fe.up.pt (=?iso-8859-1?Q?Jo=E3o_Manuel_R._S._Tavares?=) Date: Fri, 2 May 2008 14:51:26 +0100 Subject: [vtkusers] =?iso-8859-1?q?Symposium_=22Image_Processing_and_Analy?= =?iso-8859-1?q?sis=22_within_the_ICCES=2709_Thailand_-_Announce_?= =?iso-8859-1?q?=26_Call_for_Papers?= Message-ID: <003e01c8ac5b$9dd8c650$d98a52f0$@up.pt> (Our apologies for cross-posting. We appreciate if you kindly distribute this information by your co-workers and colleagues.) **************************************************************************** ********************* Symposium ?Image Processing and Analysis? International Conference on Computational & Experimental Engineering and Sciences 2009 (ICCES'09) Phuket, Thailand, 8-13 April 2009 http://icces.org/cgi-bin/ices09/pages/index **************************************************************************** ********************* Dear Colleague, Within the International Conference on Computational & Experimental Engineering and Sciences 2009 (ICCES'09), to be held in Phuket, Thailand, in 8-13 April 2009, we are organizing the Symposium ?Image Processing and Analysis?. Examples of some topics that will be considered in that symposium are: Image restoring, Description, Compression, Segmentation and Description; Objects tracking, Matching, Reconstruction and Registration; Visualization Enhance; Simulation and Animation; Software Development for Image Processing and Analysis; Grid Computing in Image Processing and Analysis; Applications of Image Processing and Analysis. Due to your research activities in those fields, we would like to invite you to submit your work and participate in the Symposium ?Image Processing and Analysis?. For instructions and submission, please access to the conference website at: http://icces.org/cgi-bin/ices09/pages/index. Please note, when submitting your work you should choose the Symposium ?Image Processing and Analysis?. Important dates and Instructions: - 15 Oct 2008: Start abstract submission; - 1 Jan 2009: Deadline for abstract submission; - 10 Jan 2009: End of abstract selection. If you intend to submit your work please notify as soon as possible the main organizer of your intention (tavares at fe.up.pt); Instructions for authors are available at: http://icces.org/cgi-bin/ices09/pages/guide. With kind regards, Yours sincerely, The Organizers, Jo?o Manuel R. S. Tavares (tavares at fe.up.pt) (main organizer) Faculty of Engineering of University of Porto, Porto, Portugal Yongjie (Jessica) Zhan (jessicaz at andrew.cmu.edu) Department of Mechanical Engineering, Carnegie Mellon University, Pittsburgh, USA Maria Jo?o M. Vasconcelos (maria.vasconcelos at fe.up.pt) Faculty of Engineering of University of Porto, Porto, Portugal From paulojamorim at gmail.com Fri May 2 12:26:08 2008 From: paulojamorim at gmail.com (Paulo Henrique Junqueira Amorim) Date: Fri, 2 May 2008 13:26:08 -0300 Subject: [vtkusers] PolyData Operations VTK 5 In-Reply-To: References: <98e18c70804261844j1af98c6ew9ca5fd9f934b86@mail.gmail.com> Message-ID: <98e18c70805020926s44e22e0fwca58ad0fd9e92c79@mail.gmail.com> Hi Mathieu, Thank but the vtkImplicitPolyData only works in vtk 4.2, my project uses vtk 5.1 and wrapper to Python. I tried to convert PolyData implicit function and then use the vtkImplicitBoolean but the output of vtkImplicitBoolean is null, I am exported to stl and export null, I am creted Actor and Add renderer, but the output of the renderer is black. See below code. Best Regards, Paulo Amorim The code convert PolyData in Implicit Function: from vtk import * #To test PolyData Boolean Cylinder = vtkCylinderSource() Cylinder.SetHeight(35) Cylinder.SetRadius(6) Cube = vtkCubeSource() Cube.SetXLength(100) Cube.SetYLength(10) Cube.SetZLength(10) # transforming polyData of the Cylinder to an implicitFunction poly_Cylinder = vtkPolyData() poly_Cylinder.SetPoints(Cylinder.GetOutput().GetPoints()) tri_Cylinder = vtkTriangleFilter() tri_Cylinder.SetInput(poly_Cylinder) implicit_Cylinder = vtkImplicitModeller() implicit_Cylinder.SetInputConnection(tri_Cylinder.GetOutputPort()) dataset_Cylinder = vtkImplicitDataSet() dataset_Cylinder.SetDataSet(implicit_Cylinder.GetOutput()) # ---- transforming polyData of the Cube to an implicitFunction ----------- poly_Cube = vtkPolyData() poly_Cube.SetPoints(Cube.GetOutput().GetPoints()) tri_Cube = vtkTriangleFilter() tri_Cube.SetInput(poly_Cube) implicit_Cube = vtkImplicitModeller() implicit_Cube.SetInputConnection(tri_Cube.GetOutputPort()) dataset_Cube = vtkImplicitDataSet() dataset_Cube.SetDataSet(implicit_Cube.GetOutput()) #Boolean Difference two implicit funcion (cylinder and cube) implict_Boolean = vtkImplicitBoolean() implict_Boolean.SetOperationTypeToDifference() implict_Boolean.AddFunction(dataset_Cube) implict_Boolean.AddFunction(dataset_Cylinder) Sample = vtkSampleFunction() Sample.SetImplicitFunction(implict_Boolean) Surface = vtkContourFilter() Surface.SetInputConnection(Sample.GetOutputPort()) #Export to STL writerBinary = vtkSTLWriter() writerBinary.SetFileName("c:\\exported.stl") writerBinary.SetInput(Surface.GetOutput()) writerBinary.SetFileType(2) writerBinary.Write() Mapper = vtkPolyDataMapper() Mapper.SetInput(Surface.GetOutput()) Mapper.ScalarVisibilityOn() Actor = vtkActor() Actor.SetMapper(Mapper) Actor.SetPosition(0,0,0) ren = vtkRenderer() ren.AddActor(Actor) renWin = vtkRenderWindow() renWin.AddRenderer(ren) iren = vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) renWin.Render() 2008/4/28 Mathieu Malaterre : > Hi Paulo, > > I believe this question has been raised in the vtkusers mailing list > before, how about: > > http://www.vtk.org/pipermail/vtkusers/2007-April/090730.html > > HTH > -Mathieu > > On Sun, Apr 27, 2008 at 3:44 AM, Paulo Henrique Junqueira Amorim > wrote: > > Hi All, > > > > I am researching how to make operation of intersse??o and subtraction of > > PolyData with the vtk 5. But I do not think any refence. > > > > That class could use? > > > > > > Best Regards, > > Paulo > > > > > > _______________________________________________ > > This is the private VTK discussion list. > > Please keep messages on-topic. Check the FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > > -- > Mathieu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From doug.hackworth at vanderbilt.edu Fri May 2 14:31:19 2008 From: doug.hackworth at vanderbilt.edu (Doug Hackworth) Date: Fri, 02 May 2008 13:31:19 -0500 Subject: [vtkusers] VTK, Python, and Qt4 In-Reply-To: <481A9BCD.3090807@aero.iitb.ac.in> References: <481A9BCD.3090807@aero.iitb.ac.in> Message-ID: <481B5DF7.7020001@vanderbilt.edu> Prabhu Ramachandran wrote: >> "RuntimeError: the PyQt4.QtCore and qt modules both wrap the QObject >> class" >> >> Here is what I'm importing: >> >> import sys >> import vtk >> import qt >> from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor > > I am no Qt expert but IIRC qt4 is not to be used with Qt (which is why > you have a separate qt4 package). You have to use qt4 in its entirety > instead of the older qt3. Many thanks again, Prabhu, that's exactly what the problem was. I had not realized that 'import qt' was actually importing qt3 (its Ubuntu package had been installed as a dependency for something else, which had escaped my notice) and that the entirely different statement 'import PyQt4' is needed to import qt4. A non-obvious point (at least to me) and why I appealed to you experts in the first place. Thanks! From hansvp at hotmail.com Fri May 2 18:51:20 2008 From: hansvp at hotmail.com (Hans van Piggelen) Date: Fri, 2 May 2008 22:51:20 +0000 Subject: [vtkusers] Mapping vtkDoubleArray Message-ID: Hi there, I'm having some trouble with mapping a vtkDoubleArray onto an existing geometry. The original data set consists of an Ensight model with various data sets. This is my code: // get original array count int arrayCount = vEnsightReader->GetOutput()->GetPointData()->GetNumberOfArrays();// add generated array to stackvGeneratedArray->SetName("Temporal gradient");vEnsightReader->GetOutput()->GetPointData()->AddArray(vGeneratedArray);if(vEnsightReader->GetOutput()->GetPointData()->SetActiveAttribute(arrayCount, 0) != arrayCount) AfxMessageBox("Array not set!");// remove current actor from scene, so it can be updated render->RemoveActor( vContourActor );vContourActor->Delete();vContourMapper->Delete();vContourMapper = vtkPolyDataMapper::New();vContourMapper->SetInput(vGeomFilter->GetOutput());vGeneratedArray->GetRange(range);lut->SetHueRange(0.6667,0.0);lut->SetTableRange(range);lut->Build();vContourMapper->SetColorModeToMapScalars();vContourMapper->SetScalarModeToUsePointFieldData();vContourMapper->ColorByArrayComponent(vEnsightReader->GetPointArrayName(arrayCount),0);vContourMapper->SetLookupTable(lut);vContourMapper->SetScalarRange(range);vContourMapper->InterpolateScalarsBeforeMappingOff();vContourMapper->ImmediateModeRenderingOn();vContourMapper->Update();vContourActor = vtkActor::New();vContourActor->SetMapper( vContourMapper );render->AddActor( vContourActor );vScalarBar = vtkScalarBarActor::New();vScalarBar->SetLookupTable(lut);vScalarBar->SetTitle("Temporal gradient");vScalarBar->GetLabelTextProperty()->SetFontFamilyToArial();vScalarBar->GetLabelTextProperty()->SetFontSize(6);render->AddActor(vScalarBar); render->ResetCameraClippingRange();renWin->Render(); All objects exist and are tested. The generated array has a valid range and array values as well. The problem is that the output does not give any color in the output, though with previously existing data sets this is not a problem. If I comment SetScalarModeToUsePointFieldData() then it seems to work, but with the wrong data set. Obviously I'm doing something wrong, so what do I need to change to solve this? Thanks in advance! _________________________________________________________________ With Windows Live for mobile, your contacts travel with you. http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_Refresh_mobile_052008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From darren.weber.lists at gmail.com Sat May 3 11:28:51 2008 From: darren.weber.lists at gmail.com (Darren Weber) Date: Sat, 3 May 2008 08:28:51 -0700 Subject: [vtkusers] texture mapping animation Message-ID: I have a closed surface where the faces contain triangles of the points, eg: vtkSurf = vtk.vtkPolyData() vtkSurf.SetPoints(points) vtkSurf.SetPolys(faces) I also have a time-series of scalar values for every point. How do I display one time-point with a reasonable colormap? How do I create a loop that changes the point values that map into the colormap? Thanks in advance, Darren -------------- next part -------------- An HTML attachment was scrubbed... URL: From trshash84 at gmail.com Sun May 4 00:16:50 2008 From: trshash84 at gmail.com (T.R.Shashwath) Date: Sun, 4 May 2008 09:46:50 +0530 Subject: [vtkusers] texture mapping animation In-Reply-To: References: Message-ID: <200805040946.50712.trshash84@gmail.com> On Saturday 03 May 2008 20:58:51 Darren Weber wrote: > I have a closed surface where the faces contain triangles of the points, > eg: > > vtkSurf = vtk.vtkPolyData() > vtkSurf.SetPoints(points) > vtkSurf.SetPolys(faces) > > I also have a time-series of scalar values for every point. How do I > display one time-point with a reasonable colormap? How do I create a loop > that changes the point values that map into the colormap? > > Thanks in advance, Darren Hi, You'll have to create a vtkPointData instance to add to your surface. You can assign the scalar values of each point to that point data, and turn on scalar color mode in the poly data mapper. That will display one time-point. If you want to do an animation of the time-series, just replace all the point values again. -- Shash From roman.kozlov at opencascade.com Sun May 4 03:21:06 2008 From: roman.kozlov at opencascade.com (Roman KOZLOV) Date: Sun, 04 May 2008 11:21:06 +0400 Subject: [vtkusers] How to change orientation (rotate to 90 degrees) of XYPlotActor Message-ID: <481D63E2.8070008@opencascade.com> Hi all. Could you please clarify is it possible to draw the vtkXYPlotActor in the vertical orientation i.e. to rotate it to 90 degrees in the XY plane? ExchangeAxes() method doesn't affect the orientation of the curve. Thank you in advance. Roman From mark.jefferson at qq.com Sun May 4 04:24:25 2008 From: mark.jefferson at qq.com (=?ISO-8859-1?B?TWFyayBKZWZmZXJzb24=?=) Date: Sun, 4 May 2008 16:24:25 +0800 Subject: [vtkusers] How to pick one vtkImageViewer2 from multi-vtkImageViewer2? Message-ID: Hi, everyone, I am displaying several 2D images using class vtkImageViewer2, of course, there is several objects of class vtkImageViewer2. and I want to know which object would be picked when I press my mouse left button. so I want to use vtkPointPicker to do it. however, the actor of class vtkImageViewer2 is vtkImageActor, while class vtkPointPicker could only get a object of class vtkActor by method GetActor(). so I have to change my mind. I want to testify which vtkImageViewer2 would be picked by class vtkRenderWindowInteractor. I add a mouse events observer like: virtual void execute(...) { // picker and viewer are pointers to the actual vtkPointPicker/vtkImageViewer2 objects. int i = picker->Pick(viewer->GetRenderWindow()->GetInteractor()->GetEventPosition()[0], viewer->GetRenderWindow()->GetInteractor()->GetEventPosition()[1], viewer->GetSlice(), viewer->GetRenderer()); if (i == 0) { return; } vtkRenderWindowInteractor * temp = picker->GetRenderer()->GetRenderWindow()->GetInteractor(); // .... and then test which vtkImageViewer2 the interactor is in // but it don't work!!!! } who can tell me how to pick one object of vtkImageViewer2 from the objects set of vtkImageViewer2? is there any method to know whick one I have picked? thank you! MJ -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.albert at jacobs-university.de Sun May 4 05:25:37 2008 From: a.albert at jacobs-university.de (Adrian Albert) Date: Sun, 4 May 2008 11:25:37 +0200 Subject: [vtkusers] resize image with vtkImageViewer Message-ID: <2cd88c320805040225x1f6d6b6aoa57896a3f1718898@mail.gmail.com> Dear All, I was wondering if there was a way of resizing an image displayed with vtkImageViewer. I have a vtkImageData object containing an 128 x 128 image, which gets displayed using 128 x 128 pixels on the screen with vtkImageViewer. I'd like to resize the image window keeping the aspect ratio of the original image. Any ideas? Many thanks, Adrian -- --------------------------------------------------- Adrian Albert School of Engineering and Science Jacobs University Bremen Germany Tel.: 00494212003258 -------------- next part -------------- An HTML attachment was scrubbed... URL: From darren.weber.lists at gmail.com Sun May 4 12:00:39 2008 From: darren.weber.lists at gmail.com (Darren Weber) Date: Sun, 4 May 2008 09:00:39 -0700 Subject: [vtkusers] texture mapping animation In-Reply-To: <200805040946.50712.trshash84@gmail.com> References: <200805040946.50712.trshash84@gmail.com> Message-ID: On Sat, May 3, 2008 at 9:16 PM, T.R.Shashwath wrote: > On Saturday 03 May 2008 20:58:51 Darren Weber wrote: > > I have a closed surface where the faces contain triangles of the points, > > eg: > > > > vtkSurf = vtk.vtkPolyData() > > vtkSurf.SetPoints(points) > > vtkSurf.SetPolys(faces) > > > > I also have a time-series of scalar values for every point. How do I > > display one time-point with a reasonable colormap? How do I create a > loop > > that changes the point values that map into the colormap? > > > > Thanks in advance, Darren > > Hi, > > You'll have to create a vtkPointData instance to add to your surface. You > can > assign the scalar values of each point to that point data, and turn on > scalar > color mode in the poly data mapper. That will display one time-point. If > you > want to do an animation of the time-series, just replace all the point > values > again. > > -- Shash > >From the longer snip of my code below, you can see that I used vtk.vtkPoints() to create the point data, which was then added to the vtk.vtkPolyData() object. Should I replace the use of vtk.vtkPoints() with vtk.vtkPointData()? Perhaps these objects are complementary, so I should use both? ### BEGIN SNIP # put data into vtk data structure points = vtk.vtkPoints() points.SetNumberOfPoints(nVert) for i in range(nVert): v = self.vert['xyz'][i] points.SetPoint(i, v[0], v[1], v[2]) faces = vtk.vtkCellArray() faces.Allocate(nFace, 1) for i in range(nFace): fv = self.face['vertex'][i] faces.InsertNextCell(3) # double check the order of vertices for vtk outward normals faces.InsertCellPoint(fv[0]) faces.InsertCellPoint(fv[1]) faces.InsertCellPoint(fv[2]) vtkSurf = vtk.vtkPolyData() vtkSurf.SetPoints(points) vtkSurf.SetPolys(faces) ### END SNIP Thanks in advance, Darren (Noob) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Moritz.Bernard.Fricke at rwth-aachen.de Sun May 4 12:10:57 2008 From: Moritz.Bernard.Fricke at rwth-aachen.de (Moritz Bernard Fricke) Date: Sun, 04 May 2008 18:10:57 +0200 Subject: [vtkusers] Using vtkContourFilter for Rendering a Point Cloud In-Reply-To: <38fd72f40804301233t6278368ar70df1114ae4a5fce@mail.gmail.com> References: <2889976.38071209564272485.JavaMail.nabble@isper.nabble.com> <38fd72f40804300759v2380c4a0ya8a12db1394f213b@mail.gmail.com> <38fd72f40804301233t6278368ar70df1114ae4a5fce@mail.gmail.com> Message-ID: Cory, i have still problems concernig the scalar warping in vtkGaussianSplatter. I can't use the ParticleReader because the files i'm using contain more information in a line. But the extraction from the file is already working, i have writting a parser doing that. But if scalar warping is on, where does the filter get the scalars from? I have a list of floats that contains the energies of the particle? How can i use thme as scalars for the splats? Moritz ----- Urspr?ngliche Nachricht ----- Von: Cory Quammen Datum: Mittwoch, April 30, 2008 9:34 pm Betreff: Re: [vtkusers] Using vtkContourFilter for Rendering a Point Cloud An: Moritz Bernard Fricke , vtkusers at vtk.org > I'm copying to the vtkusers list as a reference so that in the future > others with the same question as you. > > Take a look at vtkParticleReader. It looks like it does exactly what > you want. It reads xyz coordinates and a scalar value. > > Cory > > On Wed, Apr 30, 2008 at 11:30 AM, Moritz Bernard Fricke > wrote: > > Cory, > > how can associate these scalar values in vtk? I think that is my > major problem. > > So, I get the data for each point from a log-file from a ray > tracing simulation for acoustics. Can I use vtkFloatArray to create > an array of energies? And how can I associate these energies to the > Points in my UnstructuredGrid? > > Thank you for your help, i'm running out of time with this project! > > > > Moritz > > > > ----- Urspr?ngliche Nachricht ----- > > Von: Cory Quammen > > Datum: Mittwoch, April 30, 2008 4:59 pm > > Betreff: Re: Using vtkContourFilter for Rendering a Point Cloud > > An: moritz.bernard.fricke at rwth-aachen.de, vtkusers at vtk.org > > > > > > > > > Moritz, > > > > > > If your unstructured grid has associated scalar data (in your > case,> > the energy of the points), then according to the > documentation> > > (http://www.vtk.org/doc/nightly/html/classvtkGaussianSplatter.html),> > you can tell the vtkGaussianSplatter to scale the values of the > > > splatted Gaussian by the scalar value using ScalarWarpingOn(). > > > > > > Cory > > > > > > On Wed, Apr 30, 2008 at 10:04 AM, > > aachen.de> wrote: > > > > Hi Cory, > > > > thank you for your answer. i've tried it! I have just build an > > > Structured Grid of my Points and applied vtkGaussianSplatter > at it. > > > That works, but i want to interpolate the values of the > points. How > > > can I link the energy of one point to its position to make the > > > energy the criteria for the GaussianSplatter? > > > > > > > > Thank you for your help, > > > > > > > > moritz > > > > > > > > > > > > > > > > -- > > > Cory Quammen > > > Department of Computer Science > > > University of North Carolina at Chapel Hill > > > http://www.cs.unc.edu/~cquammen > > > > > > > > > -- > Cory Quammen > Department of Computer Science > University of North Carolina at Chapel Hill > http://www.cs.unc.edu/~cquammen > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQFollow this link to > subscribe/unsubscribe:http://www.vtk.org/mailman/listinfo/vtkusers > From cquammen at cs.unc.edu Sun May 4 12:50:42 2008 From: cquammen at cs.unc.edu (Cory Quammen) Date: Sun, 4 May 2008 12:50:42 -0400 Subject: [vtkusers] Using vtkContourFilter for Rendering a Point Cloud In-Reply-To: References: <2889976.38071209564272485.JavaMail.nabble@isper.nabble.com> <38fd72f40804300759v2380c4a0ya8a12db1394f213b@mail.gmail.com> <38fd72f40804301233t6278368ar70df1114ae4a5fce@mail.gmail.com> Message-ID: <38fd72f40805040950m30e0c166q49269522bc836558@mail.gmail.com> Moritz, You should be able to call GetPointData() on your unstructured grid, which returns an object of type vtkPointData. This object has a SetScalars() method which should allow you to associate your energies with your points. It takes a vtkDataArray, of which vtkFloatArray is a subclass. Hope that helps, Cory On Sun, May 4, 2008 at 12:10 PM, Moritz Bernard Fricke wrote: > Cory, > i have still problems concernig the scalar warping in vtkGaussianSplatter. I can't use the ParticleReader because the files i'm using contain more information in a line. But the extraction from the file is already working, i have writting a parser doing that. > > But if scalar warping is on, where does the filter get the scalars from? I have a list of floats that contains the energies of the particle? How can i use thme as scalars for the splats? > > > Moritz > > ----- Urspr?ngliche Nachricht ----- > Von: Cory Quammen > Datum: Mittwoch, April 30, 2008 9:34 pm > Betreff: Re: [vtkusers] Using vtkContourFilter for Rendering a Point Cloud > An: Moritz Bernard Fricke , vtkusers at vtk.org > > > > > I'm copying to the vtkusers list as a reference so that in the future > > others with the same question as you. > > > > Take a look at vtkParticleReader. It looks like it does exactly what > > you want. It reads xyz coordinates and a scalar value. > > > > Cory > > > > On Wed, Apr 30, 2008 at 11:30 AM, Moritz Bernard Fricke > > wrote: > > > Cory, > > > how can associate these scalar values in vtk? I think that is my > > major problem. > > > So, I get the data for each point from a log-file from a ray > > tracing simulation for acoustics. Can I use vtkFloatArray to create > > an array of energies? And how can I associate these energies to the > > Points in my UnstructuredGrid? > > > Thank you for your help, i'm running out of time with this project! > > > > > > Moritz > > > > > > ----- Urspr?ngliche Nachricht ----- > > > Von: Cory Quammen > > > Datum: Mittwoch, April 30, 2008 4:59 pm > > > Betreff: Re: Using vtkContourFilter for Rendering a Point Cloud > > > An: moritz.bernard.fricke at rwth-aachen.de, vtkusers at vtk.org > > > > > > > > > > > > > Moritz, > > > > > > > > If your unstructured grid has associated scalar data (in your > > case,> > the energy of the points), then according to the > > documentation> > > > (http://www.vtk.org/doc/nightly/html/classvtkGaussianSplatter.html),> > you can tell the vtkGaussianSplatter to scale the values of the > > > > splatted Gaussian by the scalar value using ScalarWarpingOn(). > > > > > > > > Cory > > > > > > > > On Wed, Apr 30, 2008 at 10:04 AM, > > > aachen.de> wrote: > > > > > Hi Cory, > > > > > thank you for your answer. i've tried it! I have just build an > > > > Structured Grid of my Points and applied vtkGaussianSplatter > > at it. > > > > That works, but i want to interpolate the values of the > > points. How > > > > can I link the energy of one point to its position to make the > > > > energy the criteria for the GaussianSplatter? > > > > > > > > > > Thank you for your help, > > > > > > > > > > moritz > > > > > > > > > > > > > > > > > > > > > -- > > > > Cory Quammen > > > > Department of Computer Science > > > > University of North Carolina at Chapel Hill > > > > http://www.cs.unc.edu/~cquammen > > > > > > > > > > > > > > > -- > > Cory Quammen > > Department of Computer Science > > University of North Carolina at Chapel Hill > > http://www.cs.unc.edu/~cquammen > > > _______________________________________________ > > This is the private VTK discussion list. > > Please keep messages on-topic. Check the FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQFollow this link to > > > > subscribe/unsubscribe:http://www.vtk.org/mailman/listinfo/vtkusers > > > -- Cory Quammen Department of Computer Science University of North Carolina at Chapel Hill http://www.cs.unc.edu/~cquammen From mark.jefferson at qq.com Sun May 4 21:53:59 2008 From: mark.jefferson at qq.com (=?ISO-8859-1?B?TWFyayBKZWZmZXJzb24=?=) Date: Mon, 5 May 2008 9:53:59 +0800 Subject: [vtkusers] how to pick one vtkimageviewer2 from multi-vtkimageviewer2? Message-ID: Hi, everyone, I am displaying several 2D images using class vtkImageViewer2, of course, there is several objects of class vtkImageViewer2. and I want to know which object would be picked when I press my mouse left button. so I want to use vtkPointPicker to do it. however, the actor of class vtkImageViewer2 is vtkImageActor, while class vtkPointPicker could only get a object of class vtkActor by method GetActor(). so I have to change my mind. I want to testify which vtkImageViewer2 would be picked by class vtkRenderWindowInteractor. I add a mouse events observer like: virtual void execute(...) { // picker and viewer are pointers to the actual vtkPointPicker/vtkImageViewer2 objects. int i = picker->Pick(viewer->GetRenderWindow()->GetInteractor()->GetEventPosition()[0], viewer->GetRenderWindow()->GetInteractor()->GetEventPosition()[1], viewer->GetSlice(), viewer->GetRenderer()); if (i == 0) { return; } vtkRenderWindowInteractor * temp = picker->GetRenderer()->GetRenderWindow()->GetInteractor(); // .... and then test which vtkImageViewer2 the interactor is in // but it don't work!!!! } who can tell me how to pick one object of vtkImageViewer2 from the objects set of vtkImageViewer2? is there any method to know whick one I have picked? thank you! MJ -------------- next part -------------- An HTML attachment was scrubbed... URL: From trshash84 at gmail.com Mon May 5 00:04:44 2008 From: trshash84 at gmail.com (T.R.Shashwath) Date: Mon, 5 May 2008 09:34:44 +0530 Subject: [vtkusers] texture mapping animation In-Reply-To: References: <200805040946.50712.trshash84@gmail.com> Message-ID: <200805050934.44997.trshash84@gmail.com> On Sunday 04 May 2008 21:30:39 Darren Weber wrote: > On Sat, May 3, 2008 at 9:16 PM, T.R.Shashwath wrote: > > On Saturday 03 May 2008 20:58:51 Darren Weber wrote: > > > I have a closed surface where the faces contain triangles of the > > > points, eg: > > > > > > vtkSurf = vtk.vtkPolyData() > > > vtkSurf.SetPoints(points) > > > vtkSurf.SetPolys(faces) > > > > > > I also have a time-series of scalar values for every point. How do I > > > display one time-point with a reasonable colormap? How do I create a > > > > loop > > > > > that changes the point values that map into the colormap? > > > > > > Thanks in advance, Darren > > > > Hi, > > > > You'll have to create a vtkPointData instance to add to your surface. You > > can > > assign the scalar values of each point to that point data, and turn on > > scalar > > color mode in the poly data mapper. That will display one time-point. If > > you > > want to do an animation of the time-series, just replace all the point > > values > > again. > > > > -- Shash > > From the longer snip of my code below, you can see that I used > vtk.vtkPoints() to create the point data, which was then added to the > vtk.vtkPolyData() object. Should I replace the use of vtk.vtkPoints() with > vtk.vtkPointData()? Perhaps these objects are complementary, so I should > use both? > > ### BEGIN SNIP > # put data into vtk data structure > points = vtk.vtkPoints() > points.SetNumberOfPoints(nVert) > for i in range(nVert): > v = self.vert['xyz'][i] > points.SetPoint(i, v[0], v[1], v[2]) > > faces = vtk.vtkCellArray() > faces.Allocate(nFace, 1) > for i in range(nFace): > fv = self.face['vertex'][i] > faces.InsertNextCell(3) > # double check the order of vertices for vtk outward > normals faces.InsertCellPoint(fv[0]) > faces.InsertCellPoint(fv[1]) > faces.InsertCellPoint(fv[2]) > > vtkSurf = vtk.vtkPolyData() > vtkSurf.SetPoints(points) > vtkSurf.SetPolys(faces) > ### END SNIP > > > Thanks in advance, Darren (Noob) You'll need to set both. -- shash From ivan.gm.itk at gmail.com Mon May 5 04:57:59 2008 From: ivan.gm.itk at gmail.com (ivan gm) Date: Mon, 5 May 2008 10:57:59 +0200 Subject: [vtkusers] Exception problems In-Reply-To: References: Message-ID: Hello Cameron: First of all thanks a lot for your reply. If I improve the RAM and the Graphic card Memory... Do you think my problem could be solved? I'm using 2 GB of RAM and 256 MB of Graphics Memory now. NOTE: The try catch didn't catch the last message exception mentioned. On Mon, Apr 28, 2008 at 12:57 PM, Cameron Burnett < w_e_b_m_a_s_t_e_r_6_9 at hotmail.com> wrote: > The problem is probably due to a lack of memory. You can catch these > problems by putting a try/catch around your Update() functions, and you > should get an error message. This is the code you can use for MFC. > > try > { > filter->Update(); > } > catch( itk::ExceptionObject & excep ) > { > CString msg; > msg.Format("Error: %s", excep.GetDescription()); > AfxMessageBox(msg, MB_ICONERROR); > } > > > If you want to fix this you can do a few things. One thing you can do is > call the SetReleaseDataFlag(true) function on everything in your pipeline. > This will release memory once it's no longer in use, however it will slow > down your program considerably. > > Some filters also support streaming. This breaks a task down into smaller > pieces and you end up not needing to allocate a lot of memory all at once. > You can set it up like this, and you just simply connect it to your pipeline > and call Update() on it in order to stream through the pipeline. > > typedef itk::StreamingImageFilter< OutputImageType,OutputImageType > > StreamingFilterType; > StreamingFilterType::Pointer streamer = StreamingFilterType::New(); > streamer->SetReleaseDataFlag(true); > > streamer->SetNumberOfStreamDivisions(4); > > > Have a look at your operating system's memory usage while you run the > program. And if you include the try/catch thing you should be able to figure > out where your program gets up to before it runs out of memory. Note that > the program will continue to run after that point, and that is why it seems > like it works until the end. > > > Hope this helps, > > Cameron. > > > > > ------------------------------ > Date: Mon, 28 Apr 2008 11:08:41 +0200 > From: ivan.gm.itk at gmail.com > To: vtkusers at vtk.org > Subject: [vtkusers] Exception problems > > > Hello: > > I have a problem with a not controled exception in runtime. I'm using > windows, MFC, VTK, ITK in Visual Studio 2005. My code looks like this: > > .... > pitkDICOMReader->SetFileNames(files); > pitkDICOMReader->SetImageIO( itk::GDCMImageIO::New() ); > pitkDICOMReader->Update(); > filter = ThresholdType::New(); > filter->SetInput( this->pitkDICOMReader); > filter->ThresholdOutside(minT, maxT); > filter->Update(); > ... > ( typedef itk::ImageToVTKImageFilter ConnectorType; ) > connector->SetInput( filter->GetOutput() ); > connector->Update(); > > /*now I create a 3D polydata*/ > contourFilter->SetInput(connector->GetOutput()); > contourFilter->Update(); > smoothFilter->SetInputConnection(contourFilter->GetOutputPort()); > smoothFilter->SetNumberOfIterations(30); > smoothFilter->SetRelaxationFactor(1.0); > smoothFilter->Update(); > polyDataNormals->SetInputConnection(smoothFilter->GetOutputPort()); > polyDataNormals->Update(); > this->BoneMapper->SetInput(polyDataNormals->GetOutput()); > this->BoneMapper->Update(); > this->BoneActor->SetMapper(this->BoneMapper); > this->BoneActor->GetProperty()->SetColor(1.0, 1.0, 0.0); > this->BoneActor->GetProperty()->SetDiffuse(0.0); > this->BoneActor->GetProperty()->SetSpecular(1.0); > this->BoneActor->GetProperty()->SetSpecularPower(5); > this->pvtkRenderer3D->AddActor(this->BoneActor); > this->pvtkRenderer3D->ResetCamera(); > if (this->pvtkMFCWindow3D) this->pvtkMFCWindow3D->RedrawWindow(); > //"the program crash here" > > When I open 3D images with 100 slices it runs perfect but with one of the > images (with 350 slices) the program crash in runtime and Visual Studio > shows the following error message: > > Excepci?n no controlada en 0x0d9e5c01 en myaplication.exe: 0xC0000005: > Infracci?n de acceso al escribir en la ubicaci?n 0x00000000. > > After that the file ftime64.c apairs in Visual Studio at line 130 where it > calls to _ftime64_s(tp); > > In addition, when I comment the smoothfilter and other previous filters it > works good. > > What could the problem be? Do you know how I can solve it? > > > Thanks a lot. > > Iv?n Garc?a Mart?nez. > > > ------------------------------ > before someone else does Find the job of your dreams > -------------- next part -------------- An HTML attachment was scrubbed... URL: From w_e_b_m_a_s_t_e_r_6_9 at hotmail.com Mon May 5 08:00:21 2008 From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com (Cameron Burnett) Date: Mon, 5 May 2008 22:00:21 +1000 Subject: [vtkusers] Exception problems In-Reply-To: References: Message-ID: I'm working with 2GB at the moment. If I call SetReleaseDataFlag(true) on every filter in my pipeline, then I can work with DICOM datasets up to about 400MB. More RAM would surely help (provided that you're not using a single core processor), but there are ways around it like the ones I told you about in the email. And there are certain benefits/drawbacks for either approach..... like if you don't release your data it will chew up your memory but will be quite fast.... and if you do release then it will use less memory but will be slower (from my experience it has been slower). As for the try/catch thing.... did you try putting that around every update function?? If you go through and do each one separately then you should eventually find the one that is the problem. Date: Mon, 5 May 2008 10:57:59 +0200 From: ivan.gm.itk at gmail.com To: vtkusers at vtk.org Subject: [vtkusers] Exception problems Hello Cameron: First of all thanks a lot for your reply. If I improve the RAM and the Graphic card Memory... Do you think my problem could be solved? I'm using 2 GB of RAM and 256 MB of Graphics Memory now. NOTE: The try catch didn't catch the last message exception mentioned. On Mon, Apr 28, 2008 at 12:57 PM, Cameron Burnett wrote: The problem is probably due to a lack of memory. You can catch these problems by putting a try/catch around your Update() functions, and you should get an error message. This is the code you can use for MFC. try { filter->Update(); } catch( itk::ExceptionObject & excep ) { CString msg; msg.Format("Error: %s", excep.GetDescription()); AfxMessageBox(msg, MB_ICONERROR); } If you want to fix this you can do a few things. One thing you can do is call the SetReleaseDataFlag(true) function on everything in your pipeline. This will release memory once it's no longer in use, however it will slow down your program considerably. Some filters also support streaming. This breaks a task down into smaller pieces and you end up not needing to allocate a lot of memory all at once. You can set it up like this, and you just simply connect it to your pipeline and call Update() on it in order to stream through the pipeline. typedef itk::StreamingImageFilter< OutputImageType,OutputImageType > StreamingFilterType; StreamingFilterType::Pointer streamer = StreamingFilterType::New(); streamer->SetReleaseDataFlag(true); streamer->SetNumberOfStreamDivisions(4); Have a look at your operating system's memory usage while you run the program. And if you include the try/catch thing you should be able to figure out where your program gets up to before it runs out of memory. Note that the program will continue to run after that point, and that is why it seems like it works until the end. Hope this helps, Cameron. Date: Mon, 28 Apr 2008 11:08:41 +0200 From: ivan.gm.itk at gmail.com To: vtkusers at vtk.org Subject: [vtkusers] Exception problems Hello: I have a problem with a not controled exception in runtime. I'm using windows, MFC, VTK, ITK in Visual Studio 2005. My code looks like this: .... pitkDICOMReader->SetFileNames(files); pitkDICOMReader->SetImageIO( itk::GDCMImageIO::New() ); pitkDICOMReader->Update(); filter = ThresholdType::New(); filter->SetInput( this->pitkDICOMReader); filter->ThresholdOutside(minT, maxT); filter->Update(); ... ( typedef itk::ImageToVTKImageFilter ConnectorType; ) connector->SetInput( filter->GetOutput() ); connector->Update(); /*now I create a 3D polydata*/ contourFilter->SetInput(connector->GetOutput()); contourFilter->Update(); smoothFilter->SetInputConnection(contourFilter->GetOutputPort()); smoothFilter->SetNumberOfIterations(30); smoothFilter->SetRelaxationFactor(1.0); smoothFilter->Update(); polyDataNormals->SetInputConnection(smoothFilter->GetOutputPort()); polyDataNormals->Update(); this->BoneMapper->SetInput(polyDataNormals->GetOutput()); this->BoneMapper->Update(); this->BoneActor->SetMapper(this->BoneMapper); this->BoneActor->GetProperty()->SetColor(1.0, 1.0, 0.0); this->BoneActor->GetProperty()->SetDiffuse(0.0); this->BoneActor->GetProperty()->SetSpecular(1.0); this->BoneActor->GetProperty()->SetSpecularPower(5); this->pvtkRenderer3D->AddActor(this->BoneActor); this->pvtkRenderer3D->ResetCamera(); if (this->pvtkMFCWindow3D) this->pvtkMFCWindow3D->RedrawWindow(); //"the program crash here" When I open 3D images with 100 slices it runs perfect but with one of the images (with 350 slices) the program crash in runtime and Visual Studio shows the following error message: Excepci?n no controlada en 0x0d9e5c01 en myaplication.exe: 0xC0000005: Infracci?n de acceso al escribir en la ubicaci?n 0x00000000. After that the file ftime64.c apairs in Visual Studio at line 130 where it calls to _ftime64_s(tp); In addition, when I comment the smoothfilter and other previous filters it works good. What could the problem be? Do you know how I can solve it? Thanks a lot. Iv?n Garc?a Mart?nez. before someone else does Find the job of your dreams _________________________________________________________________ Never miss another e-mail with Hotmail on your mobile. http://www.livelife.ninemsn.com.au/article.aspx?id=343869 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Mon May 5 09:25:32 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Mon, 05 May 2008 08:25:32 -0500 Subject: [vtkusers] texture mapping animation In-Reply-To: References: <200805040946.50712.trshash84@gmail.com> Message-ID: <481F0ACC.2070503@cfdrc.com> Darren Weber wrote: > > > On Sat, May 3, 2008 at 9:16 PM, T.R.Shashwath > wrote: > > On Saturday 03 May 2008 20:58:51 Darren Weber wrote: > > I have a closed surface where the faces contain triangles of the > points, > > eg: > > > > vtkSurf = vtk.vtkPolyData() > > vtkSurf.SetPoints(points) > > vtkSurf.SetPolys(faces) > > > > I also have a time-series of scalar values for every point. How > do I > > display one time-point with a reasonable colormap? How do I > create a loop > > that changes the point values that map into the colormap? > > > > Thanks in advance, Darren > > Hi, > > You'll have to create a vtkPointData instance to add to your > surface. You can > assign the scalar values of each point to that point data, and > turn on scalar > color mode in the poly data mapper. That will display one > time-point. If you > want to do an animation of the time-series, just replace all the > point values > again. > > -- Shash > > > > From the longer snip of my code below, you can see that I used > vtk.vtkPoints() to create the point data, which was then added to the > vtk.vtkPolyData() object. Should I replace the use of vtk.vtkPoints() > with vtk.vtkPointData()? Perhaps these objects are complementary, so > I should use both? > > ### BEGIN SNIP > # put data into vtk data structure > points = vtk.vtkPoints() > points.SetNumberOfPoints(nVert) > for i in range(nVert): > v = self.vert['xyz'][i] > points.SetPoint(i, v[0], v[1], v[2]) > > faces = vtk.vtkCellArray() > faces.Allocate(nFace, 1) > for i in range(nFace): > fv = self.face['vertex'][i] > faces.InsertNextCell(3) > # double check the order of vertices for vtk outward > normals > faces.InsertCellPoint(fv[0]) > faces.InsertCellPoint(fv[1]) > faces.InsertCellPoint(fv[2]) > > vtkSurf = vtk.vtkPolyData() > vtkSurf.SetPoints(points) > vtkSurf.SetPolys(faces) > ### END SNIP > > > Thanks in advance, Darren (Noob) Hi Darren, vtkPoints contains the coordinates of the points in your dataset. vtkPointData holds arrays that have a data value (scalar, vector, normal, etc.) for every point. - Amy -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From rcpompeu at hotmail.com Mon May 5 09:45:11 2008 From: rcpompeu at hotmail.com (Renato Cesar Pompeu) Date: Mon, 5 May 2008 13:45:11 +0000 Subject: [vtkusers] Removing Actors Message-ID: Hello All, How do I remove an individual actor from the scene? My code does not work. Someone help me? Thanks. if (tbnIniciar->Down) { VTK3->GetRenderer()->AddActor(outlineActor); } else { VTK3->GetRenderer()->RemoveActor(outlineActor); VTK3->GetRenderer()->RemoveViewProp(outlineActor); VTK3->GetRenderer()->Clear(); } VTK3->Invalidate(); _________________________________________________________________ Confira v?deos com not?cias do NY Times, gols direto do Lance, videocassetadas e muito mais no MSN Video! http://video.msn.com/?mkt=pt-br -------------- next part -------------- An HTML attachment was scrubbed... URL: From w_e_b_m_a_s_t_e_r_6_9 at hotmail.com Mon May 5 10:31:09 2008 From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com (Cameron Burnett) Date: Tue, 6 May 2008 00:31:09 +1000 Subject: [vtkusers] Removing Actors In-Reply-To: References: Message-ID: Is the program actually entering the 'else' section?? Maybe tbnIniciar->Down is always true? If you're not sure then throw in a print statement to see if anything prints in that section. The RemoveActor function is the correct one to use. I am using that in the program that I'm working on at the moment. If that is not the problem, then it could be that something is still using the actor that you're trying to remove. That can be a problem when using the Delete function to remove it from memory, however I'm not sure if it can be a problem for RemoveActor as well. Hope that helps a bit, Cameron. From: rcpompeu at hotmail.com To: vtkusers at public.kitware.com Date: Mon, 5 May 2008 13:45:11 +0000 Subject: [vtkusers] Removing Actors Hello All, How do I remove an individual actor from the scene? My code does not work. Someone help me? Thanks. if (tbnIniciar->Down) { VTK3->GetRenderer()->AddActor(outlineActor); } else { VTK3->GetRenderer()->RemoveActor(outlineActor); VTK3->GetRenderer()->RemoveViewProp(outlineActor); VTK3->GetRenderer()->Clear(); } VTK3->Invalidate(); Not?cias direto do New York Times, gols do Lance, videocassetadas e muitos outros v?deos no MSN Videos! Confira j?! _________________________________________________________________ It's simple! Sell your car for just $30 at CarPoint.com.au http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Mon May 5 10:33:33 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Mon, 05 May 2008 09:33:33 -0500 Subject: [vtkusers] Removing Actors In-Reply-To: References: Message-ID: <481F1ABD.9050208@cfdrc.com> Did you try re-rendering after you removed the actor? - Amy Cameron Burnett wrote: > Is the program actually entering the 'else' section?? Maybe > tbnIniciar->Down is always true? If you're not sure then throw in a > print statement to see if anything prints in that section. > > The RemoveActor function is the correct one to use. I am using that in > the program that I'm working on at the moment. > > If that is not the problem, then it could be that something is still > using the actor that you're trying to remove. That can be a problem > when using the Delete function to remove it from memory, however I'm > not sure if it can be a problem for RemoveActor as well. > > Hope that helps a bit, > Cameron. > > > > ------------------------------------------------------------------------ > From: rcpompeu at hotmail.com > To: vtkusers at public.kitware.com > Date: Mon, 5 May 2008 13:45:11 +0000 > Subject: [vtkusers] Removing Actors > > Hello All, > > How do I remove an individual actor from the scene? My code does > not work. Someone help me? Thanks. > > if (tbnIniciar->Down) { > VTK3->GetRenderer()->AddActor(outlineActor); > } > > else { > VTK3->GetRenderer()->RemoveActor(outlineActor); > VTK3->GetRenderer()->RemoveViewProp(outlineActor); > VTK3->GetRenderer()->Clear(); > } > > VTK3->Invalidate(); > > > ------------------------------------------------------------------------ > Not?cias direto do New York Times, gols do Lance, videocassetadas > e muitos outros v?deos no MSN Videos! Confira j?! > > > > ------------------------------------------------------------------------ > at CarPoint.com.au It's simple! Sell your car for just $30 > > > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From ahs at cfdrc.com Mon May 5 10:54:49 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Mon, 05 May 2008 09:54:49 -0500 Subject: [vtkusers] Removing Actors In-Reply-To: References: <481F1ABD.9050208@cfdrc.com> Message-ID: <481F1FB9.9050103@cfdrc.com> Please keep the discussion on the vtkusers list rather than emailing me directly. That way other people can contribute to the conversation, and the discussion is archived. By "re-rendering", I mean calling Render() on your vtkRenderWindow. (I'm guessing that VTK3 in the code segment you sent is a vtkRenderWindow.) - Amy Renato Cesar Pompeu wrote: > Do you mean VTK3->GetRenderer() ? > > I've tried: > > ... > if (tbnCubo->Down) { > VTK3->GetRenderer()->AddActor(cubo1); > } > else { > VTK3->GetRenderer()->RemoveActor(cubo1); > VTK3->GetRenderer()->RemoveViewProp(cubo1); > VTK3->GetRenderer()->Clear(); > VTK3->GetRenderer(); > } > > cubo->Delete(); > cuboMapper->Delete(); > cubo1->Delete(); > VTK3->Invalidate(); > > > but the actor doesn't disappear from the scene when the button is up. > If I put : > > VTK3->GetRenderer()->RemoveAllViewProps(); > > then all the actors disappear from the scene. > > > > > Date: Mon, 5 May 2008 09:33:33 -0500 > > From: ahs at cfdrc.com > > To: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com > > CC: rcpompeu at hotmail.com; vtkusers at public.kitware.com > > Subject: Re: [vtkusers] Removing Actors > > > > Did you try re-rendering after you removed the actor? > > - Amy > > > > Cameron Burnett wrote: > > > Is the program actually entering the 'else' section?? Maybe > > > tbnIniciar->Down is always true? If you're not sure then throw in a > > > print statement to see if anything prints in that section. > > > > > > The RemoveActor function is the correct one to use. I am using > that in > > > the program that I'm working on at the moment. > > > > > > If that is not the problem, then it could be that something is still > > > using the actor that you're trying to remove. That can be a problem > > > when using the Delete function to remove it from memory, however I'm > > > not sure if it can be a problem for RemoveActor as well. > > > > > > Hope that helps a bit, > > > Cameron. > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > From: rcpompeu at hotmail.com > > > To: vtkusers at public.kitware.com > > > Date: Mon, 5 May 2008 13:45:11 +0000 > > > Subject: [vtkusers] Removing Actors > > > > > > Hello All, > > > > > > How do I remove an individual actor from the scene? My code does > > > not work. Someone help me? Thanks. > > > > > > if (tbnIniciar->Down) { > > > VTK3->GetRenderer()->AddActor(outlineActor); > > > } > > > > > > else { > > > VTK3->GetRenderer()->RemoveActor(outlineActor); > > > VTK3->GetRenderer()->RemoveViewProp(outlineActor); > > > VTK3->GetRenderer()->Clear(); > > > } > > > > > > VTK3->Invalidate(); > > > > > > > > > > ------------------------------------------------------------------------ > > > Not?cias direto do New York Times, gols do Lance, videocassetadas > > > e muitos outros v?deos no MSN Videos! Confira j?! > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > at CarPoint.com.au It's simple! Sell your car for just $30 > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > This is the private VTK discussion list. > > > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > > Follow this link to subscribe/unsubscribe: > > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > -- > > Amy Squillacote Phone: (256) 726-4839 > > Computer Scientist Fax: (256) 726-4806 > > CFD Research Corporation Web: http://www.cfdrc.com > > 215 Wynn Drive, Suite 501 > > Huntsville, AL 35805 > > > > > > > ------------------------------------------------------------------------ > Receba GR?TIS as mensagens do Messenger no seu celular quando voc? > estiver offline. Conhe?a o MSN Mobile! Crie j? o seu! > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From rcpompeu at hotmail.com Mon May 5 11:20:36 2008 From: rcpompeu at hotmail.com (Renato Cesar Pompeu) Date: Mon, 5 May 2008 15:20:36 +0000 Subject: [vtkusers] Removing Actors In-Reply-To: <018601c8aec0$df33ffe0$9d9bffa0$@danesi@dinccs.com> References: <018601c8aec0$df33ffe0$9d9bffa0$@danesi@dinccs.com> Message-ID: I'm using a button to show/disappear an actor. Here's the code: vtkCubeSource *cubo = vtkCubeSource::New(); cubo->SetXLength(14); cubo->SetYLength(14); cubo->SetZLength(14); cubo->SetCenter(a/2,b/2,c/2); vtkPolyDataMapper *cuboMapper = vtkPolyDataMapper::New(); cuboMapper->SetInput(cubo->GetOutput()); vtkActor *cubo1 = vtkActor::New(); cubo1->SetMapper(cuboMapper); cubo1->GetProperty()->SetColor(0.52, 0.27, 0); cubo1->GetProperty()->SetAmbient(0.2); cubo1->GetProperty()->SetDiffuse(0.3); cubo1->GetProperty()->SetSpecular(0.8); if (tbnCubo->Down) { // the button is down = the cube appears VTK3->GetRenderer()->AddActor(cubo1); } else { // the button is up = the cube disappears VTK3->GetRenderer()->RemoveActor(cubo1); VTK3->GetRenderer()->RemoveViewProp(cubo1); VTK3->GetRenderer()->Clear(); } cubo->Delete();cuboMapper->Delete();cubo1->Delete(); VTK3->Invalidate(); When the button is up the actor does not disappear. From: frederic.danesi at dinccs.comTo: rcpompeu at hotmail.comSubject: RE: [vtkusers] Removing ActorsDate: Mon, 5 May 2008 17:01:17 +0200 Just a dumb question : is your outlineActor the same at each call or not ? ? could you please provide us with more sourcecode (t least the code before your condition ?) ? Fred. De : vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] De la part de Renato Cesar PompeuEnvoy? : lundi 5 mai 2008 15:45? : vtkusers at public.kitware.comObjet : [vtkusers] Removing Actors Hello All, How do I remove an individual actor from the scene? My code does not work. Someone help me? Thanks. if (tbnIniciar->Down) { VTK3->GetRenderer()->AddActor(outlineActor); } else { VTK3->GetRenderer()->RemoveActor(outlineActor); VTK3->GetRenderer()->RemoveViewProp(outlineActor); VTK3->GetRenderer()->Clear(); } VTK3->Invalidate(); Not?cias direto do New York Times, gols do Lance, videocassetadas e muitos outros v?deos no MSN Videos! Confira j?! _________________________________________________________________ Conhe?a o Windows Live Spaces, a rede de relacionamentos do Messenger! http://www.amigosdomessenger.com.br/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From wsalles2003 at yahoo.com.br Mon May 5 11:22:19 2008 From: wsalles2003 at yahoo.com.br (Wagner Sales) Date: Mon, 5 May 2008 08:22:19 -0700 (PDT) Subject: [vtkusers] Exception Handling in VTK Message-ID: <785237.12931.qm@web65510.mail.ac4.yahoo.com> Hi all, ITK haves a nice way to handle exceptions in C++. VTK have ones too? Someone have some example of this? Thks in advance. Abra sua conta no Yahoo! Mail, o ?nico sem limite de espa?o para armazenamento! http://br.mail.yahoo.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From w_e_b_m_a_s_t_e_r_6_9 at hotmail.com Mon May 5 11:52:48 2008 From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com (Cameron Burnett) Date: Tue, 6 May 2008 01:52:48 +1000 Subject: [vtkusers] Removing Actors In-Reply-To: References: <018601c8aec0$df33ffe0$9d9bffa0$@danesi@dinccs.com> Message-ID: Put this line at the end and see if it does anything. VTK3->GetRenderer()->Render(); From: rcpompeu at hotmail.com To: frederic.danesi at dinccs.com Date: Mon, 5 May 2008 15:20:36 +0000 CC: vtkusers at public.kitware.com Subject: Re: [vtkusers] Removing Actors I'm using a button to show/disappear an actor. Here's the code: vtkCubeSource *cubo = vtkCubeSource::New(); cubo->SetXLength(14); cubo->SetYLength(14); cubo->SetZLength(14); cubo->SetCenter(a/2,b/2,c/2); vtkPolyDataMapper *cuboMapper = vtkPolyDataMapper::New(); cuboMapper->SetInput(cubo->GetOutput()); vtkActor *cubo1 = vtkActor::New(); cubo1->SetMapper(cuboMapper); cubo1->GetProperty()->SetColor(0.52, 0.27, 0); cubo1->GetProperty()->SetAmbient(0.2); cubo1->GetProperty()->SetDiffuse(0.3); cubo1->GetProperty()->SetSpecular(0.8); if (tbnCubo->Down) { // the button is down = the cube appears VTK3->GetRenderer()->AddActor(cubo1); } else { // the button is up = the cube disappears VTK3->GetRenderer()->RemoveActor(cubo1); VTK3->GetRenderer()->RemoveViewProp(cubo1); VTK3->GetRenderer()->Clear(); } cubo->Delete(); cuboMapper->Delete(); cubo1->Delete(); VTK3->Invalidate(); When the button is up the actor does not disappear. From: frederic.danesi at dinccs.com To: rcpompeu at hotmail.com Subject: RE: [vtkusers] Removing Actors Date: Mon, 5 May 2008 17:01:17 +0200 Just a dumb question : is your outlineActor the same at each call or not ? ? could you please provide us with more sourcecode (t least the code before your condition ?) ? Fred. De : vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] De la part de Renato Cesar Pompeu Envoy? : lundi 5 mai 2008 15:45 ? : vtkusers at public.kitware.com Objet : [vtkusers] Removing Actors Hello All, How do I remove an individual actor from the scene? My code does not work. Someone help me? Thanks. if (tbnIniciar->Down) { VTK3->GetRenderer()->AddActor(outlineActor); } else { VTK3->GetRenderer()->RemoveActor(outlineActor); VTK3->GetRenderer()->RemoveViewProp(outlineActor); VTK3->GetRenderer()->Clear(); } VTK3->Invalidate(); Not?cias direto do New York Times, gols do Lance, videocassetadas e muitos outros v?deos no MSN Videos! Confira j?! Conhe?a j? o Windows Live Spaces, o site de relacionamentos do Messenger! Crie j? o seu! _________________________________________________________________ Never miss another e-mail with Hotmail on your mobile. http://www.livelife.ninemsn.com.au/article.aspx?id=343869 -------------- next part -------------- An HTML attachment was scrubbed... URL: From morenoisidro at yahoo.com.ar Mon May 5 11:53:37 2008 From: morenoisidro at yahoo.com.ar (Isidro Moreno) Date: Mon, 5 May 2008 12:53:37 -0300 Subject: [vtkusers] vtk-cmake help Message-ID: <97C62E0533EE409E8E97DD718B8FF69B@isidro> Hi! Is there any help site/file that explains each CMake option for building vtk? (I say, besides the few words that appear in CMake app / CMakeCache file...) Does anybody know how to install VTK/C++ in many PCs without compiling the code each time?. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From ybourret at mirarco.org Mon May 5 12:23:18 2008 From: ybourret at mirarco.org (Yannick Bourret) Date: Mon, 05 May 2008 12:23:18 -0400 Subject: [vtkusers] vtk-cmake help In-Reply-To: <97C62E0533EE409E8E97DD718B8FF69B@isidro> References: <97C62E0533EE409E8E97DD718B8FF69B@isidro> Message-ID: Hello Isidro, The information will be useful aswell. Please let me know if you find anything. Also, in my case, I only want to Install VTK with Python Wrapping. However, I am unable to compile it since I get many linking errors when using Visual Studio 8 (2005) On Mon, 5 May 2008 12:53:37 -0300 "Isidro Moreno" wrote: >Hi! Is there any help site/file that explains each CMake option for building vtk? (I say, besides the few words that appear in CMake app / CMakeCache file...) Does anybody know how to install VTK/C++ in many PCs without compiling the code each time?. Thanks! Yannick Bourret, Co-op Student VR Programmer and Pilot ybourret at mirarco.org MIRARCO -- Mining Innovation Laurentian University 935 Ramsey Lake Road Sudbury, ONT, P3E 2C6, CANADA Tel.: (705) 675-1151 ext. 5075 Fax: (705) 675-4838 From mhalle at bwh.harvard.edu Mon May 5 14:12:15 2008 From: mhalle at bwh.harvard.edu (Michael Halle) Date: Mon, 05 May 2008 14:12:15 -0400 Subject: [vtkusers] 5.2 or CVS head compile with X11 on Mac OS X 10.5.2? Message-ID: <481F4DFF.6010801@bwh.harvard.edu> Could someone post their configuration to successfully build VTK 5.2 or CVS head on Mac OS X 10.5.2 using X11 (ideally, wrapping Tcl and Python)? I've been fighting the GL dylib reimportation bug, but even with that working, I get a "vtk" executable that dumps core, or a Python build that can't find XAllocSizeHints. I've even tried the Xquartz development version of X11, with no complete success. It would be great if this were either fixed or documented for a final 5.2 release. Thanks a lot. --Mike mhalle - at - bwh.harvard.edu From c.p.botha at tudelft.nl Mon May 5 15:19:15 2008 From: c.p.botha at tudelft.nl (Charl Botha) Date: Mon, 5 May 2008 21:19:15 +0200 Subject: [vtkusers] vtk-cmake help In-Reply-To: References: <97C62E0533EE409E8E97DD718B8FF69B@isidro> Message-ID: <31ddba770805051219o2b3043b9ped71cb4bda444286@mail.gmail.com> On Mon, May 5, 2008 at 6:23 PM, Yannick Bourret wrote: > The information will be useful aswell. Please let me know if you find > anything. Also, in my case, I only want to Install VTK with Python > Wrapping. > > However, I am unable to compile it since I get many linking > errors when using Visual Studio 8 (2005) You could try my pre-configured VTK 5.1 binaries for Python 2.5, all built with Visual Studio 8: http://cpbotha.net/2007/08/02/python-enabled-vtk-51-and-itk-32-windows-binaries/ I am planning to update these to VTK 5.2 when that gets released. If you're more adventurous and would like to build VTK on Windows yourself, you can use my really ugly build system, called johannes: see http://code.google.com/p/devide/wiki/Downloads?tm=2 under "Building your own from source". johannes builds far more than just VTK, so you'll have to follow the instructions in http://code.google.com/p/devide/source/browse/branches/v8-2/johannes/WINDOWS.txt?r=2831 if you want to build just VTK. Good luck, Charl Botha From morenoisidro at yahoo.com.ar Mon May 5 15:43:15 2008 From: morenoisidro at yahoo.com.ar (Isidro Moreno) Date: Mon, 5 May 2008 16:43:15 -0300 Subject: [vtkusers] vtk-cmake help Message-ID: <527492AD50954E16B063018935E641DC@isidro> Charl, Please, I'm expecting someone to help me with the initial topic. I suggest you to write about Python wrapping in another topic so more people can help us better. Thanks! -------------------------------------------------- From: "Charl Botha" Sent: Monday, May 05, 2008 4:19 PM To: "Yannick Bourret" Cc: "Isidro Moreno" ; Subject: Re: [vtkusers] vtk-cmake help > On Mon, May 5, 2008 at 6:23 PM, Yannick Bourret > wrote: >> The information will be useful aswell. Please let me know if you find >> anything. Also, in my case, I only want to Install VTK with Python >> Wrapping. >> >> However, I am unable to compile it since I get many linking >> errors when using Visual Studio 8 (2005) > > You could try my pre-configured VTK 5.1 binaries for Python 2.5, all > built with Visual Studio 8: > http://cpbotha.net/2007/08/02/python-enabled-vtk-51-and-itk-32-windows-binaries/ > > I am planning to update these to VTK 5.2 when that gets released. > > If you're more adventurous and would like to build VTK on Windows > yourself, you can use my really ugly build system, called johannes: > see http://code.google.com/p/devide/wiki/Downloads?tm=2 under > "Building your own from source". johannes builds far more than just > VTK, so you'll have to follow the instructions in > http://code.google.com/p/devide/source/browse/branches/v8-2/johannes/WINDOWS.txt?r=2831 > if you want to build just VTK. > > Good luck, > Charl Botha From imikejackson at gmail.com Mon May 5 15:46:56 2008 From: imikejackson at gmail.com (Mike Jackson) Date: Mon, 5 May 2008 15:46:56 -0400 Subject: [vtkusers] 5.2 or CVS head compile with X11 on Mac OS X 10.5.2? In-Reply-To: <481F4DFF.6010801@bwh.harvard.edu> References: <481F4DFF.6010801@bwh.harvard.edu> Message-ID: <43a689850805051246i3a5ddb22h50b8cdc43d82d89f@mail.gmail.com> Attached are my notes for getting ParaView 2.6.2 running under Leopard. Most of the same should apply to VTK. Mike On Mon, May 5, 2008 at 2:12 PM, Michael Halle wrote: > Could someone post their configuration to successfully build VTK 5.2 or CVS > head on Mac OS X 10.5.2 using X11 (ideally, wrapping Tcl and Python)? > > I've been fighting the GL dylib reimportation bug, but even with that > working, I get a "vtk" executable that dumps core, or a Python build that > can't find XAllocSizeHints. I've even tried the Xquartz development version > of X11, with no complete success. > > It would be great if this were either fixed or documented for a final 5.2 > release. > > Thanks a lot. > > --Mike > mhalle - at - bwh.harvard.edu > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Mike Jackson imikejackson _at_ gee-mail dot com -------------- next part -------------- A non-text attachment was scrubbed... Name: Leopard_ParaView261_Build_Notes.txt.rtf Type: application/rtf Size: 2837 bytes Desc: not available URL: From rcpompeu at hotmail.com Mon May 5 16:00:45 2008 From: rcpompeu at hotmail.com (Renato Cesar Pompeu) Date: Mon, 5 May 2008 20:00:45 +0000 Subject: [vtkusers] Removing Actors In-Reply-To: References: <018601c8aec0$df33ffe0$9d9bffa0$@danesi@dinccs.com> Message-ID: Still the same. Thanks From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.comTo: rcpompeu at hotmail.comCC: vtkusers at public.kitware.comSubject: RE: [vtkusers] Removing ActorsDate: Tue, 6 May 2008 01:52:48 +1000 Put this line at the end and see if it does anything.VTK3->GetRenderer()->Render(); From: rcpompeu at hotmail.comTo: frederic.danesi at dinccs.comDate: Mon, 5 May 2008 15:20:36 +0000CC: vtkusers at public.kitware.comSubject: Re: [vtkusers] Removing Actors I'm using a button to show/disappear an actor. Here's the code: vtkCubeSource *cubo = vtkCubeSource::New(); cubo->SetXLength(14); cubo->SetYLength(14); cubo->SetZLength(14); cubo->SetCenter(a/2,b/2,c/2); vtkPolyDataMapper *cuboMapper = vtkPolyDataMapper::New(); cuboMapper->SetInput(cubo->GetOutput()); vtkActor *cubo1 = vtkActor::New(); cubo1->SetMapper(cuboMapper); cubo1->GetProperty()->SetColor(0.52, 0.27, 0); cubo1->GetProperty()->SetAmbient(0.2); cubo1->GetProperty()->SetDiffuse(0.3); cubo1->GetProperty()->SetSpecular(0.8); if (tbnCubo->Down) { // the button is down = the cube appears VTK3->GetRenderer()->AddActor(cubo1);}else { // the button is up = the cube disappears VTK3->GetRenderer()->RemoveActor(cubo1); VTK3->GetRenderer()->RemoveViewProp(cubo1); VTK3->GetRenderer()->Clear();}cubo->Delete();cuboMapper->Delete();cubo1->Delete();VTK3->Invalidate();When the button is up the actor does not disappear. From: frederic.danesi at dinccs.comTo: rcpompeu at hotmail.comSubject: RE: [vtkusers] Removing ActorsDate: Mon, 5 May 2008 17:01:17 +0200 Just a dumb question : is your outlineActor the same at each call or not ? ? could you please provide us with more sourcecode (t least the code before your condition ?) ? Fred. De : vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] De la part de Renato Cesar PompeuEnvoy? : lundi 5 mai 2008 15:45? : vtkusers at public.kitware.comObjet : [vtkusers] Removing Actors Hello All, How do I remove an individual actor from the scene? My code does not work. Someone help me? Thanks. if (tbnIniciar->Down) { VTK3->GetRenderer()->AddActor(outlineActor); } else { VTK3->GetRenderer()->RemoveActor(outlineActor); VTK3->GetRenderer()->RemoveViewProp(outlineActor); VTK3->GetRenderer()->Clear(); } VTK3->Invalidate(); Not?cias direto do New York Times, gols do Lance, videocassetadas e muitos outros v?deos no MSN Videos! Confira j?! Conhe?a j? o Windows Live Spaces, o site de relacionamentos do Messenger! Crie j? o seu! Hotmail on your mobile. Never miss another e-mail with _________________________________________________________________ Conhe?a o Windows Live Spaces, a rede de relacionamentos do Messenger! http://www.amigosdomessenger.com.br/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From dqchen at cvip.louisville.edu Mon May 5 15:52:39 2008 From: dqchen at cvip.louisville.edu (Dongqing Chen) Date: Mon, 5 May 2008 15:52:39 -0400 Subject: [vtkusers] Does VTK have 3D region growing? Message-ID: <001901c8aee9$93209c20$9a28a588@rachidcvip> Dear All: I am thinking if VTK 5 has/supports 3D region growing algorithm. Thanks a lot. Best Wishes, ----------------------------------------------------------------- Dongqing Chen Ph.D Candidate Rm. 07, Paul C. Lutz Hall Computer Vision & Image Processing (CVIP) Lab Department of Electrical & Computer Engineering Speed School of Engineering University of Louisville Louisville, KY. 40292 U.S.A Email: dqchen at cvip.louisville.edu Phone:+1-502-852-2789 (Lab) +1-502-852-6130 (Office) ----------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.p.botha at tudelft.nl Mon May 5 16:27:13 2008 From: c.p.botha at tudelft.nl (Charl Botha) Date: Mon, 5 May 2008 22:27:13 +0200 Subject: [vtkusers] vtk-cmake help In-Reply-To: <527492AD50954E16B063018935E641DC@isidro> References: <527492AD50954E16B063018935E641DC@isidro> Message-ID: <31ddba770805051327j71cc1e84kcce04534ff0c0746@mail.gmail.com> On Mon, May 5, 2008 at 9:43 PM, Isidro Moreno wrote: > Please, I'm expecting someone to help me with the initial topic. I > suggest you to write about Python wrapping in another topic so more people > can help us better. Sorry about that, I was replying to Yannick Bourret's mail in this same thread. From costabel at wanadoo.fr Mon May 5 18:05:13 2008 From: costabel at wanadoo.fr (Martin Costabel) Date: Mon, 05 May 2008 17:05:13 -0500 Subject: [vtkusers] 5.2 or CVS head compile with X11 on Mac OS X 10.5.2? In-Reply-To: <481F4DFF.6010801@bwh.harvard.edu> References: <481F4DFF.6010801@bwh.harvard.edu> Message-ID: <481F8499.6050906@wanadoo.fr> Michael Halle wrote: > Could someone post their configuration to successfully build VTK 5.2 or > CVS head on Mac OS X 10.5.2 using X11 (ideally, wrapping Tcl and Python)? > > I've been fighting the GL dylib reimportation bug, but even with that > working, I get a "vtk" executable that dumps core, or a Python build > that can't find XAllocSizeHints. I've even tried the Xquartz > development version of X11, with no complete success. In the Fink package for vtk-5.0.4, the following cmake flag takes care of the GL dylib reimportation bug: -DOPENGL_gl_LIBRARY:STRING="-L/usr/X11R6/lib -lGL -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" No idea if more recent versions of vtk need something different. -- Martin From rcpompeu at hotmail.com Mon May 5 19:06:01 2008 From: rcpompeu at hotmail.com (Renato Cesar Pompeu) Date: Mon, 5 May 2008 23:06:01 +0000 Subject: [vtkusers] Updating In-Reply-To: <019401c8aec4$a3f2a3b0$ebd7eb10$@danesi@dinccs.com> References: <018601c8aec0$df33ffe0$9d9bffa0$@danesi@dinccs.com> <019401c8aec4$a3f2a3b0$ebd7eb10$@danesi@dinccs.com> Message-ID: Hi All, I have a value generated by a timer component (Vmaxgrad[i][j][k]). How is it possible to update an actor with these generated values? Thanks a lot. Her is my code: vtkFloatArray *vetores = vtkFloatArray::New(); vetores->SetNumberOfComponents(3); vtkPoints *pontos = vtkPoints::New(); vtkFloatArray *xCoords = vtkFloatArray::New();for (i=0; i<=a; i++) xCoords->InsertNextValue(xv[i]); vtkFloatArray *yCoords = vtkFloatArray::New();for (i=0; i<=b; i++) yCoords->InsertNextValue(yv[i]); vtkFloatArray *zCoords = vtkFloatArray::New();for (i=0; i<=c; i++) zCoords->InsertNextValue(zv[i]); vtkRectilinearGrid *rgrid = vtkRectilinearGrid::New(); rgrid->SetDimensions(a+1,b+1,c+1); rgrid->SetXCoordinates(xCoords); rgrid->SetYCoordinates(yCoords); rgrid->SetZCoordinates(zCoords); vtkDoubleArray *array = vtkDoubleArray::New(); for (k=0; k<=c; k++) for (j=0; j<=b; j++) for (i=0; i<=a; i++) { array->InsertValue(k*(a+1)*(b+1)+j*(a+1)+i, Vmaxgrad[i][j][k]); pontos->InsertPoint(k*(a+1)*(b+1)+j*(a+1)+i, i, j, k); vetores->InsertTuple3(k*(a+1)*(b+1)+j*(a+1)+i, vx[i][j][k], vy[i][j][k], vz[i][j][k]);} rgrid->GetPointData()->SetVectors(vetores); rgrid->GetPointData()->SetScalars(array); vtkRectilinearGridGeometryFilter *plane = vtkRectilinearGridGeometryFilter::New(); plane->SetInput(rgrid); vtkLookupTable *Table = vtkLookupTable::New(); Table->SetNumberOfColors(150); Table->SetHueRange(0.667 , 0); Table->SetRange(rgrid->GetScalarRange()); vtkRectilinearGridOutlineFilter *outline = vtkRectilinearGridOutlineFilter::New(); outline->SetInput(rgrid); vtkPolyDataMapper *outlineMapper = vtkPolyDataMapper::New(); outlineMapper->SetInputConnection(outline->GetOutputPort()); vtkActor *outlineActor = vtkActor::New(); outlineActor->SetMapper(outlineMapper); outlineActor->GetProperty()->SetColor( 0, 0, 0); VTK3->GetRenderer()->AddActor(outlineActor); } _________________________________________________________________ Confira v?deos com not?cias do NY Times, gols direto do Lance, videocassetadas e muito mais no MSN Video! http://video.msn.com/?mkt=pt-br -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulojamorim at gmail.com Mon May 5 20:13:50 2008 From: paulojamorim at gmail.com (Paulo Henrique Junqueira Amorim) Date: Mon, 5 May 2008 21:13:50 -0300 Subject: [vtkusers] PolyData Operations VTK 5 In-Reply-To: <98e18c70805020926s44e22e0fwca58ad0fd9e92c79@mail.gmail.com> References: <98e18c70804261844j1af98c6ew9ca5fd9f934b86@mail.gmail.com> <98e18c70805020926s44e22e0fwca58ad0fd9e92c79@mail.gmail.com> Message-ID: <98e18c70805051713o4869cdc0vbc64eba64a39312@mail.gmail.com> Hi, Anyone have any ideas? Regards, Paulo 2008/5/2 Paulo Henrique Junqueira Amorim : > Hi Mathieu, > > Thank but the vtkImplicitPolyData only works in vtk 4.2, my project uses > vtk 5.1 and wrapper to Python. > > I tried to convert PolyData implicit function and then use the > vtkImplicitBoolean but the output of vtkImplicitBoolean is null, I am > exported to stl and export null, I am creted Actor and Add renderer, but the > output of the renderer is black. See below code. > > Best Regards, > Paulo Amorim > > > The code convert PolyData in Implicit Function: > > from vtk import * > > #To test PolyData Boolean > Cylinder = vtkCylinderSource() > Cylinder.SetHeight(35) > Cylinder.SetRadius(6) > > Cube = vtkCubeSource() > Cube.SetXLength(100) > Cube.SetYLength(10) > Cube.SetZLength(10) > > > > # transforming polyData of the Cylinder to an implicitFunction > poly_Cylinder = vtkPolyData() > poly_Cylinder.SetPoints(Cylinder.GetOutput().GetPoints()) > > tri_Cylinder = vtkTriangleFilter() > tri_Cylinder.SetInput(poly_Cylinder) > > implicit_Cylinder = vtkImplicitModeller() > implicit_Cylinder.SetInputConnection(tri_Cylinder.GetOutputPort()) > > dataset_Cylinder = vtkImplicitDataSet() > dataset_Cylinder.SetDataSet(implicit_Cylinder.GetOutput()) > > > > # ---- transforming polyData of the Cube to an implicitFunction > ----------- > poly_Cube = vtkPolyData() > poly_Cube.SetPoints(Cube.GetOutput().GetPoints()) > > tri_Cube = vtkTriangleFilter() > tri_Cube.SetInput(poly_Cube) > > implicit_Cube = vtkImplicitModeller() > implicit_Cube.SetInputConnection(tri_Cube.GetOutputPort()) > > dataset_Cube = vtkImplicitDataSet() > dataset_Cube.SetDataSet(implicit_Cube.GetOutput()) > > > #Boolean Difference two implicit funcion (cylinder and cube) > > implict_Boolean = vtkImplicitBoolean() > implict_Boolean.SetOperationTypeToDifference() > > implict_Boolean.AddFunction(dataset_Cube) > implict_Boolean.AddFunction(dataset_Cylinder) > > > Sample = vtkSampleFunction() > Sample.SetImplicitFunction(implict_Boolean) > > Surface = vtkContourFilter() > Surface.SetInputConnection(Sample.GetOutputPort()) > > > #Export to STL > writerBinary = vtkSTLWriter() > writerBinary.SetFileName("c:\\exported.stl") > writerBinary.SetInput(Surface.GetOutput()) > writerBinary.SetFileType(2) > writerBinary.Write() > > > > Mapper = vtkPolyDataMapper() > Mapper.SetInput(Surface.GetOutput()) > Mapper.ScalarVisibilityOn() > > Actor = vtkActor() > Actor.SetMapper(Mapper) > Actor.SetPosition(0,0,0) > > > ren = vtkRenderer() > ren.AddActor(Actor) > > renWin = vtkRenderWindow() > renWin.AddRenderer(ren) > > iren = vtkRenderWindowInteractor() > iren.SetRenderWindow(renWin) > > renWin.Render() > > > > > 2008/4/28 Mathieu Malaterre : > > Hi Paulo, > > > > I believe this question has been raised in the vtkusers mailing list > > before, how about: > > > > http://www.vtk.org/pipermail/vtkusers/2007-April/090730.html > > > > HTH > > -Mathieu > > > > On Sun, Apr 27, 2008 at 3:44 AM, Paulo Henrique Junqueira Amorim > > wrote: > > > Hi All, > > > > > > I am researching how to make operation of intersse??o and subtraction > > of > > > PolyData with the vtk 5. But I do not think any refence. > > > > > > That class could use? > > > > > > > > > Best Regards, > > > Paulo > > > > > > > > > _______________________________________________ > > > This is the private VTK discussion list. > > > Please keep messages on-topic. Check the FAQ at: > > > http://www.vtk.org/Wiki/VTK_FAQ > > > Follow this link to subscribe/unsubscribe: > > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > > > > > > > > -- > > Mathieu > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andresba at hotmail.com Mon May 5 20:27:58 2008 From: andresba at hotmail.com (Andres Barrera) Date: Mon, 5 May 2008 19:27:58 -0500 Subject: [vtkusers] FW: Removing Actors In-Reply-To: References: Message-ID: rcpompeu,Try to re-render the scene, using vtkRenderWindow::Render() (e.g. VTK3->Render(); ) Andres From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.comTo: rcpompeu at hotmail.comDate: Tue, 6 May 2008 00:31:09 +1000CC: vtkusers at public.kitware.comSubject: Re: [vtkusers] Removing Actors Is the program actually entering the 'else' section?? Maybe tbnIniciar->Down is always true? If you're not sure then throw in a print statement to see if anything prints in that section.The RemoveActor function is the correct one to use. I am using that in the program that I'm working on at the moment.If that is not the problem, then it could be that something is still using the actor that you're trying to remove. That can be a problem when using the Delete function to remove it from memory, however I'm not sure if it can be a problem for RemoveActor as well.Hope that helps a bit,Cameron. From: rcpompeu at hotmail.comTo: vtkusers at public.kitware.comDate: Mon, 5 May 2008 13:45:11 +0000Subject: [vtkusers] Removing Actors Hello All, How do I remove an individual actor from the scene? My code does not work. Someone help me? Thanks. if (tbnIniciar->Down) { VTK3->GetRenderer()->AddActor(outlineActor); } else { VTK3->GetRenderer()->RemoveActor(outlineActor); VTK3->GetRenderer()->RemoveViewProp(outlineActor); VTK3->GetRenderer()->Clear(); } VTK3->Invalidate(); Not?cias direto do New York Times, gols do Lance, videocassetadas e muitos outros v?deos no MSN Videos! Confira j?! at CarPoint.com.au It's simple! Sell your car for just $30 Get Free (PRODUCT) RED? Emoticons, Winks and Display Pics. Check it out! _________________________________________________________________ With Windows Live for mobile, your contacts travel with you. http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_Refresh_mobile_052008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.danewitz at fh-wolfenbuettel.de Tue May 6 05:11:11 2008 From: d.danewitz at fh-wolfenbuettel.de (Dmitri Danewitz) Date: Tue, 06 May 2008 11:11:11 +0200 Subject: [vtkusers] Get coordinates of scalar values of a DataSet Message-ID: <4fca24f8b6.4f8b64fca2@fh-wolfenbuettel.de> Hello all! I have filtered a 2D-slice out of a 3D-rectangular-grid DataSet and need to know the coordinates of given scalar values. For example i need the coordinates of the first scalar that is less than "50". I'd like to save the coordinates as integers. Can someone help me? From paul at science.uva.nl Tue May 6 07:59:59 2008 From: paul at science.uva.nl (Paul Melis) Date: Tue, 06 May 2008 13:59:59 +0200 Subject: [vtkusers] vtkVoxelModeller / converting "bit" scalar type? Message-ID: <4820483F.1020809@science.uva.nl> Hello, Is there any way to actually use the output of the vtkVoxelModeller? Its output has scalar type "bit", but there seems to be no way to use this as I haven't found a filter that can handle the type (not even vtkImageCast or vtkImageShiftScale). The TCL test included in the docs for vtkVoxelModeller seems to suggest that writing the filter's output to a .vtk file and then reading it back in is a work-around, but even that doesn't work, as the result after reading is still "bit". Is the only way really to _hand-edit_ the output file so as to change the scalar type? If so, is there a filter that can do similar things? In my case convert outlines (vtkPolyData consisting of lines) to a bi-level structured points set denoting inside/outside. I looked at vtkImplicitModeller, but it can't get it to fill the inside of the outlines, while vtkVoxelModeller does this by itself. Thanks for any help, Paul From polys_poly at hotmail.com Tue May 6 09:00:36 2008 From: polys_poly at hotmail.com (polys_poly at hotmail.com) Date: Tue, 6 May 2008 16:00:36 +0300 Subject: [vtkusers] Calculating the area of a polygon Message-ID: Hello, I am using the following code to create a polygon in 3D. vtkPolygon* polygon1 = vtkPolygon::New(); vtkPoints* polygonPoints1 = vtkPoints::New(); vtkPolyData* polyData1 = vtkPolyData::New(); vtkPolyDataMapper* polygonMapper1 = vtkPolyDataMapper::New(); vtkTriangleFilter* tri1= vtkTriangleFilter::New(); polygonPoints1->SetNumberOfPoints(4); polygon1->GetPointIds()->SetNumberOfIds(4); polygonPoints1->InsertPoint(0, x1, y1, z1); polygon1->GetPointIds()->SetId(0, 0); polygonPoints1->InsertPoint(1, x2, y2, z2); polygon1->GetPointIds()->SetId(1, 1); polygonPoints1->InsertPoint(2, x3, y3, z3); polygon1->GetPointIds()->SetId(2, 2); polygonPoints1->InsertPoint(3, x4, y4, z4); polygon1->GetPointIds()->SetId(3, 3); polyData1->Allocate(); polyData1->InsertNextCell(polygon1->GetCellType(),polygon1->GetPointIds()); polyData1->SetPoints(polygonPoints1); tri1->SetInput(polyData1); polygonMapper1->SetInput(tri1->GetOutput()); What i am trying to do is get the area of the polygon. I am using the following code but i get 0 for the area vtkMassProperties* polygonProperties = vtkMassProperties::New(); polygonProperties->SetInputConnection(tri1->GetOutputPort()); double area = polygonProperties->SurfaceArea; Can someone tell me what i am doing wrong or is there any other way to compute the area of a polygon. Maybe there is a way to find the number of pixels that a polygon has on the screen and multiply that number with the pixel size? Thanks in advance, Polys -------------- next part -------------- An HTML attachment was scrubbed... URL: From wesbrooks at gmail.com Tue May 6 09:06:10 2008 From: wesbrooks at gmail.com (Wesley Brooks) Date: Tue, 6 May 2008 14:06:10 +0100 Subject: [vtkusers] Different colours within the same polydata? Message-ID: Dear Users, I'm trying to visualize some data that is a collection of lines, points and triangles. Is it possible to have some lines within the same polydata a different colour to the others? If so how do you do this? I'd also like to do the same thing with the points and triangles. At the moment I have to split it up into different polydata objects, creating an actor for each one then collecting all the actors with an assembly. This is currently taking a long time to visualise the data in either Windows or Linux. I'm running Python 2.4 and 2.5. Cheers, Wesley Brooks From d.danewitz at fh-wolfenbuettel.de Tue May 6 10:12:45 2008 From: d.danewitz at fh-wolfenbuettel.de (Dmitri Danewitz) Date: Tue, 06 May 2008 16:12:45 +0200 Subject: [vtkusers] XY-Plot issue Message-ID: <5418b54d24.54d245418b@fh-wolfenbuettel.de> Hello all! I have a curve on an XY-Plot and need to store the y-values of given x- values in integer variables. Until now I can only get the values by printing the plot and measuring with a ruler :-( Greets Dmitri From polys_poly at hotmail.com Tue May 6 10:49:49 2008 From: polys_poly at hotmail.com (polys_poly at hotmail.com) Date: Tue, 6 May 2008 17:49:49 +0300 Subject: [vtkusers] Ray interesection with volume - findinf the mouse position Message-ID: Hello, Currently i am creating a volume of a DICOM Dataset. The interactor i am using is vtkInteractorStyleTrackballCamera. What i want to do is finding the mouse pointer location on the rendering window, and then finding the ray that connects the position of the camera with the mouse position so i can find the points of the volume that this ray intersects. I would appreciate any help on this subject. Thanks, Polys -------------- next part -------------- An HTML attachment was scrubbed... URL: From rcpompeu at hotmail.com Tue May 6 10:51:40 2008 From: rcpompeu at hotmail.com (Renato Cesar Pompeu) Date: Tue, 6 May 2008 14:51:40 +0000 Subject: [vtkusers] Updating In-Reply-To: <019401c8aec4$a3f2a3b0$ebd7eb10$@danesi@dinccs.com> References: <018601c8aec0$df33ffe0$9d9bffa0$@danesi@dinccs.com> <019401c8aec4$a3f2a3b0$ebd7eb10$@danesi@dinccs.com> Message-ID: Hi All, I have a value generated by a timer component (Vmaxgrad[i][j][k]). How is it possible to update an actor with these generated values? Thanks a lot. Her is my code: vtkFloatArray *vetores = vtkFloatArray::New(); vetores->SetNumberOfComponents(3);vtkPoints *pontos = vtkPoints::New();vtkFloatArray *xCoords = vtkFloatArray::New();for (i=0; i<=a; i++) xCoords->InsertNextValue(xv[i]);vtkFloatArray *yCoords = vtkFloatArray::New();for (i=0; i<=b; i++) yCoords->InsertNextValue(yv[i]);vtkFloatArray *zCoords = vtkFloatArray::New();for (i=0; i<=c; i++) zCoords->InsertNextValue(zv[i]);vtkRectilinearGrid *rgrid = vtkRectilinearGrid::New(); rgrid->SetDimensions(a+1,b+1,c+1); rgrid->SetXCoordinates(xCoords); rgrid->SetYCoordinates(yCoords); rgrid->SetZCoordinates(zCoords);vtkDoubleArray *array = vtkDoubleArray::New(); for (k=0; k<=c; k++) for (j=0; j<=b; j++) for (i=0; i<=a; i++) { array->InsertValue(k*(a+1)*(b+1)+j*(a+1)+i, Vmaxgrad[i][j][k]); pontos->InsertPoint(k*(a+1)*(b+1)+j*(a+1)+i, i, j, k); vetores->InsertTuple3(k*(a+1)*(b+1)+j*(a+1)+i, vx[i][j][k], vy[i][j][k], vz[i][j][k]);} rgrid->GetPointData()->SetVectors(vetores); rgrid->GetPointData()->SetScalars(array);vtkRectilinearGridGeometryFilter *plane = vtkRectilinearGridGeometryFilter::New(); plane->SetInput(rgrid);vtkLookupTable *Table = vtkLookupTable::New(); Table->SetNumberOfColors(150); Table->SetHueRange(0.667 , 0); Table->SetRange(rgrid->GetScalarRange());vtkRectilinearGridOutlineFilter *outline = vtkRectilinearGridOutlineFilter::New(); outline->SetInput(rgrid);vtkPolyDataMapper *outlineMapper = vtkPolyDataMapper::New(); outlineMapper->SetInputConnection(outline->GetOutputPort());vtkActor *outlineActor = vtkActor::New(); outlineActor->SetMapper(outlineMapper); outlineActor->GetProperty()->SetColor( 0, 0, 0); VTK3->GetRenderer()->AddActor(outlineActor); } _________________________________________________________________ Conhe?a o Windows Live Spaces, a rede de relacionamentos do Messenger! http://www.amigosdomessenger.com.br/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From darlonv at gmail.com Tue May 6 11:34:17 2008 From: darlonv at gmail.com (Darlon) Date: Tue, 6 May 2008 12:34:17 -0300 Subject: [vtkusers] Arrow with 2 points Message-ID: <5bac1d910805060834x4ae5dc7bka4477210c758f454@mail.gmail.com> Hi. I have two points: p1=(x1,y1,z1) and p2=(x2,y2,z2), and need to create an arrow from p1 to p2. I know how to create the arrow using vtkArrowSource and move the arrow to p1, but how can i do to make that p2 be the final point of the arrow? I am using linux, with g++ and vtk 5.0. thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at science.uva.nl Tue May 6 11:38:34 2008 From: paul at science.uva.nl (Paul Melis) Date: Tue, 06 May 2008 17:38:34 +0200 Subject: [vtkusers] vtkVoxelModeller / converting "bit" scalar type? In-Reply-To: <4820483F.1020809@science.uva.nl> References: <4820483F.1020809@science.uva.nl> Message-ID: <48207B7A.3070401@science.uva.nl> Paul Melis wrote: > Hello, > Is there any way to actually use the output of the vtkVoxelModeller? > Its output has scalar type "bit", but there seems to be no way to use > this as I haven't found a filter that can handle the type (not even > vtkImageCast or vtkImageShiftScale). The TCL test included in the docs > for vtkVoxelModeller seems to suggest that writing the filter's output > to a .vtk file and then reading it back in is a work-around, but even > that doesn't work, as the result after reading is still "bit". Is the > only way really to _hand-edit_ the output file so as to change the > scalar type? > > If so, is there a filter that can do similar things? In my case > convert outlines (vtkPolyData consisting of lines) to a bi-level > structured points set denoting inside/outside. I looked at > vtkImplicitModeller, but it can't get it to fill the inside of the > outlines, while vtkVoxelModeller does this by itself. Never mind. I seem to have found a work-around by using a vtkDelaunay3D on the lines, followed by a vtkImplicitModeller followed by a vtkImageThreshold. Paul From goodwin.lawlor at ucd.ie Tue May 6 20:32:13 2008 From: goodwin.lawlor at ucd.ie (Goodwin Lawlor) Date: Wed, 07 May 2008 01:32:13 +0100 Subject: [vtkusers] 403 error at vtk.org Message-ID: Hi All, I'm getting a: "Sorry, error 403 Server unable to read htaccess file, denying access to be safe" from the nightly dashboard web page, http://www.vtk.org/Testing/Dashboard/MostRecentResults-Nightly/Dashboard.html Anyone else seeing it? Thanks, Goodwin From wes.turner at kitware.com Tue May 6 20:34:04 2008 From: wes.turner at kitware.com (Wes Turner) Date: Tue, 6 May 2008 20:34:04 -0400 Subject: [vtkusers] 403 error at vtk.org In-Reply-To: References: Message-ID: <7ade83390805061734g4d28f4d5u29f0934bf072d619@mail.gmail.com> Yes, I'm seeing it too. - Wes On Tue, May 6, 2008 at 8:32 PM, Goodwin Lawlor wrote: > Hi All, > > I'm getting a: > > "Sorry, error 403 > Server unable to read htaccess file, denying access to be safe" > > from the nightly dashboard web page, > http://www.vtk.org/Testing/Dashboard/MostRecentResults-Nightly/Dashboard.html > > Anyone else seeing it? > > Thanks, > > Goodwin > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Wesley D. Turner, Ph.D. Kitware, Inc. R&D Engineer 28 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-371-3971 x120 -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodwin.lawlor at ucd.ie Tue May 6 20:53:08 2008 From: goodwin.lawlor at ucd.ie (Goodwin Lawlor) Date: Wed, 07 May 2008 01:53:08 +0100 Subject: [vtkusers] 403 error at vtk.org In-Reply-To: <7ade83390805061734g4d28f4d5u29f0934bf072d619@mail.gmail.com> References: <7ade83390805061734g4d28f4d5u29f0934bf072d619@mail.gmail.com> Message-ID: <4820FD74.1090705@ucd.ie> Maybe the page has officially moved to: http://public.kitware.com/dashboard.php ? If it has the link to the dashboard from vtk.org should be updated. Goodwin Wes Turner wrote: > Yes, I'm seeing it too. > > - Wes > > On Tue, May 6, 2008 at 8:32 PM, Goodwin Lawlor > wrote: > > Hi All, > > I'm getting a: > > "Sorry, error 403 > Server unable to read htaccess file, denying access to be safe" > > from the nightly dashboard web page, > http://www.vtk.org/Testing/Dashboard/MostRecentResults-Nightly/Dashboard.html > > Anyone else seeing it? > > Thanks, > > Goodwin > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > -- > Wesley D. Turner, Ph.D. > Kitware, Inc. > R&D Engineer > 28 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-371-3971 x120 > > > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers From goodwin.lawlor at ucd.ie Tue May 6 20:53:08 2008 From: goodwin.lawlor at ucd.ie (Goodwin Lawlor) Date: Wed, 07 May 2008 01:53:08 +0100 Subject: [vtkusers] 403 error at vtk.org In-Reply-To: <7ade83390805061734g4d28f4d5u29f0934bf072d619@mail.gmail.com> References: <7ade83390805061734g4d28f4d5u29f0934bf072d619@mail.gmail.com> Message-ID: <4820FD74.1090705@ucd.ie> Maybe the page has officially moved to: http://public.kitware.com/dashboard.php ? If it has the link to the dashboard from vtk.org should be updated. Goodwin Wes Turner wrote: > Yes, I'm seeing it too. > > - Wes > > On Tue, May 6, 2008 at 8:32 PM, Goodwin Lawlor > wrote: > > Hi All, > > I'm getting a: > > "Sorry, error 403 > Server unable to read htaccess file, denying access to be safe" > > from the nightly dashboard web page, > http://www.vtk.org/Testing/Dashboard/MostRecentResults-Nightly/Dashboard.html > > Anyone else seeing it? > > Thanks, > > Goodwin > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > -- > Wesley D. Turner, Ph.D. > Kitware, Inc. > R&D Engineer > 28 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-371-3971 x120 > > > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers From mark.jefferson at qq.com Tue May 6 21:56:43 2008 From: mark.jefferson at qq.com (=?ISO-8859-1?B?TWFyayBKZWZmZXJzb24=?=) Date: Wed, 7 May 2008 9:56:43 +0800 Subject: [vtkusers] How to add a polygon actor in the volume rendering? Message-ID: Hi, I am doing volume rendering now, and I want to add some polygon actors in it, for example, a cone, a sphere and so on. but I find these polygon actors would disappear if there is volume rendering, and there would be only the volume rendering even though you have added some polygon actors. so I want to ask : can the actors based on voxels (like volume rendering) and the actors based on polygons (like surface rendering or a sphere and so on) be renderred in the same render window at the same time? but if couldn't, why I could add a outline for my volume rendering? and a outline(class vtkOutlineFilter) is also renderred by vtkActor. if it could, could you tell me how could I add a polygon actor in volume rendering? thank you for your help! M.J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.jefferson at qq.com Wed May 7 03:16:48 2008 From: mark.jefferson at qq.com (=?ISO-8859-1?B?TWFyayBKZWZmZXJzb24=?=) Date: Wed, 7 May 2008 15:16:48 +0800 Subject: [vtkusers] How to add a polygon actor in the volume rendering? Message-ID: Hi, it is OK now, thank you very much! M.J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.danewitz at fh-wolfenbuettel.de Wed May 7 04:22:07 2008 From: d.danewitz at fh-wolfenbuettel.de (Dmitri Danewitz) Date: Wed, 07 May 2008 10:22:07 +0200 Subject: [vtkusers] Reading the value of a vtkDataSet - Cell Message-ID: <999b596dca.96dca999b5@fh-wolfenbuettel.de> Hello all! I have a vtkDataSet with 1961 cells. (1961 x-values, 1 y-value and 1 z- value) How can I read the scalar values of the cells? Thanks Dmitri From philippe.pouletaut at utc.fr Wed May 7 06:14:35 2008 From: philippe.pouletaut at utc.fr (Philippe Pouletaut) Date: Wed, 07 May 2008 12:14:35 +0200 Subject: [vtkusers] vtkPlane::ProjectPoint : how to get projected point ? Message-ID: <4821810B.6010901@utc.fr> Hello vtkuser, I would like to get projected points onto a plane from a polydata set. I use VTK5.0 and try the vtkPlane ProjectPoint method as the tcl example follows : vtkPlane plane set origin [list 2.0 0.0 0.0] set normal [list -1.0 0.0 0.0] set xproj [list 0.0 0.0 0.0] set p1 [list 0.0 1.0 0.0] eval [plane ProjectPoint $p1 $origin $normal $xproj] But it doesn't work ... It indicates that the calling arguments are bad or the method is not found. I've also tested the GeneralizedProjectPoint: The same error occurs. Can anybody help me to find what is wrong ? Is there another way to get projected points on a plane ? Many thanks for your attention. -- Philippe POULETAUT Universit? de Technologie de Compi?gne Dpt G?nie Biologique. UMR 6600 BP 20529 F 60205 Compi?gne Cedex - France T?l.: +33 (0)3.44.23.44.23 poste 53.11 fax : 03 44 20 79 42 courriel : Philippe.Pouletaut at utc.fr From Frank.Lindseth at sintef.no Wed May 7 07:02:04 2008 From: Frank.Lindseth at sintef.no (Frank Lindseth) Date: Wed, 7 May 2008 13:02:04 +0200 Subject: [vtkusers] Change display origin from lower left 2 upper left Message-ID: <6ABB767B-74C0-4C92-AE89-8144AC1B0F19@sintef.no> Hi all, Is it possible to change VTK's display/viewport convention from (origin in lower left): /\ y | | O--------> x To (origin in upper left): O--------> x | | \/ y Any help would be greatly appreciated. Background: We would like to replace the old "display system" in an existing application with a new based on VTK, i.e. both display/viewport layout and visualizing exiting data that "assumes" that the display/viewport origin is in the upper left corner, converting setup/data coordinates (y) is of course an option, but it would make things a lot easier if VTK used the same origin (as opposed to the lower-left default), I'm pretty sure that I was able to set this a long time ago (vtkRenderWindow-method maybe?), but can't find the needed functionality anywhere anymore, is it possible? - Frank -------------- next part -------------- An HTML attachment was scrubbed... URL: From moshman65 at yahoo.com Wed May 7 07:27:57 2008 From: moshman65 at yahoo.com (Emmanouil Moschidis) Date: Wed, 7 May 2008 04:27:57 -0700 (PDT) Subject: [vtkusers] Change display origin from lower left 2 upper left In-Reply-To: <6ABB767B-74C0-4C92-AE89-8144AC1B0F19@sintef.no> Message-ID: <130796.10889.qm@web36703.mail.mud.yahoo.com> Hi Frank I know that with the vtkImageFlip class has this funtcionality when it comes to the manipulation of a vtkImageData object. I'm not sure about the viewport though... I'd suppose there is no problem as the origin is defined internally in each object and not by the viewport, am I right? Frank Lindseth wrote: Hi all, Is it possible to change VTK's display/viewport convention from (origin in lower left): /\ y | | O--------> x To (origin in upper left): O--------> x | | \/ y Any help would be greatly appreciated. Background: We would like to replace the old "display system" in an existing application with a new based on VTK, i.e. both display/viewport layout and visualizing exiting data that "assumes" that the display/viewport origin is in the upper left corner, converting setup/data coordinates (y) is of course an option, but it would make things a lot easier if VTK used the same origin (as opposed to the lower-left default), I'm pretty sure that I was able to set this a long time ago (vtkRenderWindow-method maybe?), but can't find the needed functionality anywhere anymore, is it possible? - Frank _______________________________________________ This is the private VTK discussion list. Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers --------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Frank.Lindseth at sintef.no Wed May 7 08:11:43 2008 From: Frank.Lindseth at sintef.no (Frank Lindseth) Date: Wed, 7 May 2008 14:11:43 +0200 Subject: [vtkusers] Change display origin from lower left 2 upper left In-Reply-To: <130796.10889.qm@web36703.mail.mud.yahoo.com> References: <130796.10889.qm@web36703.mail.mud.yahoo.com> Message-ID: <10A6DCE5-1FBB-45B6-8365-E16C1A68766B@sintef.no> Yes it's possible to manipulate the data sent to the new display- system and vtkImageFlip could be used to convert vtkImageData, but I would prefer (a least for the time being) to use the data as is, and instead adapt the new VTK display system to the old one (basically flipping the window/viewport y-axis), it's pretty complicated in terms of view-layout (e.g. view-position and width/hight in pixel coord. as well as overlay (e.g. line gong from pixel (display/viewport) x1,y1 to x2,y2). So somthing like: renWin->SetOriginToUpperLeft(); would be very nice, is my vague recollection of such a method totally wrong? - Frank On May 7, 2008, at 1:27 PM, Emmanouil Moschidis wrote: > Hi Frank > I know that with the vtkImageFlip class has this funtcionality when > it comes to the manipulation of a vtkImageData object. I'm not sure > about the viewport though... I'd suppose there is no problem as the > origin is defined internally in each object and not by the viewport, > am I right? > > Frank Lindseth wrote: > Hi all, > > Is it possible to change VTK's display/viewport convention from > (origin in lower left): > /\ y > | > | > O--------> x > > To (origin in upper left): > O--------> x > | > | > \/ y > > Any help would be greatly appreciated. > > > Background: > We would like to replace the old "display system" in an existing > application with a new based on VTK, > i.e. both display/viewport layout and visualizing exiting data that > "assumes" that the display/viewport origin is in the upper left > corner, > converting setup/data coordinates (y) is of course an option, but it > would make things a lot easier if VTK used the same origin (as > opposed to the lower-left default), > I'm pretty sure that I was able to set this a long time ago > (vtkRenderWindow-method maybe?), but can't find the needed > functionality anywhere anymore, > is it possible? > > - Frank > > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. > Try it now. ------------------------------ Frank Lindseth Research Scientist (PhD) SINTEF Health Research Dept. Medical Technology N-7465 Trondheim, Norway Location: Olav Kyrres gt. 9, 4th floor, Trondheim E-mail: Frank.Lindseth at sintef.no Telephone: +47 928 09 372 Telefax: +47 930 70 800 -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.bottino at polito.it Wed May 7 09:53:19 2008 From: andrea.bottino at polito.it (Andrea Bottino) Date: Wed, 07 May 2008 15:53:19 +0200 Subject: [vtkusers] A question about surface cutting Message-ID: <4821B44F.5060905@polito.it> Hi everybody, I'd like to make a hole in a 3D surface. I have the contour of the part of the surface that must be removed (defined as a set of points). I was trying to use vtkExtractGeometry with vtkImplicitSelectionLoop to perform the cut, but what I get as result, is just the part of the object INSIDE the contour 8while I'd like to obtain the surface with the hole). I've checked the documentation and the examples but I couldn't find a way to tell that I want to keep the outside of the contour. The only way to obtain the desired result was to use vtkClipPolyData, which however is much slower than vtkExtractGeometry. Anybody knows how to solve the problem? This is an excerpt of the code I'm using // this extracts from the surface the internal part of the loop, I'd like to get the external part... vtkImplicitSelectionLoop* loop = vtkImplicitSelectionLoop::New(); loop->SetLoop( contourPts ); loop->SetAutomaticNormalGeneration(1); vtkExtractGeometry* extract = vtkExtractGeometry::New(); extract->SetInputConnection( face->getModelSurface() ); extract->SetImplicitFunction( loop ); vtkConnectivityFilter* connect = vtkConnectivityFilter::New(); connect->SetInputConnection(extract->GetOutputPort()); connect->SetExtractionModeToClosestPointRegion(); connect->SetClosestPoint( contourPts->GetPoint(0) ); // to make a hole in the surface vtkClipPolyData* clipper = vtkClipPolyData::New(); clipper->SetInputConnection(face->getModelSurface()); clipper->SetClipFunction(loop); clipper->GenerateClipScalarsOn(); clipper->GenerateClippedOutputOn(); clipper->SetValue(0.5); best regards, -- Andrea Bottino Politecnico di Torino, DAUIN Corso Duca degli Abruzzi, 24 10129 Torino ITALY Tel +39 011 5647175 / Fax +39 011 5647099. http://www.polito.it/cgvg From ahs at cfdrc.com Wed May 7 09:55:03 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Wed, 07 May 2008 08:55:03 -0500 Subject: [vtkusers] A question about surface cutting In-Reply-To: <4821B44F.5060905@polito.it> References: <4821B44F.5060905@polito.it> Message-ID: <4821B4B7.9070608@cfdrc.com> Hi Andrea, Did you try calling ExtractInsideOff() on your instance of vtkExtractGeometry? The ExtractInside flag is supposed to determine whether to extract the cells inside the implicit function (the default) or outside (what I think you want). - Amy Andrea Bottino wrote: > Hi everybody, > I'd like to make a hole in a 3D surface. I have the contour of the > part of the surface that must be removed (defined as a set of points). > I was trying to use vtkExtractGeometry with vtkImplicitSelectionLoop > to perform the cut, but what I get as result, is just the part of the > object INSIDE the contour 8while I'd like to obtain the surface with > the hole). I've checked the documentation and the examples but I > couldn't find a way to tell that I want to keep the outside of the > contour. The only way to obtain the desired result was to use > vtkClipPolyData, which however is much slower than vtkExtractGeometry. > Anybody knows how to solve the problem? > > This is an excerpt of the code I'm using > > // this extracts from the surface the internal part of the loop, I'd > like to get the external part... > > vtkImplicitSelectionLoop* loop = vtkImplicitSelectionLoop::New(); > loop->SetLoop( contourPts ); > loop->SetAutomaticNormalGeneration(1); > > vtkExtractGeometry* extract = vtkExtractGeometry::New(); > extract->SetInputConnection( face->getModelSurface() ); > extract->SetImplicitFunction( loop ); > > vtkConnectivityFilter* connect = vtkConnectivityFilter::New(); > connect->SetInputConnection(extract->GetOutputPort()); > connect->SetExtractionModeToClosestPointRegion(); > connect->SetClosestPoint( contourPts->GetPoint(0) ); > > // to make a hole in the surface > > vtkClipPolyData* clipper = vtkClipPolyData::New(); > clipper->SetInputConnection(face->getModelSurface()); > clipper->SetClipFunction(loop); > clipper->GenerateClipScalarsOn(); > clipper->GenerateClippedOutputOn(); > clipper->SetValue(0.5); > > > best regards, > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From mcoursolle at rogue-research.com Wed May 7 12:12:37 2008 From: mcoursolle at rogue-research.com (Mathieu Coursolle) Date: Wed, 7 May 2008 12:12:37 -0400 Subject: [vtkusers] Increasing vtkPolyData resolution Message-ID: <85E311E8-13BE-4C35-B1C2-B1C1B7E4AF14@rogue-research.com> Hi VTK users, I have a closed 3D mesh (vtkPolyData) for which each scalar has a value assign to it. I would like to increase the resolution of the mesh to have a better scalar resolution. Is there a filter to increase the number of cells of a polydata without changing its shape? Thank you! Mathieu From Alexandre_Gouaillard at hms.harvard.edu Wed May 7 12:42:56 2008 From: Alexandre_Gouaillard at hms.harvard.edu (Alexandre GOUAILLARD) Date: Thu, 08 May 2008 00:42:56 +0800 Subject: [vtkusers] Increasing vtkPolyData resolution In-Reply-To: <85E311E8-13BE-4C35-B1C2-B1C1B7E4AF14@rogue-research.com> Message-ID: Hi mathieu You have the subdivision filters (butterfly, loop, ...) Surface triangular mesh only. I don't know what happen to attached scalar, but I think they are handled smoothly. Alex. On 5/8/08 12:12 AM, "Mathieu Coursolle" wrote: > Hi VTK users, > > I have a closed 3D mesh (vtkPolyData) for which each scalar has a > value assign to it. I would like to increase the resolution of the > mesh to have a better scalar resolution. > > Is there a filter to increase the number of cells of a polydata > without changing its shape? > > Thank you! > > Mathieu > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers From shekhar.kaushik at gmail.com Wed May 7 13:26:59 2008 From: shekhar.kaushik at gmail.com (Kaushik .) Date: Wed, 7 May 2008 22:56:59 +0530 Subject: [vtkusers] vtkMPIController and python Message-ID: Hi I compiled the the latest vtk code( checked out from repo ), and found the wrappings for the vtkMPIController generated. The class however does not have the Initialize() function wrapped. Which makes it pretty much useless. Any way out of this ? Or no support for the parallel modules in python ? Is this still an open issue ? -- shekhar -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcoursolle at rogue-research.com Wed May 7 15:33:42 2008 From: mcoursolle at rogue-research.com (Mathieu Coursolle) Date: Wed, 7 May 2008 15:33:42 -0400 Subject: [vtkusers] Creating a texture for a closed mesh Message-ID: Hi VTK users, I have a closed 3D mesh (vtkPolydata) and an image data (vtkImageData). Right now, I am using the vtkProbeFilter to assign the scalar values of the mesh to be the one of the image data, which is working fine. I would like to use a texture instead of scalar values to be able to reduce the resolution of the mesh, but keeping the same scalar resolution. I was wondering how this could be achieve with VTK? Thanks! Mathieu From d.danewitz at fh-wolfenbuettel.de Thu May 8 05:30:52 2008 From: d.danewitz at fh-wolfenbuettel.de (Dmitri Danewitz) Date: Thu, 08 May 2008 11:30:52 +0200 Subject: [vtkusers] from vtkPolyData into vtkFloatArray Message-ID: Hi all! Does somebody know how to put the Data from vtkPolyData into vtkFloatArray? Thanks! Dmitri From Moritz.Bernard.Fricke at rwth-aachen.de Thu May 8 05:41:30 2008 From: Moritz.Bernard.Fricke at rwth-aachen.de (Moritz Bernard Fricke) Date: Thu, 08 May 2008 11:41:30 +0200 Subject: [vtkusers] Creating an animation of a sequence of Data Message-ID: Hi all! I have created a set of iso surfaces in a vrml-room for one point in time. As the calculation is very slow, i want to do an offline-calculation for every 10ms and then create an animation for this sequence using vtkAnimationScene. As you can see below, i'm using vtkGaussianSplatter and vtkContourfilter to create iso surfaces from an UnstructuredGrid called 'intergrid' Can anybody help me with that? [...] aisoGS=vtk.vtkGaussianSplatter() aisoGS.SetInput(intergrid) aisoGS.ScalarWarpingOn() aisoGS.SetAccumulationModeToSum() iso=vtk.vtkContourFilter() iso.SetInputConnection(aisoGS.GetOutputPort()) iso.GenerateValues(3,0.7*maxdensity,maxdensity) isoMapper = vtk.vtkPolyDataMapper() isoMapper.SetInput(iso.GetOutput()) isoActor=vtk.vtkActor() isoActor.SetMapper(isoMapper) isoActor.GetProperty().SetOpacity(0.3) isoActor.AddPosition(0,0,0) room.SetRenderWindow(ren.GetRenderWindow()) room.SetRenderWindow(ren.GetRenderWindow()) renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) renWin.FullScreenOn() iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) ren.SetBackground(.1, .2, .4) ren.AddActor(isoparticleActor) #ren.AddActor(particleActor) #ren.AddActor(triangulation) #ren.AddActor(isoActor) # Set camera values ren.ResetCamera() ren.GetActiveCamera().Azimuth(0) ren.GetActiveCamera().Elevation(0) ren.GetActiveCamera().Dolly(10) ren.GetActiveCamera().SetViewAngle(90) ren.ResetCameraClippingRange() # Render the scene and start interaction. iren.Initialize() renWin.Render() iren.Start() From polys_poly at hotmail.com Thu May 8 08:14:12 2008 From: polys_poly at hotmail.com (polys_poly at hotmail.com) Date: Thu, 8 May 2008 15:14:12 +0300 Subject: [vtkusers] Ray interesection with volume - finding the mouse position Message-ID: Hello, Currently i am creating a volume of a DICOM Dataset. The interactor i am using is vtkInteractorStyleTrackballCamera. What i want to do is finding the mouse pointer location on the rendering window, and then finding the ray that connects the position of the camera with the mouse position so i can find the points of the volume or the actors that this ray intersects. I would appreciate any help on this subject. Thanks, Polys -------------- next part -------------- An HTML attachment was scrubbed... URL: From polys_poly at hotmail.com Thu May 8 08:16:13 2008 From: polys_poly at hotmail.com (polys_poly at hotmail.com) Date: Thu, 8 May 2008 15:16:13 +0300 Subject: [vtkusers] Calculating the area of a polygon In-Reply-To: <619D02C7-A539-4B79-897A-B25821AE55F6@knology.net> References: <619D02C7-A539-4B79-897A-B25821AE55F6@knology.net> Message-ID: Thanks Michael. That worked From: Michael Rice Sent: Wednesday, May 07, 2008 3:35 PM To: polys_poly at hotmail.compolys_poly@hotmail.com Subject: Re: [vtkusers] Calculating the area of a polygon Did you call polygonProperties->Update() before trying to use the polygonProperties->SurfaceArea? Michael On May 6, 2008, at 8:00 AM, wrote: Hello, I am using the following code to create a polygon in 3D. vtkPolygon* polygon1 = vtkPolygon::New(); vtkPoints* polygonPoints1 = vtkPoints::New(); vtkPolyData* polyData1 = vtkPolyData::New(); vtkPolyDataMapper* polygonMapper1 = vtkPolyDataMapper::New(); vtkTriangleFilter* tri1= vtkTriangleFilter::New(); polygonPoints1->SetNumberOfPoints(4); polygon1->GetPointIds()->SetNumberOfIds(4); polygonPoints1->InsertPoint(0, x1, y1, z1); polygon1->GetPointIds()->SetId(0, 0); polygonPoints1->InsertPoint(1, x2, y2, z2); polygon1->GetPointIds()->SetId(1, 1); polygonPoints1->InsertPoint(2, x3, y3, z3); polygon1->GetPointIds()->SetId(2, 2); polygonPoints1->InsertPoint(3, x4, y4, z4); polygon1->GetPointIds()->SetId(3, 3); polyData1->Allocate(); polyData1->InsertNextCell(polygon1->GetCellType(),polygon1->GetPointIds()); polyData1->SetPoints(polygonPoints1); tri1->SetInput(polyData1); polygonMapper1->SetInput(tri1->GetOutput()); What i am trying to do is get the area of the polygon. I am using the following code but i get 0 for the area vtkMassProperties* polygonProperties = vtkMassProperties::New(); polygonProperties->SetInputConnection(tri1->GetOutputPort()); double area = polygonProperties->SurfaceArea; Can someone tell me what i am doing wrong or is there any other way to compute the area of a polygon. Maybe there is a way to find the number of pixels that a polygon has on the screen and multiply that number with the pixel size? Thanks in advance, Polys _______________________________________________ This is the private VTK discussion list. Please keep messages on-topic. Check the 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 jd379252 at gmail.com Thu May 8 08:20:14 2008 From: jd379252 at gmail.com (pof) Date: Thu, 08 May 2008 14:20:14 +0200 Subject: [vtkusers] Is vtkDelaunay2D filter always producing counter-clockwise cells? Message-ID: <4822EFFE.5020905@gmail.com> Hi all, I'm using vtkDelaunay2D filter to triangulate data points. As a result, it usually (or at least it's what I thought) produces triangular cells that are counter-clockwise. However, in some cases, it also produces clockwise cells (see topology of the cell with Id=4 in the output file "MeshData.vtk" given below, obtained with the file "Test.cpp" also given below). As a hint, in this small test, a constrained Delaunay triangulation is performed by specifying the outer boundary (counter-clockwise). So my questions : - Is it normal that in some cases vtkDelaunay2D filter produces clockwise cells ? - Is there a way to force the filter to obtain only counter-clockwise cells ? Thanks, File "MeshData.vtk" # vtk DataFile Version 3.0 vtk output ASCII DATASET POLYDATA POINTS 11 float 200 700 0 800 700 0 200 600 0 800 600 0 200 500 0 800 500 0 500 520 0 500 550 0 500 600 0 500 650 0 500 700 0 POLYGONS 13 52 3 7 5 3 3 7 6 5 3 9 8 3 3 8 7 3 3 4 6 5 3 9 0 2 3 7 2 4 3 9 3 1 3 7 4 6 3 10 9 1 3 8 2 7 3 9 2 8 3 10 0 9 CELL_DATA 13 POINT_DATA 11 File "Test.cpp" ///////////////////////////////////////////////////////////////////////// // Test of constrained Delaunay2D with outer boundary // vtk5.0.4 // #include "vtkPolyData.h" #include "vtkPolyDataMapper.h" #include "vtkActor.h" #include "vtkRenderer.h" #include "vtkRenderWindow.h" #include "vtkRenderWindowInteractor.h" #include "vtkCamera.h" #include "vtkPoints.h" #include "vtkCellArray.h" #include "vtkDelaunay2D.h" #include "vtkExtractEdges.h" #include "vtkTubeFilter.h" #include "vtkProperty.h" #include "vtkIdFilter.h" #include "vtkCellCenters.h" #include "vtkSelectVisiblePoints.h" #include "vtkLabeledDataMapper.h" #include "vtkTextProperty.h" #include "vtkActor2D.h" #include "vtkPolyDataWriter.h" int main() { // Generate the input points vtkPoints *points = vtkPoints::New(); points->InsertPoint(0, 200., 700., 0.); points->InsertPoint(1, 800., 700., 0.); points->InsertPoint(2, 200., 600., 0.); points->InsertPoint(3, 800., 600., 0.); points->InsertPoint(4, 200., 500., 0.); points->InsertPoint(5, 800., 500., 0.); points->InsertPoint(6, 500., 520., 0.); points->InsertPoint(7, 500., 550., 0.); points->InsertPoint(8, 500., 600., 0.); points->InsertPoint(9, 500., 650., 0.); points->InsertPoint(10, 500., 700., 0.); // Generate the constrained outer boundary vtkCellArray *polys = vtkCellArray::New(); polys->InsertNextCell(8); polys->InsertCellPoint(3); polys->InsertCellPoint(1); polys->InsertCellPoint(10); polys->InsertCellPoint(0); polys->InsertCellPoint(2); polys->InsertCellPoint(4); polys->InsertCellPoint(5); polys->InsertCellPoint(3); // Build the polydata vtkPolyData *polyData = vtkPolyData::New(); polyData->SetPoints(points); polyData->SetPolys(polys); // Triangulate them vtkDelaunay2D *del1 = vtkDelaunay2D::New(); del1->SetInput(polyData); del1->SetSource(polyData); vtkPolyDataMapper *mapMesh = vtkPolyDataMapper::New(); mapMesh->SetInputConnection(del1->GetOutputPort()); vtkActor *meshActor = vtkActor::New(); meshActor->SetMapper(mapMesh); // Write the output polydata to a file vtkPolyDataWriter *writerPD = vtkPolyDataWriter::New(); writerPD->SetFileName("MeshData.vtk"); writerPD->SetInput(del1->GetOutput()); writerPD->Write(); // Tubes around mesh vtkExtractEdges *extract = vtkExtractEdges::New(); extract->SetInputConnection(del1->GetOutputPort()); vtkTubeFilter *tubes = vtkTubeFilter::New(); tubes->SetInputConnection(extract->GetOutputPort()); tubes->SetRadius(1.0); tubes->SetNumberOfSides(6); vtkPolyDataMapper *mapEdges = vtkPolyDataMapper::New(); mapEdges->SetInputConnection(tubes->GetOutputPort()); vtkActor *edgeActor = vtkActor::New(); edgeActor->SetMapper(mapEdges); (edgeActor->GetProperty())->SetColor(1,0,0); (edgeActor->GetProperty())->SetSpecularColor(1,1,1); (edgeActor->GetProperty())->SetSpecular(0.3); (edgeActor->GetProperty())->SetSpecularPower(20); (edgeActor->GetProperty())->SetAmbient(0.2); (edgeActor->GetProperty())->SetDiffuse(0.8); // Create the graphics structure vtkRenderer *ren1 = vtkRenderer::New(); ///////////////////////////////////////////////////////////////////// // Stuff to display point and celll Ids ///////////////////////////////////////////////////////////////////// vtkIdFilter *ids = vtkIdFilter::New(); ids->SetInput(del1->GetOutput()); ids->CellIdsOn(); ids->PointIdsOn(); //////////////////////////////////////////////////////////////////// // Create labels for cells vtkCellCenters *cc = vtkCellCenters::New(); cc->SetInputConnection(ids->GetOutputPort()); vtkSelectVisiblePoints *visCells = vtkSelectVisiblePoints::New(); visCells->SetInputConnection(cc->GetOutputPort()); visCells->SetRenderer(ren1); // Create the mapper to display the cell ids. Specify the // format to use for the labels. Also create the associated actor. vtkLabeledDataMapper *cellMapper = vtkLabeledDataMapper::New(); cellMapper->SetInputConnection(visCells->GetOutputPort()); cellMapper->SetLabelFormat("%g"); cellMapper->SetLabelModeToLabelFieldData(); (cellMapper->GetLabelTextProperty())->SetColor(0.,0.,1.); vtkActor2D *cellLabels = vtkActor2D::New(); cellLabels->SetMapper(cellMapper); //////////////////////////////////////////////////////////////////// // Create labels for points vtkSelectVisiblePoints *visPts = vtkSelectVisiblePoints::New(); visPts->SetInputConnection(ids->GetOutputPort()); visPts->SetRenderer(ren1); // Create the mapper to display the point ids. Specify the // format to use for the labels. Also create the associated actor. vtkLabeledDataMapper *ldm = vtkLabeledDataMapper::New(); ldm->SetInputConnection(visPts->GetOutputPort()); ldm->SetLabelFormat("%g"); ldm->SetLabelModeToLabelFieldData(); (ldm->GetLabelTextProperty())->SetColor(1.,0.,0.); vtkActor2D *pointLabels = vtkActor2D::New(); pointLabels->SetMapper(ldm); // Finishes the graphics structure // Add the actors to the renderer, set the background and size ren1->AddActor(meshActor); ren1->AddActor(edgeActor); ren1->AddActor(cellLabels); ren1->AddActor(pointLabels); vtkRenderWindow *renWin = vtkRenderWindow::New(); renWin->AddRenderer(ren1); renWin->SetSize(400, 400); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(renWin); // Add the actors to the renderer, set the background and size ren1->SetBackground(0.1, 0.2, 0.4); renWin->SetSize(400, 400); ren1->ResetCamera(); renWin->Render(); // This starts the event loop iren->Start(); // Delete all the instances that have been created ren1->Delete(); renWin->Delete(); iren->Delete(); meshActor->Delete(); mapMesh->Delete(); writerPD->Delete(); extract->Delete(); tubes->Delete(); edgeActor->Delete(); mapEdges->Delete(); ids->Delete(); cc->Delete(); visCells->Delete(); cellMapper->Delete(); cellLabels->Delete(); ldm->Delete(); pointLabels->Delete(); visPts->Delete(); del1->Delete(); polyData->Delete(); points->Delete(); polys->Delete(); return 0; } From hobbsk at ohiou.edu Thu May 8 08:37:45 2008 From: hobbsk at ohiou.edu (Kevin H. Hobbs) Date: Thu, 08 May 2008 08:37:45 -0400 Subject: [vtkusers] from vtkPolyData into vtkFloatArray In-Reply-To: References: Message-ID: <1210250265.25298.4.camel@gargon.hooperlab> On Thu, 2008-05-08 at 11:30 +0200, Dmitri Danewitz wrote: > Hi all! > > Does somebody know how to put the Data from vtkPolyData into > vtkFloatArray? > > Thanks! Do you want to get the point data, cell data, or something else? Do you know what type is used to store the data in the points or cells? does polydata->GetPoints()->GetData(); work for you? -------------- 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 cquammen at cs.unc.edu Thu May 8 08:43:43 2008 From: cquammen at cs.unc.edu (Cory Quammen) Date: Thu, 8 May 2008 08:43:43 -0400 Subject: [vtkusers] from vtkPolyData into vtkFloatArray In-Reply-To: References: Message-ID: <38fd72f40805080543x5878f41fq2065d1c30ef2b103@mail.gmail.com> Dmitri, I'm assuming you are talking about getting scalar values from the points in the vtkPolyData object. This ought to do it: vtkPolyData *polyData = ...; vtkDataArray *array = polyData->GetPointData()->GetScalars(); If your polydata has float data, you'll want to cast your vtkDataArray vtkFloatArray. I believe this can be done with vtkFloatArray *array = vtkFloatArray::SafeDownCast(polyData->GetPointData()->GetScalars()); Otherwise, you'll have to downcast to the correct array type then copy and cast into a new vtkFloatArray. Hope this helps, Cory On Thu, May 8, 2008 at 5:30 AM, Dmitri Danewitz wrote: > Hi all! > > Does somebody know how to put the Data from vtkPolyData into > vtkFloatArray? > > Thanks! > > Dmitri > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Cory Quammen Department of Computer Science University of North Carolina at Chapel Hill http://www.cs.unc.edu/~cquammen From julian.ibarz at gmail.com Thu May 8 09:13:31 2008 From: julian.ibarz at gmail.com (Julian Ibarz) Date: Thu, 8 May 2008 15:13:31 +0200 Subject: [vtkusers] Ray interesection with volume - finding the mouse position In-Reply-To: References: Message-ID: <1c4aee80805080613s2f4a15ddybb6bd806ef703395@mail.gmail.com> I don't know what you want exactly but if you want to find the points of the volume or the actors picked by the mouse you have in the VTK nightly version : http://www.vtk.org/doc/nightly/html/classvtkPointPicker.html http://www.vtk.org/doc/nightly/html/classvtkPropPicker.html To get the mouse position : http://www.vtk.org/doc/nightly/html/classvtkRenderWindowInteractor.html You are working with what programming language ? C++ ? Java ? other ? To get the mouse position it's change with the language. For example in java you create a vtkCanvas to draw the rendering and override the methode MouseMoveEvent(MouseEvent e) to get the new position of the mouse when it moves and get the position with e->x and e->y... This answers your question ? 2008/5/8 : > Hello, > > Currently i am creating a volume of a DICOM Dataset. The interactor i am > using is vtkInteractorStyleTrackballCamera. > What i want to do is finding the mouse pointer location on the rendering > window, and then finding the ray that connects the position of the camera > with the mouse position so i can find the points of the volume or the actors > that this ray intersects. > > I would appreciate any help on this subject. > > Thanks, > Polys > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -- Julian Ibarz -------------- next part -------------- An HTML attachment was scrubbed... URL: From polys_poly at hotmail.com Thu May 8 09:19:24 2008 From: polys_poly at hotmail.com (polys_poly at hotmail.com) Date: Thu, 8 May 2008 16:19:24 +0300 Subject: [vtkusers] Ray interesection with volume - finding the mouse position In-Reply-To: <1c4aee80805080613s2f4a15ddybb6bd806ef703395@mail.gmail.com> References: <1c4aee80805080613s2f4a15ddybb6bd806ef703395@mail.gmail.com> Message-ID: Actually i want to be able to pick some actors (polygons) that i am rendering with the brain volume so that i can calculate and display the surface area of the picked actor. In the beginning i asked about finding the mouse position but this is not needed since i found out about the pick functions of VTK (i'm a newbie). Hope the links you gave me will help Thanks, Polys From: Julian Ibarz Sent: Thursday, May 08, 2008 4:13 PM To: polys_poly at hotmail.com ; vtkusers at vtk.org Subject: Re: [vtkusers] Ray interesection with volume - finding the mouse position I don't know what you want exactly but if you want to find the points of the volume or the actors picked by the mouse you have in the VTK nightly version : http://www.vtk.org/doc/nightly/html/classvtkPointPicker.html http://www.vtk.org/doc/nightly/html/classvtkPropPicker.html To get the mouse position : http://www.vtk.org/doc/nightly/html/classvtkRenderWindowInteractor.html You are working with what programming language ? C++ ? Java ? other ? To get the mouse position it's change with the language. For example in java you create a vtkCanvas to draw the rendering and override the methode MouseMoveEvent(MouseEvent e) to get the new position of the mouse when it moves and get the position with e->x and e->y... This answers your question ? 2008/5/8 : Hello, Currently i am creating a volume of a DICOM Dataset. The interactor i am using is vtkInteractorStyleTrackballCamera. What i want to do is finding the mouse pointer location on the rendering window, and then finding the ray that connects the position of the camera with the mouse position so i can find the points of the volume or the actors that this ray intersects. I would appreciate any help on this subject. Thanks, Polys _______________________________________________ This is the private VTK discussion list. Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers -- Julian Ibarz -------------- next part -------------- An HTML attachment was scrubbed... URL: From prashanth.dumpuri at vanderbilt.edu Thu May 8 12:17:32 2008 From: prashanth.dumpuri at vanderbilt.edu (Prashanth) Date: Thu, 08 May 2008 11:17:32 -0500 Subject: [vtkusers] Creating a texture for a closed mesh In-Reply-To: References: Message-ID: <4823279C.9020802@vanderbilt.edu> Mathieu, If I understand your question correctly, you are looking for vtkOpenGLVolumeTextureMapper3D / vtkVolumeTextureMapper3D. Prashanth > Hi VTK users, > I have a closed 3D mesh (vtkPolydata) and an image data (vtkImageData). Right now, I am using the vtkProbeFilter to assign the scalar values of the mesh to be the one of the image data, which is working fine. I would like to use a texture instead of scalar values to be able to reduce the resolution of the mesh, but keeping the same scalar > resolution. > I was wondering how this could be achieve with VTK? > Thanks! > Mathieu > From a.albert at jacobs-university.de Thu May 8 13:50:00 2008 From: a.albert at jacobs-university.de (Adrian Albert) Date: Thu, 8 May 2008 19:50:00 +0200 Subject: [vtkusers] improve rendering quality in vtkFixedPointVolumeRayCastMapper? Message-ID: <2cd88c320805081050l4513dfd8ibed3f63c0654a0ca@mail.gmail.com> Dear All, I am rendering the heart.vtk example from the ../Data/ directory in VTK using vtkFixedPointVolumeRayCastMapper, but I get only poor image quality, and a rather blocky appearence. Is there a way to obtain better quality with this mapper? Thanks for helping out, Adrian -- --------------------------------------------------- Adrian Albert School of Engineering and Science Jacobs University Bremen Germany Tel.: 00494212003258 -------------- next part -------------- An HTML attachment was scrubbed... URL: From thlecocq at msn.com Thu May 8 15:10:52 2008 From: thlecocq at msn.com (Thomas Lecocq) Date: Thu, 8 May 2008 19:10:52 +0000 Subject: [vtkusers] [Enthought-dev] [MayaVi-users] converting xyz(txt) to unstructured grid(vtk) In-Reply-To: References: Message-ID: edit: FW to vtk-users too... >Caly >Dear Thomas >Thank you for the previous reply, I need your help in something theoretical, i read the VTK book and I understand that there are fee techniques >used to convert unstructured points to unstructured grid.. are we using Delaunay 3D to. or ... can I know more about the code as in what >technique is being used..Splatting.. Interpolation or Triangulation.. . thanks for ur help.. *** Mmm ... Well ... I have, actually, never done that... You may want to try the PointToCellData Filter in Mayavi2 ... (??) (I never read "the book"...) Thomas On 4/10/08, Cally K wrote: Thank You so much, you really made my day. i managed to run the new python program. I had to enter the "import string" at the top also, but thank you so much again. On 4/9/08, Thomas Lecocq wrote: > Hi, > > The message you see is an error that says that you don't have a package > called "Scientific" .. > > It isn't actually needed in order to read/write a file. > > See the attached file, I did modify it... Normaly, it should work fine. > > you have to call the program from a command line "python PointCloud.py > input.txt" where input.txt contains one "X Y Z" per line > > HTH > > Thomas > > ********************** > Thomas Lecocq > > Geologist > Ph.D.Student (Seismology) > Royal Observatory of Belgium > ********************** > > Date: Wed, 9 Apr 2008 14:30:26 +0800 > From: kalpana0611 at gmail.com > To: mayavi-users at lists.sourceforge.net > Subject: [MayaVi-users] converting xyz(txt) to unstructured grid(vtk) > > Hi > > I found this link > http://mayavi.sourceforge.net/mwiki/PointCloudson converting point clouds to > vtk's unstructured grid form. Unfortunately, I dun know python, is there a > C++ program that I can use or could someone show me how to convert the file, > I have installed python on windows and linux. I dun need to install vtk to > run this program rite.. I can just run it from the console...? > > > anyway, i tried running the script without much knowledge of course, in > windows, I received this error > > Traceback (most recent call last): > File "C:\Documents and Settings\kalpanak\Desktop\ppp\xyz2vtk.py", line 1, > in > from Scientific.IO.TextFile import pointclouddatafile > ImportError: No module named Scientific.IO.TextFile > > > > I hope someone could guide me... > -------------- next part -------------- An HTML attachment was scrubbed... URL: From polys_poly at hotmail.com Thu May 8 18:56:18 2008 From: polys_poly at hotmail.com (polys_poly at hotmail.com) Date: Fri, 9 May 2008 01:56:18 +0300 Subject: [vtkusers] Pick an actor Message-ID: Hello, this is what i am currently doing. I have created an application in C++ where i render a DICOM dataset. I also have some text files and each one contains a set of coordinates that form a polygon. With the rendered volume i also render the polygons (vtkActor). What i want to do is add to the application the functionality of selecting these polygons-actors. For example the user moves the mouse pointer on top of a polygon. He then presses "p" or another button, and the actor is picked so he can view the polygon's surface area. If anyone has an example in C++ that does more or less what i wanna do or can give me some tips i would be really grateful since i need to do this asap and have no experience at all in observers, pickers, events etc!!!! Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From zgut at itc.pw.edu.pl Fri May 9 04:38:08 2008 From: zgut at itc.pw.edu.pl (Zbigniew Gut) Date: Fri, 9 May 2008 10:38:08 +0200 Subject: [vtkusers] About contour VTK C++ Message-ID: <003001c8b1b0$027435f0$a49b1dc2@eltanin> Hi I am new user in VTK so I have problem to solve. I am using unstructured grid data: vtkUnstructuredGridReader *pl3d = vtkUnstructuredGridReader::New(); pl3d->SetFileName(VTK_DATA_ROOT "der.vtk"); pl3d->SetScalarsName("scalars"); pl3d->Update(); It's OK. But I would like to show only contour this object (outside wall-cell). Regards Antoni zgut at itc.pw.edu.pl -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.hartl at bkf.at Fri May 9 06:20:57 2008 From: philipp.hartl at bkf.at (Philipp Hartl) Date: Fri, 09 May 2008 12:20:57 +0200 Subject: [vtkusers] Pick an actor In-Reply-To: References: Message-ID: <48242589.4090400@bkf.at> Hi, for mouse picking you can start here http://www.vtk.org/Wiki/VTK_Mouse_Picking VTK is using a pipeline for visualizing the geometric primitives and more, so you have to enclose each object you want to pick in a separated pipeline by a vtkActor. (e.g. vtkPolyData ... -> vtkActor, vtkUnstructeredGrid ... -> vtkActor, and so on) Each actor can be picked, certainly if it is added to the rendering pipeline and visible. Cheers, Philipp polys_poly at hotmail.com schrieb: > Hello, > > this is what i am currently doing. I have created an application in C++ > where i render a DICOM dataset. I also have some text files and each > one contains a set of coordinates that form a polygon. With the rendered > volume i also render the polygons (vtkActor). What i want to do is add > to the application the functionality of selecting these polygons-actors. > For example the user moves the mouse pointer on top of a polygon. He > then presses "p" or another button, and the actor is picked so he can > view the polygon's surface area. > > If anyone has an example in C++ that does more or less what i wanna do > or can give me some tips i would be really grateful since i need to do > this asap and have no experience at all in observers, pickers, events > etc!!!! > > Thanks in advance > > > > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers From hansvp at hotmail.com Fri May 9 07:51:36 2008 From: hansvp at hotmail.com (Hans van Piggelen) Date: Fri, 9 May 2008 11:51:36 +0000 Subject: [vtkusers] About contour VTK C++ In-Reply-To: <003001c8b1b0$027435f0$a49b1dc2@eltanin> References: <003001c8b1b0$027435f0$a49b1dc2@eltanin> Message-ID: You can use vtkGeometryFilter, followed by a vtkPolyDataMapper, add it to an vtkActor and display it in the renderer: vtkGeometryFilter *vGeomFilter = vtkGeometryFilter::New();vGeomFilter->SetInput( pl3d->GetOutput() );vGeomFilter->Update();vtkPolyDataMapper *vContourMapper = vtkPolyDataMapper::New();vContourMapper->SetInput( vGeomFilter->GetOutput() );vContourMapper->ScalarVisibilityOff(); vtkActor *vContourActor = vtkActor::New();vContourActor->SetMapper( vContourMapper );vContourActor->GetProperty()->SetColor(1,1,1); // whitevContourActor->GetProperty()->SetOpacity(0.7); // somewhat transparent render->AddActor( vContourActor ); Or something similar of course. From: zgut at itc.pw.edu.pl To: vtkusers at vtk.org Date: Fri, 9 May 2008 10:38:08 +0200 Subject: [vtkusers] About contour VTK C++ Hi I am new user in VTK so I have problem to solve. I am using unstructured grid data: vtkUnstructuredGridReader *pl3d = vtkUnstructuredGridReader::New(); pl3d->SetFileName(VTK_DATA_ROOT "der.vtk"); pl3d->SetScalarsName("scalars"); pl3d->Update(); It's OK. But I would like to show only contour this object (outside wall-cell). Regards Antoni zgut at itc.pw.edu.pl _________________________________________________________________ With Windows Live for mobile, your contacts travel with you. http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_Refresh_mobile_052008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From evans at aps.anl.gov Fri May 9 13:18:57 2008 From: evans at aps.anl.gov (Kenneth Evans) Date: Fri, 9 May 2008 12:18:57 -0500 Subject: [vtkusers] wxPython & VTK: How to Destroy wxVTKRenderWindow without errors? Message-ID: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> Hi, I have an application that continually makes new VTK plots. The problem is that when I destroy the previous wx.Panel that has the wxVTKRenderWindow and the vtkRenderer with something like: self.plotPanel.Destroy() then I get errors like: ERROR: In ..\..\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 233 vtkWin32OpenGLRenderWindow (01025F30): wglMakeCurrent failed in MakeCurrent(), error: The handle is invalid. ERROR: In ..\..\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 233 vtkWin32OpenGLRenderWindow (01025F30): wglMakeCurrent failed in MakeCurrent(), error: The handle is invalid. ERROR: In ..\..\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 124 vtkWin32OpenGLRenderWindow (01025F30): wglMakeCurrent failed in Clean(), error: 6 If I don't call Destroy(), then I get all these errors at the end (and presumably also have leaked memory). I have tried a number of things, all without successfully avoiding these errors, which appear in a vtkOutputWindow. So, the question is how do you remove and replace a wxVTKRenderWindow properly. Thanks, ??????? -Ken More info: I am using Python 2.5 and VTK 5.0.4 with wxVTKRenderWindow and wxVTKRenderWindowInteractor replaced with the current versions in CVS (because the distributed ones don't work). This is on Windows XP. The code for the wx.Panel is: class PlotPanel(wx.Panel): """ Generic plot panel """ def __init__(self, parent, id = wx.ID_ANY, color = None, dpi = None, **kwargs): wx.Panel.__init__(self, parent, id = id, **kwargs) self.renWin = wxVTKRenderWindow(self, -1) self.ren = vtk.vtkRenderer() self.renWin.GetRenderWindow().AddRenderer(self.ren) self.createPlot() self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.renWin, 1, wx.LEFT | wx.TOP | wx.GROW) self.SetSizerAndFit(self.sizer) def OnPaint(self, event): self.canvas.draw() def createPlot(self): """ Needs to be overridden in a subclass """ pass And a simple plot could be made by subclassing and overriding createPlot: class DemoPanel(PlotPanel): """ Basic Cone Demo """ def createPlot(self): """ Override createPlot from the base class """ cone = vtk.vtkConeSource() cone.SetResolution(8) coneMapper = vtk.vtkPolyDataMapper() coneMapper.SetInput(cone.GetOutput()) coneActor = vtk.vtkActor() coneActor.SetMapper(coneMapper) self.ren.AddActor(coneActor) self.ren.ResetCamera() From tavares at fe.up.pt Fri May 9 14:32:26 2008 From: tavares at fe.up.pt (=?iso-8859-1?Q?Jo=E3o_Manuel_R._S._Tavares?=) Date: Fri, 9 May 2008 19:32:26 +0100 Subject: [vtkusers] =?iso-8859-1?q?Special_Track_=22Computational_Bioimagi?= =?iso-8859-1?q?ng_and_Visualization=22_within_the_ISVC08_USA_-_Ann?= =?iso-8859-1?q?ounce_=26_Call_for_Papers?= Message-ID: <02f201c8b203$07e19750$17a4c5f0$@up.pt> ---------------------------------------------------------------------------- --------------------- (Apologies for cross-posting) Special Track ?Computational Bioimaging and Visualization? International Symposium on Visual Computing (ISVC08) Las Vegas, Nevada, USA, December 1-3, 2008 http://www.isvc.net We would appreciate if you could distribute this information by your colleagues and co-workers. ---------------------------------------------------------------------------- --------------------- Dear Colleague, Within the ISVC08 - International Symposium on Visual Computing (http://www.isvc.net), to be held in Las Vegas, Nevada, USA, in December 1-3, 2008, we are organizing the Special Track ?Computational Bioimaging and Visualization?. The main goal of the Special Track ?Computational Bioimaging and Visualization? is to bring together researchers involved in the related fields (Image Acquisition, Image Segmentation, Objects Tracking, Objects Matching, Shape Reconstruction, Motion and Deformation Analysis, Medical Imaging, Scientific Visualization, Software Development, Grid Computing, etc.), in order to set the major lines of development for the near future. Therefore, this Special Track will bring researchers representing various fields related to Computational Vision, Computer Graphics, Computational Mechanics, Scientific Visualization, Mathematics, Statistics, Medical Imaging, etc. Thus, it will endeavor to contribute to obtain better solutions for more realistic computational ?living? models from images, and attempts to establish a bridge between the 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 ?Computational Bioimaging and Visualization?. Topics In this Special Track the following topics will be considered (not limited to): - Image Processing and Analysis for Computational Bioimaging and Visualization; - Segmentation, Reconstruction, Tracking and Motion Analyse in Medical Images; - Biomedical Signal and Image Acquisition and Processing; - Objects Simulation and Virtual Reality; - Computer Aided Diagnosis, Surgery, Therapy, Treatment and Telemedicine Systems; - Software Development for Computational Bioimaging and Visualization; - Grid and High Performance Computing for Computational Bioimaging and Visualization. Submission/Proceedings Instructions for authors are available in the website of ISVC'08 (http://www.isvc.net/author.html). Authors should submit electronically their contributions through the website of ISVC'08 (http://www.isvc.net), selecting the Special Track ?Computational Bioimaging and Visualization?. 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 21, 2008; - Notification of acceptance: September 1, 2008; - Camera-ready version: September 15, 2008. Scientific Committee Alberto De Santis, Italy Ana Mafalda Reis, Portugal Arrate Mu?oz Barrutia, Spain Barbara Caputo, Switzerland Chang-Tsun Li, UK Christos E. Constantinou, USA Constantine Kotropoulos, Greece Daniela Iacoviello, Italy Dinggang Shen, USA Eduardo Borges Pires, Portugal Enrique Alegre Guti?rrez, Spain Filipa Sousa, Portugal Francisco Perales, Spain Gerhard A. Holzapfel, Sweden H?lder C. Rodrigues, Portugal Hemerson Pistori, Brasil Jo?o Manuel R. S. Tavares, Portugal Jorge M. G. Barbosa, Portugal Jorge S. Marques, Portugal Jose M. Garc?a Aznar, Spain Lu?s Paulo Reis, Portugal Manuel Gonz?lez Hidalgo, Spain Maria Elizete Kunkel, Germany Michel A. Audette, Germany Miguel Angel Guevara, Cuba Patrick Dubois, France Renato M. N. Jorge, Portugal Reneta P. Barneva, USA Roberto Bellotti, Italy Sabina Tangaro, Italy Samrat Goswami, USA S?nia I. Gon?alves-Verheij, The Netherlands Valentin Brimkov, USA Yongjie Zhan, USA Xavier Roca Marv?, Spain 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) Samrat Goswami - University of Texas at Austin, USA (tarmas at gmail.com) (Organizers of the Special Track ?Computational Bioimaging and Visualization) From jordigh at gmail.com Fri May 9 15:31:13 2008 From: jordigh at gmail.com (=?ISO-8859-1?Q?Jordi_Guti=E9rrez_Hermoso?=) Date: Fri, 9 May 2008 14:31:13 -0500 Subject: [vtkusers] Bug list? Message-ID: <9543b3a40805091231r2ffa63eam4649c2871be2b385@mail.gmail.com> Is there a bugzilla or something like that for VTK? Where are bugs recorded? I can't find anything obvious. I'm getting segfaults in 64 bits with a program that uses VTK extensively, and I'd like to rule out the possibility that the bug is in VTK itself. - Jordi G. H. From david.cole at kitware.com Fri May 9 15:35:26 2008 From: david.cole at kitware.com (David Cole) Date: Fri, 9 May 2008 15:35:26 -0400 Subject: [vtkusers] Bug list? In-Reply-To: <9543b3a40805091231r2ffa63eam4649c2871be2b385@mail.gmail.com> References: <9543b3a40805091231r2ffa63eam4649c2871be2b385@mail.gmail.com> Message-ID: Click the "Bug Tracker" link on the left hand side of the page at http://www.vtk.org Or use this link directly: http://www.vtk.org/Bug Then choose "VTK" from the drop down list of projects on the main bug tracker page..... HTH, David On Fri, May 9, 2008 at 3:31 PM, Jordi Guti?rrez Hermoso wrote: > Is there a bugzilla or something like that for VTK? Where are bugs > recorded? I can't find anything obvious. > > I'm getting segfaults in 64 bits with a program that uses VTK > extensively, and I'd like to rule out the possibility that the bug is > in VTK itself. > > - Jordi G. H. > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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.cole at kitware.com Fri May 9 15:36:01 2008 From: david.cole at kitware.com (David Cole) Date: Fri, 9 May 2008 15:36:01 -0400 Subject: [vtkusers] Bug list? In-Reply-To: <9543b3a40805091231r2ffa63eam4649c2871be2b385@mail.gmail.com> References: <9543b3a40805091231r2ffa63eam4649c2871be2b385@mail.gmail.com> Message-ID: Can you send along a small snippet of sample code that reproduces the crash...? On Fri, May 9, 2008 at 3:31 PM, Jordi Guti?rrez Hermoso wrote: > Is there a bugzilla or something like that for VTK? Where are bugs > recorded? I can't find anything obvious. > > I'm getting segfaults in 64 bits with a program that uses VTK > extensively, and I'd like to rule out the possibility that the bug is > in VTK itself. > > - Jordi G. H. > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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 ahs at cfdrc.com Fri May 9 15:35:12 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Fri, 09 May 2008 14:35:12 -0500 Subject: [vtkusers] Bug list? In-Reply-To: <9543b3a40805091231r2ffa63eam4649c2871be2b385@mail.gmail.com> References: <9543b3a40805091231r2ffa63eam4649c2871be2b385@mail.gmail.com> Message-ID: <4824A770.9070906@cfdrc.com> Please see http://www.vtk.org/Bug/my_view_page.php. (If you go to www.vtk.org, there's a "Bug Tracker" link in the left-hand column that will get you there.) - Amy Jordi Guti?rrez Hermoso wrote: > Is there a bugzilla or something like that for VTK? Where are bugs > recorded? I can't find anything obvious. > > I'm getting segfaults in 64 bits with a program that uses VTK > extensively, and I'd like to rule out the possibility that the bug is > in VTK itself. > > - Jordi G. H. > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From sean at rogue-research.com Fri May 9 15:45:17 2008 From: sean at rogue-research.com (Sean McBride) Date: Fri, 9 May 2008 15:45:17 -0400 Subject: [vtkusers] Bug list? In-Reply-To: <9543b3a40805091231r2ffa63eam4649c2871be2b385@mail.gmail.com> References: <9543b3a40805091231r2ffa63eam4649c2871be2b385@mail.gmail.com> Message-ID: <20080509194517.84631544@kingu.local> On 5/9/08 2:31 PM, Jordi Guti?rrez Hermoso said: >I'm getting segfaults in 64 bits with a program that uses VTK >extensively, and I'd like to rule out the possibility that the bug is >in VTK itself. It's certainly possible VTK is at fault: -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From c.p.botha at tudelft.nl Fri May 9 16:25:39 2008 From: c.p.botha at tudelft.nl (Charl Botha) Date: Fri, 9 May 2008 22:25:39 +0200 Subject: [vtkusers] wxPython & VTK: How to Destroy wxVTKRenderWindow without errors? In-Reply-To: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> Message-ID: <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> On Fri, May 9, 2008 at 7:18 PM, Kenneth Evans wrote: > So, the question is how do you remove and replace a wxVTKRenderWindow > properly. The problem is that VTK reference counts everything and WX doesn't. So you have to be careful to disconnect all VTK and WX elements and then also make sure that all VTK bindings (refs in C++) disappear. Importantly, get the renderwindow to release its graphics resources. This all comes down to the following SuperSafe(tm) approach: # remove all actors from the renderer ren.RemoveAllViewProps() # get rid of your binding del ren # get the renderwindow to release all system resources (including opengl context) wxRWI.GetRenderWindow().Finalize() # break link between RWI and RW wxRWI.SetRenderWindow(None) # get rid of our binding del wxRWI # now you can destroy the containing wx Window wxWin.Destroy() Good luck, Charl -- http://visualisation.tudelft.nl/CharlBotha From polys_poly at hotmail.com Fri May 9 19:37:47 2008 From: polys_poly at hotmail.com (polys_poly at hotmail.com) Date: Sat, 10 May 2008 02:37:47 +0300 Subject: [vtkusers] GetMousePosition always gives (0,0) Message-ID: Hello, I am writing an application with MFC GUI and simply using vtkRenderWindowInteractor* m_pIren = vtkRenderWindowInteractor::New; . . . . int mouseX, mouseY; m_pIren->GetMousePosition(&mouseX, &mouseY); and still the coordinates i get are both 0. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jordigh at gmail.com Fri May 9 19:48:26 2008 From: jordigh at gmail.com (=?ISO-8859-1?Q?Jordi_Guti=E9rrez_Hermoso?=) Date: Fri, 9 May 2008 18:48:26 -0500 Subject: [vtkusers] Possible 64 bit segfault [was: Bug list?] Message-ID: <9543b3a40805091648t276211d3p9658170a8b6230f0@mail.gmail.com> On 09/05/2008, David Cole wrote: > Can you send along a small snippet of sample code that reproduces the > crash...? I've tried. It's Octaviz[1] that's using VTK. I have an Octave script that I've only managed to get a consistent segfault with some data set, but I haven't managed to simplify the test case and still get a segfault. While I decide if the problem is in Octaviz or VTK, I've submitted a Debian bug on Octaviz[2] and I'll try debugging this one myself. The segfault does happen several calls deep into VTK proper. If you'll excuse the tangle with Octaviz and Octave, below you will find a stack trace, without debug symbols for VTK If you think it would be helfpul to compile VTK with debug symbols and produce another stack trace, let me know. It's mostly out of impatience that I don't have VTK with debug symbols, because it takes a looooong time to compile VTK. ;-) You'll observe that the last bit of Octaviz code (which is really VTK code wrapped with the proper incantations to be called from Octave) called on #9 of stack trace below before going into VTK proper is this, from vtkAlgorithm.cc: /* ah virtual void Update (); */ error_flag = 0; if (!error_flag) { vtk_pointer->Update(); // segfault here return retval; } } Hope I provided somewhat relevant information... Cheers, - Jordi G. H. [1] http://octaviz.sf.net [2] http://bugs.debian.org/480431 #0 0x00002b8214528efb in vtkMergePoints::InsertUniquePoint () from /usr/lib/libvtkFiltering.so.5.0 #1 0x00002b8214584f51 in vtkTriangle::Clip () from /usr/lib/libvtkFiltering.so.5.0 #2 0x00002b821499146f in vtkClipPolyData::RequestData () from /usr/lib/libvtkGraphics.so.5.0 #3 0x00002b82144c54e4 in vtkExecutive::CallAlgorithm () from /usr/lib/libvtkFiltering.so.5.0 #4 0x00002b82144c1b7c in vtkDemandDrivenPipeline::ExecuteData () from /usr/lib/libvtkFiltering.so.5.0 #5 0x00002b82144c489d in vtkDemandDrivenPipeline::ProcessRequest () from /usr/lib/libvtkFiltering.so.5.0 #6 0x00002b8214576969 in vtkStreamingDemandDrivenPipeline::ProcessRequest () from /usr/lib/libvtkFiltering.so.5.0 #7 0x00002b82144c316e in vtkDemandDrivenPipeline::UpdateData () from /usr/lib/libvtkFiltering.so.5.0 #8 0x00002b821457683b in vtkStreamingDemandDrivenPipeline::Update () from /usr/lib/libvtkFiltering.so.5.0 #9 0x00002b821c676106 in FvtkAlgorithm (args=@0x7fff9e922720, nargout=0) at /home/jordi/oct/octaviz/Filtering/vtkAlgorithm.cc:955 #10 0x00002b820ca073ba in octave_builtin::do_multi_index_op (this=0x71eb20, nargout=0, args=@0x7fff9e922720) at ov-builtin.cc:106 #11 0x00002b820c9c2d26 in octave_value::do_multi_index_op ( #12 0x00002b820c9072f2 in feval (name=@0x7fff9e9217b0, args=@0x7fff9e922720, nargout=0) at parse.y:3552 #13 0x00002b82187fb5a1 in FvtkPolyDataAlgorithm (args=@0x7fff9e922720, nargout=0) at /home/jordi/oct/octaviz/Filtering/vtkPolyDataAlgorithm.cc:326 #14 0x00002b820ca073ba in octave_builtin::do_multi_index_op (this=0x71e160, nargout=0, args=@0x7fff9e922720) at ov-builtin.cc:106 #15 0x00002b820c9c2d26 in octave_value::do_multi_index_op ( this=0x7fff9e921a80, nargout=0, idx=@0x7fff9e922720) at ov.cc:970 #16 0x00002b820c9072f2 in feval (name=@0x7fff9e922380, args=@0x7fff9e922720, nargout=0) at parse.y:3552 #17 0x00002b821c45f162 in FvtkClipPolyData (args=@0x7fff9e922720, nargout=0) at /home/jordi/oct/octaviz/Graphics/vtkClipPolyData.cc:493 #18 0x00002b820ca073ba in octave_builtin::do_multi_index_op (this=0x71eac0, nargout=0, args=@0x7fff9e922720) at ov-builtin.cc:106 #19 0x00002b820c9c2d26 in octave_value::do_multi_index_op ( this=0x7fff9e922630, nargout=0, idx=@0x7fff9e922720) at ov.cc:970 #20 0x00002b820c9072f2 in feval (name=@0x7fff9e9227d0, args=@0x7fff9e922720, nargout=0) at parse.y:3552 #21 0x00002b8215025dbb in vtk_object::subsref (this=0xd90430, type=@0xe7d8c8, idx=@0x7fff9e922b10, nargout=0) at /home/jordi/oct/octaviz/Common/octaviz.cc:263 #22 0x00002b820c9c3aea in octave_value::subsref (this=0x7fff9e922b30, type=@0xe7d8c8, idx=@0x7fff9e922b10, nargout=0) at ov.cc:932 #23 0x00002b820cabdbd3 in tree_index_expression::rvalue (this=0xe7d890, nargout=0) at pt-idx.cc:385 #24 0x00002b820cad7e6e in tree_statement::eval (this=0xe7db90, silent=false, nargout=0, in_function_or_script_body=true) at pt-stmt.cc:124 #25 0x00002b820cad81a7 in tree_statement_list::eval (this=0xe798f0, silent=false, nargout=0) at pt-stmt.cc:185 #26 0x00002b820ca0c7a6 in octave_user_function::do_multi_index_op ( this=0x70f470, nargout=1, args=@0x111b5e0) at ov-usr-fcn.cc:459 #27 0x00002b820ca0bf27 in octave_user_function::subsref (this=0x70f470, type=@0xe6c808, idx=@0x7fff9e9235b0, nargout=1) at ov-usr-fcn.cc:325 #28 0x00002b820ca0f931 in octave_user_function::subsref (this=0x70f470, type=@0xe6c808, idx=@0x7fff9e9235b0) at ov-usr-fcn.h:274 #29 0x00002b820c9c3a88 in octave_value::subsref (this=0x7fff9e9235d0, type=@0xe6c808, idx=@0x7fff9e9235b0, nargout=1) at ov.cc:930 #30 0x00002b820cabdbd3 in tree_index_expression::rvalue (this=0xe6c7d0, nargout=1) at pt-idx.cc:385 #31 0x00002b820cabc283 in tree_index_expression::rvalue (this=0xe6c7d0) at pt-idx.cc:396 #32 0x00002b820caab9eb in tree_simple_assignment::rvalue (this=0xe6cd70) at pt-assign.cc:202 #33 0x00002b820caac42e in tree_simple_assignment::rvalue (this=0xe6cd70, nargout=0) at pt-assign.cc:184 #34 0x00002b820cad7e6e in tree_statement::eval (this=0xe6cab0, silent=false, nargout=0, in_function_or_script_body=false) at pt-stmt.cc:124 #35 0x00002b820cad81a7 in tree_statement_list::eval (this=0xe66a60, silent=false, nargout=0) at pt-stmt.cc:185 #36 0x00002b820cac82ab in tree_simple_for_command::do_for_loop_once ( this=0xe6dc50, ult=@0x7fff9e9240a0, rhs=@0x7fff9e9241e0, quit=@0x7fff9e9241cf) at pt-loop.cc:228 #37 0x00002b820cac3c7d in tree_simple_for_command::eval (this=0xe6dc50) at pt-loop.cc:388 #38 0x00002b820cad7d6a in tree_statement::eval (this=0xe6e540, silent=false, nargout=0, in_function_or_script_body=false) at pt-stmt.cc:99 #39 0x00002b820cad81a7 in tree_statement_list::eval (this=0xe65100, silent=false, nargout=0) at pt-stmt.cc:185 #40 0x00002b820cad626c in tree_if_clause::eval (this=0xe76a60) at pt-select.cc:54 #41 0x00002b820cad62be in tree_if_command_list::eval (this=0xe653a0) at pt-select.cc:85 #42 0x00002b820cad6337 in tree_if_command::eval (this=0xe76ae0) at pt-select.cc:124 #43 0x00002b820cad7d6a in tree_statement::eval (this=0xe75d80, silent=false, nargout=0, in_function_or_script_body=false) at pt-stmt.cc:99 #44 0x00002b820cad81a7 in tree_statement_list::eval (this=0xd76b80, silent=false, nargout=0) at pt-stmt.cc:185 #45 0x00002b820cac82ab in tree_simple_for_command::do_for_loop_once ( this=0xe76c90, ult=@0x7fff9e9253a0, rhs=@0x7fff9e9254e0, quit=@0x7fff9e9254cf) at pt-loop.cc:228 #46 0x00002b820cac3c7d in tree_simple_for_command::eval (this=0xe76c90) at pt-loop.cc:388 #47 0x00002b820cad7d6a in tree_statement::eval (this=0xe76bb0, silent=false, nargout=0, in_function_or_script_body=true) at pt-stmt.cc:99 #48 0x00002b820cad81a7 in tree_statement_list::eval (this=0xd62780, silent=false, nargout=0) at pt-stmt.cc:185 #49 0x00002b820ca0c7a6 in octave_user_function::do_multi_index_op ( this=0x70f5a0, nargout=0, args=@0x11160a0) at ov-usr-fcn.cc:459 #50 0x00002b820ca0bf27 in octave_user_function::subsref (this=0x70f5a0, type=@0xd4c108, idx=@0x7fff9e9266a0, nargout=0) at ov-usr-fcn.cc:325 #51 0x00002b820c9c3aea in octave_value::subsref (this=0x7fff9e9266c0, type=@0xd4c108, idx=@0x7fff9e9266a0, nargout=0) at ov.cc:932 #52 0x00002b820cabdbd3 in tree_index_expression::rvalue (this=0xd4c0d0, nargout=0) at pt-idx.cc:385 #53 0x00002b820cad7e6e in tree_statement::eval (this=0xd4c020, silent=false, nargout=0, in_function_or_script_body=true) at pt-stmt.cc:124 #54 0x00002b820cad81a7 in tree_statement_list::eval (this=0xce6430, silent=false, nargout=0) at pt-stmt.cc:185 #55 0x00002b820ca0c7a6 in octave_user_function::do_multi_index_op ( this=0x70f210, nargout=0, args=@0x1113ee0) at ov-usr-fcn.cc:459 #56 0x00002b820ca0bf27 in octave_user_function::subsref (this=0x70f210, type=@0xc68918, idx=@0x7fff9e9270b0, nargout=0) at ov-usr-fcn.cc:325 #57 0x00002b820c9c3aea in octave_value::subsref (this=0x7fff9e9270d0, type=@0xc68918, idx=@0x7fff9e9270b0, nargout=0) at ov.cc:932 #58 0x00002b820cabdbd3 in tree_index_expression::rvalue (this=0xc688e0, nargout=0) at pt-idx.cc:385 #59 0x00002b820cad7e6e in tree_statement::eval (this=0xc685d0, silent=false, nargout=0, in_function_or_script_body=false) at pt-stmt.cc:124 #60 0x00002b820cad81a7 in tree_statement_list::eval (this=0xb1fe10, silent=false, nargout=0) at pt-stmt.cc:185 #61 0x00002b820cac82ab in tree_simple_for_command::do_for_loop_once ( this=0xc6fc20, ult=@0x7fff9e9277e0, rhs=@0x7fff9e927910, quit=@0x7fff9e92791f) at pt-loop.cc:228 #62 0x00002b820cac3877 in tree_simple_for_command::eval (this=0xc6fc20) at pt-loop.cc:376 #63 0x00002b820cad7d6a in tree_statement::eval (this=0xc6fbc0, silent=false, nargout=0, in_function_or_script_body=true) at pt-stmt.cc:99 #64 0x00002b820cad81a7 in tree_statement_list::eval (this=0x858840, silent=false, nargout=0) at pt-stmt.cc:185 #65 0x00002b820ca0bcd3 in octave_user_script::do_multi_index_op ( this=0x89b650, nargout=0, args=@0x7fff9e928650) at ov-usr-fcn.cc:130 #66 0x00002b820c9c2d26 in octave_value::do_multi_index_op ( this=0x7fff9e928750, nargout=0, idx=@0x7fff9e928650) at ov.cc:970 ---Type to continue, or q to quit--- #67 0x00002b820cabad99 in tree_identifier::rvalue (this=0x8d0a60, nargout=0) at pt-id.cc:88 #68 0x00002b820cad7e6e in tree_statement::eval (this=0xc5a250, silent=false, nargout=0, in_function_or_script_body=false) at pt-stmt.cc:124 #69 0x00002b820cad81a7 in tree_statement_list::eval (this=0x7f5650, silent=false, nargout=0) at pt-stmt.cc:185 #70 0x00002b820c952509 in main_loop () at toplev.cc:291 #71 0x00002b820c8fffb5 in octave_main (argc=1, argv=0x7fff9e928e48, embedded=0) at octave.cc:850 #72 0x0000000000400868 in main (argc=1, argv=0x7fff9e928e48) at main.c:35 From imikejackson at gmail.com Sat May 10 08:59:34 2008 From: imikejackson at gmail.com (Mike Jackson) Date: Sat, 10 May 2008 08:59:34 -0400 Subject: [vtkusers] Possible 64 bit segfault [was: Bug list?] In-Reply-To: <9543b3a40805091648t276211d3p9658170a8b6230f0@mail.gmail.com> References: <9543b3a40805091648t276211d3p9658170a8b6230f0@mail.gmail.com> Message-ID: <43a689850805100559n7b9dd54es55ad1b81e03f047f@mail.gmail.com> I would definitely recompile with debug symbols. If you can reproduce the crash with a stack trace with line numbers that helps a bunch. Also, if you have access to a 32 bit system, can you reproduce the crash there? Mike On Fri, May 9, 2008 at 7:48 PM, Jordi Guti?rrez Hermoso wrote: > On 09/05/2008, David Cole wrote: >> Can you send along a small snippet of sample code that reproduces the >> crash...? > > I've tried. It's Octaviz[1] that's using VTK. I have an Octave script > that I've only managed to get a consistent segfault with some data > set, but I haven't managed to simplify the test case and still get a > segfault. > > While I decide if the problem is in Octaviz or VTK, I've submitted a > Debian bug on Octaviz[2] and I'll try debugging this one myself. The > segfault does happen several calls deep into VTK proper. If you'll > excuse the tangle with Octaviz and Octave, below you will find a stack > trace, without debug symbols for VTK If you think it would be helfpul > to compile VTK with debug symbols and produce another stack trace, let > me know. It's mostly out of impatience that I don't have VTK with > debug symbols, because it takes a looooong time to compile VTK. ;-) > > You'll observe that the last bit of Octaviz code (which is really VTK > code wrapped with the proper incantations to be called from Octave) > called on #9 of stack trace below before going into VTK proper is > this, from vtkAlgorithm.cc: > > /* ah virtual void Update (); */ > error_flag = 0; > > if (!error_flag) > { > vtk_pointer->Update(); // segfault here > return retval; > } > } > > Hope I provided somewhat relevant information... > > Cheers, > - Jordi G. H. > > [1] http://octaviz.sf.net > [2] http://bugs.debian.org/480431 > > #0 0x00002b8214528efb in vtkMergePoints::InsertUniquePoint () > from /usr/lib/libvtkFiltering.so.5.0 > #1 0x00002b8214584f51 in vtkTriangle::Clip () > from /usr/lib/libvtkFiltering.so.5.0 > #2 0x00002b821499146f in vtkClipPolyData::RequestData () > from /usr/lib/libvtkGraphics.so.5.0 > #3 0x00002b82144c54e4 in vtkExecutive::CallAlgorithm () > from /usr/lib/libvtkFiltering.so.5.0 > #4 0x00002b82144c1b7c in vtkDemandDrivenPipeline::ExecuteData () > from /usr/lib/libvtkFiltering.so.5.0 > #5 0x00002b82144c489d in vtkDemandDrivenPipeline::ProcessRequest () > from /usr/lib/libvtkFiltering.so.5.0 > #6 0x00002b8214576969 in vtkStreamingDemandDrivenPipeline::ProcessRequest () > from /usr/lib/libvtkFiltering.so.5.0 > #7 0x00002b82144c316e in vtkDemandDrivenPipeline::UpdateData () > from /usr/lib/libvtkFiltering.so.5.0 > #8 0x00002b821457683b in vtkStreamingDemandDrivenPipeline::Update () > from /usr/lib/libvtkFiltering.so.5.0 > #9 0x00002b821c676106 in FvtkAlgorithm (args=@0x7fff9e922720, nargout=0) > at /home/jordi/oct/octaviz/Filtering/vtkAlgorithm.cc:955 > #10 0x00002b820ca073ba in octave_builtin::do_multi_index_op (this=0x71eb20, > nargout=0, args=@0x7fff9e922720) at ov-builtin.cc:106 > #11 0x00002b820c9c2d26 in octave_value::do_multi_index_op ( > #12 0x00002b820c9072f2 in feval (name=@0x7fff9e9217b0, args=@0x7fff9e922720, > nargout=0) at parse.y:3552 > #13 0x00002b82187fb5a1 in FvtkPolyDataAlgorithm (args=@0x7fff9e922720, > nargout=0) at /home/jordi/oct/octaviz/Filtering/vtkPolyDataAlgorithm.cc:326 > #14 0x00002b820ca073ba in octave_builtin::do_multi_index_op (this=0x71e160, > nargout=0, args=@0x7fff9e922720) at ov-builtin.cc:106 > #15 0x00002b820c9c2d26 in octave_value::do_multi_index_op ( > this=0x7fff9e921a80, nargout=0, idx=@0x7fff9e922720) at ov.cc:970 > #16 0x00002b820c9072f2 in feval (name=@0x7fff9e922380, args=@0x7fff9e922720, > nargout=0) at parse.y:3552 > #17 0x00002b821c45f162 in FvtkClipPolyData (args=@0x7fff9e922720, nargout=0) > at /home/jordi/oct/octaviz/Graphics/vtkClipPolyData.cc:493 > #18 0x00002b820ca073ba in octave_builtin::do_multi_index_op (this=0x71eac0, > nargout=0, args=@0x7fff9e922720) at ov-builtin.cc:106 > #19 0x00002b820c9c2d26 in octave_value::do_multi_index_op ( > this=0x7fff9e922630, nargout=0, idx=@0x7fff9e922720) at ov.cc:970 > #20 0x00002b820c9072f2 in feval (name=@0x7fff9e9227d0, args=@0x7fff9e922720, > nargout=0) at parse.y:3552 > #21 0x00002b8215025dbb in vtk_object::subsref (this=0xd90430, type=@0xe7d8c8, > idx=@0x7fff9e922b10, nargout=0) > at /home/jordi/oct/octaviz/Common/octaviz.cc:263 > #22 0x00002b820c9c3aea in octave_value::subsref (this=0x7fff9e922b30, > type=@0xe7d8c8, idx=@0x7fff9e922b10, nargout=0) at ov.cc:932 > #23 0x00002b820cabdbd3 in tree_index_expression::rvalue (this=0xe7d890, > nargout=0) at pt-idx.cc:385 > #24 0x00002b820cad7e6e in tree_statement::eval (this=0xe7db90, silent=false, > nargout=0, in_function_or_script_body=true) at pt-stmt.cc:124 > #25 0x00002b820cad81a7 in tree_statement_list::eval (this=0xe798f0, > silent=false, nargout=0) at pt-stmt.cc:185 > #26 0x00002b820ca0c7a6 in octave_user_function::do_multi_index_op ( > this=0x70f470, nargout=1, args=@0x111b5e0) at ov-usr-fcn.cc:459 > #27 0x00002b820ca0bf27 in octave_user_function::subsref (this=0x70f470, > type=@0xe6c808, idx=@0x7fff9e9235b0, nargout=1) at ov-usr-fcn.cc:325 > #28 0x00002b820ca0f931 in octave_user_function::subsref (this=0x70f470, > type=@0xe6c808, idx=@0x7fff9e9235b0) at ov-usr-fcn.h:274 > #29 0x00002b820c9c3a88 in octave_value::subsref (this=0x7fff9e9235d0, > type=@0xe6c808, idx=@0x7fff9e9235b0, nargout=1) at ov.cc:930 > #30 0x00002b820cabdbd3 in tree_index_expression::rvalue (this=0xe6c7d0, > nargout=1) at pt-idx.cc:385 > #31 0x00002b820cabc283 in tree_index_expression::rvalue (this=0xe6c7d0) > at pt-idx.cc:396 > #32 0x00002b820caab9eb in tree_simple_assignment::rvalue (this=0xe6cd70) > at pt-assign.cc:202 > #33 0x00002b820caac42e in tree_simple_assignment::rvalue (this=0xe6cd70, > nargout=0) at pt-assign.cc:184 > #34 0x00002b820cad7e6e in tree_statement::eval (this=0xe6cab0, silent=false, > nargout=0, in_function_or_script_body=false) at pt-stmt.cc:124 > #35 0x00002b820cad81a7 in tree_statement_list::eval (this=0xe66a60, > silent=false, nargout=0) at pt-stmt.cc:185 > #36 0x00002b820cac82ab in tree_simple_for_command::do_for_loop_once ( > this=0xe6dc50, ult=@0x7fff9e9240a0, rhs=@0x7fff9e9241e0, > quit=@0x7fff9e9241cf) at pt-loop.cc:228 > #37 0x00002b820cac3c7d in tree_simple_for_command::eval (this=0xe6dc50) > at pt-loop.cc:388 > #38 0x00002b820cad7d6a in tree_statement::eval (this=0xe6e540, silent=false, > nargout=0, in_function_or_script_body=false) at pt-stmt.cc:99 > #39 0x00002b820cad81a7 in tree_statement_list::eval (this=0xe65100, > silent=false, nargout=0) at pt-stmt.cc:185 > #40 0x00002b820cad626c in tree_if_clause::eval (this=0xe76a60) > at pt-select.cc:54 > #41 0x00002b820cad62be in tree_if_command_list::eval (this=0xe653a0) > at pt-select.cc:85 > #42 0x00002b820cad6337 in tree_if_command::eval (this=0xe76ae0) > at pt-select.cc:124 > #43 0x00002b820cad7d6a in tree_statement::eval (this=0xe75d80, silent=false, > nargout=0, in_function_or_script_body=false) at pt-stmt.cc:99 > #44 0x00002b820cad81a7 in tree_statement_list::eval (this=0xd76b80, > silent=false, nargout=0) at pt-stmt.cc:185 > #45 0x00002b820cac82ab in tree_simple_for_command::do_for_loop_once ( > this=0xe76c90, ult=@0x7fff9e9253a0, rhs=@0x7fff9e9254e0, > quit=@0x7fff9e9254cf) at pt-loop.cc:228 > #46 0x00002b820cac3c7d in tree_simple_for_command::eval (this=0xe76c90) > at pt-loop.cc:388 > #47 0x00002b820cad7d6a in tree_statement::eval (this=0xe76bb0, silent=false, > nargout=0, in_function_or_script_body=true) at pt-stmt.cc:99 > #48 0x00002b820cad81a7 in tree_statement_list::eval (this=0xd62780, > silent=false, nargout=0) at pt-stmt.cc:185 > #49 0x00002b820ca0c7a6 in octave_user_function::do_multi_index_op ( > this=0x70f5a0, nargout=0, args=@0x11160a0) at ov-usr-fcn.cc:459 > #50 0x00002b820ca0bf27 in octave_user_function::subsref (this=0x70f5a0, > type=@0xd4c108, idx=@0x7fff9e9266a0, nargout=0) at ov-usr-fcn.cc:325 > #51 0x00002b820c9c3aea in octave_value::subsref (this=0x7fff9e9266c0, > type=@0xd4c108, idx=@0x7fff9e9266a0, nargout=0) at ov.cc:932 > #52 0x00002b820cabdbd3 in tree_index_expression::rvalue (this=0xd4c0d0, > nargout=0) at pt-idx.cc:385 > #53 0x00002b820cad7e6e in tree_statement::eval (this=0xd4c020, silent=false, > nargout=0, in_function_or_script_body=true) at pt-stmt.cc:124 > #54 0x00002b820cad81a7 in tree_statement_list::eval (this=0xce6430, > silent=false, nargout=0) at pt-stmt.cc:185 > #55 0x00002b820ca0c7a6 in octave_user_function::do_multi_index_op ( > this=0x70f210, nargout=0, args=@0x1113ee0) at ov-usr-fcn.cc:459 > #56 0x00002b820ca0bf27 in octave_user_function::subsref (this=0x70f210, > type=@0xc68918, idx=@0x7fff9e9270b0, nargout=0) at ov-usr-fcn.cc:325 > #57 0x00002b820c9c3aea in octave_value::subsref (this=0x7fff9e9270d0, > type=@0xc68918, idx=@0x7fff9e9270b0, nargout=0) at ov.cc:932 > #58 0x00002b820cabdbd3 in tree_index_expression::rvalue (this=0xc688e0, > nargout=0) at pt-idx.cc:385 > #59 0x00002b820cad7e6e in tree_statement::eval (this=0xc685d0, silent=false, > nargout=0, in_function_or_script_body=false) at pt-stmt.cc:124 > #60 0x00002b820cad81a7 in tree_statement_list::eval (this=0xb1fe10, > silent=false, nargout=0) at pt-stmt.cc:185 > #61 0x00002b820cac82ab in tree_simple_for_command::do_for_loop_once ( > this=0xc6fc20, ult=@0x7fff9e9277e0, rhs=@0x7fff9e927910, > quit=@0x7fff9e92791f) at pt-loop.cc:228 > #62 0x00002b820cac3877 in tree_simple_for_command::eval (this=0xc6fc20) > at pt-loop.cc:376 > #63 0x00002b820cad7d6a in tree_statement::eval (this=0xc6fbc0, silent=false, > nargout=0, in_function_or_script_body=true) at pt-stmt.cc:99 > #64 0x00002b820cad81a7 in tree_statement_list::eval (this=0x858840, > silent=false, nargout=0) at pt-stmt.cc:185 > #65 0x00002b820ca0bcd3 in octave_user_script::do_multi_index_op ( > this=0x89b650, nargout=0, args=@0x7fff9e928650) at ov-usr-fcn.cc:130 > #66 0x00002b820c9c2d26 in octave_value::do_multi_index_op ( > this=0x7fff9e928750, nargout=0, idx=@0x7fff9e928650) at ov.cc:970 > ---Type to continue, or q to quit--- > #67 0x00002b820cabad99 in tree_identifier::rvalue (this=0x8d0a60, nargout=0) > at pt-id.cc:88 > #68 0x00002b820cad7e6e in tree_statement::eval (this=0xc5a250, silent=false, > nargout=0, in_function_or_script_body=false) at pt-stmt.cc:124 > #69 0x00002b820cad81a7 in tree_statement_list::eval (this=0x7f5650, > silent=false, nargout=0) at pt-stmt.cc:185 > #70 0x00002b820c952509 in main_loop () at toplev.cc:291 > #71 0x00002b820c8fffb5 in octave_main (argc=1, argv=0x7fff9e928e48, embedded=0) > at octave.cc:850 > #72 0x0000000000400868 in main (argc=1, argv=0x7fff9e928e48) at main.c:35 > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Mike Jackson imikejackson _at_ gee-mail dot com From polys_poly at hotmail.com Sat May 10 09:24:44 2008 From: polys_poly at hotmail.com (polys_poly at hotmail.com) Date: Sat, 10 May 2008 16:24:44 +0300 Subject: [vtkusers] Bug in SetRenderWindow(NULL) still exists? Message-ID: Hello, I made an MDI application using MFC in which i create two different windows and visualize some volumes. Closing the first window works just fine. But when i try to close the second window i get the error: ERROR: In ..\..\VTK_Source\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 129 vtkWin32OpenGLRenderWindow (0ABA54D8): wglMakeCurrent failed in Clean(), error: 6 I found the following message http://www.vtk.org/pipermail/vtk-developers/2003-December/002689.html but couldn't find a solution for visual studio 2005. Is this really a bug or is it something i am doing wrong. I could really use some help here. Thanks in advance. Polys -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.albert at jacobs-university.de Sat May 10 10:50:27 2008 From: a.albert at jacobs-university.de (Adrian Albert) Date: Sat, 10 May 2008 16:50:27 +0200 Subject: [vtkusers] render independent rgba components with vtkFixedPointVolumeRayCastMapper Message-ID: <2cd88c320805100750k4e2cf896xc0bf131f2f06da76@mail.gmail.com> Dear All I am writing a program in VTK that takes some data, performs some operations, and spits out a 4-component RGBA array. The RGBA has in fact non-zero opacity values for the relevant regions, and for those regions also the R value to a constant (255). I am rendering this array with vtkFixedPointVolumeRayCastMapper, using independent input array components (RGBA). The probem is that I get a rather blocky appearence in my final image (I use the heart.vtk and the ironprot.vtk datasets from the examples folder in VTK). I was wondering if this might be because the dataset resolution is low (32x32x32), or because I do not set some parameters right in my input dataset. Maybe VTK's volume rendering explicitly needs some gradient computations, which is not done automatically when rendering, but rather needs to be initialized when creating a new vtkImageData object and setting the RGBA array as the object's scalars? Any help will be greatly appreciated! Best, Adrian -- --------------------------------------------------- Adrian Albert School of Engineering and Science Jacobs University Bremen Germany Tel.: 00494212003258 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Moritz.Bernard.Fricke at rwth-aachen.de Sat May 10 11:05:55 2008 From: Moritz.Bernard.Fricke at rwth-aachen.de (Moritz Bernard Fricke) Date: Sat, 10 May 2008 17:05:55 +0200 Subject: [vtkusers] vtkAVIWriter doesn't work Message-ID: Hi all, I want to use vtkAVIWriter using vtk 5.0.3. I always get the error: Traceback (most recent call last): File "particle_interactiv.py", line 3, in AviWriter=vtk.vtkAVIWriter() AttributeError: 'module' object has no attribute 'vtkAVIWriter' I just don't see the problem. Can it be that vtk 5.0.3 isn't containig vtkAVIWriter ? Thanks, Moritz From jcplatt at dsl.pipex.com Sat May 10 16:34:20 2008 From: jcplatt at dsl.pipex.com (John Platt) Date: Sat, 10 May 2008 21:34:20 +0100 Subject: [vtkusers] FW: Bug in SetRenderWindow(NULL) still exists? Message-ID: <002b01c8b2dd$3d313250$0100a8c0@pacsys4> Hi, Are you doing your VTK clean up in CMyView::OnDestroy() message handler? John -----Original Message----- From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of polys_poly at hotmail.com Sent: 10 May 2008 14:25 To: VTK users group Subject: [vtkusers] Bug in SetRenderWindow(NULL) still exists? Hello, I made an MDI application using MFC in which i create two different windows and visualize some volumes. Closing the first window works just fine. But when i try to close the second window i get the error: ERROR: In ..\..\VTK_Source\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 129 vtkWin32OpenGLRenderWindow (0ABA54D8): wglMakeCurrent failed in Clean(), error: 6 I found the following message http://www.vtk.org/pipermail/vtk-developers/2003-December/002689.html but couldn't find a solution for visual studio 2005. Is this really a bug or is it something i am doing wrong. I could really use some help here. Thanks in advance. Polys -------------- next part -------------- An HTML attachment was scrubbed... URL: From jordigh at gmail.com Sat May 10 23:11:31 2008 From: jordigh at gmail.com (=?ISO-8859-1?Q?Jordi_Guti=E9rrez_Hermoso?=) Date: Sat, 10 May 2008 22:11:31 -0500 Subject: [vtkusers] Possible 64 bit segfault Message-ID: <9543b3a40805102011g2764bcaek9e8a332576675c96@mail.gmail.com> On 10/05/2008, Mike Jackson wrote: > You need to run ccmake from the build directory, NOT the source directory. I'm doing an in-source build, so the source and build directories are the same, right? Anyways, I figured it out. Turns out that I had to run cmake before I could tweak with ccmake. Now it turns out that Octaviz won't build against cvs VTK, although it builds against VTK 5.0. :-/ If I'm going to be looking for 64bit segfaults, I think I need to check against the cvs version in case it's already been fixed there. Is there a dedicated developers list, or is every VTK user also a developer? I'll try asking here. Octaviz is an Octave wrapper of VTK classes that also provides a few Octave scripts for a familiar and comfortable interface. The wrapping is done by a file that is, if the copyright header speaks forsoothly, a modification of VTK code for wrapping other languages. The problem is with one of the files produced by this parser, so I'm guessing that if the bug is with Octaviz, it must be in the parser. Here's the problem (and 64bit problems are starting to show up here): the parser produced some code that assumed some data type was an int and an int*. The parsed code then tried to call vtkIdTypeArray::GetTupleValue(vtkIdType, vtkIdType*). Now, as far as I can tell, on my 64bit system vtkIdType is typedeffed to long long. It's not possible to cast an int* to long long*, hence the compile error. I'm guessing this means that I need to fix the parser to produce vtkIdType in certain places instead of int? Thanks, - Jordi G. H. From evans at aps.anl.gov Sun May 11 00:01:12 2008 From: evans at aps.anl.gov (Kenneth Evans, Jr.) Date: Sat, 10 May 2008 23:01:12 -0500 Subject: [vtkusers] wxPython & VTK: How to Destroy wxVTKRenderWindow without errors? In-Reply-To: <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> Message-ID: <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> Charl, Thanks very much for the detailed instructions. They seem to have worked. Actually, just the lines dealing with the vtkRenderer (i.e. ren) were sufficient. I am confused about the other lines. First, I am mostly just using a wxVTKRenderWindow, not a wxVTKRenderWindowInteractor. (I haven't, in fact, figured out how to make the cone6.py tutorial, which uses both, work in WX, but I haven't tried very hard, yet.) Note that neither wxVTKRenderWindow nor wxVTKRenderWindowInteractor has a SetRenderWindow() method. (At least in the CVS versions I am using.) I had in fact already tried doing that. Also renWin.getRenderWindow() probably returns the same object as ren. GetRenderWindow() and it has already been finalized. It doesn't complain, though. This is what I am doing now, but it should probably be fixed up: def shutDownVTK(self): """ What has to be done to shut down VTK """ # vtkRenderer if(self.ren != None): # Remove all actors from the renderer self.ren.RemoveAllViewProps() # Get the renderwindow to release all system resources (including # opengl context) self.ren.GetRenderWindow().Finalize() # Remove the reference del self.ren # # wxVTKRenderWindow if(self.renWin != None): self.renWin.GetRenderWindow().Finalize() # break link between RWI and RW # self.renWinI.SetRenderWindow(None) # No such method # Remove the reference del self.renWin # # wxVTKRenderWindowInteractor if(self.renWinI != None): self.renWinI.GetRenderWindow().Finalize() # break link between RWI and RW # self.renWinI.SetRenderWindow(None) ) # No such method # Remove the reference del self.renWinI As I said, only implementing the first block was enough for my case. That apparently does shut down OpenGL. Thanks again, -Ken -----Original Message----- From: cpbotha at medvis.org [mailto:cpbotha at medvis.org] On Behalf Of Charl Botha Sent: Friday, May 09, 2008 3:26 PM To: Kenneth Evans Cc: vtkusers at vtk.org Subject: Re: [vtkusers] wxPython & VTK: How to Destroy wxVTKRenderWindow without errors? On Fri, May 9, 2008 at 7:18 PM, Kenneth Evans wrote: > So, the question is how do you remove and replace a wxVTKRenderWindow > properly. The problem is that VTK reference counts everything and WX doesn't. So you have to be careful to disconnect all VTK and WX elements and then also make sure that all VTK bindings (refs in C++) disappear. Importantly, get the renderwindow to release its graphics resources. This all comes down to the following SuperSafe(tm) approach: # remove all actors from the renderer ren.RemoveAllViewProps() # get rid of your binding del ren # get the renderwindow to release all system resources (including opengl context) wxRWI.GetRenderWindow().Finalize() # break link between RWI and RW wxRWI.SetRenderWindow(None) # get rid of our binding del wxRWI # now you can destroy the containing wx Window wxWin.Destroy() Good luck, Charl -- http://visualisation.tudelft.nl/CharlBotha From c.p.botha at tudelft.nl Sun May 11 04:27:47 2008 From: c.p.botha at tudelft.nl (Charl Botha) Date: Sun, 11 May 2008 10:27:47 +0200 Subject: [vtkusers] wxPython & VTK: How to Destroy wxVTKRenderWindow without errors? In-Reply-To: <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> Message-ID: <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> On Sun, May 11, 2008 at 6:01 AM, Kenneth Evans, Jr. wrote: > Thanks very much for the detailed instructions. They seem to have worked. Glad I could help! Most people keeping their wxRW(I)s hanging around until application end, so they never notice this problem. > I am confused about the other lines. First, I am mostly just using a > wxVTKRenderWindow, not a wxVTKRenderWindowInteractor. (I haven't, in fact, I was assuming a wxVTKRWI. The most important is the Finalize() call, as this gets rid of all system resources (including the opengl context). The complete invocation I sent is a bit more paranoid and tries to disconnect as much as possible in the case of a wxVTKRWI. See you, Charl From a.albert at jacobs-university.de Sun May 11 07:17:47 2008 From: a.albert at jacobs-university.de (Adrian Albert) Date: Sun, 11 May 2008 13:17:47 +0200 Subject: [vtkusers] datasets in vtk format? Message-ID: <2cd88c320805110417r6c810fcave212a78de5deb8a5@mail.gmail.com> Dear All, can some one recommend me a website from where I could download volumetric datasets in vtk format? I'm specifically looking for structured points formats. Thanks! Adrian -- --------------------------------------------------- Adrian Albert School of Engineering and Science Jacobs University Bremen Germany Tel.: 00494212003258 -------------- next part -------------- An HTML attachment was scrubbed... URL: From polys_poly at hotmail.com Sun May 11 09:56:08 2008 From: polys_poly at hotmail.com (polys_poly at hotmail.com) Date: Sun, 11 May 2008 16:56:08 +0300 Subject: [vtkusers] vtkPropPicker - Get Surface Area of actor (polygon) Message-ID: Hello, I am creating some polygons in 3D and i am picking these actors using the following code int mouseX = m_pRenderWindow->GetInteractor()->GetEventPosition()[0]; int mouseY = m_pRenderWindow->GetInteractor()->GetEventPosition()[1]; vtkObject* prop = vtkProp::New(); int i = m_pPropPicker->PickProp(mouseX, mouseY, pChildFrameReference->m_wndView.m_pVTK->m_pRenderer); if (i==1) prop = m_pPropPicker->GetViewProp(); How can i get the surface area of the polygon picked? Thanks in advance, Polys -------------- next part -------------- An HTML attachment was scrubbed... URL: From evans at aps.anl.gov Sun May 11 13:12:43 2008 From: evans at aps.anl.gov (Kenneth Evans, Jr.) Date: Sun, 11 May 2008 12:12:43 -0500 Subject: [vtkusers] wxPython & VTK: How to Destroy wxVTKRenderWindow without errors? In-Reply-To: <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> Message-ID: Charl, I have looked at this some more and also tried to get the cone6.py tutorial to work. 1. The problem is that wxVTKRenderWindowInteractor doesn't seem to have a way to set the vtkRenderWindow. In the cone6.py code block: # The vtkRenderWindowInteractor class watches for events (e.g., keypress, # mouse) in the vtkRenderWindow. These events are translated into # event invocations that VTK understands (see VTK/Common/vtkCommand.h # for all events that VTK processes). Then observers of these VTK # events can process them as appropriate. iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) There is no SetRenderWindow() if you use wxVTKRenderWindowInteractor. 2. Using the cone6 tutorial with this line commented out and printing what is returned by the shutDownVTK() method I listed in the last message (which is pretty much what you suggested), I find: self.ren.GetRenderWindow() and self.renWin.GetRenderWindow() are the same object (as I expected). self.renWin.GetRenderWindow() is a different object. 3. This lack of a way to change the RenderWindow is also why you can't use: wxRWI.SetRenderWindow(None) as you suggested. 4. Perhaps the best question to ask is how do you get the cone6 tutorial to work with WX, given that is missing SetRenderWindow? BTW the first part of your solution _did_ solve the problem with the vtkWin32OpenGLRenderWindow error. I guess I am moving on to the next problem. Perhaps it should be a different topic, although it came up as a result of your proposed solution. Thanks for the help, -Ken From c.p.botha at tudelft.nl Sun May 11 18:12:42 2008 From: c.p.botha at tudelft.nl (Charl Botha) Date: Mon, 12 May 2008 00:12:42 +0200 Subject: [vtkusers] wxPython & VTK: How to Destroy wxVTKRenderWindow without errors? In-Reply-To: References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> Message-ID: <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> On Sun, May 11, 2008 at 7:12 PM, Kenneth Evans, Jr. wrote: > I have looked at this some more and also tried to get the cone6.py tutorial > to work. > > 1. The problem is that wxVTKRenderWindowInteractor doesn't seem to have a > way to set the vtkRenderWindow. In the cone6.py code block: > > There is no SetRenderWindow() if you use wxVTKRenderWindowInteractor. Hmm, did you double-check? I see the following: >> print rwi > >> print rwi.SetRenderWindow There is some swig-magic going on, so you don't see it in dir() calls and in introspection-based autocompletion, but it's there. You just need to call it. :) That being said: under normal circumstances, you should never need to call this, except at shutdown, and even then it's probably not really necessary. The wxVTKRWI creates its own RenderWindow. > 2. Using the cone6 tutorial with this line commented out and printing what > is returned by the shutDownVTK() method I listed in the last message (which > is pretty much what you suggested), I find: > > self.ren.GetRenderWindow() and self.renWin.GetRenderWindow() are the same > object (as I expected). self.renWin.GetRenderWindow() is a different > object. This statement is self-contradictory. What exactly do you mean here? > 3. This lack of a way to change the RenderWindow is also why you can't use: > > wxRWI.SetRenderWindow(None) > > as you suggested. I've been using this for quite a long time. Could you re-check that you can't invoke that method on the wxVTKRWI? > 4. Perhaps the best question to ask is how do you get the cone6 tutorial to > work with WX, given that is missing SetRenderWindow? As explained right up above, the wxVTKRWI creates its own vtkRenderWindow. Only thing you have to do is to create a vtkRenderer and then install it as follows: ren = vtk.vtkRenderer() rwi.GetRenderWindow().AddRenderer(ren) Good luck! Charl From evans at aps.anl.gov Mon May 12 00:53:59 2008 From: evans at aps.anl.gov (Kenneth Evans, Jr.) Date: Sun, 11 May 2008 23:53:59 -0500 Subject: [vtkusers] wxPython & VTK: How to Destroy wxVTKRenderWindow without errors? In-Reply-To: <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> Message-ID: <6DAD69CEEC61453C8DDD5E0B1986496B@CICADA> Charl, >> I've been using this for quite a long time. Could you re-check that >> you can't invoke that method on the wxVTKRWI? There is no such method in my version. It generates an exception if you try to use it. If you look at the code, there is, in fact, no such method. I have attached the code. I was not able to use the wxVTKRenderWindow* versions in the current distribution (5.0.4). They gave an error owing to using wxPython, as I recall. I probably have it written down at work. That is one of several problems I had making VTK work with Python 2.5 and the current WX. The versions I am using are newer and have your name in them. Apart from the problems in this email thread, they seem to work well. I got these versions from CVS under HEAD following a clue I got by Googling vtkusers. (They get eventually get installed into INSTALL_DIR\lib\site-packages\vtk\wx.) In any event with these versions you can't replace the vtkRenderWindow* by wxVTKRenderWindow* in cone6.py, owing to the reasons I have stated. I have found I _can_ make the cone6 tutorial interactor work by using wxVTKRenderWindowInteractor _in place of_ wxVTKRenderWindow instead of in addition to it as it was originally. >> The wxVTKRWI creates its own RenderWindow. ... which is internal. You can't do what is done in cone6.py and use the same one as in renWin. If you look at the attached code, what I said should make more sense. We are clearly using different versions. Looks that that should be resolved first, then it will probably all make sense. Thanks, -Ken -----Original Message----- From: cpbotha at medvis.org [mailto:cpbotha at medvis.org] On Behalf Of Charl Botha Sent: Sunday, May 11, 2008 5:13 PM To: Kenneth Evans, Jr. Cc: vtkusers at vtk.org Subject: Re: [vtkusers] wxPython & VTK: How to Destroy wxVTKRenderWindow without errors? On Sun, May 11, 2008 at 7:12 PM, Kenneth Evans, Jr. wrote: > I have looked at this some more and also tried to get the cone6.py tutorial > to work. > > 1. The problem is that wxVTKRenderWindowInteractor doesn't seem to have a > way to set the vtkRenderWindow. In the cone6.py code block: > > There is no SetRenderWindow() if you use wxVTKRenderWindowInteractor. Hmm, did you double-check? I see the following: >> print rwi > >> print rwi.SetRenderWindow There is some swig-magic going on, so you don't see it in dir() calls and in introspection-based autocompletion, but it's there. You just need to call it. :) That being said: under normal circumstances, you should never need to call this, except at shutdown, and even then it's probably not really necessary. The wxVTKRWI creates its own RenderWindow. > 2. Using the cone6 tutorial with this line commented out and printing what > is returned by the shutDownVTK() method I listed in the last message (which > is pretty much what you suggested), I find: > > self.ren.GetRenderWindow() and self.renWin.GetRenderWindow() are the same > object (as I expected). self.renWin.GetRenderWindow() is a different > object. This statement is self-contradictory. What exactly do you mean here? > 3. This lack of a way to change the RenderWindow is also why you can't use: > > wxRWI.SetRenderWindow(None) > > as you suggested. I've been using this for quite a long time. Could you re-check that you can't invoke that method on the wxVTKRWI? > 4. Perhaps the best question to ask is how do you get the cone6 tutorial to > work with WX, given that is missing SetRenderWindow? As explained right up above, the wxVTKRWI creates its own vtkRenderWindow. Only thing you have to do is to create a vtkRenderer and then install it as follows: ren = vtk.vtkRenderer() rwi.GetRenderWindow().AddRenderer(ren) Good luck! Charl -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: wxVTKRenderWindow.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: wxVTKRenderWindowInteractor.py URL: From hadez803 at yahoo.com Mon May 12 04:13:52 2008 From: hadez803 at yahoo.com (hossein (hadez803)) Date: Mon, 12 May 2008 01:13:52 -0700 (PDT) Subject: [vtkusers] vtk & vs2008.net Message-ID: <791724.33752.qm@web51311.mail.re2.yahoo.com> An HTML attachment was scrubbed... URL: From carlding at gmail.com Mon May 12 05:23:28 2008 From: carlding at gmail.com (Feng Ding) Date: Mon, 12 May 2008 17:23:28 +0800 Subject: [vtkusers] Better way to draw vertex normals? Message-ID: Dear list, I'm trying to draw a normal line for each vertex on a 3D surface mesh, which contains n vertices. My current method uses vtkLineSource to represent the normal line. Then, for each normal line, I create its corresponding polyDataMapper and Actor in order to draw it in the render window. Here's my problem: when n is a large number, rendering n Actors is very slow. Is there any better way to draw vertex normals? Possible to draw multiple vtkLineSource objects using only one polyDataMapper and one Actor? Thanks! Best regards, DING Feng From Chunlei.Han at tyks.fi Mon May 12 05:28:54 2008 From: Chunlei.Han at tyks.fi (Han Chunlei) Date: Mon, 12 May 2008 12:28:54 +0300 Subject: [vtkusers] How to keep ROI on screen using vtksplinewidget? Message-ID: <18A7E7877ADDE249ABB19920039173E0011DD674@PANNU1.vsshp.net> Dear VTKers: Using vtksplinewidget, I can draw a ROI (region of interest) on an image, and I can keep this information in memory, however I do not know how to keep this ROI on screen when I want to draw another one? Thanks in advance. Regards Chunlei -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Mon May 12 09:16:20 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Mon, 12 May 2008 08:16:20 -0500 Subject: [vtkusers] vtkAVIWriter doesn't work In-Reply-To: References: Message-ID: <48284324.4050207@cfdrc.com> Ho Moritz, Are you running on Windows? That's the only platform where the vtkAVIWriter is supported. - Amy Moritz Bernard Fricke wrote: > Hi all, > > I want to use vtkAVIWriter using vtk 5.0.3. I always get the error: > > Traceback (most recent call last): > File "particle_interactiv.py", line 3, in > AviWriter=vtk.vtkAVIWriter() > AttributeError: 'module' object has no attribute 'vtkAVIWriter' > > I just don't see the problem. Can it be that vtk 5.0.3 isn't containig vtkAVIWriter ? > > Thanks, > Moritz > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From welucarell at equityeng.com Mon May 12 09:31:22 2008 From: welucarell at equityeng.com (William E Lucarell) Date: Mon, 12 May 2008 09:31:22 -0400 Subject: [vtkusers] vtkAVIWriter doesn't work In-Reply-To: References: Message-ID: <000001c8b434$7bbad500$73307f00$@com> Do you have any additional code to configure the AVI Writer? I've implemented it before so I may be able to help. Bill -----Original Message----- From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Moritz Bernard Fricke Sent: Saturday, May 10, 2008 11:06 AM To: vtkusers at vtk.org Subject: [vtkusers] vtkAVIWriter doesn't work Hi all, I want to use vtkAVIWriter using vtk 5.0.3. I always get the error: Traceback (most recent call last): File "particle_interactiv.py", line 3, in AviWriter=vtk.vtkAVIWriter() AttributeError: 'module' object has no attribute 'vtkAVIWriter' I just don't see the problem. Can it be that vtk 5.0.3 isn't containig vtkAVIWriter ? Thanks, Moritz _______________________________________________ This is the private VTK discussion list. Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers From hadez803 at yahoo.com Mon May 12 09:30:07 2008 From: hadez803 at yahoo.com (hossein (hadez803)) Date: Mon, 12 May 2008 06:30:07 -0700 (PDT) Subject: [vtkusers] output file Message-ID: <216448.51169.qm@web51303.mail.re2.yahoo.com> An HTML attachment was scrubbed... URL: From Moritz.Bernard.Fricke at rwth-aachen.de Mon May 12 10:20:59 2008 From: Moritz.Bernard.Fricke at rwth-aachen.de (Moritz Bernard Fricke) Date: Mon, 12 May 2008 16:20:59 +0200 Subject: [vtkusers] vtkAVIWriter doesn't work In-Reply-To: <000001c8b434$7bbad500$73307f00$@com> References: <000001c8b434$7bbad500$73307f00$@com> Message-ID: Thanks you for your answers. I'm using ubuntu 7.1 . It seems like that is the problem. Am i right? ----- Urspr?ngliche Nachricht ----- Von: William E Lucarell Datum: Montag, Mai 12, 2008 3:29 pm Betreff: Re: [vtkusers] vtkAVIWriter doesn't work An: vtkusers at vtk.org > Do you have any additional code to configure the AVI Writer? I've > implemented it before so I may be able to help. > > Bill > > -----Original Message----- > From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On > BehalfOf Moritz Bernard Fricke > Sent: Saturday, May 10, 2008 11:06 AM > To: vtkusers at vtk.org > Subject: [vtkusers] vtkAVIWriter doesn't work > > Hi all, > > I want to use vtkAVIWriter using vtk 5.0.3. I always get the error: > > Traceback (most recent call last): > File "particle_interactiv.py", line 3, in > AviWriter=vtk.vtkAVIWriter() > AttributeError: 'module' object has no attribute 'vtkAVIWriter' > > I just don't see the problem. Can it be that vtk 5.0.3 isn't > containigvtkAVIWriter ? > > Thanks, > Moritz > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQFollow this link to > subscribe/unsubscribe:http://www.vtk.org/mailman/listinfo/vtkusers > From ahs at cfdrc.com Mon May 12 10:33:36 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Mon, 12 May 2008 09:33:36 -0500 Subject: [vtkusers] vtkAVIWriter doesn't work In-Reply-To: References: <000001c8b434$7bbad500$73307f00$@com> Message-ID: <48285540.2070704@cfdrc.com> Yes, you're correct. The vtkAVIWriter only works (and is only built) on Windows. You can't use it on linux. VTK does have FFMPEG and MPEG2 writers that can be used in a unix / linux environment, but you will have to build VTK yourself in order to use either of them. They are not compiled into VTK by default because there are licensing issues with both of them: FFMPEG uses the LGPL license, which is incompatible with VTK's BSD-style license; portions of MPEG2 are patented, so this writer is not built by default in an effort to keep VTK patent-free. See http://www.vtk.org/doc/nightly/html/classvtkFFMPEGWriter.html and http://www.vtk.org/doc/nightly/html/classvtkMPEG2Writer.html for more information. - Amy Moritz Bernard Fricke wrote: > Thanks you for your answers. I'm using ubuntu 7.1 . It seems like that is the problem. Am i right? > > ----- Urspr?ngliche Nachricht ----- > Von: William E Lucarell > Datum: Montag, Mai 12, 2008 3:29 pm > Betreff: Re: [vtkusers] vtkAVIWriter doesn't work > An: vtkusers at vtk.org > > >> Do you have any additional code to configure the AVI Writer? I've >> implemented it before so I may be able to help. >> >> Bill >> >> -----Original Message----- >> From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On >> BehalfOf Moritz Bernard Fricke >> Sent: Saturday, May 10, 2008 11:06 AM >> To: vtkusers at vtk.org >> Subject: [vtkusers] vtkAVIWriter doesn't work >> >> Hi all, >> >> I want to use vtkAVIWriter using vtk 5.0.3. I always get the error: >> >> Traceback (most recent call last): >> File "particle_interactiv.py", line 3, in >> AviWriter=vtk.vtkAVIWriter() >> AttributeError: 'module' object has no attribute 'vtkAVIWriter' >> >> I just don't see the problem. Can it be that vtk 5.0.3 isn't >> containigvtkAVIWriter ? >> >> Thanks, >> Moritz >> >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQFollow this link to >> subscribe/unsubscribe:http://www.vtk.org/mailman/listinfo/vtkusers >> >> > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From n.kinar at usask.ca Mon May 12 10:39:35 2008 From: n.kinar at usask.ca (Nicholas Kinar) Date: Mon, 12 May 2008 08:39:35 -0600 Subject: [vtkusers] output file In-Reply-To: <216448.51169.qm@web51303.mail.re2.yahoo.com> References: <216448.51169.qm@web51303.mail.re2.yahoo.com> Message-ID: <482856A7.3020001@usask.ca> Perhaps the application is missing the common runtime for Windows. This could be because you do not have Visual Studio installed on the other computer. Here is a link to a forum post which may help you: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=72965&SiteID=1 A common way to ensure that your application has all of the necessary components on another computer is to run Dependency Walker on the binary: http://www.dependencywalker.com/ A copy of Dependency Walker should be bundled with Visual Studio. Nicholas hossein (hadez803) wrote: > > hi, > > I have built a console project with vtk. The .exe file runs on the > computer it was compiled on but when i run the file on another > computer i get the following error" > > This application has failed to start because the application > configuration is incorrect. > > > > How can i fix this. > > regards > > hossein. > > > ------------------------------------------------------------------------ > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try > it now. > > > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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 evans at aps.anl.gov Mon May 12 10:46:04 2008 From: evans at aps.anl.gov (Kenneth Evans) Date: Mon, 12 May 2008 09:46:04 -0500 Subject: [vtkusers] output file In-Reply-To: <216448.51169.qm@web51303.mail.re2.yahoo.com> References: <216448.51169.qm@web51303.mail.re2.yahoo.com> Message-ID: <003001c8b43e$e7b3a020$950836a4@aps.anl.gov> Hossein, You probably need to install the redistributables: http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391- 8A4D-074B9F2BC1BF &displaylang=en or look for vcredist_x86.exe in your Visual Studio tree. (Microsoft isn't noted for informative error messages.) -Ken _____ From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of hossein (hadez803) Sent: Monday, May 12, 2008 8:30 AM To: vtkusers at vtk.org Subject: [vtkusers] output file hi, I have built a console project with vtk. The .exe file runs on the computer it was compiled on but when i run the file on another computer i get the following error" This application has failed to start because the application configuration is incorrect. How can i fix this. regards hossein. _____ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hobbsk at ohiou.edu Mon May 12 12:03:11 2008 From: hobbsk at ohiou.edu (Kevin H. Hobbs) Date: Mon, 12 May 2008 12:03:11 -0400 Subject: [vtkusers] Possible 64 bit segfault In-Reply-To: <9543b3a40805102011g2764bcaek9e8a332576675c96@mail.gmail.com> References: <9543b3a40805102011g2764bcaek9e8a332576675c96@mail.gmail.com> Message-ID: <1210608191.22459.35.camel@gargon.hooperlab> On Sat, 2008-05-10 at 22:11 -0500, Jordi Guti?rrez Hermoso wrote: > I'm guessing this means that I need to fix the parser to produce > vtkIdType in certain places instead of int? That sounds like a good bet. I think vtkIdType can also be 64 bits on 32 bit systems if VTK_USE_64BIT_IDS is on. -------------- 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 c.p.botha at tudelft.nl Mon May 12 13:13:37 2008 From: c.p.botha at tudelft.nl (Charl Botha) Date: Mon, 12 May 2008 19:13:37 +0200 Subject: [vtkusers] wxPython & VTK: How to Destroy wxVTKRenderWindow without errors? In-Reply-To: <6DAD69CEEC61453C8DDD5E0B1986496B@CICADA> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> <6DAD69CEEC61453C8DDD5E0B1986496B@CICADA> Message-ID: <31ddba770805121013t64e510bco5add2af6edcf515b@mail.gmail.com> Hi there Ken, On Mon, May 12, 2008 at 6:53 AM, Kenneth Evans, Jr. wrote: > There is no such method in my version. It generates an exception if you try > to use it. If you look at the code, there is, in fact, no such method. I > have attached the code. As I said, it's not explicitly there, but it is available. The trick is in the __getattr__ method: when you call SetRenderWindow(), __getattr__ is automatically invoked and finds it in the contained vtkGenericRenderWindowInteractor instance. Do you see now? > In any event with these versions you can't replace the vtkRenderWindow* by > wxVTKRenderWindow* in cone6.py, owing to the reasons I have stated. I have > found I _can_ make the cone6 tutorial interactor work by using > wxVTKRenderWindowInteractor _in place of_ wxVTKRenderWindow instead of in > addition to it as it was originally. That's the whole point. You're supposed to use either one or the other, not both. In other words, the idea is NOT that you instantiate one of each and then assign the one to the other. Use either the wxVTKRWI exclusively, or the wxVTKRW exclusively. > If you look at the attached code, what I said should make more sense. We > are clearly using different versions. Looks that that should be resolved > first, then it will probably all make sense. No, I am using this version. In fact, the last change (1.28) is a fix from Nicolas P. that I slipped in via the friendly Berk Geveci (due to the commit freeze). I hope things are clear now. See you, Charl From evans at aps.anl.gov Mon May 12 15:24:18 2008 From: evans at aps.anl.gov (Kenneth Evans) Date: Mon, 12 May 2008 14:24:18 -0500 Subject: [vtkusers] wxPython & VTK: How to Destroy wxVTKRenderWindow without errors? In-Reply-To: <31ddba770805121013t64e510bco5add2af6edcf515b@mail.gmail.com> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> <6DAD69CEEC61453C8DDD5E0B1986496B@CICADA> <31ddba770805121013t64e510bco5add2af6edcf515b@mail.gmail.com> Message-ID: <006301c8b465$c5fe67e0$950836a4@aps.anl.gov> Charl, >> Do you see now? No. I get an exception. I also get an exception in the following line from your original solution: wxRWI.SetRenderWindow(None) i.e. Exception destroying renWin 'wxVTKRenderWindow' object has no attribute 'SetRenderWindow' OK, I think I see the problem. I typically use a vtkRenderWindow and not a vtkRenderWindowInteractor. I translated your fix to use wxVTKRenderWindow (what I use). It does not have that method. vtkRenderWindowInteractor apparently does, even though you can't find it through pattern searching. I am not exactly a Python guru and did not know about __getattr__. So I [somewhat] see, now. Clever. (But makes hard-to-follow code). When I did use a vtkRenderWindowInteractor was in trying to modify the cone6.py turorial example (VTK_DIR\Examples\Tutorial\Step6\Python) to use WX. That did not work: a. If I modified it to use: iren.SetRenderWindow(self.renWin) it fails with iren.SetRenderWindow(self.renWin) ValueError: method requires a VTK object (which is a different exception, sorry). b. If I modify it to use: iren.SetRenderWindow(self.renWin.GetRenderWindow()) it doesn't get an exception, but it doesn't work right either. c. If I just replace the wxVTKRenderWindow with a wxVTKRenderWindowInteractor everywhere, it works fine. I apologize that in doing all this trial and error, I may have got confused about which class had what methods and what exceptions. >> You're supposed to use either one or the other, not both. So, that seems to work, once you know the rule. However, the cone6.py example (VTK_DIR\Examples\Tutorial\Step6\Python) doesn't do that. (It's not that I especially care about cone6.py, but it is a standard example that everyone has.) What happens when you have more than one interactor? In any event I've learned a bit. Thanks. Sorry if I've been a pain in the butt. -Ken From sajendra at gmail.com Mon May 12 15:27:47 2008 From: sajendra at gmail.com (Sajendra N) Date: Mon, 12 May 2008 15:27:47 -0400 Subject: [vtkusers] Reading ITK Deformation Field in VTK Message-ID: <8151b65f0805121227j16ebab34ld1e5e7964360ee7@mail.gmail.com> Hi everyone, After performing a deformable registration using ITK, I saved the resulting deformation field to disk in MetaImage format using itkImageFileWriter. I later read the deformation field from disk into VTK using vtkMetaImageReader and set that as the input to a vtkGridTransform which I use to transform points, however the point locations after transformation are wrong. If I do everything in ITK (reading the metaimage file, transforming points), I get the correct transformation. At least part of the problem was the the "POSITION" tag was not written in the header, it was written as "OFFSET" instead. I fixed that manually but I am still having problems. Is there a further incompatibility in the file formats? I am hoping someone has done this successfully in the past and had some ideas. I can provide sample data and code to reproduce the issue, but the data set might be rather large. Thank you, Sajendra -- ?crasez l'inf?me! From luis.ibanez at kitware.com Mon May 12 18:22:20 2008 From: luis.ibanez at kitware.com (Luis Ibanez) Date: Mon, 12 May 2008 18:22:20 -0400 Subject: [vtkusers] Reading ITK Deformation Field in VTK In-Reply-To: <8151b65f0805121227j16ebab34ld1e5e7964360ee7@mail.gmail.com> References: <8151b65f0805121227j16ebab34ld1e5e7964360ee7@mail.gmail.com> Message-ID: <4828C31C.6060005@kitware.com> Hi Sajendra, a) From what type of ITK Deformable registration did you generate this deformation field ? (e.g. Demons ?, FEM ?, BSplines ?) b) If it was from using BSplines, did you used a Bulk transform ? c) The points that you are transforming, are they located in the coordinate system of the Fixed image ? and are you trying to map them to the coordinate system of the moving image ? d) What is your frame of reference for determining that the mapped points are wrong ? have you loaded one of the images into ParaView ? Does this image has an origin different from Zero ? e) What specific version of ParaView are you using ? Please let us know, Luis ---------------- Sajendra N wrote: > Hi everyone, > > After performing a deformable registration using ITK, I saved the > resulting deformation field to disk in MetaImage format using > itkImageFileWriter. > I later read the deformation field from disk into VTK using > vtkMetaImageReader and set that as the input to a vtkGridTransform > which I use to transform points, however the point locations after > transformation are wrong. > If I do everything in ITK (reading the metaimage file, transforming > points), I get the correct transformation. > At least part of the problem was the the "POSITION" tag was not > written in the header, it was written as "OFFSET" instead. I fixed > that manually but I am still having problems. > Is there a further incompatibility in the file formats? I am hoping > someone has done this successfully in the past and had some ideas. > I can provide sample data and code to reproduce the issue, but the > data set might be rather large. > > Thank you, > Sajendra > From marius.erdt at gmx.de Tue May 13 06:21:14 2008 From: marius.erdt at gmx.de (Marius Erdt) Date: Tue, 13 May 2008 12:21:14 +0200 Subject: [vtkusers] Interpolating between contours (resampling MRI data) Message-ID: <48296B9A.5030109@gmx.de> Hi, I've got MRI data that needs to be resampled to isotropic voxel dimensions. While the resampling of the voxel data set is not the problem, there are also contours in every slice which need to be interpolated as well. The contours themselves are single point sets for each slice. My question is now how to interpolate between the contours from the different slices such that they match the isotropic (resampled) voxel data set? That means, in every slice of the new resampled data set has to be an appropriate contour. I was thinking about generating a surface from the whole (3D) point cloud and then slicing through the surface by defining cutting planes. However, I don't know if there is a more straightforward way in VTK. Does anyone know if there is an easy/common way to deal with such a problem? If not, would the approach with cutting planes appropriate? Thanks for any help, Marius From subbu.iitb at gmail.com Tue May 13 06:57:16 2008 From: subbu.iitb at gmail.com (Subbu) Date: Tue, 13 May 2008 16:27:16 +0530 Subject: [vtkusers] Compilation error VTK wrap TCL (VTK 5.0.4 & TCL 8.5) Message-ID: <17806cba0805130357s1c0a70a7gadcbe082dce95fe2@mail.gmail.com> Hi, When i compil VTK with VTK wrap TCL, i got an error saying "CMake Error at Wrapping/TCL?CMakeLists.txt:37 (INCLUDE DIRECTORIES) include_directories given empty string as include directory. could any one help to get thru this error and compile VTK Thanks in advance -- K. Subburaj OrthoCAD Network Research Facility Indian Institute of Technology Bombay Powai, Mumbai - 400 076 India -------------- next part -------------- An HTML attachment was scrubbed... URL: From hebrev at gmail.com Tue May 13 07:28:26 2008 From: hebrev at gmail.com (Brian Gee Chacko) Date: Tue, 13 May 2008 16:58:26 +0530 Subject: [vtkusers] Mesh Animation Message-ID: <27ca73ef0805130428y13a3820cq447cb274ebc89f44@mail.gmail.com> Dear All, How do we do mesh animation in VTK? Regards Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From hebrev at gmail.com Tue May 13 07:35:33 2008 From: hebrev at gmail.com (Brian Gee Chacko) Date: Tue, 13 May 2008 17:05:33 +0530 Subject: [vtkusers] Hardware device interface Message-ID: <27ca73ef0805130435y30dea13fwce078df45defaaf6@mail.gmail.com> Hi all, I am having trouble interfacing VR devices with VTK. What i am facing at the moment is that if at all i use the vtkRenderWindowInteractor, the data can be retreived only at the point any mouse interaction is done on the window. What exactly should be done to use device interfacing using VTK? At the moment i am trying to combine OpenGL and VTK, but the method is too temporary and not very fullfiling Regards Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodwin.lawlor at ucd.ie Tue May 13 07:38:51 2008 From: goodwin.lawlor at ucd.ie (Goodwin Lawlor) Date: Tue, 13 May 2008 12:38:51 +0100 Subject: [vtkusers] Compilation error VTK wrap TCL (VTK 5.0.4 & TCL 8.5) In-Reply-To: <17806cba0805130357s1c0a70a7gadcbe082dce95fe2@mail.gmail.com> References: <17806cba0805130357s1c0a70a7gadcbe082dce95fe2@mail.gmail.com> Message-ID: Hi K. Subburaj, This usually happens when you are linking against a version of Tcl whose resources haven't been included in VTK. Check here to see what you have: VTK\Utilities\TclTk\resources I think you will need to checkout a CVS version of VTK if you want to link against Tcl8.5 or else downgrade your Tcl version to 8.4 I posted a patch to the bug tracker ( http://public.kitware.com/Bug/view.php?id=3424 ) which allows VTK to take the resources from the Tcl/Tk source tree - unfortunately the patch didn't get copied onto the new tracker with the report. hth Goodwin Subbu wrote: > > Hi, > > When i compil VTK with VTK wrap TCL, i got an error saying "CMake Error > at Wrapping/TCL?CMakeLists.txt:37 (INCLUDE DIRECTORIES) > include_directories given empty string as include directory. > > could any one help to get thru this error and compile VTK > > Thanks in advance > > -- > K. Subburaj > OrthoCAD Network Research Facility > Indian Institute of Technology Bombay > Powai, Mumbai - 400 076 > India > > > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers From beromuald at wanadoo.fr Tue May 13 08:50:03 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Tue, 13 May 2008 14:50:03 +0200 (CEST) Subject: [vtkusers] How to use vtkPointPlacer? Message-ID: <32117199.248971210683003735.JavaMail.www@wwinf1523> Hi all, For my work, I have to colorize some pixels on an image, and until now I use this algorithm: ??? vtkPoints* pts = vtkPoints::New(); ??? vtkDataArray* scalars = vtkUnsignedCharArray::New(); ??? scalars->SetNumberOfComponents(3); ??? //----------------------- ? ? //for(......... ? ? //I insert all of my points ? ? //----------------------- ??? vtkDiskSource* src = vtkDiskSource::New(); ??? src->SetRadialResolution(1); ??? src->SetCircumferentialResolution(15); ??? src->SetInnerRadius(0.0); ??? src->SetOuterRadius(1.0); ??? vtkPolyData* polyData = vtkPolyData::New(); ??? polyData->SetPoints(pts); ??? polyData->GetPointData()->SetScalars(scalars); ??? vtkGlyph3D* glyph = vtkGlyph3D::New(); ??? glyph->SetSourceConnection(src->GetOutputPort()); ??? glyph->SetInput(polyData); ??? glyph->SetColorModeToColorByScalar(); ??? glyph->SetScaleModeToDataScalingOff() ; ??? ??? vtkPolyData* outPut = glyph->GetOutput(); ??? vtkPolyDataMapper* mapper = vtkPolyDataMapper::New(); ??? mapper->SetInput(outPut); ??? actorColorize = vtkActor::New(); ??? actorColorize->SetMapper(mapper); ??? ??? viewer->GetRenderer()->AddActor(actorColorize); But this is not very smart, and this create disks, and I want to colorize just the pixels which are in my list. After, I have found the "vtkPointPlacer" class, but I don't find any explanations to use this. Can you help me please? Thanks for answers, Bye -------------- next part -------------- An HTML attachment was scrubbed... URL: From hellowskyfal at gmail.com Tue May 13 09:52:31 2008 From: hellowskyfal at gmail.com (Stefano Sclaverano) Date: Tue, 13 May 2008 15:52:31 +0200 Subject: [vtkusers] vtkImageViewer and vtkLine Message-ID: Hi all, I think it could be a stupid question but I would know if it's possible and if someone has just done it... I'm tring to render an image Analyze 7.5 with vtkImageViewer and I want to put over this image a line to indicate me where I am with my cursor in the differents views (CORONAL, AXIAL, SAGITTAL). Not Problem with the visualisation but I cant arrive to render the line over the images... Someone knows how I can do it? Thanks. Stefano -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.gavana at gmail.com Tue May 13 09:57:05 2008 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Tue, 13 May 2008 14:57:05 +0100 Subject: [vtkusers] Modifying sphere radius from actor Message-ID: Hi All, I am visualizing a bunch of spheres, and depending on some user's choices, I need to change the radius and the colour of these spheres. So, instead of removing and re-creating the sphere actor every time I need to change some sphere property, I thought to use a suggestion from Amy I found in the archives: http://www.vtk.org/pipermail/vtkusers/2001-August/057091.html What I do, is something like this: sphereMapper = sphereActor.GetMapper() print "SOURCE:", sphereMapper.GetInput().GetSource() But this always prints "None" if I execute the attached code (in Python, using wxVTKRenderWindow). If you run the code, simply press any key: this activates the OnKeyDown method which tries to extract the vtkSphereSource from its mapper. Am I missing something? Is it possible to do what I am asking or I need to re-create every time the sphere, mapper and actor? Thank you for your suggestions. Andrea. # Begin Code import wx import vtk from vtk.wx.wxVTKRenderWindow import wxVTKRenderWindow from vtk.util.colors import red, green, blue class wxVTKRW(wxVTKRenderWindow): def __init__(self, parent): wxVTKRenderWindow.__init__(self, parent, -1) self.ren = vtk.vtkRenderer() self.GetRenderWindow().AddRenderer(self.ren) centers = [(0, 0, 0), (2, 2, 2), (-3, -3, -3)] colours = (red, green, blue) for center, colour in zip(centers, colours): sphere = vtk.vtkSphereSource() sphere.SetCenter(*center) sphereMapper = vtk.vtkPolyDataMapper() sphereMapper.SetInput(sphere.GetOutput()) sphereActor = vtk.vtkActor() sphereActor.SetMapper(sphereMapper) sphereActor.GetProperty().SetColor(colour) self.ren.AddActor(sphereActor) self.ren.ResetCamera() # Store the last actor self.lastActor = sphereActor def OnKeyDown(self, event): # Try to retrieve the sphere source # Here is where the problem lies: GetSource() returns None! sphereMapper = self.lastActor.GetMapper() print "SOURCE:", sphereMapper.GetInput().GetSource() #-------------------------------------------------------------------- def wxVTKRWExample(): """Like it says, just a simple example """ # every wx app needs an app app = wx.PySimpleApp() # create the top-level frame, sizer and wxVTKRWI frame = wx.Frame(None, -1, "wxVTKRWI", size=(600, 500)) frame.CenterOnScreen() widget = wxVTKRW(frame) # show the window frame.Show() app.MainLoop() if __name__ == "__main__": wxVTKRWExample() # End code "Imagination Is The Only Weapon In The War Against Reality." http://xoomer.alice.it/infinity77/ From goodwin.lawlor at ucd.ie Tue May 13 10:09:05 2008 From: goodwin.lawlor at ucd.ie (Goodwin Lawlor) Date: Tue, 13 May 2008 15:09:05 +0100 Subject: [vtkusers] Compilation error VTK wrap TCL (VTK 5.0.4 & TCL 8.5) In-Reply-To: References: <17806cba0805130357s1c0a70a7gadcbe082dce95fe2@mail.gmail.com> Message-ID: Goodwin Lawlor wrote: > Hi K. Subburaj, > > This usually happens when you are linking against a version of Tcl whose > resources haven't been included in VTK. > > Check here to see what you have: VTK\Utilities\TclTk\resources > > I think you will need to checkout a CVS version of VTK if you want to > link against Tcl8.5 or else downgrade your Tcl version to 8.4 > > I posted a patch to the bug tracker ( > http://public.kitware.com/Bug/view.php?id=3424 ) which allows VTK to > take the resources from the Tcl/Tk source tree - unfortunately the patch > didn't get copied onto the new tracker with the report. The patch is in the mailing list here too: http://www.vtk.org/pipermail/vtkusers/2006-June/085694.html From beromuald at wanadoo.fr Tue May 13 10:11:31 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Tue, 13 May 2008 16:11:31 +0200 (CEST) Subject: [vtkusers] vtkImageViewer and vtkLine Message-ID: <27333507.277561210687891385.JavaMail.www@wwinf2633> Hi Stefano, I think you have to draw your line at +0.01 on the image, because the line is draw under your image. Bye > Message du 13/05/08 15:53 > De : "Stefano Sclaverano" > A : vtkusers at vtk.org > Copie ? : > Objet : [vtkusers] vtkImageViewer and vtkLine > > Hi all, ? I think it could be a stupid question but?I would know if it's possible and if someone has just done it... I'm tring to render an image Analyze 7.5 with vtkImageViewer and I want to put over this image a line to indicate me where I am with my cursor in the differents views (CORONAL, AXIAL, SAGITTAL). Not Problem with the visualisation but I cant arrive to?render the line over the images... ? Someone knows how I can do it? ? Thanks. Stefano > > [ (pas de nom de fichier) (0.3 Ko) ] -------------- next part -------------- An HTML attachment was scrubbed... URL: From sajendra at gmail.com Tue May 13 11:21:22 2008 From: sajendra at gmail.com (Sajendra N) Date: Tue, 13 May 2008 11:21:22 -0400 Subject: [vtkusers] Reading ITK Deformation Field in VTK In-Reply-To: <4828C31C.6060005@kitware.com> References: <8151b65f0805121227j16ebab34ld1e5e7964360ee7@mail.gmail.com> <4828C31C.6060005@kitware.com> Message-ID: <8151b65f0805130821pf633b11wd79d84135786f22c@mail.gmail.com> Luis to answer your questions: a) The deformation field was generated from a Demons registration. b) BSplines was not used. c) The fixed and moving images have the same origin, spacing, and extents. There are arbitrary user defined points that I would want to map either from the moving image coordinate system into the fixed image coordinate system or vice-versa. d) I determine that the points mapped using VTK are wrong because they do not agree with the same points mapped using ITK. The points mapped through ITK agree very closely with what I "expect" given thatI know what the points represent. I am only mapping points when I have the problem I mentioned, not warping images, so I have not loaded any images into ParaView. e) As I mentioned, I am not using Paraview. I am using ITK 3.2.0 and VTK 5.0.2 I solved my immediate problem by doing everything in ITK, it would be nice to be able to map the points in VTK when needed as the API is sometimes more convenient and has support for inverting the transform when needed. -Sajendra On Mon, May 12, 2008 at 6:22 PM, Luis Ibanez wrote: > > Hi Sajendra, > > > a) From what type of ITK Deformable registration did you > generate this deformation field ? > > (e.g. Demons ?, FEM ?, BSplines ?) > > > b) If it was from using BSplines, > did you used a Bulk transform ? > > > c) The points that you are transforming, are they located > in the coordinate system of the Fixed image ? > and are you trying to map them to the coordinate > system of the moving image ? > > > d) What is your frame of reference for determining that > the mapped points are wrong ? have you loaded one of > the images into ParaView ? Does this image has an origin > different from Zero ? > > > e) What specific version of ParaView are you using ? > > > Please let us know, > > > Luis > > > ---------------- > > > Sajendra N wrote: > > > Hi everyone, > > > > After performing a deformable registration using ITK, I saved the > > resulting deformation field to disk in MetaImage format using > > itkImageFileWriter. > > I later read the deformation field from disk into VTK using > > vtkMetaImageReader and set that as the input to a vtkGridTransform > > which I use to transform points, however the point locations after > > transformation are wrong. > > If I do everything in ITK (reading the metaimage file, transforming > > points), I get the correct transformation. > > At least part of the problem was the the "POSITION" tag was not > > written in the header, it was written as "OFFSET" instead. I fixed > > that manually but I am still having problems. > > Is there a further incompatibility in the file formats? I am hoping > > someone has done this successfully in the past and had some ideas. > > I can provide sample data and code to reproduce the issue, but the > > data set might be rather large. > > > > Thank you, > > Sajendra > > > > > -- ?crasez l'inf?me! From fabiofz at gmail.com Tue May 13 14:34:01 2008 From: fabiofz at gmail.com (Fabio Zadrozny) Date: Tue, 13 May 2008 15:34:01 -0300 Subject: [vtkusers] Bug in vtkAssembly? Message-ID: Hi, I'm trying to debug some performance problems while using vtk, and after running it through a profiler (amd code analyst), it seems that the MTime of objects that are added to a vtkAssembly are changed upon any rendering (and that reflects in the MTime of the vtkAssembly itself -- and slow renders as a direct result of that). The code to reproduce it is attached (python). Should I open a bug with that? (I'm trying to figure out why that happens, but I'm not really very used to vtk code -- so, if someone else is able to take a look at it, it would be great). Thanks, Fabio p.s.: I'm using vtk 5.0.3 -------------- next part -------------- A non-text attachment was scrubbed... Name: profile_vtk.py Type: application/octet-stream Size: 3330 bytes Desc: not available URL: From evans at aps.anl.gov Tue May 13 15:39:29 2008 From: evans at aps.anl.gov (Kenneth Evans) Date: Tue, 13 May 2008 14:39:29 -0500 Subject: [vtkusers] wxPython & VTK: Problem with cone6.py in WX In-Reply-To: <006301c8b465$c5fe67e0$950836a4@aps.anl.gov> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> <6DAD69CEEC61453C8DDD5E0B1986496B@CICADA> <31ddba770805121013t64e510bco5add2af6edcf515b@mail.gmail.com> <006301c8b465$c5fe67e0$950836a4@aps.anl.gov> Message-ID: <004b01c8b531$0faead70$950836a4@aps.anl.gov> Hi, Attached is an attempt to use the cone6.py tutorial with WX. I have made the minimum changes to cone6.py that I thought necessary to make it run under WX. As such, it could serve as a more detailed example than given in wxVTKRenderWindow.py and wxVTKRenderWindowInteractor.py. It would have helped me to have had such an example (but perhaps working better ;-). There are two switches at the top of the file: USE_WX: True to use WX, False to do the original cone6.py. USE_INTERACTOR_ONLY: Only relevant if USE_WX = True. Explained below. The problem is that virtually all VTK examples have a vtkRenderWindow. The ones that use vtkRenderWindowInteractor add that in addition. I have been unable to successfully mimic that behavior. Perhaps someone can point out why. To show what happens, use USE_WX = True and USE_INTERACTOR_ONLY = False. It is possible to do what cone6.py does if you use a wxVTKRenderWindowInteractor _in place of_ the wxVTKRenderWindow and also use it in place of creating a separate wxVTKRenderWindowInteractor. This is what you get with USE_WX = True and USE_INTERACTOR_ONLY = True. While this seems to work, it entails more changes in modifying existing examples and is a different pattern than in dozens of VTK examples, including cone6.py, cone6.cxx, etc. I also feel it _should_ work this way. The problem seems to be that: iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) goes to: iren = wxVTKRenderWindowInteractor(frame, wx.ID_ANY) iren.SetRenderWindow(renWin.GetRenderWindow()) would be the appropriate change. However, this doesn't work well and gives a small plot scrunched up in the upper left corner of the frame. Have I done something wrong? In addition, using the wxVTKRenderWindowInteractor-only design pattern, while it works in this case, is crashing python.exe (with an invalid access error) in other cases. I won't present these here until I have banged on them more myself, but I mention them because perhaps the problem is with what I am doing here. Thanks for any help. -Ken -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Cone6WX.py URL: From lisa.avila at kitware.com Tue May 13 15:44:58 2008 From: lisa.avila at kitware.com (Lisa Avila) Date: Tue, 13 May 2008 15:44:58 -0400 Subject: [vtkusers] Reminder - Early Registration Deadline is May 15th Message-ID: <4829EFBA.8050002@kitware.com> ** Reminder - Early Registration deadline is May 15th ** Developer's Training Week will be held June 9 ? 13, 2008, in Albany, NY. Details ---------- Developer's Training Week will cover our open-source projects including VTK, ITK, ParaView and CMake. These hands-on courses are appropriate for both new users wishing to quickly gain proficiency and experienced developers requiring advanced customization skills. As an added bonus, this year the VTK course will be split into two tracks: Beginner and Advanced. Users who have taken the VTK course in the past are encouraged to attend the Advanced VTK track to learn new skills and functionalities that haven?t been covered in previous VTK trainings. Developer?s Training Week is a great opportunity to meet some of the key contributors to these open-source projects as well as other users in the open source community. As a course attendee, you will receive: - A complete set of course notes - The VTK User's Guide - The Visualization Toolkit textbook - The ITK Software Guide - The ParaView Guide - Mastering CMake - Snacks daily - Lunch (Monday through Thursday) - A dinner reception on both Monday and Wednesday evening The week will be divided into 9 half-day sessions, allowing attendees to customize their experience based on their individual requirements. The cost for registration, per half-day session, is $350 on or before May 15th and $400 from May 16th on. We are also offering a discounted full week registration rate of $2600 on or before May 15th and $2950 from May 16th on. Additional student or group discounts are available upon request. Note that attendees must register for a minimum of 3 half-day sessions. No prior experience is necessary; however, attendees are expected to have basic knowledge of C or C++ in order to fully participate in the interactive exercises. Kitware courses incorporate both technical presentations and practical exercises designed to reinforce learning. For an optimal learning experience each attendee should bring their own laptop computer to the courses. Approximately two weeks before the courses, attendees will receive detailed instructions on how to download, install and test all necessary software on their laptop computer. A limited number of course computers are available for attendees who are unable to bring one. Additional information is available by emailing courses at kitware.com or by calling 518-371-3971. From evans at aps.anl.gov Tue May 13 15:52:42 2008 From: evans at aps.anl.gov (Kenneth Evans) Date: Tue, 13 May 2008 14:52:42 -0500 Subject: [vtkusers] Problem with vtkRenderWindowInteractor with more than one widget In-Reply-To: <006301c8b465$c5fe67e0$950836a4@aps.anl.gov> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> <6DAD69CEEC61453C8DDD5E0B1986496B@CICADA> <31ddba770805121013t64e510bco5add2af6edcf515b@mail.gmail.com> <006301c8b465$c5fe67e0$950836a4@aps.anl.gov> Message-ID: <005501c8b532$e8483e20$950836a4@aps.anl.gov> Hi, I would like to use vtkRenderWindowInteractorwith more than one widget. Attached is an example that is like cone6.py but with a sphere added. The problem is that if I type "i" in the window, it only toggles the vtkBoxWidget on the cone and not on the sphere. In contrast, if I type "p" on either the cone or the sphere, it draws the pick box about that one --- the behavior I would think one would want. Is this a shortcoming of the vtkRenderWindowInteractor or am I doing something wrong? It would be nice to be able to make a vtk3DWidget-type widget appear and disappear independently on _any_ so-equiped object in the scene. Is there a way around it? (I would like to use this in Python or Java, so inheritance is not the way to go. The fact that it happens in C++ indicates it is in the implementation, not in the wrappers. Thanks, -Ken -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Interactor.cxx URL: From jordigh at gmail.com Tue May 13 17:22:22 2008 From: jordigh at gmail.com (=?ISO-8859-1?Q?Jordi_Guti=E9rrez_Hermoso?=) Date: Tue, 13 May 2008 16:22:22 -0500 Subject: [vtkusers] Possible 64 bit segfault In-Reply-To: <1210608191.22459.35.camel@gargon.hooperlab> References: <9543b3a40805102011g2764bcaek9e8a332576675c96@mail.gmail.com> <1210608191.22459.35.camel@gargon.hooperlab> Message-ID: <9543b3a40805131422v659950atcc4d21c651c6ccaa@mail.gmail.com> On 12/05/2008, Kevin H. Hobbs wrote: > > On Sat, 2008-05-10 at 22:11 -0500, Jordi Guti?rrez Hermoso wrote: > > I'm guessing this means that I need to fix the parser to produce > > vtkIdType in certain places instead of int? > > That sounds like a good bet. I think vtkIdType can also be 64 bits on 32 > bit systems if VTK_USE_64BIT_IDS is on. Hrm. Writing a parser is harder than I thought. I feel like I need to have taken a CS course in compilers to do this properly... I'll see if I can imitate the code for Python or Java and translate that to Octave... - Jordi G. H. From gonx1 at yahoo.com Tue May 13 20:43:57 2008 From: gonx1 at yahoo.com (justin goyanko) Date: Tue, 13 May 2008 17:43:57 -0700 (PDT) Subject: [vtkusers] vtkDataSets from 3DS files Message-ID: <87690.80693.qm@web38105.mail.mud.yahoo.com> Hi, I'm currently trying to get some vtkDataSets from 3DS files. From some similar posts on the mailing list some suggest on getting the data from the renderer itself. So far what i've done loading it to the renderer but i'm still not able to get the data via GetMapper(). I'm just wondering if i missed something =P It compiles ok but the program crashes when executed. Using VC++ Express 2008 on windows xp Below is a sample code: vtk3DSImporter *importer = vtk3DSImporter::New(); importer->ComputeNormalsOn(); importer->SetFileName("C:/vtk3ds_test/bunny.3DS"); importer->Read(); vtkRenderWindow* renWin = (importer->GetRenderWindow()); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(renWin); renWin->SetSize(300, 300); vtkRenderer* ren = (importer->GetRenderer()); ren->SetBackground(0.1, 0.2, 0.4); vtkActorCollection *acol = vtkActorCollection::New(); acol = ren->GetActors(); vtkActor *actor = vtkActor::New(); actor = acol->GetLastActor(); cout << "actor:" << actor->GetClassName() << endl; vtkOpenGLActor *oglActor = vtkOpenGLActor::New(); oglActor = (vtkOpenGLActor*)acol->GetLastActor(); cout << "oglActor: " << oglActor->GetClassName(); oglActor->GetMapper(); (ERROR ON THIS LINE) -------------- next part -------------- An HTML attachment was scrubbed... URL: From jourdain at artenum.com Wed May 14 03:22:26 2008 From: jourdain at artenum.com (Sebastien Jourdain) Date: Wed, 14 May 2008 09:22:26 +0200 Subject: [vtkusers] How to export a 3D scene in X3Db format in Java ? Message-ID: <06449759-C8B0-486F-94B7-571204ED8BF9@artenum.com> Hello everyone, I'm currently trying to export my 3D scene in an X3Db (binary) file format. I managed to make it work with the X3D format but not the X3Db one. The printed error is right below : [java] Cannot find required Class: x3dConverterClass [java] Invalid memory access of location 00000000 eip=0045bb09 [java] Java Result: 138 My source code : public static void main(String[] args) { String fileToLoad = args[0]; String fileToWrite = args[1]; String fastinfosetFilePath = args[2]; // init vtkPanel panel = new vtkPanel(); vtkActor actor = new vtkActor(); vtkDataSetMapper mapper = new vtkDataSetMapper(); vtkDataSetReader reader = new vtkDataSetReader(); vtkX3DExporter exporter = new vtkX3DExporter(); // Static method setting ? vtkX3DExporterJavaHelper helper = new vtkX3DExporterJavaHelper(); helper.SetFastInfosetJarLocation(fastinfosetFilePath); // set pipeline reader.SetFileName(fileToLoad); mapper.SetInput(reader.GetOutput()); actor.SetMapper(mapper); panel.GetRenderer().AddActor(actor); // Exporter configuration exporter.SetRenderWindow(panel.GetRenderWindow()); exporter.SetBinary(1); exporter.SetFileName(fileToWrite); exporter.Update(); exporter.Write(); } Thanks in advanced for your help, Seb From beromuald at wanadoo.fr Wed May 14 03:33:39 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Wed, 14 May 2008 09:33:39 +0200 (CEST) Subject: [vtkusers] How to use vtkPointPlacer? Message-ID: <23976054.459171210750419710.JavaMail.www@wwinf1c08> Nobody can help me? > Message du 13/05/08 14:50 > De : "Romuald BERTRAND" > A : vtkusers at public.kitware.com > Copie ? : > Objet : [vtkusers] How to use vtkPointPlacer? > > Hi all, For my work, I have to colorize some pixels on an image, and until now I use this algorithm: ??? vtkPoints* pts = vtkPoints::New(); ??? vtkDataArray* scalars = vtkUnsignedCharArray::New(); ??? scalars->SetNumberOfComponents(3); ??? //----------------------- ? ? //for(......... ? ? //I insert all of my points ? ? //----------------------- ??? vtkDiskSource* src = vtkDiskSource::New(); ??? src->SetRadialResolution(1); ??? src->SetCircumferentialResolution(15); ??? src->SetInnerRadius(0.0); ??? src->SetOuterRadius(1.0); ??? vtkPolyData* polyData = vtkPolyData::New(); ??? polyData->SetPoints(pts); ??? polyData->GetPointData()->SetScalars(scalars); ??? vtkGlyph3D* glyph = vtkGlyph3D::New(); ??? glyph->SetSourceConnection(src->GetOutputPort()); ??? glyph->SetInput(polyData); ??? glyph->SetColorModeToColorByScalar(); ??? glyph->SetScaleModeToDataScalingOff() ; ??? ??? vtkPolyData* outPut = glyph->GetOutput(); ??? vtkPolyDataMapper* mapper = vtkPolyDataMapper::New(); ??? mapper->SetInput(outPut); ??? actorColorize = vtkActor::New(); ??? actorColorize->SetMapper(mapper); ??? ??? viewer->GetRenderer()->AddActor(actorColorize); But this is not very smart, and this create disks, and I want to colorize just the pixels which are in my list. After, I have found the "vtkPointPlacer" class, but I don't find any explanations to use this. Can you help me please? Thanks for answers, Bye -------------- next part -------------- An HTML attachment was scrubbed... URL: From hellowskyfal at gmail.com Wed May 14 05:09:43 2008 From: hellowskyfal at gmail.com (Stefano Sclaverano) Date: Wed, 14 May 2008 11:09:43 +0200 Subject: [vtkusers] vtkImageViewer and vtkLine In-Reply-To: <27333507.277561210687891385.JavaMail.www@wwinf2633> References: <27333507.277561210687891385.JavaMail.www@wwinf2633> Message-ID: Hi all, Finally I drew the line in this way, but it's not very correct : . . . // The line definition seeds = vtkLineSource::New(); seeds->SetPoint1(0.0,0.0,0.0); seeds->SetPoint2(0.0,0.1,0.0); seeds->SetResolution(20); // The Line Mapper seedsMapper = vtkPolyDataMapper::New(); seedsMapper->SetInputConnection(seeds->GetOutputPort()); // The line Actor seedsActor = vtkActor::New(); seedsActor->SetMapper(seedsMapper); seedsActor->GetProperty()->SetColor(1.0,1.0,1.0); seedsActor->GetProperty()->SetRepresentationToPoints(); seedsActor->GetProperty()->SetOpacity(0.95); // The line Render seedsRen = vtkRenderer::New(); seedsRen->AddActor(seedsActor); seedsRen->SetViewport(0.499,0.0,0.501,1.0); // The ImageViewer Render ren = vtkRenderer::New(); // The general RenderWindow renWindow = vtkRenderWindow::New(); renWindow->AddRenderer(ren); renWindow->AddRenderer(seedsRen); // The Actor2D of ImageViewer ren->AddActor2D(viewer->GetActor2D()); // Render the entire world this->GetInteractor()->Render(); . . . All better ideas are welcome! Thanks 2008/5/13 Romuald BERTRAND : > Hi Stefano, > > I think you have to draw your line at +0.01 on the image, because the line > is draw under your image. > > Bye > > > > > > Message du 13/05/08 15:53 > > De : "Stefano Sclaverano" > > A : vtkusers at vtk.org > > Copie ? : > > Objet : [vtkusers] vtkImageViewer and vtkLine > > > > > > > Hi all, > > > > I think it could be a stupid question but I would know if it's possible > and if someone has just done it... > > I'm tring to render an image Analyze 7.5 with vtkImageViewer and I want to > put over this image a line to indicate me where I am with > > my cursor in the differents views (CORONAL, AXIAL, SAGITTAL). > > Not Problem with the visualisation but I cant arrive to render the line > over the images... > > > > Someone knows how I can do it? > > > > Thanks. > > Stefano > > > > > [ (pas de nom de fichier) (0.3 Ko) ] > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hadez803 at yahoo.com Wed May 14 06:47:37 2008 From: hadez803 at yahoo.com (hossein (hadez803)) Date: Wed, 14 May 2008 03:47:37 -0700 (PDT) Subject: [vtkusers] vtk & vs2008.net In-Reply-To: <791724.33752.qm@web51311.mail.re2.yahoo.com> Message-ID: <837094.52949.qm@web51311.mail.re2.yahoo.com> An HTML attachment was scrubbed... URL: From riechmann at ira.uka.de Wed May 14 07:44:59 2008 From: riechmann at ira.uka.de (Matthias Riechmann) Date: Wed, 14 May 2008 13:44:59 +0200 Subject: [vtkusers] Add scalars to polygons Message-ID: <482AD0BB.3020808@ira.uka.de> Hi there, is there some kind of filter or similar mechanism to add scalars to polydatas? I would like to load an stl file and set the scalars afterwards. Matthias -- Dipl.-Inform. Matthias Riechmann Institut f?r Prozessrechentechnik, Automation und Robotik Medizin-Gruppe Universit?t Karlsruhe (TH) Geb?ude 40.28, Zimmer 103 Engler-Bunte-Ring 8 76131 Karlsruhe Fon: +49 (721) 608-4049 Fax: +49 (721) 608-7141 Web: http://wwwipr.ira.uka.de/~richmann -------------- next part -------------- A non-text attachment was scrubbed... Name: riechmann.vcf Type: text/x-vcard Size: 518 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3319 bytes Desc: S/MIME Cryptographic Signature URL: From welucarell at equityeng.com Wed May 14 08:10:43 2008 From: welucarell at equityeng.com (William E Lucarell) Date: Wed, 14 May 2008 08:10:43 -0400 Subject: [vtkusers] Add scalars to polygons In-Reply-To: <482AD0BB.3020808@ira.uka.de> References: <482AD0BB.3020808@ira.uka.de> Message-ID: <001f01c8b5bb$8bd93980$a38bac80$@com> Below is a code example for setting scalars in polygonal data. I got it from http://public.kitware.com/pipermail/vtkusers/2004-January/071326.html VTK_LINE = 3 VTK_POLYGON = 7 # initialize polydata object polydata = vtk.vtkPolyData() polydata.SetLines(vtk.vtkCellArray()) polydata.SetPolys(vtk.vtkCellArray()) points = vtk.vtkPoints() # points for poly 1 (triangle) points.InsertNextPoint(0.2, 0.3, 0) points.InsertNextPoint(0.4, 0.55, 0) points.InsertNextPoint(0.2, 0.8, 0) # points for line 1 (line) points.InsertNextPoint(0.5, 0.3, 0) points.InsertNextPoint(0.5, 0.8, 0) # points for poly 2 (bar) points.InsertNextPoint(0.6, 0.3, 0) points.InsertNextPoint(0.8, 0.3, 0) points.InsertNextPoint(0.8, 0.8, 0) points.InsertNextPoint(0.6, 0.8, 0) polydata.SetPoints(points) # set scalar cell data colors = vtk.vtkFloatArray() polydata.GetCellData().SetScalars(colors) # create poly 1 ids = vtk.vtkIdList() ids.InsertNextId(0) ids.InsertNextId(1) ids.InsertNextId(2) cell = polydata.InsertNextCell(VTK_POLYGON, ids) # poly 1 should get the first color (red) colors.InsertTuple1(cell, 0.0) # create line 1 ids.Reset() ids.InsertNextId(3) ids.InsertNextId(4) cell = polydata.InsertNextCell(VTK_LINE, ids) # line 1 should get the second color (green) colors.InsertTuple1(cell, 1.0) # create poly 2 ids.Reset() ids.InsertNextId(5) ids.InsertNextId(6) ids.InsertNextId(7) ids.InsertNextId(8) cell = polydata.InsertNextCell(VTK_POLYGON, ids) # poly 2 should get the third color (blue) colors.InsertTuple1(cell, 2.0) # create reference poly with colors as they should be refpoly = vtk.vtkPolyData() refpoly.SetLines(vtk.vtkCellArray()) refpoly.GetCellData().SetScalars(colors) scalars = refpoly.GetCellData().GetScalars() print scalars.GetNumberOfTuples() refpoints = vtk.vtkPoints() refpoints.InsertNextPoint(0.2, 0.2, 0) refpoints.InsertNextPoint(0.4, 0.2, 0) refpoints.InsertNextPoint(0.6, 0.2, 0) refpoints.InsertNextPoint(0.8, 0.2, 0) refpoly.SetPoints(refpoints) ids.Reset() ids.InsertNextId(0) ids.InsertNextId(1) cell = refpoly.InsertNextCell(VTK_LINE, ids) ids.Reset() ids.InsertNextId(1) ids.InsertNextId(2) cell = refpoly.InsertNextCell(VTK_LINE, ids) ids.Reset() ids.InsertNextId(2) ids.InsertNextId(3) cell = refpoly.InsertNextCell(VTK_LINE, ids) # define colors lut = vtk.vtkLookupTable() lut.SetNumberOfTableValues(3) lut.SetTableRange(0, 2) lut.SetTableValue(0, 1.0, 0.0, 0.0, 1.0) # red lut.SetTableValue(1, 0.0, 1.0, 0.0, 1.0) # green lut.SetTableValue(2, 0.0, 0.0, 1.0, 1.0) # blue lut.Build() # create mapper and assign colortable polyMapper = vtk.vtkPolyDataMapper() polyMapper.SetInput(polydata) polyMapper.SetScalarModeToUseCellData() polyMapper.UseLookupTableScalarRangeOn() polyMapper.SetLookupTable(lut) coordinate = vtk.vtkCoordinate() coordinate.SetCoordinateSystemToNormalizedViewport() polyMapper2D = vtk.vtkPolyDataMapper2D() polyMapper2D.SetTransformCoordinate(coordinate) polyMapper2D.SetInput(polydata) polyMapper2D.SetScalarModeToUseCellData() polyMapper2D.UseLookupTableScalarRangeOn() polyMapper2D.SetLookupTable(lut) # same for the refpoly refpolyMapper = vtk.vtkPolyDataMapper() refpolyMapper.SetInput(refpoly) refpolyMapper.SetScalarModeToUseCellData() refpolyMapper.UseLookupTableScalarRangeOn() refpolyMapper.SetLookupTable(lut) refpolyMapper2D = vtk.vtkPolyDataMapper2D() refpolyMapper2D.SetTransformCoordinate(coordinate) refpolyMapper2D.SetInput(refpoly) refpolyMapper2D.SetScalarModeToUseCellData() refpolyMapper2D.UseLookupTableScalarRangeOn() refpolyMapper.SetLookupTable(lut) refpolyMapper2D.SetLookupTable(lut) # create actors polyActor = vtk.vtkActor() polyActor.SetMapper(polyMapper) polyActor2D = vtk.vtkActor2D() polyActor2D.SetMapper(polyMapper2D) refpolyActor = vtk.vtkActor() refpolyActor.SetMapper(refpolyMapper) refpolyActor2D = vtk.vtkActor2D() refpolyActor2D.SetMapper(refpolyMapper2D) # create renderers renderer = vtk.vtkRenderer() renderer.SetViewport(0, 0, 0.5, 1.0) renderer.AddActor(polyActor) renderer.AddActor(refpolyActor) renderer2D = vtk.vtkRenderer() renderer2D.SetViewport(0.5, 0.0, 1.0, 1.0) renderer2D.AddActor(polyActor2D) renderer2D.AddActor(refpolyActor2D) # render it renderWindow = vtk.vtkRenderWindow() renderWindow.SetSize(600,300) renderWindow.AddRenderer(renderer) renderWindow.AddRenderer(renderer2D) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renderWindow) renderWindow.Render() iren.Start() Hope this helps! Bill -----Original Message----- From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Matthias Riechmann Sent: Wednesday, May 14, 2008 7:45 AM To: vtkusers at vtk.org Subject: [vtkusers] Add scalars to polygons Hi there, is there some kind of filter or similar mechanism to add scalars to polydatas? I would like to load an stl file and set the scalars afterwards. Matthias -- Dipl.-Inform. Matthias Riechmann Institut f?r Prozessrechentechnik, Automation und Robotik Medizin-Gruppe Universit?t Karlsruhe (TH) Geb?ude 40.28, Zimmer 103 Engler-Bunte-Ring 8 76131 Karlsruhe Fon: +49 (721) 608-4049 Fax: +49 (721) 608-7141 Web: http://wwwipr.ira.uka.de/~richmann From evans at aps.anl.gov Wed May 14 10:01:59 2008 From: evans at aps.anl.gov (Kenneth Evans, Jr.) Date: Wed, 14 May 2008 09:01:59 -0500 Subject: [vtkusers] wxPython & VTK: Problem with cone6.py in WX In-Reply-To: <004b01c8b531$0faead70$950836a4@aps.anl.gov> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> <6DAD69CEEC61453C8DDD5E0B1986496B@CICADA> <31ddba770805121013t64e510bco5add2af6edcf515b@mail.gmail.com> <006301c8b465$c5fe67e0$950836a4@aps.anl.gov> <004b01c8b531$0faead70$950836a4@aps.anl.gov> Message-ID: Hi, I got it to work with the usual pattern of a vtkRenderWindow and a separate vtkRenderWindowInteractor (USE_WX = True and USE_INTERACTOR_ONLY = False in the example). The idea is to use a regular vtkRenderWindowInteractor, not a wxVTKRenderWindowInteractor. Thus: iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) goes to: iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin.GetRenderWindow()) instead of my first guess of: iren = wxVTKRenderWindowInteractor(frame, wx.ID_ANY) iren.SetRenderWindow(renWin.GetRenderWindow()) For some reason it zooms way in when you do this. I needed to add: if(USE_WX and not USE_INTERACTOR_ONLY): # Reset the camera (Seems to be needed) ren1.ResetCamera() It probably shouldn't change the zoom. The new version is attached. It seems to be a more detailed example of how to use VTK with WX than any I've found elsewhere. It shows two different ways. Any comments or criticism would be appreciated. -Ken -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Cone6WX.py URL: From peloquin at iastate.edu Wed May 14 10:37:56 2008 From: peloquin at iastate.edu (Catherine Peloquin) Date: Wed, 14 May 2008 09:37:56 -0500 Subject: [vtkusers] vtkOBJExporter and vtkOBJReader .obj files do not have colors Message-ID: <3a72f1140805140737o75cf8ac8t41f94d3add1bc802@mail.gmail.com> Hello all, I am using vtkOBJExporter and vtkOBJReader to save and load .obj files of colored surfaces. This works well, except that when I load in a saved .obj file, all objects are white. How can I maintain the colors, as well as the objects' geometry, when I load in .obj files? I save the files like so: vtkOBJExporter* vtkExporter = vtkOBJExporter::New(); vtkExporter->SetRenderWindow(renderWindowName); vtkExporter->SetFilePrefix(filename.c_str()); vtkExporter->Write(); And load files like so: vtkOBJReader* vtkReader = vtkOBJReader::New(); vtkReader->SetFileName(filename.c_str()); vtkReader->Update(); // force the VTK pipeline to update int nPoints = vtkReader->GetOutput()->GetNumberOfPoints(); vtkContourNormals = vtkPolyDataNormals::New(); vtkContourNormals->SetInput(vtkReader->GetOutput()); vtkContourNormals->SetFeatureAngle(60.0); vtkContourMapper = vtkPolyDataMapper::New(); vtkContourMapper->SetInput(vtkContourNormals->GetOutput()); vtkContourMapper->ScalarVisibilityOff(); //Then visualize the data Thanks, Catherine -------------- next part -------------- An HTML attachment was scrubbed... URL: From int64380 at stud.uni-stuttgart.de Wed May 14 10:43:45 2008 From: int64380 at stud.uni-stuttgart.de (Mohammad Nazrul Islam) Date: Wed, 14 May 2008 16:43:45 +0200 Subject: [vtkusers] vtkAssignAttribute : Target location for the attribute is Message-ID: <200805141643.AA966918474@studsv07.stud.uni-stuttgart.de> Hi, hope everybode is doing fine.I am trying to plot streamline using from structuredppoints and i have the following code. pl3d = vtk.vtkStructuredPointsReader() pl3d.SetFileName("flow-00010000.-000.vtk") pl3d.Update() aa=vtk.vtkAssignAttribute() aa.SetInputConnection(pl3d.GetOutputPort()) aa.Assign("OutArray","VECTORS","POINTS_DATA") print aa integ = vtk.vtkRungeKutta4() line=vtk.vtkLineSource() line.SetPoint1(12,0,12) line.SetPoint2(12,4,12) streamline=vtk.vtkStreamLine() streamline.SetInput(aa.GetOutput()) streamline.SetSource(line.GetOutput()) streamline.SetMaximumPropagationTime(500) streamline.SetStepLength(0.5) streamline.SetIntegrationStepLength(0.05) streamline.SetIntegrationDirectionToIntegrateBothDirections() streamline.SetIntegrator(integ) and the rendering staff. but I am getting the following message. ERROR: In/usr/local64/extra-packages/VTK-5.0.3/VTK/Graphics/vtkAssignAttribute.cxx, line 162 vtkAssignAttribute (0x86c8b0): Target location for the attribute is invalid. vtkAssignAttribute (0x86c8b0) Debug: Off Modified Time: 207 Reference Count: 3 Registered Events: (none) Executive: 0x876d60 ErrorCode: Success Information: 0x86c980 AbortExecute: Off Progress: 0 Progress Text: (None) Field name: (none) Field type: -1 Attribute type: -1 Input attribute type: -1 Attribute location: -1 Code anybody help pls. Thanks in advance, Mohammad From alcohol at gmx.de Wed May 14 11:08:43 2008 From: alcohol at gmx.de (alcohol at gmx.de) Date: Wed, 14 May 2008 17:08:43 +0200 Subject: [vtkusers] undefined symbol: JAWT_GetAWT Message-ID: <20080514150843.274510@gmx.net> Hi all, I installed VTK on my linux (ubuntu 8.04) machine (Java Wrapper option is enabled) with make, make install. If I try to run my Java app following error message is displayed: /usr/lib/jvm/java-6-sun-1.6.0.06/bin/java: symbol lookup error: /home/hakan/vtk/build/bin/libvtkRenderingJava.so.5.0.4: undefined symbol: JAWT_GetAWT - LD_LIBRARY_PATH is set to /usr/local/vtk-5.0/bin:/usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/:/home/hakan/vtk/build/bin/ - ccmake configuration parameter JAVA_AWT_LIBRARY is set to: /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libjawt.so Any ideas? Thanks -- Psssst! Schon vom neuen GMX MultiMessenger geh?rt? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger From hereimran at yahoo.com Wed May 14 11:09:51 2008 From: hereimran at yahoo.com (mohd imran) Date: Wed, 14 May 2008 08:09:51 -0700 (PDT) Subject: [vtkusers] how to find best fitting plane in an image Message-ID: <548034.22006.qm@web33802.mail.mud.yahoo.com> Hi everyone, I am new to this network and presently i am working on a project of volume estimation of an object in an image. my present task is to find the minimum volume of an object, from a 2d image. so can any one help me how to find best fitting plane in a 2d image. i am doing programing in vc++. thanks, Mohammed Imran Ahmed Biomedical Engg. Ratiborer Strasse 2+4, Zi-02-00-01 Erlangen, 91058 Germany. Mobile NO. 004917663086540 Send instant messages to your online friends http://uk.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlding at gmail.com Wed May 14 12:26:39 2008 From: carlding at gmail.com (Feng Ding) Date: Thu, 15 May 2008 00:26:39 +0800 Subject: [vtkusers] Possible to "convert" vtkPolyData to vtkImageData Message-ID: Dear list, I'm going to generate some 3D volume image data for testing. I'm wondering if it is possible to achieve this by filling image data inside some surface mesh models. Does VTK have any functionality to do this? Can someone give me a hint? Thanks. Best regards, DING Feng From evans at aps.anl.gov Wed May 14 12:50:05 2008 From: evans at aps.anl.gov (Kenneth Evans) Date: Wed, 14 May 2008 11:50:05 -0500 Subject: [vtkusers] Modifying sphere radius from actor In-Reply-To: References: Message-ID: <002b01c8b5e2$8fc15e70$950836a4@aps.anl.gov> Hi, I tried your example. Nothing happens for me on key down, so I didn't go any farther. Nevertheless, since you saved the actor as self.lastActor, why not just do: self.lastActor.GetProperty().SetColor(newColour) Or maybe I misunderstood. -Ken From wsales at gmail.com Wed May 14 14:37:21 2008 From: wsales at gmail.com (Wagner Sales) Date: Wed, 14 May 2008 15:37:21 -0300 Subject: [vtkusers] How to converting coordinates from dataset to view? Message-ID: <11b83aa60805141137k3b12e1fdo6649139cd8e52339@mail.gmail.com> Hi all, I'm trying to show marked points in a 2D view from a dataset in 3D view of segmented data from this dataset. To explain more: a) I have a DICOM dataset b) In 2D view I was marked some points to use in segmentation, done by ITK. The segmentation works fine, then I think my points are marked ok. c) After segmentation, I extract the polydata and show in a 3D view. d) Then, I try to create new points in 2D view and show in 3D. The points are created, but in 3D appears in a different location. Well, I think I need to convert the coordinates from the point and after that set manually the position of the point (a vtkActor) in 3D view. Are I'm correct? If yes, how to convert these coordinates? Are another more simple approach? Tks for any help, Wagner Sales -------------- next part -------------- An HTML attachment was scrubbed... URL: From wsales at gmail.com Wed May 14 15:10:12 2008 From: wsales at gmail.com (Wagner Sales) Date: Wed, 14 May 2008 16:10:12 -0300 Subject: [vtkusers] How to converting coordinates from dataset to view? - Part two Message-ID: <11b83aa60805141210y699a7d3ci89c6ed1d4b123db7@mail.gmail.com> Hi all, The following message was sent in some minutes ago. I'm trying to show marked points in a 2D view from a dataset in 3D view of segmented data from this dataset. To explain more: a) I have a DICOM dataset b) In 2D view I was marked some points to use in segmentation, done by ITK. The segmentation works fine, then I think my points are marked ok. c) After segmentation, I extract the polydata and show in a 3D view. d) Then, I try to create new points in 2D view and show in 3D. The points are created, but in 3D appears in a different location. Well, I think I need to convert the coordinates from the point and after that set manually the position of the point (a vtkActor) in 3D view. Are I'm correct? If yes, how to convert these coordinates? Are another more simple approach? Well, taking a look at my VTK book and some examples, I think I need to translate the dataset to global coordinates. This are done by the following code: double *Point::translateCoordinates(int x, int y, int z) { // m_CurrentImageData are a vtkImageData instance if(!m_CurrentImageData) { xyzCoords[0] = 0.0; xyzCoords[1] = 0.0; xyzCoords[2] = 0.0; return xyzCoords; } q[0] = x; q[1] = y; q[2] = z; cellNum = m_CurrentImageData->ComputeCellId(q); subID = m_CurrentImageData->GetCell( cellNum )->GetParametricCenter(paraCoords); int &subIDadd = subID; m_CurrentImageData->GetCell(cellNum)->EvaluateLocation(subIDadd, paraCoords, xyzCoords, vtkcellweights); return xyzCoords; } Then I'm trying to set the actor position using xyzCoords, but not working ( the point are in wrong position yet ). Any help? Thks in advance, Wagner Sales -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim.hutton at gmail.com Wed May 14 16:39:15 2008 From: tim.hutton at gmail.com (Tim Hutton) Date: Wed, 14 May 2008 21:39:15 +0100 Subject: [vtkusers] vtkOBJExporter and vtkOBJReader .obj files do not have colors In-Reply-To: <3a72f1140805140737o75cf8ac8t41f94d3add1bc802@mail.gmail.com> References: <3a72f1140805140737o75cf8ac8t41f94d3add1bc802@mail.gmail.com> Message-ID: The answer can be found in vtkOBJReader.cxx http://public.kitware.com/cgi-bin/viewcvs.cgi/IO/vtkOBJReader.cxx?view=markup from "This is only partial support for the OBJ format..." No colour information is loaded from OBJ files. If we can work out which OBJ tags to support and how to map the information onto VTK structures we could add it. Sorry to disappoint, Tim On Wed, May 14, 2008 at 3:37 PM, Catherine Peloquin wrote: > Hello all, > > I am using vtkOBJExporter and vtkOBJReader to save and load .obj files of > colored surfaces. This works well, except that when I load in a saved .obj > file, all objects are white. How can I maintain the colors, as well as the > objects' geometry, when I load in .obj files? > > I save the files like so: > vtkOBJExporter* vtkExporter = vtkOBJExporter::New(); > vtkExporter->SetRenderWindow(renderWindowName); > vtkExporter->SetFilePrefix(filename.c_str()); > vtkExporter->Write(); > > And load files like so: > vtkOBJReader* vtkReader = vtkOBJReader::New(); > vtkReader->SetFileName(filename.c_str()); > vtkReader->Update(); // force the VTK pipeline to update > int nPoints = vtkReader->GetOutput()->GetNumberOfPoints(); > vtkContourNormals = vtkPolyDataNormals::New(); > vtkContourNormals->SetInput(vtkReader->GetOutput()); > vtkContourNormals->SetFeatureAngle(60.0); > vtkContourMapper = vtkPolyDataMapper::New(); > vtkContourMapper->SetInput(vtkContourNormals->GetOutput()); > vtkContourMapper->ScalarVisibilityOff(); > //Then visualize the data > > Thanks, > Catherine > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -- Tim Hutton - http://www.sq3.org.uk Take the Organic Builder challenge - http://www.sq3.org.uk/Evolution/Squirm3/OrganicBuilder/ From marius.erdt at gmx.de Thu May 15 04:30:04 2008 From: marius.erdt at gmx.de (Marius Erdt) Date: Thu, 15 May 2008 10:30:04 +0200 Subject: [vtkusers] Slow vtkPolyDataToImageStencil Message-ID: <482BF48C.9040401@gmx.de> Hi, I'm using the vtkPolyDataToImageStencil Filter to convert a polyData mesh into vtkImageStencilData which I want to use to mask an area in another volume. However, the filter takes a large amount of time to run (> 25 minutes on a Quad 6600 2,4 GHz). The mesh itself is the result of VTK marching cubes and is not very complex (one konvex object). Below is the code fragment I took from this list for the conversion. Thanks for any help, Marius vtkPolyDataNormals * normalsFilter = vtkPolyDataNormals::New(); normalsFilter->SetInput( polyData ); normalsFilter->SetFeatureAngle(50); normalsFilter->SetConsistency(1); normalsFilter->SetSplitting(1); normalsFilter->SetFlipNormals(0); normalsFilter->Update(); vtkPolyDataToImageStencil * surfaceConverter = vtkPolyDataToImageStencil::New(); surfaceConverter->SetInput( normalsFilter->GetOutput() ); surfaceConverter->SetTolerance( 0.0 ); surfaceConverter->Update(); From simon.esneault at gmail.com Thu May 15 04:36:48 2008 From: simon.esneault at gmail.com (Simon ESNEAULT) Date: Thu, 15 May 2008 10:36:48 +0200 Subject: [vtkusers] Possible to "convert" vtkPolyData to vtkImageData In-Reply-To: References: Message-ID: <9459eb850805150136m3b2efbccp704097c9a0a509ea@mail.gmail.com> Hi, Not sure to understand what you really want, but if it is a "rasterization" process yout can use vtkSelectEnclosedPoints (maybe only on CVS) Regards Simon On Wed, May 14, 2008 at 6:26 PM, Feng Ding wrote: > > Dear list, > > I'm going to generate some 3D volume image data for testing. I'm > wondering if it is possible to achieve this by filling image data > inside some surface mesh models. Does VTK have any functionality to do > this? Can someone give me a hint? Thanks. > > Best regards, > DING Feng > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers -- ------------------------------------------------------------------ Simon Esneault Laboratoire Traitement du Signal et de l'Image, (LTSI, UMR-INSERM 642) Universit? de Rennes I, Campus de Beaulieu, 35042 Rennes Cedex, France. Tel : +33 (0)6 64 61 30 94 Mail : simon.esneault at univ-rennes1.fr ------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.bottino at polito.it Thu May 15 05:46:40 2008 From: andrea.bottino at polito.it (Andrea Bottino) Date: Thu, 15 May 2008 11:46:40 +0200 Subject: [vtkusers] 3D morphing of polygonal surface Message-ID: <482C0680.2020201@polito.it> An HTML attachment was scrubbed... URL: From andrea.gavana at gmail.com Thu May 15 06:19:21 2008 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Thu, 15 May 2008 11:19:21 +0100 Subject: [vtkusers] Modifying sphere radius from actor In-Reply-To: <002b01c8b5e2$8fc15e70$950836a4@aps.anl.gov> References: <002b01c8b5e2$8fc15e70$950836a4@aps.anl.gov> Message-ID: Hi Kenneth, On Wed, May 14, 2008 at 5:50 PM, Kenneth Evans wrote: > Hi, > > I tried your example. Nothing happens for me on key down, so I didn't go > any farther. If you are on Windows, you should see something printed in the command window when you press whatever key you want. > Nevertheless, since you saved the actor as self.lastActor, why > not just do: > > self.lastActor.GetProperty().SetColor(newColour) The main problem is not the colour, as I know how to change that in an actor... my question was: from the actor, is there any way I can get back the vtkSphereSource to change its radius, center and so on? It looks possible in C++ (as Amy pointed out) but in Python calling GetSource() always returns None. Andrea. "Imagination Is The Only Weapon In The War Against Reality." http://xoomer.alice.it/infinity77/ From david.gobbi at gmail.com Thu May 15 06:32:15 2008 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 15 May 2008 06:32:15 -0400 Subject: [vtkusers] Slow vtkPolyDataToImageStencil In-Reply-To: <482BF48C.9040401@gmx.de> References: <482BF48C.9040401@gmx.de> Message-ID: <48a17b780805150332s523af6eep28faf68edef6a5e@mail.gmail.com> Hi Marius, You have to tell vtkPolyDataToImageStencil what OutputWholeExtent to use, otherwise it will generate the largest possible output extent. The easiest way to do this (in VTK 5.2 and VTK cvs) is to use the SetInformationInput() method to specify a vtkImageData that has the same extent that you want vtkPolyDataToImageStencil to use. The other way is to call SetOutputWholeExtent() to set the extent manually. See the doxygen page for a full description of how to use these methods. David On Thu, May 15, 2008 at 4:30 AM, Marius Erdt wrote: > Hi, > > I'm using the vtkPolyDataToImageStencil Filter to convert a polyData mesh > into vtkImageStencilData which I want to use to mask an area in another > volume. > However, the filter takes a large amount of time to run (> 25 minutes on a > Quad 6600 2,4 GHz). The mesh itself is the result of VTK marching cubes and > is not very complex (one konvex object). > > Below is the code fragment I took from this list for the conversion. > > Thanks for any help, > > Marius > > vtkPolyDataNormals * normalsFilter = vtkPolyDataNormals::New(); > normalsFilter->SetInput( polyData ); > normalsFilter->SetFeatureAngle(50); > normalsFilter->SetConsistency(1); > normalsFilter->SetSplitting(1); > normalsFilter->SetFlipNormals(0); > normalsFilter->Update(); > > vtkPolyDataToImageStencil * surfaceConverter = > vtkPolyDataToImageStencil::New(); > surfaceConverter->SetInput( normalsFilter->GetOutput() ); > surfaceConverter->SetTolerance( 0.0 ); > surfaceConverter->Update(); > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > From david.gobbi at gmail.com Thu May 15 06:48:57 2008 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 15 May 2008 06:48:57 -0400 Subject: [vtkusers] Possible to "convert" vtkPolyData to vtkImageData In-Reply-To: <9459eb850805150136m3b2efbccp704097c9a0a509ea@mail.gmail.com> References: <9459eb850805150136m3b2efbccp704097c9a0a509ea@mail.gmail.com> Message-ID: <48a17b780805150348s4ad43bddoffc5ccd8ba23b91d@mail.gmail.com> Feng, The vtkPolyDataToImageStencil filter will do what you want. Look at Hybrid/Testing/Tcl/TestImageStencilWithPolydata.tcl. For image data, I wouldn't advise using a generic filter like vtkSelectEnclosedPoints because it will be quite slow. David On Thu, May 15, 2008 at 4:36 AM, Simon ESNEAULT wrote: > Hi, > > Not sure to understand what you really want, but if it is a "rasterization" > process yout can use vtkSelectEnclosedPoints (maybe only on CVS) > > Regards > Simon > > On Wed, May 14, 2008 at 6:26 PM, Feng Ding wrote: >> >> Dear list, >> >> I'm going to generate some 3D volume image data for testing. I'm >> wondering if it is possible to achieve this by filling image data >> inside some surface mesh models. Does VTK have any functionality to do >> this? Can someone give me a hint? Thanks. >> >> Best regards, >> DING Feng >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers > > > > -- > ------------------------------------------------------------------ > Simon Esneault > Laboratoire Traitement du Signal et de l'Image, (LTSI, UMR-INSERM 642) > Universit? de Rennes I, Campus de Beaulieu, > 35042 Rennes Cedex, France. > Tel : +33 (0)6 64 61 30 94 > Mail : simon.esneault at univ-rennes1.fr > ------------------------------------------------------------------ > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > From tarekbensaid at gmail.com Thu May 15 07:07:36 2008 From: tarekbensaid at gmail.com (ben said tarek) Date: Thu, 15 May 2008 13:07:36 +0200 Subject: [vtkusers] Reading a 2D DICOM Series and Writing a Volume Message-ID: <8a5cac3a0805150407o399373b9jff4b9dd8de7390de@mail.gmail.com> Hi, I have 2D dicom images and I'd like to convert it to a volume format. So, I used DicomSeriesReadImageWrite2 from itk and it generates a vtk file. (binary or ascii file). My problem consist on the visualization on this file in vtk !!! If anyone can help me ? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From w_e_b_m_a_s_t_e_r_6_9 at hotmail.com Thu May 15 10:22:51 2008 From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com (Cameron Burnett) Date: Fri, 16 May 2008 00:22:51 +1000 Subject: [vtkusers] My program refuses to exit In-Reply-To: <482B32E9.9000409@kitware.com> References: <4818DCF9.3040306@kitware.com> <4821D26D.9010300@kitware.com> <482A1223.7000600@kitware.com> <482B32E9.9000409@kitware.com> Message-ID: Whenever I close my program (with either the exit button i made, or the X at the top-right of the screen) the process keeps on going. I have to actually click the stop button on visual c++ in order to stop it, and if I run it outside vc++ I have to close the process in the task manager. I've got a feeling its got something to do with the render window interactor I made for my clipping plane box widget, since iren is actually an infinite loop. Note that I've called Delete on absolutely everything, and tried various ways to remove or disable (or both) the iren, but to no avail. The reason why this is such a problem is because originally my RAM was free after this method, and now it keeps holding quite a lot (which is a huge problem for the rest of my stuff). So I'm guessing that if I fix the exit problem I will also fix my memory release problem also. Maybe someone can have a look at the problem section and see if there is anything I need to do? I've called delete on everything below this section, so don't worry about that. Thanks. vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(this->pvtkMFCWindow->GetRenderWindow()); vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New(); iren->SetInteractorStyle(style); style->Delete(); boxWidget = vtkBoxWidget::New(); boxWidget->SetInteractor(iren); boxWidget->SetPlaceFactor(1); boxWidget->SetProp3D(volume); boxWidget->PlaceWidget(); boxWidget->InsideOutOn(); vtkMyCallback *callback = vtkMyCallback::New(); callback->volumeMapper = mapper; boxWidget->AddObserver(vtkCommand::InteractionEvent, callback); callback->Delete(); boxWidget->On(); iren->Initialize(); iren->Start(); iren->Delete(); _________________________________________________________________ Be part of history. Take part in Australia's first e-mail archive with Email Australia. http://emailaustralia.ninemsn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.bottino at polito.it Thu May 15 13:00:40 2008 From: andrea.bottino at polito.it (Andrea Bottino) Date: Thu, 15 May 2008 19:00:40 +0200 Subject: [vtkusers] 3D morphing of polygonal surface Message-ID: <482C6C38.8020404@polito.it> (I apologize for multiple copies, but my previous msg apparently never reached the list) one question before reinventing the wheel... I have to morph a 3D polygonal model into another. I've been able to do it by constraining a transformation choosing a set of correspondences on the two surfaces. However, these were selected at hand. I need something that does the morphing automatically. I've read that some derivations of the iterative closest point (considering non affine transformations) does this, however in VTK only affine transformations are coded. The 3Dmorph test program also was not of any help. Does anybody have some suggestions? -- Andrea Bottino Politecnico di Torino, DAUIN Corso Duca degli Abruzzi, 24 10129 Torino ITALY Tel +39 011 5647175 / Fax +39 011 5647099 http://www.polito.it/cgvg From beromuald at wanadoo.fr Fri May 16 09:02:17 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Fri, 16 May 2008 15:02:17 +0200 (CEST) Subject: [vtkusers] How to change pixel color? Message-ID: <17686669.642951210942937001.JavaMail.www@wwinf1510> Hi all, I have to display an image for my work. After, I have to change the color of several pixels, I don't know why. I have a vtkImageData, and I have search some methods to set the scalars of the pixels which are stored in, but I don't arrived. Someone could help me? Thanks for answers. Romuald -------------- next part -------------- An HTML attachment was scrubbed... URL: From yenanqu at scs.fsu.edu Fri May 16 14:03:03 2008 From: yenanqu at scs.fsu.edu (yenanqu at scs.fsu.edu) Date: Fri, 16 May 2008 14:03:03 -0400 Subject: [vtkusers] How to change pixel color? In-Reply-To: <17686669.642951210942937001.JavaMail.www@wwinf1510> References: <17686669.642951210942937001.JavaMail.www@wwinf1510> Message-ID: <20080516140303.p3babges8c4kss00@email.scs.fsu.edu> Did you retrieve pixel data from vtkImageData seccessfully? Yenan Quoting Romuald BERTRAND : > Hi all, > > I have to display an image for my work. After, I have to change the > color of several pixels, I don't know why. I have a vtkImageData, > and I have search some methods to set the scalars of the pixels > which are stored in, but I don't arrived. > > Someone could help me? > > Thanks for answers. > > Romuald > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From markww at gmail.com Fri May 16 14:14:13 2008 From: markww at gmail.com (Mark Wyszomierski) Date: Fri, 16 May 2008 14:14:13 -0400 Subject: [vtkusers] How to change pixel color? In-Reply-To: <20080516140303.p3babges8c4kss00@email.scs.fsu.edu> References: <17686669.642951210942937001.JavaMail.www@wwinf1510> <20080516140303.p3babges8c4kss00@email.scs.fsu.edu> Message-ID: Yeah once you get a pointer to the pixel data in vtkImageData you can manipulate it however you want. It's just an array of values. Mark On 5/16/08, yenanqu at scs.fsu.edu wrote: > Did you retrieve pixel data from vtkImageData seccessfully? > > > Yenan > Quoting Romuald BERTRAND : > >> Hi all, >> >> I have to display an image for my work. After, I have to change the >> color of several pixels, I don't know why. I have a vtkImageData, >> and I have search some methods to set the scalars of the pixels >> which are stored in, but I don't arrived. >> >> Someone could help me? >> >> Thanks for answers. >> >> Romuald >> >> -- >> This message has been scanned for viruses and >> dangerous content by MailScanner, and is >> believed to be clean. >> >> > > > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > From yenanqu at scs.fsu.edu Fri May 16 14:27:11 2008 From: yenanqu at scs.fsu.edu (yenanqu at scs.fsu.edu) Date: Fri, 16 May 2008 14:27:11 -0400 Subject: [vtkusers] How to change pixel color? In-Reply-To: References: <17686669.642951210942937001.JavaMail.www@wwinf1510> <20080516140303.p3babges8c4kss00@email.scs.fsu.edu> Message-ID: <20080516142711.y23bvz6sgg8sc4cc@email.scs.fsu.edu> How to get pointer from vtkImageData is the hardest thing,which I still can not make it. //id is vtkImageData int *uExtent = id->GetUpdateExtent(); pPix = (unsigned char*)id->GetScalarPointer(uExtent[0], uExtent[2], uExtent[4]); or pPix = (unsigned char*)id->GetScalarPointer(); the only method I could find out. It didn't work for me. try it to see if it works for you. Yenan Quoting Mark Wyszomierski : > Yeah once you get a pointer to the pixel data in vtkImageData you can > manipulate it however you want. It's just an array of values. > > Mark > > On 5/16/08, yenanqu at scs.fsu.edu wrote: >> Did you retrieve pixel data from vtkImageData seccessfully? >> >> >> Yenan >> Quoting Romuald BERTRAND : >> >>> Hi all, >>> >>> I have to display an image for my work. After, I have to change the >>> color of several pixels, I don't know why. I have a vtkImageData, >>> and I have search some methods to set the scalars of the pixels >>> which are stored in, but I don't arrived. >>> >>> Someone could help me? >>> >>> Thanks for answers. >>> >>> Romuald >>> >>> -- >>> This message has been scanned for viruses and >>> dangerous content by MailScanner, and is >>> believed to be clean. >>> >>> >> >> >> >> ---------------------------------------------------------------- >> This message was sent using IMP, the Internet Messaging Program. >> >> >> -- >> This message has been scanned for viruses and >> dangerous content by MailScanner, and is >> believed to be clean. >> >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From markww at gmail.com Fri May 16 15:35:05 2008 From: markww at gmail.com (Mark Wyszomierski) Date: Fri, 16 May 2008 15:35:05 -0400 Subject: [vtkusers] How to change pixel color? In-Reply-To: <20080516142711.y23bvz6sgg8sc4cc@email.scs.fsu.edu> References: <17686669.642951210942937001.JavaMail.www@wwinf1510> <20080516140303.p3babges8c4kss00@email.scs.fsu.edu> <20080516142711.y23bvz6sgg8sc4cc@email.scs.fsu.edu> Message-ID: >> pPix = (unsigned char*)id->GetScalarPointer(); That should work, I've used it many times for instance in this project: http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 I show the value of the pixel that the mouse is over. Maybe there's something else going on in your pipeline? Mark On 5/16/08, yenanqu at scs.fsu.edu wrote: > How to get pointer from vtkImageData is the hardest thing,which I > still can not make it. > > //id is vtkImageData > int *uExtent = id->GetUpdateExtent(); > pPix = (unsigned char*)id->GetScalarPointer(uExtent[0], uExtent[2], > uExtent[4]); > > or > > pPix = (unsigned char*)id->GetScalarPointer(); > > the only method I could find out. It didn't work for me. try it to see > if it works for you. > > Yenan > > Quoting Mark Wyszomierski : > >> Yeah once you get a pointer to the pixel data in vtkImageData you can >> manipulate it however you want. It's just an array of values. >> >> Mark >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: >>> Did you retrieve pixel data from vtkImageData seccessfully? >>> >>> >>> Yenan >>> Quoting Romuald BERTRAND : >>> >>>> Hi all, >>>> >>>> I have to display an image for my work. After, I have to change the >>>> color of several pixels, I don't know why. I have a vtkImageData, >>>> and I have search some methods to set the scalars of the pixels >>>> which are stored in, but I don't arrived. >>>> >>>> Someone could help me? >>>> >>>> Thanks for answers. >>>> >>>> Romuald >>>> >>>> -- >>>> This message has been scanned for viruses and >>>> dangerous content by MailScanner, and is >>>> believed to be clean. >>>> >>>> >>> >>> >>> >>> ---------------------------------------------------------------- >>> This message was sent using IMP, the Internet Messaging Program. >>> >>> >>> -- >>> This message has been scanned for viruses and >>> dangerous content by MailScanner, and is >>> believed to be clean. >>> >>> _______________________________________________ >>> This is the private VTK discussion list. >>> Please keep messages on-topic. Check the FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> Follow this link to subscribe/unsubscribe: >>> http://www.vtk.org/mailman/listinfo/vtkusers >>> >> >> -- >> This message has been scanned for viruses and >> dangerous content by MailScanner, and is >> believed to be clean. >> >> > > > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > From wsales at gmail.com Fri May 16 18:43:14 2008 From: wsales at gmail.com (Wagner Sales) Date: Fri, 16 May 2008 19:43:14 -0300 Subject: [vtkusers] How to converting coordinates from dataset to view? - Part two In-Reply-To: <11b83aa60805141210y699a7d3ci89c6ed1d4b123db7@mail.gmail.com> References: <11b83aa60805141210y699a7d3ci89c6ed1d4b123db7@mail.gmail.com> Message-ID: <11b83aa60805161543o6fedae2asbcb884a7054408e9@mail.gmail.com> Hi all, This answer are just for future searches in the list. The code and approach are right. The problem was other, that's don't need to be mentioned here since aren't VTK related. Regards, Wagner Sales 2008/5/14 Wagner Sales : > Hi all, > > The following message was sent in some minutes ago. > I'm trying to show marked points in a 2D view from a dataset in 3D view of > segmented data from this dataset. To explain more: > a) I have a DICOM dataset > b) In 2D view I was marked some points to use in segmentation, done by ITK. > The segmentation works fine, then I think my points are marked ok. > c) After segmentation, I extract the polydata and show in a 3D view. > d) Then, I try to create new points in 2D view and show in 3D. The points > are created, but in 3D appears in a different location. > Well, I think I need to convert the coordinates from the point and after > that set manually the position of the point (a vtkActor) in 3D view. > > Are I'm correct? If yes, how to convert these coordinates? Are another more > simple approach? > > Well, taking a look at my VTK book and some examples, I think I need to > translate the dataset to global coordinates. This are done by the following > code: > > double *Point::translateCoordinates(int x, int y, int z) > { > // m_CurrentImageData are a vtkImageData instance > if(!m_CurrentImageData) > { > xyzCoords[0] = 0.0; > xyzCoords[1] = 0.0; > xyzCoords[2] = 0.0; > return xyzCoords; > } > q[0] = x; > q[1] = y; > q[2] = z; > cellNum = m_CurrentImageData->ComputeCellId(q); > subID = m_CurrentImageData->GetCell( cellNum > )->GetParametricCenter(paraCoords); > int &subIDadd = subID; > m_CurrentImageData->GetCell(cellNum)->EvaluateLocation(subIDadd, > paraCoords, > xyzCoords, vtkcellweights); > return xyzCoords; > } > > Then I'm trying to set the actor position using xyzCoords, but not working > ( the point are in wrong position yet ). Any help? > > Thks in advance, > > Wagner Sales -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.jefferson at qq.com Fri May 16 23:25:58 2008 From: mark.jefferson at qq.com (=?ISO-8859-1?B?TWFyayBKZWZmZXJzb24=?=) Date: Sat, 17 May 2008 11:25:58 +0800 Subject: [vtkusers] How to save the stenciled images? Message-ID: Hi, vtkusers, I have stenciled one CT image successfully, and I want to extract a ROI in another CT image. but how to save the stenciled images? of course, I could use vtkBMPWriter or vtkJPEGWriter to save the stenciled images to be .bmp or .jpg images, but this is not the best method, I think. on the one hand, if I save the stenciled images to be .bmp images, there would be many many many images that I need to save, and some message would be lost, because the pixel's range in CT image is 0-4095 while in bmp image is 0-255. on the other hand, if I want to see the prior image before I extract another image, I should read the images, it is very complex. so I want to know, is there any class in VTK that could save the images temporarily and then save them to be one .vtk file after I have extracted all the images? if there is no, could you give me any better suggestion? thank you very much! M.J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From evans at aps.anl.gov Sat May 17 09:01:51 2008 From: evans at aps.anl.gov (Kenneth Evans, Jr.) Date: Sat, 17 May 2008 08:01:51 -0500 Subject: [vtkusers] Modifying sphere radius from actor Message-ID: Andrea, >> If you are on Windows, you should see something printed in the command window when you press whatever key you want. Nothing happened when I pressed any keys. I noticed later that I got all the output when the program closes. I am not experienced with events in VTK (but wouldn't mind learning). It turned out this was actually because stdout wasn't being flushed, not the events. (I wasn't running it directly from a console.) My fault, but I haven't had trouble before with printing debug statements. However, in looking at things now that I can print, what I find is that: vtkPloyDataMapper.GetInput is a vtkPolyData which is a vtkDataObject which has a GetSouce which returns a vtkSource but a vtkSphereSource is not a vtkSource So I would not expect this to work, or at least not be surprised that it isn't. (Assuming I did all the tracing right ;-) In any event, if you print the vtkPolyDataMapper.GetInput() when it is created, then the source is None at that time. You can't even use SetSource because the vtkSphereSource is not a vtkSource. >> The main problem is not the colour, ... I understand. However, I don't then know exactly what you are trying to accomplish. It looks as though you are trying to change the sphere. Why not keep a reference to the sphere (which you have to do anyway to keep it from being garbage collected) instead of (or in addition to) the sphereMapper? It does look to me as though this approach won't work. -Ken From hiba_vtk at yahoo.fr Sat May 17 09:28:32 2008 From: hiba_vtk at yahoo.fr (C. Hiba) Date: Sat, 17 May 2008 13:28:32 +0000 (GMT) Subject: [vtkusers] Link between ITK and VTK Message-ID: <380847.26998.qm@web28304.mail.ukl.yahoo.com> An HTML attachment was scrubbed... URL: From hiba_vtk at yahoo.fr Sat May 17 09:29:00 2008 From: hiba_vtk at yahoo.fr (C. Hiba) Date: Sat, 17 May 2008 13:29:00 +0000 (GMT) Subject: [vtkusers] Link between ITK and VTK Message-ID: <696662.19485.qm@web28308.mail.ukl.yahoo.com> An HTML attachment was scrubbed... URL: From PeterMethfessel at gmx.de Sat May 17 13:21:50 2008 From: PeterMethfessel at gmx.de (Peter Methfessel) Date: Sat, 17 May 2008 19:21:50 +0200 Subject: [vtkusers] vtkusers Digest, Vol 49, Issue 16 References: Message-ID: <001b01c8b842$7ee99a10$7d02a8c0@joker> Send vtkusers mailing list submissions to vtkusers at vtk.org To subscribe or unsubscribe via the World Wide Web, visit http://www.vtk.org/mailman/listinfo/vtkusers or, via email, send a message with subject or body 'help' to vtkusers-request at vtk.org You can reach the person managing the list at vtkusers-owner at vtk.org When replying, please edit your Subject line so it is more specific than "Re: Contents of vtkusers digest..." Today's Topics: 1. 3D morphing of polygonal surface (Andrea Bottino) 2. How to change pixel color? (Romuald BERTRAND) 3. Re: How to change pixel color? (yenanqu at scs.fsu.edu) 4. Re: How to change pixel color? (Mark Wyszomierski) 5. Re: How to change pixel color? (yenanqu at scs.fsu.edu) 6. Re: How to change pixel color? (Mark Wyszomierski) 7. Re: How to converting coordinates from dataset to view? - Part two (Wagner Sales) 8. How to save the stenciled images? ( Mark Jefferson ) 9. Re: Modifying sphere radius from actor (Kenneth Evans, Jr.) 10. Link between ITK and VTK (C. Hiba) 11. Link between ITK and VTK (C. Hiba) ---------------------------------------------------------------------- Message: 1 Date: Thu, 15 May 2008 19:00:40 +0200 From: Andrea Bottino Subject: [vtkusers] 3D morphing of polygonal surface To: VTK Users Message-ID: <482C6C38.8020404 at polito.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed (I apologize for multiple copies, but my previous msg apparently never reached the list) one question before reinventing the wheel... I have to morph a 3D polygonal model into another. I've been able to do it by constraining a transformation choosing a set of correspondences on the two surfaces. However, these were selected at hand. I need something that does the morphing automatically. I've read that some derivations of the iterative closest point (considering non affine transformations) does this, however in VTK only affine transformations are coded. The 3Dmorph test program also was not of any help. Does anybody have some suggestions? -- Andrea Bottino Politecnico di Torino, DAUIN Corso Duca degli Abruzzi, 24 10129 Torino ITALY Tel +39 011 5647175 / Fax +39 011 5647099 http://www.polito.it/cgvg ------------------------------ Message: 2 Date: Fri, 16 May 2008 15:02:17 +0200 (CEST) From: Romuald BERTRAND Subject: [vtkusers] How to change pixel color? To: vtkusers at vtk.org Message-ID: <17686669.642951210942937001.JavaMail.www at wwinf1510> Content-Type: text/plain; charset="utf-8" Hi all, I have to display an image for my work. After, I have to change the color of several pixels, I don't know why. I have a vtkImageData, and I have search some methods to set the scalars of the pixels which are stored in, but I don't arrived. Someone could help me? Thanks for answers. Romuald -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 3 Date: Fri, 16 May 2008 14:03:03 -0400 From: yenanqu at scs.fsu.edu Subject: Re: [vtkusers] How to change pixel color? To: Romuald BERTRAND Cc: vtkusers at vtk.org Message-ID: <20080516140303.p3babges8c4kss00 at email.scs.fsu.edu> Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Did you retrieve pixel data from vtkImageData seccessfully? Yenan Quoting Romuald BERTRAND : > Hi all, > > I have to display an image for my work. After, I have to change the > color of several pixels, I don't know why. I have a vtkImageData, > and I have search some methods to set the scalars of the pixels > which are stored in, but I don't arrived. > > Someone could help me? > > Thanks for answers. > > Romuald > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ------------------------------ Message: 4 Date: Fri, 16 May 2008 14:14:13 -0400 From: "Mark Wyszomierski" Subject: Re: [vtkusers] How to change pixel color? To: yenanqu at scs.fsu.edu Cc: vtkusers at vtk.org Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Yeah once you get a pointer to the pixel data in vtkImageData you can manipulate it however you want. It's just an array of values. Mark On 5/16/08, yenanqu at scs.fsu.edu wrote: > Did you retrieve pixel data from vtkImageData seccessfully? > > > Yenan > Quoting Romuald BERTRAND : > >> Hi all, >> >> I have to display an image for my work. After, I have to change the >> color of several pixels, I don't know why. I have a vtkImageData, >> and I have search some methods to set the scalars of the pixels >> which are stored in, but I don't arrived. >> >> Someone could help me? >> >> Thanks for answers. >> >> Romuald >> >> -- >> This message has been scanned for viruses and >> dangerous content by MailScanner, and is >> believed to be clean. >> >> > > > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > ------------------------------ Message: 5 Date: Fri, 16 May 2008 14:27:11 -0400 From: yenanqu at scs.fsu.edu Subject: Re: [vtkusers] How to change pixel color? To: Mark Wyszomierski Cc: vtkusers at vtk.org Message-ID: <20080516142711.y23bvz6sgg8sc4cc at email.scs.fsu.edu> Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" How to get pointer from vtkImageData is the hardest thing,which I still can not make it. //id is vtkImageData int *uExtent = id->GetUpdateExtent(); pPix = (unsigned char*)id->GetScalarPointer(uExtent[0], uExtent[2], uExtent[4]); or pPix = (unsigned char*)id->GetScalarPointer(); the only method I could find out. It didn't work for me. try it to see if it works for you. Yenan Quoting Mark Wyszomierski : > Yeah once you get a pointer to the pixel data in vtkImageData you can > manipulate it however you want. It's just an array of values. > > Mark > > On 5/16/08, yenanqu at scs.fsu.edu wrote: >> Did you retrieve pixel data from vtkImageData seccessfully? >> >> >> Yenan >> Quoting Romuald BERTRAND : >> >>> Hi all, >>> >>> I have to display an image for my work. After, I have to change the >>> color of several pixels, I don't know why. I have a vtkImageData, >>> and I have search some methods to set the scalars of the pixels >>> which are stored in, but I don't arrived. >>> >>> Someone could help me? >>> >>> Thanks for answers. >>> >>> Romuald >>> >>> -- >>> This message has been scanned for viruses and >>> dangerous content by MailScanner, and is >>> believed to be clean. >>> >>> >> >> >> >> ---------------------------------------------------------------- >> This message was sent using IMP, the Internet Messaging Program. >> >> >> -- >> This message has been scanned for viruses and >> dangerous content by MailScanner, and is >> believed to be clean. >> >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ------------------------------ Message: 6 Date: Fri, 16 May 2008 15:35:05 -0400 From: "Mark Wyszomierski" Subject: Re: [vtkusers] How to change pixel color? To: yenanqu at scs.fsu.edu Cc: vtkusers at vtk.org Message-ID: Content-Type: text/plain; charset=ISO-8859-1 >> pPix = (unsigned char*)id->GetScalarPointer(); That should work, I've used it many times for instance in this project: http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 I show the value of the pixel that the mouse is over. Maybe there's something else going on in your pipeline? Mark On 5/16/08, yenanqu at scs.fsu.edu wrote: > How to get pointer from vtkImageData is the hardest thing,which I > still can not make it. > > //id is vtkImageData > int *uExtent = id->GetUpdateExtent(); > pPix = (unsigned char*)id->GetScalarPointer(uExtent[0], uExtent[2], > uExtent[4]); > > or > > pPix = (unsigned char*)id->GetScalarPointer(); > > the only method I could find out. It didn't work for me. try it to see > if it works for you. > > Yenan > > Quoting Mark Wyszomierski : > >> Yeah once you get a pointer to the pixel data in vtkImageData you can >> manipulate it however you want. It's just an array of values. >> >> Mark >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: >>> Did you retrieve pixel data from vtkImageData seccessfully? >>> >>> >>> Yenan >>> Quoting Romuald BERTRAND : >>> >>>> Hi all, >>>> >>>> I have to display an image for my work. After, I have to change the >>>> color of several pixels, I don't know why. I have a vtkImageData, >>>> and I have search some methods to set the scalars of the pixels >>>> which are stored in, but I don't arrived. >>>> >>>> Someone could help me? >>>> >>>> Thanks for answers. >>>> >>>> Romuald >>>> >>>> -- >>>> This message has been scanned for viruses and >>>> dangerous content by MailScanner, and is >>>> believed to be clean. >>>> >>>> >>> >>> >>> >>> ---------------------------------------------------------------- >>> This message was sent using IMP, the Internet Messaging Program. >>> >>> >>> -- >>> This message has been scanned for viruses and >>> dangerous content by MailScanner, and is >>> believed to be clean. >>> >>> _______________________________________________ >>> This is the private VTK discussion list. >>> Please keep messages on-topic. Check the FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> Follow this link to subscribe/unsubscribe: >>> http://www.vtk.org/mailman/listinfo/vtkusers >>> >> >> -- >> This message has been scanned for viruses and >> dangerous content by MailScanner, and is >> believed to be clean. >> >> > > > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > ------------------------------ Message: 7 Date: Fri, 16 May 2008 19:43:14 -0300 From: "Wagner Sales" Subject: Re: [vtkusers] How to converting coordinates from dataset to view? - Part two To: vtkusers at vtk.org Message-ID: <11b83aa60805161543o6fedae2asbcb884a7054408e9 at mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Hi all, This answer are just for future searches in the list. The code and approach are right. The problem was other, that's don't need to be mentioned here since aren't VTK related. Regards, Wagner Sales 2008/5/14 Wagner Sales : > Hi all, > > The following message was sent in some minutes ago. > I'm trying to show marked points in a 2D view from a dataset in 3D view of > segmented data from this dataset. To explain more: > a) I have a DICOM dataset > b) In 2D view I was marked some points to use in segmentation, done by > ITK. > The segmentation works fine, then I think my points are marked ok. > c) After segmentation, I extract the polydata and show in a 3D view. > d) Then, I try to create new points in 2D view and show in 3D. The points > are created, but in 3D appears in a different location. > Well, I think I need to convert the coordinates from the point and after > that set manually the position of the point (a vtkActor) in 3D view. > > Are I'm correct? If yes, how to convert these coordinates? Are another > more > simple approach? > > Well, taking a look at my VTK book and some examples, I think I need to > translate the dataset to global coordinates. This are done by the > following > code: > > double *Point::translateCoordinates(int x, int y, int z) > { > // m_CurrentImageData are a vtkImageData instance > if(!m_CurrentImageData) > { > xyzCoords[0] = 0.0; > xyzCoords[1] = 0.0; > xyzCoords[2] = 0.0; > return xyzCoords; > } > q[0] = x; > q[1] = y; > q[2] = z; > cellNum = m_CurrentImageData->ComputeCellId(q); > subID = m_CurrentImageData->GetCell( cellNum > )->GetParametricCenter(paraCoords); > int &subIDadd = subID; > m_CurrentImageData->GetCell(cellNum)->EvaluateLocation(subIDadd, > paraCoords, > xyzCoords, vtkcellweights); > return xyzCoords; > } > > Then I'm trying to set the actor position using xyzCoords, but not working > ( the point are in wrong position yet ). Any help? > > Thks in advance, > > Wagner Sales -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 8 Date: Sat, 17 May 2008 11:25:58 +0800 From: " Mark Jefferson " Subject: [vtkusers] How to save the stenciled images? To: " vtkusers " Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi, vtkusers, I have stenciled one CT image successfully, and I want to extract a ROI in another CT image. but how to save the stenciled images? of course, I could use vtkBMPWriter or vtkJPEGWriter to save the stenciled images to be .bmp or .jpg images, but this is not the best method, I think. on the one hand, if I save the stenciled images to be .bmp images, there would be many many many images that I need to save, and some message would be lost, because the pixel's range in CT image is 0-4095 while in bmp image is 0-255. on the other hand, if I want to see the prior image before I extract another image, I should read the images, it is very complex. so I want to know, is there any class in VTK that could save the images temporarily and then save them to be one .vtk file after I have extracted all the images? if there is no, could you give me any better suggestion? thank you very much! M.J. -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 9 Date: Sat, 17 May 2008 08:01:51 -0500 From: "Kenneth Evans, Jr." Subject: Re: [vtkusers] Modifying sphere radius from actor To: "'VTK Users'" Message-ID: Content-Type: text/plain; charset="us-ascii" Andrea, >> If you are on Windows, you should see something printed in the command window when you press whatever key you want. Nothing happened when I pressed any keys. I noticed later that I got all the output when the program closes. I am not experienced with events in VTK (but wouldn't mind learning). It turned out this was actually because stdout wasn't being flushed, not the events. (I wasn't running it directly from a console.) My fault, but I haven't had trouble before with printing debug statements. However, in looking at things now that I can print, what I find is that: vtkPloyDataMapper.GetInput is a vtkPolyData which is a vtkDataObject which has a GetSouce which returns a vtkSource but a vtkSphereSource is not a vtkSource So I would not expect this to work, or at least not be surprised that it isn't. (Assuming I did all the tracing right ;-) In any event, if you print the vtkPolyDataMapper.GetInput() when it is created, then the source is None at that time. You can't even use SetSource because the vtkSphereSource is not a vtkSource. >> The main problem is not the colour, ... I understand. However, I don't then know exactly what you are trying to accomplish. It looks as though you are trying to change the sphere. Why not keep a reference to the sphere (which you have to do anyway to keep it from being garbage collected) instead of (or in addition to) the sphereMapper? It does look to me as though this approach won't work. -Ken ------------------------------ Message: 10 Date: Sat, 17 May 2008 13:28:32 +0000 (GMT) From: "C. Hiba" Subject: [vtkusers] Link between ITK and VTK To: vtk Message-ID: <380847.26998.qm at web28304.mail.ukl.yahoo.com> Content-Type: text/plain; charset="us-ascii" An HTML attachment was scrubbed... URL: ------------------------------ Message: 11 Date: Sat, 17 May 2008 13:29:00 +0000 (GMT) From: "C. Hiba" Subject: [vtkusers] Link between ITK and VTK To: vtk Message-ID: <696662.19485.qm at web28308.mail.ukl.yahoo.com> Content-Type: text/plain; charset="us-ascii" 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 49, Issue 16 **************************************** -- No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.16/1446 - Release Date: 16.05.2008 07:42 From mark.jefferson at qq.com Sat May 17 22:47:08 2008 From: mark.jefferson at qq.com (=?ISO-8859-1?B?TWFyayBKZWZmZXJzb24=?=) Date: Sun, 18 May 2008 10:47:8 +0800 Subject: [vtkusers] How to save the stenciled images? Message-ID: Hi, vtkusers, I have stenciled one CT image successfully, and I want to extract a ROI in another CT image. but how to save the stenciled images? of course, I could use vtkBMPWriter or vtkJPEGWriter to save the stenciled images to be .bmp or .jpg images, but this is not the best method, I think. on the one hand, if I save the stenciled images to be .bmp images, there would be many many many images that I need to save, and some message would be lost, because the pixel's range in CT image is 0-4095 while in bmp image is 0-255. on the other hand, if I want to see the prior image before I extract another image, I should read the images, it is very complex. so I want to know, is there any class in VTK that could save the images temporarily and then save them to be one .vtk file after I have extracted all the images? if there is no, could you give me any better suggestion? thank you very much! M.J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cquammen at cs.unc.edu Sun May 18 11:08:01 2008 From: cquammen at cs.unc.edu (Cory Quammen) Date: Sun, 18 May 2008 11:08:01 -0400 Subject: [vtkusers] How to save the stenciled images? In-Reply-To: References: Message-ID: <38fd72f40805180808q46175683p8f07ec906314a9e3@mail.gmail.com> Try vtkXMLImageDataWriter: http://www.vtk.org/doc/nightly/html/classvtkXMLImageDataWriter.html. It will save a single 3D image to a file with the data type of your CT image (probably unsigned shorts), so you don't have to worry about the lower dynamic range of BMP or JPEG images. To read it back, use the vtkXMLImageDataWriter class. Hope that helps, Cory On Sat, May 17, 2008 at 10:47 PM, Mark Jefferson wrote: > Hi, vtkusers, > > I have stenciled one CT image successfully, and I want to extract a ROI in > another CT image. but how to save the stenciled images? of course, I could > use vtkBMPWriter or vtkJPEGWriter to save the stenciled images to be .bmp or > .jpg images, but this is not the best method, I think. > > on the one hand, if I save the stenciled images to be .bmp images, there > would be many many many images that I need to save, and some message would > be lost, because the pixel's range in CT image is 0-4095 while in bmp image > is 0-255. on the other hand, if I want to see the prior image before I > extract another image, I should read the images, it is very complex. > > so I want to know, is there any class in VTK that could save the images > temporarily and then save them to be one .vtk file after I have extracted > all the images? > > if there is no, could you give me any better suggestion? thank you very > much! > > > M.J. > > > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -- Cory Quammen Department of Computer Science University of North Carolina at Chapel Hill http://www.cs.unc.edu/~cquammen From paulojamorim at gmail.com Sun May 18 11:50:48 2008 From: paulojamorim at gmail.com (Paulo Henrique Junqueira Amorim) Date: Sun, 18 May 2008 12:50:48 -0300 Subject: [vtkusers] PolyData Operations VTK 5 In-Reply-To: <98e18c70805051713o4869cdc0vbc64eba64a39312@mail.gmail.com> References: <98e18c70804261844j1af98c6ew9ca5fd9f934b86@mail.gmail.com> <98e18c70805020926s44e22e0fwca58ad0fd9e92c79@mail.gmail.com> <98e18c70805051713o4869cdc0vbc64eba64a39312@mail.gmail.com> Message-ID: <98e18c70805180850o42eb838ar7daf7d0f1edb482b@mail.gmail.com> the vtk not have a class for that? 2008/5/5 Paulo Henrique Junqueira Amorim : > Hi, > > Anyone have any ideas? > > Regards, > Paulo > > > 2008/5/2 Paulo Henrique Junqueira Amorim : > > Hi Mathieu, >> >> Thank but the vtkImplicitPolyData only works in vtk 4.2, my project uses >> vtk 5.1 and wrapper to Python. >> >> I tried to convert PolyData implicit function and then use the >> vtkImplicitBoolean but the output of vtkImplicitBoolean is null, I am >> exported to stl and export null, I am creted Actor and Add renderer, but the >> output of the renderer is black. See below code. >> >> Best Regards, >> Paulo Amorim >> >> >> The code convert PolyData in Implicit Function: >> >> from vtk import * >> >> #To test PolyData Boolean >> Cylinder = vtkCylinderSource() >> Cylinder.SetHeight(35) >> Cylinder.SetRadius(6) >> >> Cube = vtkCubeSource() >> Cube.SetXLength(100) >> Cube.SetYLength(10) >> Cube.SetZLength(10) >> >> >> >> # transforming polyData of the Cylinder to an implicitFunction >> poly_Cylinder = vtkPolyData() >> poly_Cylinder.SetPoints(Cylinder.GetOutput().GetPoints()) >> >> tri_Cylinder = vtkTriangleFilter() >> tri_Cylinder.SetInput(poly_Cylinder) >> >> implicit_Cylinder = vtkImplicitModeller() >> implicit_Cylinder.SetInputConnection(tri_Cylinder.GetOutputPort()) >> >> dataset_Cylinder = vtkImplicitDataSet() >> dataset_Cylinder.SetDataSet(implicit_Cylinder.GetOutput()) >> >> >> >> # ---- transforming polyData of the Cube to an implicitFunction >> ----------- >> poly_Cube = vtkPolyData() >> poly_Cube.SetPoints(Cube.GetOutput().GetPoints()) >> >> tri_Cube = vtkTriangleFilter() >> tri_Cube.SetInput(poly_Cube) >> >> implicit_Cube = vtkImplicitModeller() >> implicit_Cube.SetInputConnection(tri_Cube.GetOutputPort()) >> >> dataset_Cube = vtkImplicitDataSet() >> dataset_Cube.SetDataSet(implicit_Cube.GetOutput()) >> >> >> #Boolean Difference two implicit funcion (cylinder and cube) >> >> implict_Boolean = vtkImplicitBoolean() >> implict_Boolean.SetOperationTypeToDifference() >> >> implict_Boolean.AddFunction(dataset_Cube) >> implict_Boolean.AddFunction(dataset_Cylinder) >> >> >> Sample = vtkSampleFunction() >> Sample.SetImplicitFunction(implict_Boolean) >> >> Surface = vtkContourFilter() >> Surface.SetInputConnection(Sample.GetOutputPort()) >> >> >> #Export to STL >> writerBinary = vtkSTLWriter() >> writerBinary.SetFileName("c:\\exported.stl") >> writerBinary.SetInput(Surface.GetOutput()) >> writerBinary.SetFileType(2) >> writerBinary.Write() >> >> >> >> Mapper = vtkPolyDataMapper() >> Mapper.SetInput(Surface.GetOutput()) >> Mapper.ScalarVisibilityOn() >> >> Actor = vtkActor() >> Actor.SetMapper(Mapper) >> Actor.SetPosition(0,0,0) >> >> >> ren = vtkRenderer() >> ren.AddActor(Actor) >> >> renWin = vtkRenderWindow() >> renWin.AddRenderer(ren) >> >> iren = vtkRenderWindowInteractor() >> iren.SetRenderWindow(renWin) >> >> renWin.Render() >> >> >> >> >> 2008/4/28 Mathieu Malaterre : >> >> Hi Paulo, >>> >>> I believe this question has been raised in the vtkusers mailing list >>> before, how about: >>> >>> http://www.vtk.org/pipermail/vtkusers/2007-April/090730.html >>> >>> HTH >>> -Mathieu >>> >>> On Sun, Apr 27, 2008 at 3:44 AM, Paulo Henrique Junqueira Amorim >>> wrote: >>> > Hi All, >>> > >>> > I am researching how to make operation of intersse??o and subtraction >>> of >>> > PolyData with the vtk 5. But I do not think any refence. >>> > >>> > That class could use? >>> > >>> > >>> > Best Regards, >>> > Paulo >>> > >>> > >>> > _______________________________________________ >>> > This is the private VTK discussion list. >>> > Please keep messages on-topic. Check the FAQ at: >>> > http://www.vtk.org/Wiki/VTK_FAQ >>> > Follow this link to subscribe/unsubscribe: >>> > http://www.vtk.org/mailman/listinfo/vtkusers >>> > >>> > >>> >>> >>> >>> -- >>> Mathieu >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From prabhat246 at yahoo.com Sun May 18 13:34:44 2008 From: prabhat246 at yahoo.com (prabhat246) Date: Sun, 18 May 2008 10:34:44 -0700 (PDT) Subject: [vtkusers] Marching cubes In-Reply-To: <16834785.post@talk.nabble.com> References: <16834785.post@talk.nabble.com> Message-ID: <17305560.post@talk.nabble.com> Hello everyone, I got the answer for my question from ITK forum. in the example Well, I've changed the code vtkContourFilter * contour = vtkContourFilter::New(); contour->SetInput( vtkImporter2->GetOutput() ); contour->SetValue(0, 128); to vtkMarchingCubes * contour = vtkMarchingCubes::New(); contour->SetInput(vtkImporter1->GetOutput()); contour->SetValue(0, 128); It ensures me that now I get output only from Marching cubes algo. I am new to learn this algorithm. 1. Can you please explain what are these parameters of SetValue function ?? 2. How can I change the cube size to be bigger ?? and 3. Which file (and which function)has the actual code for the Marching cubes algorithm??? Hoping for a helpful quick response (I didn't get answer of my prev. question even after 15 days from VTK forum) Thanks a lot Prabhat prabhat246 wrote: > > I wanted to run marching cubes on my Dicom image set. > I was told to refer example > > InsightApplications-3.4.0\Auxiliary\vtk\ itkReadITKImage3DSegmentShowVTK > > I can successfully run this example. > but I could not find where the actual Marching cube algorithm is being > called? > also How can I change the parameters of Marching cube algorithm? > (If I want output mesh to be coarse or dense) > > Thanks a lot. > Prabhat > > > -- View this message in context: http://www.nabble.com/Marching-cubes-tp16834785p17305560.html Sent from the VTK - Users mailing list archive at Nabble.com. From stefan.maas at fh-gelsenkirchen.de Sun May 18 15:15:38 2008 From: stefan.maas at fh-gelsenkirchen.de (Stefan Maas) Date: Sun, 18 May 2008 21:15:38 +0200 Subject: [vtkusers] Get the orientation of vtkPlaneWidget In-Reply-To: References: Message-ID: <003b01c8b91b$8eae9200$ac0bb600$@maas@fh-gelsenkirchen.de> Hello, can someone tell me an easy or tricky way to get the orientation of an vtkPlaneWidget? I want to use it as an "auxiliary-object" to align an vtkActor (an implant). My idea was something like this: When I move (translate, rotate) the planeWidget, the actor should take the position and orientation of the planeWidget. Setting the position works by: actor.SetPostion(planeWidget.GetPostion()); //java But for the orientation it doesn't work because there is no method called "planeWidget.GetOrientation()". Any Ideas? Thanks! Stefan From c.p.botha at tudelft.nl Sun May 18 15:23:49 2008 From: c.p.botha at tudelft.nl (Charl Botha) Date: Sun, 18 May 2008 21:23:49 +0200 Subject: [vtkusers] Get the orientation of vtkPlaneWidget In-Reply-To: <7857910152067720629@unknownmsgid> References: <7857910152067720629@unknownmsgid> Message-ID: <31ddba770805181223r4d30c851o6540d6aeb44eeca@mail.gmail.com> On Sun, May 18, 2008 at 9:15 PM, Stefan Maas wrote: > actor.SetPostion(planeWidget.GetPostion()); //java > > But for the orientation it doesn't work because there is no method called > "planeWidget.GetOrientation()". > > Any Ideas? What do you define as the orientation of the plane? You could for example get the plane normal with planeWidget.GetNormal() and align that with the relevant axis of your implant actor. With the Get{Origin,Point1,Point2}() you can also get to the geometry of the plane itself. Good luck, Charl From polys_poly at hotmail.com Sun May 18 15:40:50 2008 From: polys_poly at hotmail.com (Hotmail) Date: Sun, 18 May 2008 22:40:50 +0300 Subject: [vtkusers] frame rate Message-ID: hello how can I get the frame rate while rotating, zooming etc on a rendered volume? thanks in advance, Polys -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan.maas at fh-gelsenkirchen.de Sun May 18 15:58:07 2008 From: stefan.maas at fh-gelsenkirchen.de (Stefan Maas) Date: Sun, 18 May 2008 21:58:07 +0200 Subject: [vtkusers] Get the orientation of vtkPlaneWidget In-Reply-To: <31ddba770805181223r4d30c851o6540d6aeb44eeca@mail.gmail.com> References: <7857910152067720629@unknownmsgid> <31ddba770805181223r4d30c851o6540d6aeb44eeca@mail.gmail.com> Message-ID: <004201c8b921$7e44b330$7ace1990$@maas@fh-gelsenkirchen.de> > > On Sun, May 18, 2008 at 9:15 PM, Stefan Maas > wrote: > > actor.SetPostion(planeWidget.GetPostion()); //java > > > > But for the orientation it doesn't work because there is no method > called > > "planeWidget.GetOrientation()". > > > > Any Ideas? > > What do you define as the orientation of the plane? > > You could for example get the plane normal with > planeWidget.GetNormal() and align that with the relevant axis of your > implant actor. With the Get{Origin,Point1,Point2}() you can also get > to the geometry of the plane itself. > > Good luck, > Charl Thank you for the quick and useful answer. What I define as the orientation of the plane is the orientation value of it as it were an actor (and not a 3dWidget). Like in the definition of vtkProp3D.GetOrientation(): "Returns the orientation of the Prop3D as s vector of X,Y and Z rotation..." I had the same idea with "Get{Origin,Point1,Point2}()", but I hoped two find an easier way. But I am not sure what I have to do, when I use "planeWidget.GetNormal()". How can I convert the information from "GetNormal" to something for "actor.SetOrientation()". From prabhat246 at yahoo.com Sun May 18 15:58:25 2008 From: prabhat246 at yahoo.com (prabhat246) Date: Sun, 18 May 2008 12:58:25 -0700 (PDT) Subject: [vtkusers] Marching cubes In-Reply-To: <17305560.post@talk.nabble.com> References: <16834785.post@talk.nabble.com> <17305560.post@talk.nabble.com> Message-ID: <17307078.post@talk.nabble.com> Sorry, I forgot to mention which example. I made following changes in example \ITK\InsightApplications-3.4.0\Auxiliary\vtk\itkReadITKImage3DSegmentShowVTK Please answer my follwoing questions. Prabhat prabhat246 wrote: > > Hello everyone, > > I got the answer for my question from ITK forum. > in the example > Well, I've changed the code > > vtkContourFilter * contour = vtkContourFilter::New(); > contour->SetInput( vtkImporter2->GetOutput() ); > contour->SetValue(0, 128); > > > to > > vtkMarchingCubes * contour = vtkMarchingCubes::New(); > contour->SetInput(vtkImporter1->GetOutput()); > contour->SetValue(0, 128); > > It ensures me that now I get output only from Marching cubes algo. > I am new to learn this algorithm. > > > 1. Can you please explain what are these parameters of SetValue function > ?? > 2. How can I change the cube size to be bigger ?? and > 3. Which file (and which function)has the actual code for the Marching > cubes algorithm??? > > Hoping for a helpful quick response > (I didn't get answer of my prev. question even after 15 days from VTK > forum) > > Thanks a lot > > Prabhat > > > > > > prabhat246 wrote: >> >> I wanted to run marching cubes on my Dicom image set. >> I was told to refer example >> >> InsightApplications-3.4.0\Auxiliary\vtk\ itkReadITKImage3DSegmentShowVTK >> >> I can successfully run this example. >> but I could not find where the actual Marching cube algorithm is being >> called? >> also How can I change the parameters of Marching cube algorithm? >> (If I want output mesh to be coarse or dense) >> >> Thanks a lot. >> Prabhat >> >> >> > > -- View this message in context: http://www.nabble.com/Marching-cubes-tp16834785p17307078.html Sent from the VTK - Users mailing list archive at Nabble.com. From c.p.botha at tudelft.nl Sun May 18 17:31:15 2008 From: c.p.botha at tudelft.nl (Charl Botha) Date: Sun, 18 May 2008 23:31:15 +0200 Subject: [vtkusers] Get the orientation of vtkPlaneWidget In-Reply-To: <1012022784918105775@unknownmsgid> References: <7857910152067720629@unknownmsgid> <31ddba770805181223r4d30c851o6540d6aeb44eeca@mail.gmail.com> <1012022784918105775@unknownmsgid> Message-ID: <31ddba770805181431q13492bcrdd2065a25d8ef20f@mail.gmail.com> On Sun, May 18, 2008 at 9:58 PM, Stefan Maas wrote: > But I am not sure what I have to do, when I use "planeWidget.GetNormal()". > How can I convert the information from "GetNormal" to something for > "actor.SetOrientation()". I haven't rechecked the source code recently, but as far as I remember GetOrientation() simply refers to the current orientation w.r.t. the default initial position. This means you're going to have to rethink your strategy in any case. If you have an implant, you're going to have to define some kind of major axis. VTK can't guess this information, as it's related to your implant design. Once you have this, you could try aligning it to the plane normal. Bottom line is that there's no easy way, due to the specific design of your implant. Good luck, Charl > > -- dr. charl p. botha :: http://visualisation.tudelft.nl/CharlBotha work: c.p.botha at tudelft.nl personal: cpbotha at cpbotha.net From beromuald at wanadoo.fr Mon May 19 03:59:44 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Mon, 19 May 2008 09:59:44 +0200 (CEST) Subject: [vtkusers] How to change pixel color? Message-ID: <17408086.899171211183984258.JavaMail.www@wwinf1507> Hi, Thanks for your answers. I have tried but pPix = (unsigned char*)id->GetScalarPointer(); doesn't work for me. when I change the components, nothing change, and after I have display the array and I have seen it is null. Know you why? Yenan: Have you arrived to manipulate it correctly? Thanks > Message du 16/05/08 21:35 > De : "Mark Wyszomierski" > A : yenanqu at scs.fsu.edu > Copie ? : "Romuald BERTRAND" , vtkusers at vtk.org > Objet : Re: [vtkusers] How to change pixel color? > > >> pPix = (unsigned char*)id->GetScalarPointer(); > > That should work, I've used it many times for instance in this project: > > http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 > > I show the value of the pixel that the mouse is over. Maybe there's > something else going on in your pipeline? > > Mark > > > > On 5/16/08, yenanqu at scs.fsu.edu wrote: > > How to get pointer from vtkImageData is the hardest thing,which I > > still can not make it. > > > > //id is vtkImageData > > int *uExtent = id->GetUpdateExtent(); > > pPix = (unsigned char*)id->GetScalarPointer(uExtent[0], uExtent[2], > > uExtent[4]); > > > > or > > > > pPix = (unsigned char*)id->GetScalarPointer(); > > > > the only method I could find out. It didn't work for me. try it to see > > if it works for you. > > > > Yenan > > > > Quoting Mark Wyszomierski : > > > >> Yeah once you get a pointer to the pixel data in vtkImageData you can > >> manipulate it however you want. It's just an array of values. > >> > >> Mark > >> > >> On 5/16/08, yenanqu at scs.fsu.edu wrote: > >>> Did you retrieve pixel data from vtkImageData seccessfully? > >>> > >>> > >>> Yenan > >>> Quoting Romuald BERTRAND : > >>> > >>>> Hi all, > >>>> > >>>> I have to display an image for my work. After, I have to change the > >>>> color of several pixels, I don't know why. I have a vtkImageData, > >>>> and I have search some methods to set the scalars of the pixels > >>>> which are stored in, but I don't arrived. > >>>> > >>>> Someone could help me? > >>>> > >>>> Thanks for answers. > >>>> > >>>> Romuald > >>>> > >>>> -- > >>>> This message has been scanned for viruses and > >>>> dangerous content by MailScanner, and is > >>>> believed to be clean. > >>>> > >>>> > >>> > >>> > >>> > >>> ---------------------------------------------------------------- > >>> This message was sent using IMP, the Internet Messaging Program. > >>> > >>> > >>> -- > >>> This message has been scanned for viruses and > >>> dangerous content by MailScanner, and is > >>> believed to be clean. > >>> > >>> _______________________________________________ > >>> This is the private VTK discussion list. > >>> Please keep messages on-topic. Check the FAQ at: > >>> http://www.vtk.org/Wiki/VTK_FAQ > >>> Follow this link to subscribe/unsubscribe: > >>> http://www.vtk.org/mailman/listinfo/vtkusers > >>> > >> > >> -- > >> This message has been scanned for viruses and > >> dangerous content by MailScanner, and is > >> believed to be clean. > >> > >> > > > > > > > > ---------------------------------------------------------------- > > This message was sent using IMP, the Internet Messaging Program. > > > > > > -- > > This message has been scanned for viruses and > > dangerous content by MailScanner, and is > > believed to be clean. > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.jefferson at qq.com Mon May 19 06:01:47 2008 From: mark.jefferson at qq.com (=?ISO-8859-1?B?TWFyayBKZWZmZXJzb24=?=) Date: Mon, 19 May 2008 18:1:47 +0800 Subject: [vtkusers] How to save the stenciled images? Message-ID: thank you for your help, Cory, I have use class vtkXMLImageDataWriter and class vtkXMLImageDataReader. but I still could not save the stenciled images, maybe these classes could do it, but I could not do. after I have use this class to writer a .vti file for all the stenciled images, I use class vtkImageViewer2 to see all the images that I have saved, unluckily, all the images are the same image, which is the image that I save at last. so I don't know what's wrong with it. of course, vtkXMLImageDataWriter could save all or part of the images at a time, but what I want to do is like this : for example, there is two images. and I save the first stenciled image using class vtkXMLImageDataWriter after I have extracted the ROI, and the .vti file's name is image.vti. and then I would save the second(or the last one) image into the image.vti. at last, using class vtkImageViewer2, you would find the two images are all the second image, and the first stenciled image was lost. so, could you tell me, how to add the next stenciled image to the original .vti file(or the same .vti file)? thank you for your help again! M. J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rashed.vtk at googlemail.com Mon May 19 06:51:21 2008 From: rashed.vtk at googlemail.com (rashedk) Date: Mon, 19 May 2008 03:51:21 -0700 (PDT) Subject: [vtkusers] How to find if a point lies within a planewidget's plane? Message-ID: <17316622.post@talk.nabble.com> Hi there, I am stuck with a very trivial problem. How do I find out if a point (a,b,c) lies within a plane in 3D which is a constrained finite plane and not an infinite one. I have the coordinates of the two corners of the plane as returned by vktPlaneWidget's GetPoint1 and GetPoint2 functions. I also have the plane's normal and center. thanks in advance, Rashed. -- View this message in context: http://www.nabble.com/How-to-find-if-a-point-lies-within-a-planewidget%27s-plane--tp17316622p17316622.html Sent from the VTK - Users mailing list archive at Nabble.com. From cquammen at cs.unc.edu Mon May 19 07:02:16 2008 From: cquammen at cs.unc.edu (Cory Quammen) Date: Mon, 19 May 2008 07:02:16 -0400 Subject: [vtkusers] How to save the stenciled images? In-Reply-To: References: Message-ID: <38fd72f40805190402q259f9eb0odd94fde7ef9ee9ef@mail.gmail.com> Mark, The closest you can probably come is to jam all the stencil images together into one image with vtkImageAppendComponents and then save the whole thing into a single .vti file. I don't believe you can save more than one image in a single .vti file (someone on list correct me if I am wrong). You might be able to exploit VTK's relatively new time support and treat your images as though they were time-series data, but I am not familiar enough with that to give you advice (you might find some hints for time-series data in the documentation for vtkXMLWriter: http://www.vtk.org/doc/nightly/html/classvtkXMLWriter.html). Hope that helps, Cory On Mon, May 19, 2008 at 6:01 AM, Mark Jefferson wrote: > thank you for your help, Cory, > I have use class vtkXMLImageDataWriter and class vtkXMLImageDataReader. > but I still could not save the stenciled images, maybe these classes could > do it, but I could not do. > after I have use this class to writer a .vti file for all the stenciled > images, I use class vtkImageViewer2 to see all the images that I have saved, > unluckily, all the images are the same image, which is the image that I save > at last. so I don't know what's wrong with it. > of course, vtkXMLImageDataWriter could save all or part of the images at a > time, but what I want to do is like this : > for example, there is two images. and I save the first stenciled image > using class vtkXMLImageDataWriter after I have extracted the ROI, and the > .vti file's name is image.vti. and then I would save the second(or the last > one) image into the image.vti. at last, using class vtkImageViewer2, you > would find the two images are all the second image, and the first stenciled > image was lost. > so, could you tell me, how to add the next stenciled image to the original > .vti file(or the same .vti file)? > thank you for your help again! > M. J. > -- Cory Quammen Department of Computer Science University of North Carolina at Chapel Hill http://www.cs.unc.edu/~cquammen From mark.jefferson at qq.com Mon May 19 08:10:06 2008 From: mark.jefferson at qq.com (=?ISO-8859-1?B?TWFyayBKZWZmZXJzb24=?=) Date: Mon, 19 May 2008 20:10:6 +0800 Subject: [vtkusers] How to save the stenciled images? Message-ID: Thank you for your help, Cory, but I still don't know what's wrong with it. of course I have used class vtkImageAppendComponents, however, it doesn't work, and the image that shown by using class vtkImageViewer2 is always the last one or the first one. could you help me to see what's wrong with my codes here: vtkImageAppendComponents * imageAppend = vtkImageAppendComponents::New(); vtkImageStencil * temp1 = FinishImageStencil(); imageAppend->AddInput(temp1->GetOutput()); vtkImageStencil * temp2 = FinishImageStencil(); imageAppend->AddInput(temp2->GetOutput()); vtkXMLImageDataWriter * writer = vtkXMLImageDataWriter::New(); writer->SetInputConnection(imageAppend->GetOutputPort()); writer->SetFileName("image.vti"); writer->SetDataModeToBinary(); writer->Update(); writer->Write(); vtkXMLImageDataReader * reader = vtkXMLImageDataReader::New(); reader->SetFileName("image.vti"); reader->Update(); vtkImageData * xmlImageData = vtkImageData::New(); xmlImageData->DeepCopy(reader->GetOutput()); // display the images in image.vti using class vtkImageViewer2 ... ... // FinishImageStencil() is a function returning a object of class vtkImageStencil. here I just save two stenciled images, at the same time, I use class vtkBMPWriter to save the stenciled images, too. but the result is : the result is not right if I use vtkXMLImageDataWriter. and I doubt there is only one image in the image.vti. could you help me? thank you! M. J. ----------------------------------------------------------------------------------------------------------------------------------------------------------- Mark, The closest you can probably come is to jam all the stencil images together into one image with vtkImageAppendComponents and then save the whole thing into a single .vti file. I don't believe you can save more than one image in a single .vti file (someone on list correct me if I am wrong). You might be able to exploit VTK's relatively new time support and treat your images as though they were time-series data, but I am not familiar enough with that to give you advice (you might find some hints for time-series data in the documentation for vtkXMLWriter: http://www.vtk.org/doc/nightly/html/classvtkXMLWriter.html). Hope that helps, Cory -- Cory Quammen Department of Computer Science University of North Carolina at Chapel Hill http://www.cs.unc.edu/~cquammen -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodwin.lawlor at ucd.ie Mon May 19 08:47:06 2008 From: goodwin.lawlor at ucd.ie (Goodwin Lawlor) Date: Mon, 19 May 2008 13:47:06 +0100 Subject: [vtkusers] How to find if a point lies within a planewidget's plane? In-Reply-To: <17316622.post@talk.nabble.com> References: <17316622.post@talk.nabble.com> Message-ID: <483176CA.7070703@ucd.ie> Hi Rashed, Have a look at: vtkPolygon::PointInPolygon( double x[3], int numPts, double * pts, double bounds[6], double n[3] ) hth Goodwin rashedk wrote: > Hi there, > > I am stuck with a very trivial problem. How do I find out if a point (a,b,c) > lies within a plane in 3D which is a constrained finite plane and not an > infinite one. I have the coordinates of the two corners of the plane as > returned by vktPlaneWidget's GetPoint1 and GetPoint2 functions. I also have > the plane's normal and center. > > thanks in advance, > > Rashed. > > From goodwin.lawlor at ucd.ie Mon May 19 08:47:06 2008 From: goodwin.lawlor at ucd.ie (Goodwin Lawlor) Date: Mon, 19 May 2008 13:47:06 +0100 Subject: [vtkusers] How to find if a point lies within a planewidget's plane? In-Reply-To: <17316622.post@talk.nabble.com> References: <17316622.post@talk.nabble.com> Message-ID: <483176CA.7070703@ucd.ie> Hi Rashed, Have a look at: vtkPolygon::PointInPolygon( double x[3], int numPts, double * pts, double bounds[6], double n[3] ) hth Goodwin rashedk wrote: > Hi there, > > I am stuck with a very trivial problem. How do I find out if a point (a,b,c) > lies within a plane in 3D which is a constrained finite plane and not an > infinite one. I have the coordinates of the two corners of the plane as > returned by vktPlaneWidget's GetPoint1 and GetPoint2 functions. I also have > the plane's normal and center. > > thanks in advance, > > Rashed. > > From r.atwood at imperial.ac.uk Mon May 19 09:54:15 2008 From: r.atwood at imperial.ac.uk (Atwood, Robert C) Date: Mon, 19 May 2008 14:54:15 +0100 Subject: [vtkusers] vtkAxisActor2D -- how to change its colour? Message-ID: <2CB39EAF0E0EFF498ADEDA636B8C999F05CFA2D5@icex1.ic.ac.uk> Hi, I find that the vtkAxisActor2D member of vtkLegendScaleActor, does exactly what I am wanting to include in my application, however with the little problem that the axis is white, whereas I want it to be black. I can't see which function to use to alter this property, I'm not quite sure which member of the object this property belongs to. I have no trobule changing the colour and other properties of the labels of the axis! Any little hint or pointer to example that uses this or very similar object to draw a distance scale in the image ? (not like CubeAxesActor, I don't want it moving as the scene is rotated) Thanks Robert From goodwin.lawlor at ucd.ie Mon May 19 10:11:50 2008 From: goodwin.lawlor at ucd.ie (Goodwin Lawlor) Date: Mon, 19 May 2008 15:11:50 +0100 Subject: [vtkusers] How to find if a point lies within a planewidget's plane? In-Reply-To: References: <17316622.post@talk.nabble.com> <483176CA.7070703@ucd.ie> Message-ID: <48318AA6.9030308@ucd.ie> Hi Rashed, The 3rd corner is the origin O... vtkPlaneWidget::GetOrigin() Think of the plane being spanned by the two vectors OP1 and OP2. The 4th point is simply vector addition of O + OP1 + OP2 If you don't want to do it that way just use vtkPlaneWidget::GetPolyData() to access the 4 coords directly. hth Goodwin rashed karim wrote: > Hi Goodwin, > > Thanks for your reply. But, vtkPlaneWidget returns only the plane's > normal, center and two corner points (vtkPlaneWidget::GetPoint1( ) > and vtkPlaneWidget::GetPoint2( ) ). How do I get the other two corner > points? > > To use PointInPolygon, you need to supply all four vertices of the > plane. But I only have two. How do I get the other two? > > Any ideas? > > Thanks > Rashed > > On Mon, May 19, 2008 at 1:47 PM, Goodwin Lawlor > wrote: > > Hi Rashed, > > Have a look at: > > vtkPolygon::PointInPolygon( > double x[3], > int numPts, > double * pts, > double bounds[6], > double n[3] > ) > > hth > > Goodwin > > > rashedk wrote: > > Hi there, > I am stuck with a very trivial problem. How do I find out if a > point (a,b,c) > lies within a plane in 3D which is a constrained finite plane > and not an > infinite one. I have the coordinates of the two corners of the > plane as > returned by vktPlaneWidget's GetPoint1 and GetPoint2 > functions. I also have > the plane's normal and center. > thanks in advance, > Rashed. > > > From ahs at cfdrc.com Mon May 19 10:11:57 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Mon, 19 May 2008 09:11:57 -0500 Subject: [vtkusers] vtkAxisActor2D -- how to change its colour? In-Reply-To: <2CB39EAF0E0EFF498ADEDA636B8C999F05CFA2D5@icex1.ic.ac.uk> References: <2CB39EAF0E0EFF498ADEDA636B8C999F05CFA2D5@icex1.ic.ac.uk> Message-ID: <48318AAD.4000708@cfdrc.com> Hi Robert, Once you get the vtkAxisActor2D from the vtkLegendScaleActor (e.g., using the GetRightAxis() method), you can modify the properties of the axis itself by calling GetProperty() on the vtkAxisActor2D and adjusting the parameters as necessary. In c++, the code to change the color of the right axis to black would look something like the following. vtkLegendScaleActor *lsa = vtkLegendScaleActor::New(); ... lsa->GetRightAxis()->GetProperty()->SetColor(0, 0, 0); - Amy Atwood, Robert C wrote: > Hi, I find that the vtkAxisActor2D member of vtkLegendScaleActor, does > exactly what I am wanting to include in my application, however with the > little problem that the axis is white, whereas I want it to be black. > > I can't see which function to use to alter this property, I'm not quite > sure which member of the object this property belongs to. > > I have no trobule changing the colour and other properties of the labels > of the axis! > > Any little hint or pointer to example that uses this or very similar > object to draw a distance scale in the image ? (not like > CubeAxesActor, I don't want it moving as the scene is rotated) > > Thanks > Robert > > > > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From jcplatt at dsl.pipex.com Mon May 19 10:23:37 2008 From: jcplatt at dsl.pipex.com (John Platt) Date: Mon, 19 May 2008 15:23:37 +0100 Subject: [vtkusers] vtkAxisActor2D -- how to change its colour? In-Reply-To: <2CB39EAF0E0EFF498ADEDA636B8C999F05CFA2D5@icex1.ic.ac.uk> Message-ID: <001f01c8b9bb$f0a61be0$0100a8c0@pacsys4> Hi, Have you tried anything along the lines GetRightAxis()->GetProperty()->SetColor( 0, 0, 0 ); HTH John. -----Original Message----- From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Atwood, Robert C Sent: 19 May 2008 14:54 To: vtkusers Subject: [vtkusers] vtkAxisActor2D -- how to change its colour? Hi, I find that the vtkAxisActor2D member of vtkLegendScaleActor, does exactly what I am wanting to include in my application, however with the little problem that the axis is white, whereas I want it to be black. I can't see which function to use to alter this property, I'm not quite sure which member of the object this property belongs to. I have no trobule changing the colour and other properties of the labels of the axis! Any little hint or pointer to example that uses this or very similar object to draw a distance scale in the image ? (not like CubeAxesActor, I don't want it moving as the scene is rotated) Thanks Robert _______________________________________________ This is the private VTK discussion list. Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers From r.atwood at imperial.ac.uk Mon May 19 10:31:27 2008 From: r.atwood at imperial.ac.uk (Atwood, Robert C) Date: Mon, 19 May 2008 15:31:27 +0100 Subject: [vtkusers] FW: Thanks! RE: vtkAxisActor2D -- how to change its colour? Message-ID: <2CB39EAF0E0EFF498ADEDA636B8C999F05CFA2D7@icex1.ic.ac.uk> Thanks, Amy, John, that did the trick. I was confused because this method GetProperty() is in a superclass so I didn't initially find it . Robert ******** Hi, Have you tried anything along the lines GetRightAxis()->GetProperty()->SetColor( 0, 0, 0 ); HTH John. ******* > Once you get the vtkAxisActor2D from the vtkLegendScaleActor (e.g., > using the GetRightAxis() method), you can modify the > properties of the > axis itself by calling GetProperty() on the vtkAxisActor2D > and adjusting > the parameters as necessary. ... 0); > > - Amy > From wsales at gmail.com Mon May 19 11:40:36 2008 From: wsales at gmail.com (Wagner Sales) Date: Mon, 19 May 2008 12:40:36 -0300 Subject: [vtkusers] VTKBlog Message-ID: <11b83aa60805190840u6a8ea938qf35fbe2487b393ab@mail.gmail.com> Hi all, This blog aren't from me, but helped me with some things. Then, I'm sending this invitation to the list ( and, of course, a copy to the author ). I think that's will be great to all of us more one good source of VTK examples and information. Blog address: http://vtkblog.blogspot.com Regards, Wagner Sales Dear all, I have not updated for nearly a year. My previous goal is to accompany the weakness of the VTK mailing list. The mailing list is good source of information, but unfortunately lacking organized structure. The example programs given in the VTK source distributions are also nice, but most of them are written in scripting language which may not be suitable for C++ developers. That is the reason why I would like to write up some illustrative examples with demo figures and source codes using C++ programming language (instead of scripting language such as TCL and Python). Dues to some personal issues, I can't fit this goal yet. For example, I am not an expert in medical imaging, but I have been asking some examples in C++ related to this field. So, I would like to invite some volunteers to design and write some tutorials with are in similar format. The invited editors have ability to post some new articles, or edit the previous articles. The requirements for the content are =========================== 1. Programming language (Must be C++) 2. Preferred codebase (Pure VTK is preferable, adding other libraries are okay, but need to explain how to get them in the post) 3. Platform (May not need to in Windows, other platforms are okay) 4. Source codes (Must include the source code - zipped or in a single cpp file, you can upload them to some free web spaces - e.g. Google Page Creator ) 5. How to compile and build 6. (Optional) With a single image/video clip to illustrate what it is (to save time of viewers...) Some possible topics may be interesting ============================ 1. A survey of how to use VTK with other GUI libraries (e.g. such as FLTK, Qt) 2. Many illustrative examples of how to use VTK in different fields (such as volume rendering, medical imaging....) 3. Some latest features in VTK (such as GPU acceleration using shaders) 4. Using VTK with ITK (how to bridge them) 5. More.... For volunteers who are interested, please feel free to contact me via hkpeterpeter at gmail.com. I can grant the editing permission of this blog for volunteers. Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From louxkr at gmail.com Mon May 19 14:11:47 2008 From: louxkr at gmail.com (Kerry Loux) Date: Mon, 19 May 2008 14:11:47 -0400 Subject: [vtkusers] Altering a rendered actor Message-ID: <65c344fe0805191111m2d8e0626q51629eb4863a5f8e@mail.gmail.com> Hello all, Is there an easy way to update an actor in a scene? I have several actors and I want the user to be able to manipulate one of them using some kind of text input, and I'd like the actor to update on the screen as the user is typing. I've tried doing something like this and a couple of variations, but I haven't managed to find a call that does what I'm looking for: //set up all of the renderer stuff - creation of these objects and the data behind the actor occurs before this pActor->SetPosition(0.0, 0.0, 0.0); pRenderer->AddActor(pActor); pRenderer->Render(); // Let the user type something and store the input in double Input, for example pActor->SetPosition(Input, 0.0, 0.0);// same object we used above pRenderer->Render(); Any help or ideas are appreciated. Thanks, Kerry -------------- next part -------------- An HTML attachment was scrubbed... URL: From yenanqu at scs.fsu.edu Mon May 19 14:54:29 2008 From: yenanqu at scs.fsu.edu (yenanqu at scs.fsu.edu) Date: Mon, 19 May 2008 14:54:29 -0400 Subject: [vtkusers] How to change pixel color? In-Reply-To: <17408086.899171211183984258.JavaMail.www@wwinf1507> References: <17408086.899171211183984258.JavaMail.www@wwinf1507> Message-ID: <20080519145429.cjurfe2d28gcwgsk@email.scs.fsu.edu> No, I am still trying it. if you have other way to or could make it work, please, please let me know. Yenan Quoting Romuald BERTRAND : > Hi, > > Thanks for your answers. > > I have tried but pPix = (unsigned char*)id->GetScalarPointer(); > doesn't work for me. > > when I change the components, nothing change, and after I have > display the array and I have seen it is null. > Know you why? > > Yenan: Have you arrived to manipulate it correctly? > > Thanks > > > >> Message du 16/05/08 21:35 >> De : "Mark Wyszomierski" >> A : yenanqu at scs.fsu.edu >> Copie ? : "Romuald BERTRAND" , vtkusers at vtk.org >> Objet : Re: [vtkusers] How to change pixel color? >> >> >> pPix = (unsigned char*)id->GetScalarPointer(); >> >> That should work, I've used it many times for instance in this project: >> >> >> http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 >> >> I show the value of the pixel that the mouse is over. Maybe there's >> something else going on in your pipeline? >> >> Mark >> >> >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: >> > How to get pointer from vtkImageData is the hardest thing,which I >> > still can not make it. >> > >> > //id is vtkImageData >> > int *uExtent = id->GetUpdateExtent(); >> > pPix = (unsigned char*)id->GetScalarPointer(uExtent[0], uExtent[2], >> > uExtent[4]); >> > >> > or >> > >> > pPix = (unsigned char*)id->GetScalarPointer(); >> > >> > the only method I could find out. It didn't work for me. try it to see >> > if it works for you. >> > >> > Yenan >> > >> > Quoting Mark Wyszomierski : >> > >> >> Yeah once you get a pointer to the pixel data in vtkImageData you can >> >> manipulate it however you want. It's just an array of values. >> >> >> >> Mark >> >> >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: >> >>> Did you retrieve pixel data from vtkImageData seccessfully? >> >>> >> >>> >> >>> Yenan >> >>> Quoting Romuald BERTRAND : >> >>> >> >>>> Hi all, >> >>>> >> >>>> I have to display an image for my work. After, I have to change the >> >>>> color of several pixels, I don't know why. I have a vtkImageData, >> >>>> and I have search some methods to set the scalars of the pixels >> >>>> which are stored in, but I don't arrived. >> >>>> >> >>>> Someone could help me? >> >>>> >> >>>> Thanks for answers. >> >>>> >> >>>> Romuald >> >>>> >> >>>> -- >> >>>> This message has been scanned for viruses and >> >>>> dangerous content by MailScanner, and is >> >>>> believed to be clean. >> >>>> >> >>>> >> >>> >> >>> >> >>> >> >>> ---------------------------------------------------------------- >> >>> This message was sent using IMP, the Internet Messaging Program. >> >>> >> >>> >> >>> -- >> >>> This message has been scanned for viruses and >> >>> dangerous content by MailScanner, and is >> >>> believed to be clean. >> >>> >> >>> _______________________________________________ >> >>> This is the private VTK discussion list. >> >>> Please keep messages on-topic. Check the FAQ at: >> >>> http://www.vtk.org/Wiki/VTK_FAQ >> >>> Follow this link to subscribe/unsubscribe: >> >>> http://www.vtk.org/mailman/listinfo/vtkusers >> >>> >> >> >> >> -- >> >> This message has been scanned for viruses and >> >> dangerous content by MailScanner, and is >> >> believed to be clean. >> >> >> >> >> > >> > >> > >> > ---------------------------------------------------------------- >> > This message was sent using IMP, the Internet Messaging Program. >> > >> > >> > -- >> > This message has been scanned for viruses and >> > dangerous content by MailScanner, and is >> > believed to be clean. >> > >> > >> >> > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From tonee47 at yahoo.com Tue May 20 01:38:52 2008 From: tonee47 at yahoo.com (John Eke) Date: Mon, 19 May 2008 22:38:52 -0700 (PDT) Subject: [vtkusers] VTK Build Error on Ubuntu 8.04: TCL Conversion Error Message-ID: <324030.14008.qm@web38903.mail.mud.yahoo.com> Hi, I am trying to build VTK on Ubuntu 8.04 but it fails with the following error: [ 98%] Converting Tcl test Converting /usr/local/VTKsource/Filtering/Testing/Tcl/closedSplines.tcl Conversion failed! make[2]: *** [Filtering/Testing/Python/conversion_complete] Error 1 make[1]: *** [Filtering/Testing/Python/CMakeFiles/FilteringPythonTests.dir/all] Error 2 make: *** [all] Error 2 I'm not really sure what the problem is. Actually I'm clueless. And it wont let me make install if that step doesn't pass, so I'm literally stuck. Help please -------------- next part -------------- An HTML attachment was scrubbed... URL: From xs81525 at 126.com Tue May 20 04:44:19 2008 From: xs81525 at 126.com (=?gb2312?B?z8TLyQ==?=) Date: Tue, 20 May 2008 16:44:19 +0800 Subject: [vtkusers] How to mapp the vtkTexture onto the vtkPlaneSource Message-ID: <48328F50.0AF6EB.14391@m15-113.126.com> Hello everybody: I want to mapp the vtkTexture onto the vtkPlaneSource,but i don't know how to do ,please help me ,thanks in advance simon ????????xs81525 at 126.com ??????????2008-05-20 From fabrous at gmail.com Tue May 20 05:05:38 2008 From: fabrous at gmail.com (Fabricio) Date: Tue, 20 May 2008 11:05:38 +0200 Subject: [vtkusers] How to mapp the vtkTexture onto the vtkPlaneSource In-Reply-To: <48328F50.0AF6EB.14391@m15-113.126.com> References: <48328F50.0AF6EB.14391@m15-113.126.com> Message-ID: <21a95c930805200205h2a3733bek82ddf5f0f2a26b95@mail.gmail.com> Hello vtkusers, I am working with FEA and I would like to use in my simulations, files of some solids reconstructed by pictures.My files are saved with the extension vtp, and I would like to know if is possible to convert it to iges files. Or, if it is not possible, I would like to know if is possible to collect some measurements from these vtp files with VTK. Can somebody help me with my questions? Thank you very much!! Lopes -------------- next part -------------- An HTML attachment was scrubbed... URL: From cquammen at cs.unc.edu Tue May 20 09:39:30 2008 From: cquammen at cs.unc.edu (Cory Quammen) Date: Tue, 20 May 2008 09:39:30 -0400 Subject: [vtkusers] How to save the stenciled images? In-Reply-To: References: Message-ID: <38fd72f40805200639s42a83b2fm77530aca37dbc420@mail.gmail.com> Hi Mark, It sounds like you are having trouble showing your chosen image component in the vtkImageViewer2. You might try something like this: vtkImageViewer *viewer = ...; vtkImageMapToWindowLevelColors *windowLevelMap = viewer->GetWindowLevel(); // X below is an index 0 through the number of components you stuffed into your image windowLevelMap->SetActiveComponent(X); Hope that helps, Cory On Mon, May 19, 2008 at 8:10 AM, Mark Jefferson wrote: > Thank you for your help, Cory, > but I still don't know what's wrong with it. of course I have used class > vtkImageAppendComponents, however, it doesn't work, and the image that shown > by using class vtkImageViewer2 is always the last one or the first one. > could you help me to see what's wrong with my codes here: > vtkImageAppendComponents * imageAppend = vtkImageAppendComponents::New(); > vtkImageStencil * temp1 = FinishImageStencil(); > imageAppend->AddInput(temp1->GetOutput()); > vtkImageStencil * temp2 = FinishImageStencil(); > imageAppend->AddInput(temp2->GetOutput()); > vtkXMLImageDataWriter * writer = vtkXMLImageDataWriter::New(); > writer->SetInputConnection(imageAppend->GetOutputPort()); > writer->SetFileName("image.vti"); > writer->SetDataModeToBinary(); > writer->Update(); > writer->Write(); > vtkXMLImageDataReader * reader = vtkXMLImageDataReader::New(); > reader->SetFileName("image.vti"); > reader->Update(); > vtkImageData * xmlImageData = vtkImageData::New(); > xmlImageData->DeepCopy(reader->GetOutput()); > // display the images in image.vti using class vtkImageViewer2 > ... ... > // FinishImageStencil() is a function returning a object of class > vtkImageStencil. > here I just save two stenciled images, at the same time, I use class > vtkBMPWriter to save the stenciled images, too. but the result is : the > result is not right if I use vtkXMLImageDataWriter. and I doubt there is > only one image in the image.vti. > could you help me? thank you! > M. J. > > > > ----------------------------------------------------------------------------------------------------------------------------------------------------------- > Mark, > The closest you can probably come is to jam all the stencil images > together into one image with vtkImageAppendComponents and then save > the whole thing into a single .vti file. I don't believe you can save > more than one image in a single .vti file (someone on list correct me > if I am wrong). You might be able to exploit VTK's relatively new time > support and treat your images as though they were time-series data, > but I am not familiar enough with that to give you advice (you might > find some hints for time-series data in the documentation for > vtkXMLWriter: http://www.vtk.org/doc/nightly/html/classvtkXMLWriter.html). > > Hope that helps, > Cory > > -- > Cory Quammen > Department of Computer Science > University of North Carolina at Chapel Hill > http://www.cs.unc.edu/~cquammen > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -- Cory Quammen Department of Computer Science University of North Carolina at Chapel Hill http://www.cs.unc.edu/~cquammen From fabrous at gmail.com Tue May 20 11:11:04 2008 From: fabrous at gmail.com (Fabricio) Date: Tue, 20 May 2008 17:11:04 +0200 Subject: [vtkusers] Help with measurement of reconstructed solids Message-ID: <21a95c930805200811n5d1fffafkb2e28be84617579c@mail.gmail.com> Hello vtkusers, I am working with FEA and I would like to use in my simulations, files of some solids reconstructed by pictures.My files are saved with the extension vtp, and I would like to know if is possible to convert it to iges files. Or, if it is not possible, I would like to know if is possible to collect some measurements from these vtp files with VTK. Can somebody help me with my questions? Thank you very much!! Lopes -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.cole at kitware.com Tue May 20 11:44:14 2008 From: david.cole at kitware.com (David Cole) Date: Tue, 20 May 2008 11:44:14 -0400 Subject: [vtkusers] VTK Build Error on Ubuntu 8.04: TCL Conversion Error In-Reply-To: <324030.14008.qm@web38903.mail.mud.yahoo.com> References: <324030.14008.qm@web38903.mail.mud.yahoo.com> Message-ID: If you just want a quick workaround to avoid this particular problem, you can comment out the "closedSplines" test in the VTK/Filtering/Testing/Python/CMakeLists.txt file. Use a "#" character to comment out the line that says "closedSplines". There must be something unique about your system or your python installation that triggers this issue, because we do not see this on the VTK dashboards that have python wrapping turned on... Do you have a development build of python on this machine? Anything else unique? HTH, David On Tue, May 20, 2008 at 1:38 AM, John Eke wrote: > > Hi, > > I am trying to build VTK on Ubuntu 8.04 but it fails with the following > error: > > [ 98%] Converting Tcl test > > Converting /usr/local/VTKsource/Filtering/Testing/Tcl/closedSplines.tcl > Conversion failed! > make[2]: *** [Filtering/Testing/Python/conversion_complete] Error 1 > make[1]: *** > [Filtering/Testing/Python/CMakeFiles/FilteringPythonTests.dir/all] > Error 2 > make: *** [all] Error 2 > > I'm not really sure what the problem is. Actually I'm clueless. And it wont > let me make install if that step doesn't pass, so I'm literally stuck. > > Help please > > > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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 ahs at cfdrc.com Tue May 20 12:09:50 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Tue, 20 May 2008 11:09:50 -0500 Subject: [vtkusers] VTK Build Error on Ubuntu 8.04: TCL Conversion Error In-Reply-To: References: <324030.14008.qm@web38903.mail.mud.yahoo.com> Message-ID: <4832F7CE.3060205@cfdrc.com> Hi David, I'm seeing similar behavior on my Windows machine. I have a CVS checkout of VTK from May 5, 2008. I'm using the Visual C++ 2005 Express compiler. I've turned on wrapping for Tcl (v. 8.5), Java (v. 1.5.0_13), and Python (v. 2.5); none of these are development versions, and I'm using pre-compiled versions of all of them. I get the error message the John reported in Filtering (same test), but I also get an error message for most of the other VTK kits: Rendering - assembly.tcl, VolumeRendering - gaussian.tcl, IO - dem.tcl, Imaging - ContinuousClose2D.tcl, Hybrid - 3DMorph.tcl, Parallel - RectOutline.tcl, Filtering - closedSplines.tcl, Graphics - AutomaticPlaneGeneration.tcl. For each of these kits, this is the 1st test listed in the Testing/Tcl/CMakeLists.txt file. This was a fresh compile. I saw this behavior on an earlier build of VTK, but it didn't stop me from installing. I just hit "Compile" in Visual Studio to see if a 2nd build (without starting from a fresh build tree) would make any difference, but I still see the same results. - Amy David Cole wrote: > If you just want a quick workaround to avoid this particular problem, > you can comment out the "closedSplines" test in the > VTK/Filtering/Testing/Python/CMakeLists.txt file. Use a "#" character > to comment out the line that says "closedSplines". > > There must be something unique about your system or your python > installation that triggers this issue, because we do not see this on > the VTK dashboards that have python wrapping turned on... Do you have > a development build of python on this machine? Anything else unique? > > > HTH, > David > > > On Tue, May 20, 2008 at 1:38 AM, John Eke > wrote: > > > Hi, > > I am trying to build VTK on Ubuntu 8.04 but it fails with the > following error: > > [ 98%] Converting Tcl test > > Converting > /usr/local/VTKsource/Filtering/Testing/Tcl/closedSplines.tcl > Conversion failed! > make[2]: *** [Filtering/Testing/Python/conversion_complete] Error 1 > make[1]: *** > [Filtering/Testing/Python/CMakeFiles/FilteringPythonTests.dir/all] > Error 2 > make: *** [all] Error 2 > > I'm not really sure what the problem is. Actually I'm clueless. > And it wont let me make install if that step doesn't pass, so I'm > literally stuck. > > Help please > > > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From hobbsk at ohiou.edu Tue May 20 12:12:48 2008 From: hobbsk at ohiou.edu (Kevin H. Hobbs) Date: Tue, 20 May 2008 12:12:48 -0400 Subject: [vtkusers] Link between ITK and VTK In-Reply-To: <696662.19485.qm@web28308.mail.ukl.yahoo.com> References: <696662.19485.qm@web28308.mail.ukl.yahoo.com> Message-ID: <1211299968.2009.24.camel@gargon.hooperlab> On Sat, 2008-05-17 at 13:29 +0000, C. Hiba wrote: > Hi everyone. I want to apply ITK functions on VTK objects (like VRML > 3D images). > > Can you tell me how to make the link between ITK and VTK?? > > Thank you for your help > > > Include the header from InsightApplications/vtkITK/Common/ #include "vtkITKUtility.h" Then in your program : // VTK Export vtkImageExport * vtk_export = vtkImageExport::New(); vtk_export->SetInputConnection( vtk_source->GetOutputPort() ); // ITK Import typedef itk::VTKImageImport< D_ImageType > ITKImportType; ITKImportType::Pointer itk_import = ITKImportType::New(); ConnectPipelines( vtk_export, itk_import ); -------------- 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 david.cole at kitware.com Tue May 20 12:20:43 2008 From: david.cole at kitware.com (David Cole) Date: Tue, 20 May 2008 12:20:43 -0400 Subject: [vtkusers] VTK Build Error on Ubuntu 8.04: TCL Conversion Error In-Reply-To: <4832F7CE.3060205@cfdrc.com> References: <324030.14008.qm@web38903.mail.mud.yahoo.com> <4832F7CE.3060205@cfdrc.com> Message-ID: Hmmmmm.... so why don't these show up as dashboard errors I wonder....? On Tue, May 20, 2008 at 12:09 PM, Amy Squillacote wrote: > Hi David, > > I'm seeing similar behavior on my Windows machine. I have a CVS checkout of > VTK from May 5, 2008. I'm using the Visual C++ 2005 Express compiler. I've > turned on wrapping for Tcl (v. 8.5), Java (v. 1.5.0_13), and Python (v. > 2.5); none of these are development versions, and I'm using pre-compiled > versions of all of them. > > I get the error message the John reported in Filtering (same test), but I > also get an error message for most of the other VTK kits: Rendering - > assembly.tcl, VolumeRendering - gaussian.tcl, IO - dem.tcl, Imaging - > ContinuousClose2D.tcl, Hybrid - 3DMorph.tcl, Parallel - RectOutline.tcl, > Filtering - closedSplines.tcl, Graphics - AutomaticPlaneGeneration.tcl. For > each of these kits, this is the 1st test listed in the > Testing/Tcl/CMakeLists.txt file. This was a fresh compile. I saw this > behavior on an earlier build of VTK, but it didn't stop me from installing. > > I just hit "Compile" in Visual Studio to see if a 2nd build (without > starting from a fresh build tree) would make any difference, but I still see > the same results. > > - Amy > > David Cole wrote: > >> If you just want a quick workaround to avoid this particular problem, you >> can comment out the "closedSplines" test in the >> VTK/Filtering/Testing/Python/CMakeLists.txt file. Use a "#" character to >> comment out the line that says "closedSplines". >> >> There must be something unique about your system or your python >> installation that triggers this issue, because we do not see this on the VTK >> dashboards that have python wrapping turned on... Do you have a development >> build of python on this machine? Anything else unique? >> >> >> HTH, >> David >> >> >> On Tue, May 20, 2008 at 1:38 AM, John Eke > tonee47 at yahoo.com>> wrote: >> >> >> Hi, >> >> I am trying to build VTK on Ubuntu 8.04 but it fails with the >> following error: >> >> [ 98%] Converting Tcl test >> >> Converting >> /usr/local/VTKsource/Filtering/Testing/Tcl/closedSplines.tcl >> Conversion failed! >> make[2]: *** [Filtering/Testing/Python/conversion_complete] Error 1 >> make[1]: *** >> [Filtering/Testing/Python/CMakeFiles/FilteringPythonTests.dir/all] >> Error 2 >> make: *** [all] Error 2 >> >> I'm not really sure what the problem is. Actually I'm clueless. >> And it wont let me make install if that step doesn't pass, so I'm >> literally stuck. >> >> Help please >> >> >> >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> >> > > -- > Amy Squillacote Phone: (256) 726-4839 > Computer Scientist Fax: (256) 726-4806 > CFD Research Corporation Web: http://www.cfdrc.com > 215 Wynn Drive, Suite 501 > Huntsville, AL 35805 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Tue May 20 12:26:16 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Tue, 20 May 2008 11:26:16 -0500 Subject: [vtkusers] VTK Build Error on Ubuntu 8.04: TCL Conversion Error In-Reply-To: References: <324030.14008.qm@web38903.mail.mud.yahoo.com> <4832F7CE.3060205@cfdrc.com> Message-ID: <4832FBA8.9030608@cfdrc.com> Don't know... I've attached my CMakeCache.txt file in case it helps shed light on anything. David Cole wrote: > Hmmmmm.... so why don't these show up as dashboard errors I wonder....? > > > On Tue, May 20, 2008 at 12:09 PM, Amy Squillacote > wrote: > > Hi David, > > I'm seeing similar behavior on my Windows machine. I have a CVS > checkout of VTK from May 5, 2008. I'm using the Visual C++ 2005 > Express compiler. I've turned on wrapping for Tcl (v. 8.5), Java > (v. 1.5.0_13), and Python (v. 2.5); none of these are development > versions, and I'm using pre-compiled versions of all of them. > > I get the error message the John reported in Filtering (same > test), but I also get an error message for most of the other VTK > kits: Rendering - assembly.tcl, VolumeRendering - gaussian.tcl, IO > - dem.tcl, Imaging - ContinuousClose2D.tcl, Hybrid - 3DMorph.tcl, > Parallel - RectOutline.tcl, Filtering - closedSplines.tcl, > Graphics - AutomaticPlaneGeneration.tcl. For each of these kits, > this is the 1st test listed in the Testing/Tcl/CMakeLists.txt > file. This was a fresh compile. I saw this behavior on an earlier > build of VTK, but it didn't stop me from installing. > > I just hit "Compile" in Visual Studio to see if a 2nd build > (without starting from a fresh build tree) would make any > difference, but I still see the same results. > > - Amy > > David Cole wrote: > > If you just want a quick workaround to avoid this particular > problem, you can comment out the "closedSplines" test in the > VTK/Filtering/Testing/Python/CMakeLists.txt file. Use a "#" > character to comment out the line that says "closedSplines". > > There must be something unique about your system or your > python installation that triggers this issue, because we do > not see this on the VTK dashboards that have python wrapping > turned on... Do you have a development build of python on this > machine? Anything else unique? > > > HTH, > David > > > On Tue, May 20, 2008 at 1:38 AM, John Eke >> wrote: > > > Hi, > > I am trying to build VTK on Ubuntu 8.04 but it fails with the > following error: > > [ 98%] Converting Tcl test > > Converting > /usr/local/VTKsource/Filtering/Testing/Tcl/closedSplines.tcl > Conversion failed! > make[2]: *** [Filtering/Testing/Python/conversion_complete] > Error 1 > make[1]: *** > > [Filtering/Testing/Python/CMakeFiles/FilteringPythonTests.dir/all] > Error 2 > make: *** [all] Error 2 > > I'm not really sure what the problem is. Actually I'm clueless. > And it wont let me make install if that step doesn't pass, > so I'm > literally stuck. > > Help please > > > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > > -- > Amy Squillacote Phone: (256) 726-4839 > Computer Scientist Fax: (256) 726-4806 > CFD Research Corporation Web: http://www.cfdrc.com > 215 Wynn Drive, Suite 501 > Huntsville, AL 35805 > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CMakeCache.txt URL: From scott.martinelli at sei.aero Tue May 20 13:47:30 2008 From: scott.martinelli at sei.aero (Scott Martinelli) Date: Tue, 20 May 2008 13:47:30 -0400 Subject: [vtkusers] Grid Zones in VTK File Formats for Paraview Message-ID: <48330EB2.3060403@sei.aero> Hello All, I am in the process of writing my CFD output to a VTK file format, either the legacy or the unstructured XML format. I would like to be able to select different zones of my grid (body surface versus flow volume) for the display of my output variables. Is there a way to specify grid zones in these file formats? I would prefer not to create two separate output files to be read in independently. Thanks for the input From evans at aps.anl.gov Tue May 20 16:18:33 2008 From: evans at aps.anl.gov (Kenneth Evans) Date: Tue, 20 May 2008 15:18:33 -0500 Subject: [vtkusers] How to make vtkImagefrom vtkTIFFReader resize Message-ID: <005701c8bab6$adb03680$950836a4@aps.anl.gov> I am reading and rereading TIFF images of different sizes (this is in Python, but it should not matter): reader = vtk.vtkTIFFReader() reader.SetFileName(filename) reader.Update() actor = vtk.vtkImageActor() actor.SetInput(reader.GetOutput()) actor.SetVisibility(1) ren.AddActor(actor) I want to read a new image: reader.SetFileName(filename) reader.Update() This works fine, except the output = reader.GetOutput() which is a vtkImage retains the old size. output.GetExtent() returns the original extent. output.GetWholeExtent() returns the new extent but output.SetExtent(output.GetWholeExtent()) crashes. How to I reset the vtkImage extent (without creating a new actor)? Thanks, -Ken -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.jefferson at qq.com Tue May 20 23:08:33 2008 From: mark.jefferson at qq.com (=?ISO-8859-1?B?TWFyayBKZWZmZXJzb24=?=) Date: Wed, 21 May 2008 11:8:33 +0800 Subject: [vtkusers] problem of class vtkImageAppendComponents Message-ID: Thank you for your help, Cory, I have test the data output of vtkImageAppendComponents, and I write its output into a .vti file. I use VolView to test this .vti data, I find there really are two "different" components in the .vti data, but the component 0(default) and component 1 are always the same. or in other words, the two components are the same, and the components are all the first one, that is the default component. but from the vtk document, we could know the output's number of components are the summation of the two inputs' number of components, so the .vti data should have two components. what's more, my data is different, they come from the same large CT dataset, which are the first one and the last one. in my .vti data, another component is lost. and here are my codes: vtkImageAppendComponents * append = vtkImageAppendComponents::New(); append->AddInputConnection(0, reader1->GetOutputPort()); append->AddInputConnection(1, reader2->GetOutputPrort()); append->Update(); // wirte the append's output into a .vti file ... ... and then I get one warning, not error: vtkImageAppendComponents (0x02C3DC50): Attempt to connect input port index 1 for an algorithm with 1 input ports. it seems there is something wrong with input port index 1. and maybe this is the key why there is only one component in .vti data. could you tell me why? what's wrong with my codes? thank you! M. J. ------------------------------------------------------------------------------------------------------------------------------------------------ Hi Mark, It sounds like you are having trouble showing your chosen image component in the vtkImageViewer2. You might try something like this: vtkImageViewer *viewer = ...; vtkImageMapToWindowLevelColors *windowLevelMap = viewer->GetWindowLevel(); // X below is an index 0 through the number of components you stuffed into your image windowLevelMap->SetActiveComponent(X); Hope that helps, Cory On Mon, May 19, 2008 at 8:10 AM, Mark Jefferson wrote: > Thank you for your help, Cory, > but I still don't know what's wrong with it. of course I have used class > vtkImageAppendComponents, however, it doesn't work, and the image that shown > by using class vtkImageViewer2 is always the last one or the first one. > could you help me to see what's wrong with my codes here: > vtkImageAppendComponents * imageAppend = vtkImageAppendComponents::New(); > vtkImageStencil * temp1 = FinishImageStencil(); > imageAppend->AddInput(temp1->GetOutput()); > vtkImageStencil * temp2 = FinishImageStencil(); > imageAppend->AddInput(temp2->GetOutput()); > vtkXMLImageDataWriter * writer = vtkXMLImageDataWriter::New(); > writer->SetInputConnection(imageAppend->GetOutputPort()); > writer->SetFileName("image.vti"); > writer->SetDataModeToBinary(); > writer->Update(); > writer->Write(); > vtkXMLImageDataReader * reader = vtkXMLImageDataReader::New(); > reader->SetFileName("image.vti"); > reader->Update(); > vtkImageData * xmlImageData = vtkImageData::New(); > xmlImageData->DeepCopy(reader->GetOutput()); > // display the images in image.vti using class vtkImageViewer2 > ... ... > // FinishImageStencil() is a function returning a object of class > vtkImageStencil. > here I just save two stenciled images, at the same time, I use class > vtkBMPWriter to save the stenciled images, too. but the result is : the > result is not right if I use vtkXMLImageDataWriter. and I doubt there is > only one image in the image.vti. > could you help me? thank you! > M. J. > > > > ----------------------------------------------------------------------------------------------------------------------------------------------------------- > Mark, > The closest you can probably come is to jam all the stencil images > together into one image with vtkImageAppendComponents and then save > the whole thing into a single .vti file. I don't believe you can save > more than one image in a single .vti file (someone on list correct me > if I am wrong). You might be able to exploit VTK's relatively new time > support and treat your images as though they were time-series data, > but I am not familiar enough with that to give you advice (you might > find some hints for time-series data in the documentation for > vtkXMLWriter: http://www.vtk.org/doc/nightly/html/classvtkXMLWriter.html). > > Hope that helps, > Cory > > -- > Cory Quammen > Department of Computer Science > University of North Carolina at Chapel Hill > http://www.cs.unc.edu/~cquammen > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -- Cory Quammen Department of Computer Science University of North Carolina at Chapel Hill http://www.cs.unc.edu/~cquammen -------------- next part -------------- An HTML attachment was scrubbed... URL: From blloyd at vision.ee.ethz.ch Wed May 21 06:29:40 2008 From: blloyd at vision.ee.ethz.ch (Bryn Lloyd) Date: Wed, 21 May 2008 12:29:40 +0200 Subject: [vtkusers] python programmable filter / paraview In-Reply-To: References: Message-ID: <4833F994.3040007@vision.ee.ethz.ch> Hi users I wanted to visualize point ids in paraview, but I could not find a way to do this. One of the approaches I tried, was to use the programmable filter and a vtkIdFilter + vtkLabeledDataMapper. Unfortunately, neither of these classes were located by the programmable filter ("AttributeError: 'module' object has no attribute 'vtkLabeledDataMapper'"). This simple python code fails: ------------ from paraview import vtk ldm = vtk.vtkLabeledDataMapper() ------------ Does anybody know what I am doing wrong, or why this does not work? I checked if the vtk filters are in the paraview source directory: They are! Thanks for any hints/help Cheers, Bryn -- ------------------------------------------------- Bryn Lloyd Computer Vision Laboratory ETH Z?rich, Sternwartstrasse 7 CH - 8092 Z?rich, Switzerland Tel: +41 44 63 27690 Fax: +41 44 63 21199 ------------------------------------------------- From biddisco at cscs.ch Wed May 21 07:29:20 2008 From: biddisco at cscs.ch (John Biddiscombe) Date: Wed, 21 May 2008 13:29:20 +0200 Subject: [vtkusers] Grid Zones in VTK File Formats for Paraview In-Reply-To: <48330EB2.3060403@sei.aero> References: <48330EB2.3060403@sei.aero> Message-ID: <48340790.90401@cscs.ch> Scott write each zone into a separate xml file and group them using a vtm (multiblock) collection wrapper JB > Hello All, > > I am in the process of writing my CFD output to a VTK file format, > either the legacy or the unstructured XML format. I would like to be > able to select different zones of my grid (body surface versus flow > volume) for the display of my output variables. > > Is there a way to specify grid zones in these file formats? > > I would prefer not to create two separate output files to be read in > independently. > Thanks for the input > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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/about/BJohn.php CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07 Via Cantonale, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82 From vidyadhar at lucidindia.com Wed May 21 07:40:28 2008 From: vidyadhar at lucidindia.com (Vidyadhar) Date: Wed, 21 May 2008 17:10:28 +0530 Subject: [vtkusers] How to make vtkImagefrom vtkTIFFReader resize References: <005701c8bab6$adb03680$950836a4@aps.anl.gov> Message-ID: <006a01c8bb37$7b6410d0$1601a8c0@quad02> Hi, I have a suggestion. After reader.Update() call, try reader.GetOutput().Update(). This is supposed to update bounds, extents, et cetera. HTH Vidyadhar ----- Original Message ----- From: Kenneth Evans To: vtkusers at vtk.org Sent: Wednesday, May 21, 2008 1:48 AM Subject: [vtkusers] How to make vtkImagefrom vtkTIFFReader resize I am reading and rereading TIFF images of different sizes (this is in Python, but it should not matter): reader = vtk.vtkTIFFReader() reader.SetFileName(filename) reader.Update() actor = vtk.vtkImageActor() actor.SetInput(reader.GetOutput()) actor.SetVisibility(1) ren.AddActor(actor) I want to read a new image: reader.SetFileName(filename) reader.Update() This works fine, except the output = reader.GetOutput() which is a vtkImage retains the old size. output.GetExtent() returns the original extent. output.GetWholeExtent() returns the new extent but output.SetExtent(output.GetWholeExtent()) crashes. How to I reset the vtkImage extent (without creating a new actor)? Thanks, -Ken ------------------------------------------------------------------------------ _______________________________________________ This is the private VTK discussion list. Please keep messages on-topic. Check the 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 cocorim at hotmail.fr Wed May 21 07:48:12 2008 From: cocorim at hotmail.fr (Alosha [Dread_Lord]) Date: Wed, 21 May 2008 13:48:12 +0200 Subject: [vtkusers] 3d reconstruction Message-ID: Hi all ! Maybe the problem has already been exposed, and I'm sorry if it was. I've managed to made a basic DICOM Viewer. It has 4 views ; 3 views to axial, coronal ans sagittal orientation, and a tridimentionnal view for 3d reconstruction. I'm using igstk::View2D and igstk::View3D. I instantiate a CTImageSpatialObject in which I put the CT Image from the CTImageReader. Then I put the CTImageSpatialObject into a CTImageSpatialObjectRepresentation and I give it to the igstk::View2D. It's working properly and I can navigate into slides in the three 2D views. My problems is now how to perform a 3D reconstruction of the DICOM and display it in the 3D View. I've search on the net and on the mailing list for some help, but all this is still a little unclear to me. I just know that ITK and VTK has to be used, but I have no idea of how. If you can help me on that or at least show me the way for begin, I would be very greatfull. Thanks a lot ! _________________________________________________________________ Avec Hotmail, vos e-mails vous suivent partout ! Mettez Hotmail sur votre mobile ! http://www.messengersurvotremobile.com/?d=hotmail -------------- next part -------------- An HTML attachment was scrubbed... URL: From rashed.vtk at googlemail.com Wed May 21 08:01:59 2008 From: rashed.vtk at googlemail.com (rashedk) Date: Wed, 21 May 2008 05:01:59 -0700 (PDT) Subject: [vtkusers] vtkPolygon::PointInPolygon 's parameters Message-ID: <17364157.post@talk.nabble.com> Hi everyone, I cant find any reference in the documentation about the parameters of the static function vtkPolygon::PointInPolygon Here is the signature: int PointInPolygon (float x[3], int numPts, float *pts, float bounds[6], float n[3]) Especially with regards to the 4th parameter bounds[6]. If I have four corner points of a polygon (i.e. plane) for example, how do I compute bounds? Are these the min-max of each x,y,z component for the four corner points? Thanks, Rashed -- View this message in context: http://www.nabble.com/vtkPolygon%3A%3APointInPolygon-%27s-parameters-tp17364157p17364157.html Sent from the VTK - Users mailing list archive at Nabble.com. From louxkr at gmail.com Wed May 21 08:47:38 2008 From: louxkr at gmail.com (Kerry Loux) Date: Wed, 21 May 2008 08:47:38 -0400 Subject: [vtkusers] Altering a rendered actor In-Reply-To: <369e9e6b0805201714u6bb61d83r1e7b6bebd3d1d34d@mail.gmail.com> References: <369e9e6b0805201714u6bb61d83r1e7b6bebd3d1d34d@mail.gmail.com> Message-ID: <65c344fe0805210547qe774d6etce18aecdd885f495@mail.gmail.com> Thanks for your response, Lu. Yes, that's what I'm doing, but my problem is only with re-rendering the image. After updating the actor's position and orientation, the image doesn't update until I click on the screen to rotate or zoom, etc. It seems as though I'm missing the "update the screen" call. I have since found that if I call the Render() method of the renderWindowInteractor (actually a wxVTKRenderWindowInteractor) the actor disappears from the original position, but it still isn't redrawn until I click on the window. The only way I've found that updates the screen without clicking on it is to invoke a clicking event with the InvokeEvent() method. This is undesirable because then my screen rotates until I click on it. I've tried the following to get the screen to update: pConeActor->SetPosition(5.0,5.0,0.0);// Set new position - for this sample, original position was [0.0, 0.0, 0.0] m_pVTKWindow->Render(); This removes the actor from the original position, but doesn't draw it in it's new position until I click on the screen, as stated above. pConeActor->SetPosition(5.0,5.0,0.0); m_pVTKWindow->Render(); m_pVTKWindow->InvokeEvent(vtkCommand::ModifiedEvent, NULL); The addition of the InvokeEvent call here makes no difference. pConeActor->SetPosition(5.0,5.0,0.0); m_pVTKWindow->Render(); m_pVTKWindow->Update();// I've tried this with Update first, then Render as well The Update() call here makes no difference. pConeActor->SetPosition(5.0,5.0,0.0); m_pVTKWindow->Render(); m_pVTKWindow->InvokeEvent(vtkCommand::LeftButtonPressEvent, NULL); This does make the image redraw, but it also makes it spin (as though you were pressing the left mouse button...). That makes the obvious next step: pConeActor->SetPosition(5.0,5.0,0.0); m_pVTKWindow->Render(); m_pVTKWindow->InvokeEvent(vtkCommand::LeftButtonPressEvent, NULL); m_pVTKWindow->InvokeEvent(vtkCommand::LeftButtonReleaseEvent, NULL); But this doesn't do anything different than the first few attempts. I've been looking at the code that handles the LeftButtonPressEvent (vtkSubjectHelper::InvokeEvent in vtkObject.cxx) to try and figure out what part of that function makes the screen update, but so far I haven't been successful. Any help or advice is still appreciated! Thanks, Kerry On Tue, May 20, 2008 at 8:14 PM, Yick Lu wrote: > Maybe you can try "events" > > The event handler function should be like this: > > Typing Event Handler( eventArgs ) > { > //check character at the beginning > > pActor->Setpostion();//define new position > pRenderer->Render(); > > } > > The event is invoked as user type anything in the textbox. But make sure > the inputed character is checked and valid. > > > -- > Lu Yi > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Wed May 21 09:41:10 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Wed, 21 May 2008 08:41:10 -0500 Subject: [vtkusers] [SPAM] problem of class vtkImageAppendComponents In-Reply-To: References: Message-ID: <48342676.5050808@cfdrc.com> Hi Mark, You can have multiple input connections on the same input port, and this is what is expected for vtkImageAppendComponents. Try using port 0 for both input connections. Only the first input port is used by this filter, which explains both the warning message you're seeing and why both components in the output are from the first input. For filters in VTK that take multiple inputs, if the function of the inputs is the same (as is the case here -- all the input datasets will be appended together), then one input port with multiple connections is used. If the function of the inputs is different (e.g., in the glyph filter -- one input determines the position of the glyphs; another input determines the geometry to place at those positions), then multiple input ports are used -- one input port for each different type of input. Thanks for posting the code snippet and the warning message; it made it clearer what was likely going wrong. - Amy Mark Jefferson wrote: > Thank you for your help, Cory, > I have test the data output of vtkImageAppendComponents, and I write > its output into a .vti file. > I use VolView to test this .vti data, I find there really are two > "different" components in the .vti data, but the component 0(default) > and component 1 are always the same. or in other words, the two > components are the same, and the components are all the first one, > that is the default component. > but from the vtk document, we could know the output's number of > components are the summation of the two inputs' number of components, > so the .vti data should have two components. what's more, my data is > different, they come from the same large CT dataset, which are the > first one and the last one. > in my .vti data, another component is lost. and here are my codes: > vtkImageAppendComponents * append = vtkImageAppendComponents::New(); > append->AddInputConnection(0, reader1->GetOutputPort()); > append->AddInputConnection(1, reader2->GetOutputPrort()); > append->Update(); > // wirte the append's output into a .vti file > ... ... > and then I get one warning, not error: > vtkImageAppendComponents (0x02C3DC50): Attempt to connect input port > index 1 for an algorithm with 1 input ports. > it seems there is something wrong with input port index 1. and maybe > this is the key why there is only one component in .vti data. > could you tell me why? what's wrong with my codes? thank you! > M. J. > > ------------------------------------------------------------------------------------------------------------------------------------------------ > Hi Mark, > > It sounds like you are having trouble showing your chosen image > component in the vtkImageViewer2. You might try something like this: > > vtkImageViewer *viewer = ...; > vtkImageMapToWindowLevelColors *windowLevelMap = viewer->GetWindowLevel(); > // X below is an index 0 through the number of components you stuffed > into your image > windowLevelMap->SetActiveComponent(X); > > Hope that helps, > Cory > > On Mon, May 19, 2008 at 8:10 AM, Mark Jefferson > wrote: > > Thank you for your help, Cory, > > but I still don't know what's wrong with it. of course I have used > class > > vtkImageAppendComponents, however, it doesn't work, and the image > that shown > > by using class vtkImageViewer2 is always the last one or the first one. > > could you help me to see what's wrong with my codes here: > > vtkImageAppendComponents * imageAppend = > vtkImageAppendComponents::New(); > > vtkImageStencil * temp1 = FinishImageStencil(); > > imageAppend->AddInput(temp1->GetOutput()); > > vtkImageStencil * temp2 = FinishImageStencil(); > > imageAppend->AddInput(temp2->GetOutput()); > > vtkXMLImageDataWriter * writer = vtkXMLImageDataWriter::New(); > > writer->SetInputConnection(imageAppend->GetOutputPort()); > > writer->SetFileName("image.vti"); > > writer->SetDataModeToBinary(); > > writer->Update(); > > writer->Write(); > > vtkXMLImageDataReader * reader = vtkXMLImageDataReader::New(); > > reader->SetFileName("image.vti"); > > reader->Update(); > > vtkImageData * xmlImageData = vtkImageData::New(); > > xmlImageData->DeepCopy(reader->GetOutput()); > > // display the images in image.vti using class vtkImageViewer2 > > ... ... > > // FinishImageStencil() is a function returning a object of class > > vtkImageStencil. > > here I just save two stenciled images, at the same time, I use class > > vtkBMPWriter to save the stenciled images, too. but the result is : the > > result is not right if I use vtkXMLImageDataWriter. and I doubt there is > > only one image in the image.vti. > > could you help me? thank you! > > M. J. > > > > > > > > > ----------------------------------------------------------------------------------------------------------------------------------------------------------- > > Mark, > > The closest you can probably come is to jam all the stencil images > > together into one image with vtkImageAppendComponents and then save > > the whole thing into a single .vti file. I don't believe you can save > > more than one image in a single .vti file (someone on list correct me > > if I am wrong). You might be able to exploit VTK's relatively new time > > support and treat your images as though they were time-series data, > > but I am not familiar enough with that to give you advice (you might > > find some hints for time-series data in the documentation for > > vtkXMLWriter: > http://www.vtk.org/doc/nightly/html/classvtkXMLWriter.html). > > > > Hope that helps, > > Cory > > > > -- > > Cory Quammen > > Department of Computer Science > > University of North Carolina at Chapel Hill > > http://www.cs.unc.edu/~cquammen > > > > _______________________________________________ > > This is the private VTK discussion list. > > Please keep messages on-topic. Check the FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > > -- > Cory Quammen > Department of Computer Science > University of North Carolina at Chapel Hill > http://www.cs.unc.edu/~cquammen > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From w_e_b_m_a_s_t_e_r_6_9 at hotmail.com Wed May 21 10:44:50 2008 From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com (Cameron Burnett) Date: Thu, 22 May 2008 00:44:50 +1000 Subject: [vtkusers] 3d reconstruction In-Reply-To: References: Message-ID: You can actually read in a DICOM file as a 3D object just using VTK. vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New(); dicomReader->SetDirectoryName( "C:\\dicomfolder\\"); Have a look at Ray Cast Mapping as well (vtkVolumeRayCastMapper). I'm not sure if there is a better way though. With this approach, the image has to reduce its image quality (goes a bit blurry) while you move the camera. Then once you are finished moving around it will return to its original quality. Alternatively you can read it in using ITK, and then convert it back to VTK. I haven't tried this, so maybe someone can let you know the best way to do it. Regards, Cameron. From: cocorim at hotmail.fr To: vtkusers at vtk.org Date: Wed, 21 May 2008 13:48:12 +0200 Subject: [vtkusers] 3d reconstruction Hi all ! Maybe the problem has already been exposed, and I'm sorry if it was. I've managed to made a basic DICOM Viewer. It has 4 views ; 3 views to axial, coronal ans sagittal orientation, and a tridimentionnal view for 3d reconstruction. I'm using igstk::View2D and igstk::View3D. I instantiate a CTImageSpatialObject in which I put the CT Image from the CTImageReader. Then I put the CTImageSpatialObject into a CTImageSpatialObjectRepresentation and I give it to the igstk::View2D. It's working properly and I can navigate into slides in the three 2D views. My problems is now how to perform a 3D reconstruction of the DICOM and display it in the 3D View. I've search on the net and on the mailing list for some help, but all this is still a little unclear to me. I just know that ITK and VTK has to be used, but I have no idea of how. If you can help me on that or at least show me the way for begin, I would be very greatfull. Thanks a lot ! Discutez gratuitement avec vos amis en vid?o ! T?l?chargez Messenger, c'est gratuit ! _________________________________________________________________ Search for local singles online @ Lavalife - Click here http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Flavalife9%2Eninemsn%2Ecom%2Eau%2Fclickthru%2Fclickthru%2Eact%3Fid%3Dninemsn%26context%3Dan99%26locale%3Den%5FAU%26a%3D30290&_t=764581033&_r=email_taglines_Search_OCT07&_m=EXT -------------- next part -------------- An HTML attachment was scrubbed... URL: From cocorim at hotmail.fr Wed May 21 11:05:33 2008 From: cocorim at hotmail.fr (Alosha [Dread_Lord]) Date: Wed, 21 May 2008 17:05:33 +0200 Subject: [vtkusers] 3d reconstruction In-Reply-To: References: Message-ID: Thank you for your answer. The vtkDicomImageReader actually works, but I have some LINK error while instantiating vtkVolumeRayCastMapper. ( vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New() ) Anyway, is the vtkDicomImageReader build a 3D mesh using the 2D dicom serie, or just generate a data set ? In this last case, how can I display it in my igstk::View3D ? I suppose I have to build a mesh with it ? I guess there is a VTK class which takes a volume VTK data set and build a mesh with it, but I don't know which class :S. Anyway, thanks for your answer, and I'm all ears if anyone knows how to generate a 3D object from my 2D Dicom series for displaying in a igstk::View3D From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.comTo: cocorim at hotmail.frCC: vtkusers at vtk.orgSubject: RE: [vtkusers] 3d reconstructionDate: Thu, 22 May 2008 00:44:50 +1000 You can actually read in a DICOM file as a 3D object just using VTK.vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New(); dicomReader->SetDirectoryName( "C:\\dicomfolder\\");Have a look at Ray Cast Mapping as well (vtkVolumeRayCastMapper). I'm not sure if there is a better way though. With this approach, the image has to reduce its image quality (goes a bit blurry) while you move the camera. Then once you are finished moving around it will return to its original quality.Alternatively you can read it in using ITK, and then convert it back to VTK. I haven't tried this, so maybe someone can let you know the best way to do it.Regards,Cameron. From: cocorim at hotmail.frTo: vtkusers at vtk.orgDate: Wed, 21 May 2008 13:48:12 +0200Subject: [vtkusers] 3d reconstruction Hi all ! Maybe the problem has already been exposed, and I'm sorry if it was. I've managed to made a basic DICOM Viewer. It has 4 views ; 3 views to axial, coronal ans sagittal orientation, and a tridimentionnal view for 3d reconstruction. I'm using igstk::View2D and igstk::View3D. I instantiate a CTImageSpatialObject in which I put the CT Image from the CTImageReader.Then I put the CTImageSpatialObject into a CTImageSpatialObjectRepresentation and I give it to the igstk::View2D. It's working properly and I can navigate into slides in the three 2D views. My problems is now how to perform a 3D reconstruction of the DICOM and display it in the 3D View. I've search on the net and on the mailing list for some help, but all this is still a little unclear to me.I just know that ITK and VTK has to be used, but I have no idea of how. If you can help me on that or at least show me the way for begin, I would be very greatfull. Thanks a lot ! Discutez gratuitement avec vos amis en vid?o ! T?l?chargez Messenger, c'est gratuit ! Click here Search for local singles online @ Lavalife. _________________________________________________________________ Retouchez, classez et partagez vos photos gratuitement avec le logiciel Galerie de Photos ! http://www.windowslive.fr/galerie/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Wed May 21 11:20:08 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Wed, 21 May 2008 10:20:08 -0500 Subject: [vtkusers] 3d reconstruction In-Reply-To: References: Message-ID: <48343DA8.9010207@cfdrc.com> Are you linking against the vtkVolumeRendering library? You would need to do that in order to use vtkVolumeRayCastMapper (or any other volume rendering mapper). - Amy Alosha [Dread_Lord] wrote: > > Thank you for your answer. > > The vtkDicomImageReader actually works, but I have some LINK error > while instantiating vtkVolumeRayCastMapper. > > ( vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New() ) > > Anyway, is the vtkDicomImageReader build a 3D mesh using the 2D dicom > serie, or just generate a data set ? > > In this last case, how can I display it in my igstk::View3D ? I > suppose I have to build a mesh with it ? > > I guess there is a VTK class which takes a volume VTK data set and > build a mesh with it, but I don't know which class :S. > > Anyway, thanks for your answer, and I'm all ears if anyone knows how > to generate a 3D object from my 2D Dicom series for displaying in a > igstk::View3D > > > > ------------------------------------------------------------------------ > From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com > To: cocorim at hotmail.fr > CC: vtkusers at vtk.org > Subject: RE: [vtkusers] 3d reconstruction > Date: Thu, 22 May 2008 00:44:50 +1000 > > You can actually read in a DICOM file as a 3D object just using VTK. > > vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New(); > dicomReader->SetDirectoryName( "C:\\dicomfolder\\"); > > Have a look at Ray Cast Mapping as well (vtkVolumeRayCastMapper). > I'm not sure if there is a better way though. With this approach, > the image has to reduce its image quality (goes a bit blurry) > while you move the camera. Then once you are finished moving > around it will return to its original quality. > > Alternatively you can read it in using ITK, and then convert it > back to VTK. I haven't tried this, so maybe someone can let you > know the best way to do it. > > Regards, > Cameron. > > > > ------------------------------------------------------------------------ > From: cocorim at hotmail.fr > To: vtkusers at vtk.org > Date: Wed, 21 May 2008 13:48:12 +0200 > Subject: [vtkusers] 3d reconstruction > > Hi all ! > > Maybe the problem has already been exposed, and I'm sorry if > it was. > > I've managed to made a basic DICOM Viewer. It has 4 views ; 3 > views to axial, coronal ans sagittal orientation, and a > tridimentionnal view for 3d reconstruction. > > I'm using igstk::View2D and igstk::View3D. > > I instantiate a CTImageSpatialObject in which I put the CT > Image from the CTImageReader. > Then I put the CTImageSpatialObject into a > CTImageSpatialObjectRepresentation and I give it to the > igstk::View2D. > > It's working properly and I can navigate into slides in the > three 2D views. > > My problems is now how to perform a 3D reconstruction of the > DICOM and display it in the 3D View. > > I've search on the net and on the mailing list for some help, > but all this is still a little unclear to me. > I just know that ITK and VTK has to be used, but I have no > idea of how. > > If you can help me on that or at least show me the way for > begin, I would be very greatfull. > > Thanks a lot ! > > ------------------------------------------------------------------------ > Discutez gratuitement avec vos amis en vid?o ! T?l?chargez > Messenger, c'est gratuit ! > > > ------------------------------------------------------------------------ > Click here Search for local singles online @ Lavalife. > > > > > ------------------------------------------------------------------------ > Centralisez tous vos comptes mails dans Hotmail ! Cr?ez un compte > Hotmail, c'est gratuit ! > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From teresa.azevedo at fe.up.pt Wed May 21 11:27:34 2008 From: teresa.azevedo at fe.up.pt (Teresa Azevedo) Date: Wed, 21 May 2008 16:27:34 +0100 Subject: [vtkusers] vtkUnstructuredGrid problem Message-ID: <20080521162734.skc84vbnkwookkss@webmail.fe.up.pt> Hi all. I am new at VTK, but I tried to find a solution in this forum, without success. So, my problem is: I want to draw several voxels using an vtkUnstructuredGrid. Assuming that I know how many voxels (for example, 2) I need to draw and its 3D coordinates, I can use this code and it works fine: vtkUnstructuredGrid *octreeGrid = vtkUnstructuredGrid::New(); ? ? ? ? octreeGrid->Allocate(2); ? ? ? ? vtkPoints *voxelPoints = vtkPoints::New(); ? ? ? ? voxelPoints->SetNumberOfPoints(16); ? ? ? ? voxelPoints->InsertPoint(0, 0, 0, 0); ? ? ? ? voxelPoints->InsertPoint(1, 1, 0, 0); ? ? ? ? voxelPoints->InsertPoint(2, 0, 1, 0); ? ? ? ? voxelPoints->InsertPoint(3, 1, 1, 0); ? ? ? ? voxelPoints->InsertPoint(4, 0, 0, 1); ? ? ? ? voxelPoints->InsertPoint(5, 1, 0, 1); ? ? ? ? voxelPoints->InsertPoint(6, 0, 1, 1); ? ? ? ? voxelPoints->InsertPoint(7, 1, 1, 1); ? ? ? ? voxelPoints->InsertPoint(8, 0, 0, 1); ? ? ? ? voxelPoints->InsertPoint(9, 1, 0, 1); ? ? ? ? voxelPoints->InsertPoint(10, 0, 1, 1); ? ? ? ? voxelPoints->InsertPoint(11, 1, 1, 1); ? ? ? ? voxelPoints->InsertPoint(12, 0, 0, 2); ? ? ? ? voxelPoints->InsertPoint(13, 1, 0, 2); ? ? ? ? voxelPoints->InsertPoint(14, 0, 1, 2); ? ? ? ? voxelPoints->InsertPoint(15, 1, 1, 2); ? ? ? ? ? ? ? ? vtkVoxel *aVoxel1 = vtkVoxel::New(); ? ? ? ? aVoxel1->GetPointIds()->SetId(0, 0); ? ? ? ? aVoxel1->GetPointIds()->SetId(1, 1); ? ? ? ? aVoxel1->GetPointIds()->SetId(2, 2); ? ? ? ? aVoxel1->GetPointIds()->SetId(3, 3); ? ? ? ? aVoxel1->GetPointIds()->SetId(4, 4); ? ? ? ? aVoxel1->GetPointIds()->SetId(5, 5); ? ? ? ? aVoxel1->GetPointIds()->SetId(6, 6); ? ? ? ? aVoxel1->GetPointIds()->SetId(7, 7); ? ? ? ? vtkVoxel *aVoxel2 = vtkVoxel::New(); ? ? ? ? aVoxel2->GetPointIds()->SetId(0, 8); ? ? ? ? aVoxel2->GetPointIds()->SetId(1, 9); ? ? ? ? aVoxel2->GetPointIds()->SetId(2, 10); ? ? ? ? aVoxel2->GetPointIds()->SetId(3, 11); ? ? ? ? aVoxel2->GetPointIds()->SetId(4, 12); ? ? ? ? aVoxel2->GetPointIds()->SetId(5, 13); ? ? ? ? aVoxel2->GetPointIds()->SetId(6, 14); ? ? ? ? aVoxel2->GetPointIds()->SetId(7, 15); ? ? ? ? octreeGrid->InsertNextCell(VTK_VOXEL,aVoxel1->GetPointIds()); ? ? ? ? octreeGrid->InsertNextCell(VTK_VOXEL,aVoxel2->GetPointIds()); ? ? ? ? ? ? ? ? octreeGrid->SetPoints(voxelPoints); My problem is: in the beginning of my program, I do not how many voxels I need to draw. I tried this and it did not work: vtkUnstructuredGrid *octreeGrid = vtkUnstructuredGrid::New(); ? ? ? ? octreeGrid->Allocate(2); ? ? ? ? vtkPoints *voxelPoints1 = vtkPoints::New(); ? ? ? ? voxelPoints->SetNumberOfPoints(8); ? ? ? ? voxelPoints->InsertPoint(0, 0, 0, 0); ? ? ? ? voxelPoints->InsertPoint(1, 1, 0, 0); ? ? ? ? voxelPoints->InsertPoint(2, 0, 1, 0); ? ? ? ? voxelPoints->InsertPoint(3, 1, 1, 0); ? ? ? ? voxelPoints->InsertPoint(4, 0, 0, 1); ? ? ? ? voxelPoints->InsertPoint(5, 1, 0, 1); ? ? ? ? voxelPoints->InsertPoint(6, 0, 1, 1); ? ? ? ? voxelPoints->InsertPoint(7, 1, 1, 1); vtkVoxel *aVoxel1 = vtkVoxel::New(); ? ? ? ? aVoxel1->GetPointIds()->SetId(0, 0); ? ? ? ? aVoxel1->GetPointIds()->SetId(1, 1); ? ? ? ? aVoxel1->GetPointIds()->SetId(2, 2); ? ? ? ? aVoxel1->GetPointIds()->SetId(3, 3); ? ? ? ? aVoxel1->GetPointIds()->SetId(4, 4); ? ? ? ? aVoxel1->GetPointIds()->SetId(5, 5); ? ? ? ? aVoxel1->GetPointIds()->SetId(6, 6); ? ? ? ? aVoxel1->GetPointIds()->SetId(7, 7); octreeGrid->InsertNextCell(VTK_VOXEL,aVoxel1->GetPointIds()); octreeGrid->SetPoints(voxelPoints1); ? ? ? ? vtkPoints *voxelPoints2 = vtkPoints::New(); ? ? ? ? voxelPoints2->SetNumberOfPoints(8); ? ? ? ? voxelPoints2->InsertPoint(8, 0, 0, 1); ? ? ? ? voxelPoints2->InsertPoint(9, 1, 0, 1); ? ? ? ? voxelPoints2->InsertPoint(10, 0, 1, 1); ? ? ? ? voxelPoints2->InsertPoint(11, 1, 1, 1); ? ? ? ? voxelPoints2->InsertPoint(12, 0, 0, 2); ? ? ? ? voxelPoints2->InsertPoint(13, 1, 0, 2); ? ? ? ? voxelPoints2->InsertPoint(14, 0, 1, 2); ? ? ? ? voxelPoints2->InsertPoint(15, 1, 1, 2); ? ? ? ? vtkVoxel *aVoxel2 = vtkVoxel::New(); ? ? ? ? aVoxel2->GetPointIds()->SetId(0, 8); ? ? ? ? aVoxel2->GetPointIds()->SetId(1, 9); ? ? ? ? aVoxel2->GetPointIds()->SetId(2, 10); ? ? ? ? aVoxel2->GetPointIds()->SetId(3, 11); ? ? ? ? aVoxel2->GetPointIds()->SetId(4, 12); ? ? ? ? aVoxel2->GetPointIds()->SetId(5, 13); ? ? ? ? aVoxel2->GetPointIds()->SetId(6, 14); ? ? ? ? aVoxel2->GetPointIds()->SetId(7, 15); ? ? ? ? octreeGrid->InsertNextCell(VTK_VOXEL,aVoxel2->GetPointIds()); octreeGrid->SetPoints(voxelPoints2); ? ? ? ? Is there any possible way to put the voxels in the unstructuredGrid using separate vtkPoints? Something like this pseudo-code: vtkUnstructuredGrid octreeGrid allocate_enough_memory octreeGrid while (voxels_to_draw) vtkVoxel voxel vtkPoints points points->put_coordinates voxel->insert_points grid->insert_voxel end Thank you, Teresa From imranmohd20 at yahoo.com Wed May 21 11:43:55 2008 From: imranmohd20 at yahoo.com (Mohd Imran Ahmed) Date: Wed, 21 May 2008 08:43:55 -0700 (PDT) Subject: [vtkusers] How to find the boundary of an object in an image Message-ID: <991896.50859.qm@web53808.mail.re2.yahoo.com> Hi everyone, I am working in c++, I have a problem. I have an image, in which I have an access to amplitude values. Now I have to find the boundry of the object available in the image. My image is binary image, where background is in black and object is in white. so any one help me writing code in VC++. thanks in advance. bye Mohd Imran Ahmed Biomedical Engg, Handy No. : 004917663086540 Address : Ratiborer Strasse 2, Zi 02-00-01, 91058, Erlangen. Germany. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cocorim at hotmail.fr Wed May 21 11:44:27 2008 From: cocorim at hotmail.fr (Alosha [Dread_Lord]) Date: Wed, 21 May 2008 17:44:27 +0200 Subject: [vtkusers] 3d reconstruction In-Reply-To: <48343DA8.9010207@cfdrc.com> References: <48343DA8.9010207@cfdrc.com> Message-ID: Thanks, it works properly now. Now I have my vtkVolumeRayCastMapper and I have put the vtkImageData as input. So have I my 3D object or am I dreaming :P ? I know I'm not far, but there are some last steps I don't understand yet. Do you or anyone knows how to display it in my 3D View ? I must admit that I'm new in VTK and I don't understand well all this stuff yet. I don't know for example if vtkVolumeRayCastMapper gerate a 3D model that I can display. If my questions seem stupid, forgive me. There's the function I've made and at the end, I have my vtkImageData in my vtkVolumeRayCastMapper. Still, I don't know what to do with it to display a 3D model. //code typedef signed short PixelType; const unsigned int Dimension = 3; typedef itk::Image< PixelType, Dimension > ImageType; typedef itk::ImageToVTKImageFilter< ImageType > ConnectorType; 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->SetDirectory("C:/Dicoms/PHENIX/dicoms/OS/"); 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 ) { std::cout << seriesItr->c_str() << "caca" << std::endl; seriesItr++; } std::string seriesIdentifier; seriesIdentifier = seriesUID.begin()->c_str(); typedef std::vector< std::string > FileNamesContainer; FileNamesContainer fileNames; fileNames = nameGenerator->GetFileNames( seriesIdentifier ); reader->SetFileNames( fileNames ); cout << "updating the reader" << endl; try { reader->Update(); } catch (itk::ExceptionObject &ex) { std::cout << ex << std::endl; } ConnectorType::Pointer connector = ConnectorType::New(); vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New(); mapper->SetInput(connector->GetOutput()); //end code > Date: Wed, 21 May 2008 10:20:08 -0500> From: ahs at cfdrc.com> To: cocorim at hotmail.fr> CC: vtkusers at vtk.org> Subject: Re: [vtkusers] 3d reconstruction> > Are you linking against the vtkVolumeRendering library? You would need > to do that in order to use vtkVolumeRayCastMapper (or any other volume > rendering mapper).> > - Amy> > Alosha [Dread_Lord] wrote:> >> > Thank you for your answer.> > > > The vtkDicomImageReader actually works, but I have some LINK error > > while instantiating vtkVolumeRayCastMapper.> > > > ( vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New() )> > > > Anyway, is the vtkDicomImageReader build a 3D mesh using the 2D dicom > > serie, or just generate a data set ?> > > > In this last case, how can I display it in my igstk::View3D ? I > > suppose I have to build a mesh with it ?> > > > I guess there is a VTK class which takes a volume VTK data set and > > build a mesh with it, but I don't know which class :S.> > > > Anyway, thanks for your answer, and I'm all ears if anyone knows how > > to generate a 3D object from my 2D Dicom series for displaying in a > > igstk::View3D> >> >> >> > ------------------------------------------------------------------------> > From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com> > To: cocorim at hotmail.fr> > CC: vtkusers at vtk.org> > Subject: RE: [vtkusers] 3d reconstruction> > Date: Thu, 22 May 2008 00:44:50 +1000> >> > You can actually read in a DICOM file as a 3D object just using VTK.> >> > vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();> > dicomReader->SetDirectoryName( "C:\\dicomfolder\\");> >> > Have a look at Ray Cast Mapping as well (vtkVolumeRayCastMapper).> > I'm not sure if there is a better way though. With this approach,> > the image has to reduce its image quality (goes a bit blurry)> > while you move the camera. Then once you are finished moving> > around it will return to its original quality.> >> > Alternatively you can read it in using ITK, and then convert it> > back to VTK. I haven't tried this, so maybe someone can let you> > know the best way to do it.> >> > Regards,> > Cameron.> >> >> >> > ------------------------------------------------------------------------> > From: cocorim at hotmail.fr> > To: vtkusers at vtk.org> > Date: Wed, 21 May 2008 13:48:12 +0200> > Subject: [vtkusers] 3d reconstruction> >> > Hi all !> > > > Maybe the problem has already been exposed, and I'm sorry if> > it was.> > > > I've managed to made a basic DICOM Viewer. It has 4 views ; 3> > views to axial, coronal ans sagittal orientation, and a> > tridimentionnal view for 3d reconstruction.> > > > I'm using igstk::View2D and igstk::View3D.> > > > I instantiate a CTImageSpatialObject in which I put the CT> > Image from the CTImageReader.> > Then I put the CTImageSpatialObject into a> > CTImageSpatialObjectRepresentation and I give it to the> > igstk::View2D.> > > > It's working properly and I can navigate into slides in the> > three 2D views.> > > > My problems is now how to perform a 3D reconstruction of the> > DICOM and display it in the 3D View.> > > > I've search on the net and on the mailing list for some help,> > but all this is still a little unclear to me.> > I just know that ITK and VTK has to be used, but I have no> > idea of how.> > > > If you can help me on that or at least show me the way for> > begin, I would be very greatfull.> > > > Thanks a lot !> >> > ------------------------------------------------------------------------> > Discutez gratuitement avec vos amis en vid?o ! T?l?chargez> > Messenger, c'est gratuit ! > >> >> > ------------------------------------------------------------------------> > Click here Search for local singles online @ Lavalife.> > > >> >> >> > ------------------------------------------------------------------------> > Centralisez tous vos comptes mails dans Hotmail ! Cr?ez un compte > > Hotmail, c'est gratuit ! > > ------------------------------------------------------------------------> >> > _______________________________________________> > This is the private VTK discussion list.> > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ> > Follow this link to subscribe/unsubscribe:> > http://www.vtk.org/mailman/listinfo/vtkusers> > > > -- > Amy Squillacote Phone: (256) 726-4839> Computer Scientist Fax: (256) 726-4806> CFD Research Corporation Web: http://www.cfdrc.com> 215 Wynn Drive, Suite 501> Huntsville, AL 35805> > _________________________________________________________________ Votre contact a choisi Hotmail, l'e-mail ultra s?curis?. Cr?ez un compte gratuitement ! http://www.windowslive.fr/hotmail/default.asp -------------- next part -------------- An HTML attachment was scrubbed... URL: From imikejackson at gmail.com Wed May 21 11:44:43 2008 From: imikejackson at gmail.com (Mike Jackson) Date: Wed, 21 May 2008 11:44:43 -0400 Subject: [vtkusers] vtkUnstructuredGrid problem In-Reply-To: <20080521162734.skc84vbnkwookkss@webmail.fe.up.pt> References: <20080521162734.skc84vbnkwookkss@webmail.fe.up.pt> Message-ID: <43a689850805210844l621f65cv25377d46f6577c68@mail.gmail.com> Try looking at the vtkPoints->InsertNextPoint(...) Methods. This is probably what you are looking for. Mike On Wed, May 21, 2008 at 11:27 AM, Teresa Azevedo wrote: > Hi all. > > I am new at VTK, but I tried to find a solution in this forum, without > success. > So, my problem is: > > I want to draw several voxels using an vtkUnstructuredGrid. Assuming that I > know how many voxels (for example, 2) I need to draw and its 3D coordinates, > I can use this code and it works fine: > > vtkUnstructuredGrid *octreeGrid = vtkUnstructuredGrid::New(); > octreeGrid->Allocate(2); > > vtkPoints *voxelPoints = vtkPoints::New(); > voxelPoints->SetNumberOfPoints(16); > voxelPoints->InsertPoint(0, 0, 0, 0); > voxelPoints->InsertPoint(1, 1, 0, 0); > voxelPoints->InsertPoint(2, 0, 1, 0); > voxelPoints->InsertPoint(3, 1, 1, 0); > voxelPoints->InsertPoint(4, 0, 0, 1); > voxelPoints->InsertPoint(5, 1, 0, 1); > voxelPoints->InsertPoint(6, 0, 1, 1); > voxelPoints->InsertPoint(7, 1, 1, 1); > > voxelPoints->InsertPoint(8, 0, 0, 1); > voxelPoints->InsertPoint(9, 1, 0, 1); > voxelPoints->InsertPoint(10, 0, 1, 1); > voxelPoints->InsertPoint(11, 1, 1, 1); > voxelPoints->InsertPoint(12, 0, 0, 2); > voxelPoints->InsertPoint(13, 1, 0, 2); > voxelPoints->InsertPoint(14, 0, 1, 2); > voxelPoints->InsertPoint(15, 1, 1, 2); > > vtkVoxel *aVoxel1 = vtkVoxel::New(); > aVoxel1->GetPointIds()->SetId(0, 0); > aVoxel1->GetPointIds()->SetId(1, 1); > aVoxel1->GetPointIds()->SetId(2, 2); > aVoxel1->GetPointIds()->SetId(3, 3); > aVoxel1->GetPointIds()->SetId(4, 4); > aVoxel1->GetPointIds()->SetId(5, 5); > aVoxel1->GetPointIds()->SetId(6, 6); > aVoxel1->GetPointIds()->SetId(7, 7); > > vtkVoxel *aVoxel2 = vtkVoxel::New(); > aVoxel2->GetPointIds()->SetId(0, 8); > aVoxel2->GetPointIds()->SetId(1, 9); > aVoxel2->GetPointIds()->SetId(2, 10); > aVoxel2->GetPointIds()->SetId(3, 11); > aVoxel2->GetPointIds()->SetId(4, 12); > aVoxel2->GetPointIds()->SetId(5, 13); > aVoxel2->GetPointIds()->SetId(6, 14); > aVoxel2->GetPointIds()->SetId(7, 15); > > octreeGrid->InsertNextCell(VTK_VOXEL,aVoxel1->GetPointIds()); > octreeGrid->InsertNextCell(VTK_VOXEL,aVoxel2->GetPointIds()); > > octreeGrid->SetPoints(voxelPoints); > > My problem is: in the beginning of my program, I do not how many > voxels I need to draw. I tried this and it did not work: > > vtkUnstructuredGrid *octreeGrid = vtkUnstructuredGrid::New(); > octreeGrid->Allocate(2); > > vtkPoints *voxelPoints1 = vtkPoints::New(); > voxelPoints->SetNumberOfPoints(8); > voxelPoints->InsertPoint(0, 0, 0, 0); > voxelPoints->InsertPoint(1, 1, 0, 0); > voxelPoints->InsertPoint(2, 0, 1, 0); > voxelPoints->InsertPoint(3, 1, 1, 0); > voxelPoints->InsertPoint(4, 0, 0, 1); > voxelPoints->InsertPoint(5, 1, 0, 1); > voxelPoints->InsertPoint(6, 0, 1, 1); > voxelPoints->InsertPoint(7, 1, 1, 1); > > vtkVoxel *aVoxel1 = vtkVoxel::New(); > aVoxel1->GetPointIds()->SetId(0, 0); > aVoxel1->GetPointIds()->SetId(1, 1); > aVoxel1->GetPointIds()->SetId(2, 2); > aVoxel1->GetPointIds()->SetId(3, 3); > aVoxel1->GetPointIds()->SetId(4, 4); > aVoxel1->GetPointIds()->SetId(5, 5); > aVoxel1->GetPointIds()->SetId(6, 6); > aVoxel1->GetPointIds()->SetId(7, 7); > > octreeGrid->InsertNextCell(VTK_VOXEL,aVoxel1->GetPointIds()); > octreeGrid->SetPoints(voxelPoints1); > > vtkPoints *voxelPoints2 = vtkPoints::New(); > voxelPoints2->SetNumberOfPoints(8); > voxelPoints2->InsertPoint(8, 0, 0, 1); > voxelPoints2->InsertPoint(9, 1, 0, 1); > voxelPoints2->InsertPoint(10, 0, 1, 1); > voxelPoints2->InsertPoint(11, 1, 1, 1); > voxelPoints2->InsertPoint(12, 0, 0, 2); > voxelPoints2->InsertPoint(13, 1, 0, 2); > voxelPoints2->InsertPoint(14, 0, 1, 2); > voxelPoints2->InsertPoint(15, 1, 1, 2); > > vtkVoxel *aVoxel2 = vtkVoxel::New(); > aVoxel2->GetPointIds()->SetId(0, 8); > aVoxel2->GetPointIds()->SetId(1, 9); > aVoxel2->GetPointIds()->SetId(2, 10); > aVoxel2->GetPointIds()->SetId(3, 11); > aVoxel2->GetPointIds()->SetId(4, 12); > aVoxel2->GetPointIds()->SetId(5, 13); > aVoxel2->GetPointIds()->SetId(6, 14); > aVoxel2->GetPointIds()->SetId(7, 15); > > octreeGrid->InsertNextCell(VTK_VOXEL,aVoxel2->GetPointIds()); > octreeGrid->SetPoints(voxelPoints2); > > Is there any possible way to put the voxels in the unstructuredGrid using > separate vtkPoints? Something like this pseudo-code: > > vtkUnstructuredGrid octreeGrid > allocate_enough_memory octreeGrid > > while (voxels_to_draw) > vtkVoxel voxel > vtkPoints points > points->put_coordinates > voxel->insert_points > grid->insert_voxel > end > > Thank you, > Teresa > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Mike Jackson imikejackson _at_ gee-mail dot com From tarekbensaid at gmail.com Wed May 21 11:46:42 2008 From: tarekbensaid at gmail.com (ben said tarek) Date: Wed, 21 May 2008 17:46:42 +0200 Subject: [vtkusers] Pb in Marching Cubes Result Visualization Message-ID: <8a5cac3a0805210846n49c0f3efx6e005527ed08e934@mail.gmail.com> Hi everybody, I try to apply the marching cubes algorithm on a dicom series image, I remark that a region of the hole surface is placed in a wrong position ; i.e. the same region of all slices is cut and placed on the opposite direction of the image, I don't understand the pb. Here the source code : vtkRenderer *ren1 = vtkRenderer::New(); vtkRenderWindow *renWin = vtkRenderWindow::New(); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); vtkVolume16Reader *v16 = vtkVolume16Reader::New(); v16->SetDataDimensions (512,512); v16->SetDataByteOrderToLittleEndian(); v16->SetFilePrefix ("C:\\test\\000000"); v16->SetImageRange (1, 83); v16->SetDataSpacing (0.59, 0.59, 3); v16->Update(); vtkImageMarchingCubes *iso = vtkImageMarchingCubes::New(); iso->SetInput(v16->GetOutput()); iso->SetValue(0,1100); iso->SetInputMemoryLimit(3000); vtkPolyDataMapper *isoMapper = vtkPolyDataMapper::New(); isoMapper->SetInput (iso->GetOutput()); isoMapper->ScalarVisibilityOff(); isoMapper->ImmediateModeRenderingOn(); vtkActor *isoActor = vtkActor::New(); isoActor->SetMapper (isoMapper); isoActor->GetProperty()->SetColor(1,1,1); ren1->AddActor (isoActor); ren1->SetBackground (0.2, 0.3, 0.4); renWin->AddRenderer (ren1); iren->SetRenderWindow (renWin); renWin->Render(); iren->Start(); return 0; If anyone can help me, thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From tarekbensaid at gmail.com Wed May 21 12:09:40 2008 From: tarekbensaid at gmail.com (ben said tarek) Date: Wed, 21 May 2008 18:09:40 +0200 Subject: [vtkusers] Pb in Marching Cubes Result Visualization In-Reply-To: <8a5cac3a0805210846n49c0f3efx6e005527ed08e934@mail.gmail.com> References: <8a5cac3a0805210846n49c0f3efx6e005527ed08e934@mail.gmail.com> Message-ID: <8a5cac3a0805210909q32f872a2rda0d157b8b0d653b@mail.gmail.com> Here the result of the the source code below, Please help me On Wed, May 21, 2008 at 5:46 PM, ben said tarek wrote: > Hi everybody, > I try to apply the marching cubes algorithm on a dicom series image, I > remark that a region of the hole surface is placed in a wrong position ; > i.e. the same region of all slices is cut and placed on the opposite > direction of the image, I don't understand the pb. Here the source code : > > vtkRenderer *ren1 = vtkRenderer::New(); > vtkRenderWindow *renWin = vtkRenderWindow::New(); > vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); > > vtkVolume16Reader *v16 = vtkVolume16Reader::New(); > v16->SetDataDimensions (512,512); > v16->SetDataByteOrderToLittleEndian(); > v16->SetFilePrefix ("C:\\test\\000000"); > v16->SetImageRange (1, 83); > v16->SetDataSpacing (0.59, 0.59, 3); > v16->Update(); > > vtkImageMarchingCubes *iso = vtkImageMarchingCubes::New(); > iso->SetInput(v16->GetOutput()); > iso->SetValue(0,1100); > iso->SetInputMemoryLimit(3000); > vtkPolyDataMapper *isoMapper = vtkPolyDataMapper::New(); > isoMapper->SetInput (iso->GetOutput()); > isoMapper->ScalarVisibilityOff(); > isoMapper->ImmediateModeRenderingOn(); > > vtkActor *isoActor = vtkActor::New(); > isoActor->SetMapper (isoMapper); > isoActor->GetProperty()->SetColor(1,1,1); > > ren1->AddActor (isoActor); > ren1->SetBackground (0.2, 0.3, 0.4); > renWin->AddRenderer (ren1); > iren->SetRenderWindow (renWin); > renWin->Render(); > iren->Start(); > return 0; > > If anyone can help me, thank you > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: res.PNG Type: image/png Size: 34976 bytes Desc: not available URL: From ahs at cfdrc.com Wed May 21 12:21:38 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Wed, 21 May 2008 11:21:38 -0500 Subject: [vtkusers] 3d reconstruction In-Reply-To: References: <48343DA8.9010207@cfdrc.com> Message-ID: <48344C12.60403@cfdrc.com> Create a vtkVolume (http://www.vtk.org/doc/nightly/html/classvtkVolume.html); this is the volume rendering equivalent of a vtkActor. Set the mapper on the vtkVolume, and add the volume to the render window. You will also need to set up color and opacity transfer functions (see http://www.vtk.org/doc/nightly/html/classvtkColorTransferFunction.html and http://www.vtk.org/doc/nightly/html/classvtkPiecewiseFunction.html) indicating how values in your dataset map to color and opacity for rendering. In c++, do something like the following. vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New(); ... vtkColorTransferFunction *colors = vtkColorTransferFunction::New(); ... vtkPiecewiseFunction *opacities = vtkPiecewiseFunction::New(); ... vtkVolume *volume = vtkVolume::New(); volume->SetMapper(mapper); vtkVolumeProperty *property = volume->GetProperty(); property->SetColor(colors); property->SetScalarOpacity(opacities); vtkRenderer *ren = new vtkRenderer(); ren->AddViewProp(volume); - Amy Alosha [Dread_Lord] wrote: > Thanks, it works properly now. > > Now I have my vtkVolumeRayCastMapper and I have put the vtkImageData > as input. > > So have I my 3D object or am I dreaming :P ? > > I know I'm not far, but there are some last steps I don't understand yet. > > Do you or anyone knows how to display it in my 3D View ? > > I must admit that I'm new in VTK and I don't understand well all this > stuff yet. > I don't know for example if vtkVolumeRayCastMapper gerate a 3D model > that I can display. > > If my questions seem stupid, forgive me. > > There's the function I've made and at the end, I have my vtkImageData > in my vtkVolumeRayCastMapper. Still, I don't know what to do with it > to display a 3D model. > > //code > > typedef signed short PixelType; > const unsigned int Dimension = 3; > typedef itk::Image< PixelType, Dimension > ImageType; > typedef itk::ImageToVTKImageFilter< ImageType > ConnectorType; > 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->SetDirectory("C:/Dicoms/PHENIX/dicoms/OS/"); > > 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 ) > { > std::cout << seriesItr->c_str() << "caca" << std::endl; > seriesItr++; > } > > std::string seriesIdentifier; > seriesIdentifier = seriesUID.begin()->c_str(); > typedef std::vector< std::string > FileNamesContainer; > > FileNamesContainer fileNames; > fileNames = nameGenerator->GetFileNames( seriesIdentifier ); > reader->SetFileNames( fileNames ); > > cout << "updating the reader" << endl; > > try > { > reader->Update(); > } > catch (itk::ExceptionObject &ex) > { > std::cout << ex << std::endl; > } > > ConnectorType::Pointer connector = ConnectorType::New(); > > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New(); > mapper->SetInput(connector->GetOutput()); > > //end code > > > > > ------------------------------------------------------------------------ > > > Date: Wed, 21 May 2008 10:20:08 -0500 > > From: ahs at cfdrc.com > > To: cocorim at hotmail.fr > > CC: vtkusers at vtk.org > > Subject: Re: [vtkusers] 3d reconstruction > > > > Are you linking against the vtkVolumeRendering library? You would need > > to do that in order to use vtkVolumeRayCastMapper (or any other volume > > rendering mapper). > > > > - Amy > > > > Alosha [Dread_Lord] wrote: > > > > > > Thank you for your answer. > > > > > > The vtkDicomImageReader actually works, but I have some LINK error > > > while instantiating vtkVolumeRayCastMapper. > > > > > > ( vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New() ) > > > > > > Anyway, is the vtkDicomImageReader build a 3D mesh using the 2D dicom > > > serie, or just generate a data set ? > > > > > > In this last case, how can I display it in my igstk::View3D ? I > > > suppose I have to build a mesh with it ? > > > > > > I guess there is a VTK class which takes a volume VTK data set and > > > build a mesh with it, but I don't know which class :S. > > > > > > Anyway, thanks for your answer, and I'm all ears if anyone knows how > > > to generate a 3D object from my 2D Dicom series for displaying in a > > > igstk::View3D > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com > > > To: cocorim at hotmail.fr > > > CC: vtkusers at vtk.org > > > Subject: RE: [vtkusers] 3d reconstruction > > > Date: Thu, 22 May 2008 00:44:50 +1000 > > > > > > You can actually read in a DICOM file as a 3D object just using VTK. > > > > > > vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New(); > > > dicomReader->SetDirectoryName( "C:\\dicomfolder\\"); > > > > > > Have a look at Ray Cast Mapping as well (vtkVolumeRayCastMapper). > > > I'm not sure if there is a better way though. With this approach, > > > the image has to reduce its image quality (goes a bit blurry) > > > while you move the camera. Then once you are finished moving > > > around it will return to its original quality. > > > > > > Alternatively you can read it in using ITK, and then convert it > > > back to VTK. I haven't tried this, so maybe someone can let you > > > know the best way to do it. > > > > > > Regards, > > > Cameron. > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > From: cocorim at hotmail.fr > > > To: vtkusers at vtk.org > > > Date: Wed, 21 May 2008 13:48:12 +0200 > > > Subject: [vtkusers] 3d reconstruction > > > > > > Hi all ! > > > > > > Maybe the problem has already been exposed, and I'm sorry if > > > it was. > > > > > > I've managed to made a basic DICOM Viewer. It has 4 views ; 3 > > > views to axial, coronal ans sagittal orientation, and a > > > tridimentionnal view for 3d reconstruction. > > > > > > I'm using igstk::View2D and igstk::View3D. > > > > > > I instantiate a CTImageSpatialObject in which I put the CT > > > Image from the CTImageReader. > > > Then I put the CTImageSpatialObject into a > > > CTImageSpatialObjectRepresentation and I give it to the > > > igstk::View2D. > > > > > > It's working properly and I can navigate into slides in the > > > three 2D views. > > > > > > My problems is now how to perform a 3D reconstruction of the > > > DICOM and display it in the 3D View. > > > > > > I've search on the net and on the mailing list for some help, > > > but all this is still a little unclear to me. > > > I just know that ITK and VTK has to be used, but I have no > > > idea of how. > > > > > > If you can help me on that or at least show me the way for > > > begin, I would be very greatfull. > > > > > > Thanks a lot ! > > > > > > > ------------------------------------------------------------------------ > > > Discutez gratuitement avec vos amis en vid?o ! T?l?chargez > > > Messenger, c'est gratuit ! > > > > > > > > > > ------------------------------------------------------------------------ > > > Click here Search for local singles online @ Lavalife. > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > Centralisez tous vos comptes mails dans Hotmail ! Cr?ez un compte > > > Hotmail, c'est gratuit ! > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > This is the private VTK discussion list. > > > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > > Follow this link to subscribe/unsubscribe: > > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > -- > > Amy Squillacote Phone: (256) 726-4839 > > Computer Scientist Fax: (256) 726-4806 > > CFD Research Corporation Web: http://www.cfdrc.com > > 215 Wynn Drive, Suite 501 > > Huntsville, AL 35805 > > > > > > > ------------------------------------------------------------------------ > Avec Windows Live Messenger restez en contact avec tous vos amis ! > T?l?chargez Messenger, c'est gratuit ! > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From evans at aps.anl.gov Wed May 21 12:29:17 2008 From: evans at aps.anl.gov (Kenneth Evans) Date: Wed, 21 May 2008 11:29:17 -0500 Subject: [vtkusers] How to make vtkImagefrom vtkTIFFReader resize In-Reply-To: <006a01c8bb37$7b6410d0$1601a8c0@quad02> References: <005701c8bab6$adb03680$950836a4@aps.anl.gov> <006a01c8bb37$7b6410d0$1601a8c0@quad02> Message-ID: <005101c8bb5f$d08f2b30$950836a4@aps.anl.gov> When I do that: reader.SetFileName(self.filename) reader.Update() reader.GetOutput().Update() I get this error (multiple times): ERROR: In ..\..\Filtering\vtkStreamingDemandDrivenPipeline.cxx, line 628 vtkStreamingDemandDrivenPipeline (01026E70): The update extent specified in the information for output port 0 on algorithm vtkTIFFReader(01026510) is 0 498 0 749 0 0, which is outside the whole extent 0 499 0 329 0 0. -Ken _____ From: Vidyadhar [mailto:vidyadhar at lucidindia.com] Sent: Wednesday, May 21, 2008 6:40 AM To: Kenneth Evans Cc: vtkusers Subject: Re: [vtkusers] How to make vtkImagefrom vtkTIFFReader resize Hi, I have a suggestion. After reader.Update() call, try reader.GetOutput().Update(). This is supposed to update bounds, extents, et cetera. HTH Vidyadhar ----- Original Message ----- From: Kenneth Evans To: vtkusers at vtk.org Sent: Wednesday, May 21, 2008 1:48 AM Subject: [vtkusers] How to make vtkImagefrom vtkTIFFReader resize I am reading and rereading TIFF images of different sizes (this is in Python, but it should not matter): reader = vtk.vtkTIFFReader() reader.SetFileName(filename) reader.Update() actor = vtk.vtkImageActor() actor.SetInput(reader.GetOutput()) actor.SetVisibility(1) ren.AddActor(actor) I want to read a new image: reader.SetFileName(filename) reader.Update() This works fine, except the output = reader.GetOutput() which is a vtkImage retains the old size. output.GetExtent() returns the original extent. output.GetWholeExtent() returns the new extent but output.SetExtent(output.GetWholeExtent()) crashes. How to I reset the vtkImage extent (without creating a new actor)? Thanks, -Ken _____ _______________________________________________ This is the private VTK discussion list. Please keep messages on-topic. Check the 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 goodwin.lawlor at ucd.ie Wed May 21 12:32:36 2008 From: goodwin.lawlor at ucd.ie (Goodwin Lawlor) Date: Wed, 21 May 2008 17:32:36 +0100 Subject: [vtkusers] vtkPolygon::PointInPolygon 's parameters In-Reply-To: <17364157.post@talk.nabble.com> References: <17364157.post@talk.nabble.com> Message-ID: Hi Rashed, The bounds are indeed the "min-max of each x,y,z component". If you got the polydata of the plane from your widget, you can try: planeWidget->GetPolyData()->GetPoints()->GetBounds() hth Goodwin rashedk wrote: > Hi everyone, > > I cant find any reference in the documentation about the parameters of the > static function vtkPolygon::PointInPolygon > > Here is the signature: > int PointInPolygon (float x[3], int numPts, float *pts, float bounds[6], > float n[3]) > > Especially with regards to the 4th parameter bounds[6]. If I have four > corner points of a polygon (i.e. plane) for example, how do I compute > bounds? Are these the min-max of each x,y,z component for the four corner > points? > > Thanks, > Rashed From cocorim at hotmail.fr Wed May 21 13:23:37 2008 From: cocorim at hotmail.fr (Alosha [Dread_Lord]) Date: Wed, 21 May 2008 19:23:37 +0200 Subject: [vtkusers] 3d reconstruction In-Reply-To: <48344C12.60403@cfdrc.com> References: <48343DA8.9010207@cfdrc.com> <48344C12.60403@cfdrc.com> Message-ID: Great !! Tranks a lot. I understand better how it works.Alosh > Date: Wed, 21 May 2008 11:21:38 -0500> From: ahs at cfdrc.com> To: cocorim at hotmail.fr> CC: vtkusers at vtk.org> Subject: Re: [vtkusers] 3d reconstruction> > Create a vtkVolume > (http://www.vtk.org/doc/nightly/html/classvtkVolume.html); this is the > volume rendering equivalent of a vtkActor. Set the mapper on the > vtkVolume, and add the volume to the render window. You will also need > to set up color and opacity transfer functions (see > http://www.vtk.org/doc/nightly/html/classvtkColorTransferFunction.html > and http://www.vtk.org/doc/nightly/html/classvtkPiecewiseFunction.html) > indicating how values in your dataset map to color and opacity for > rendering. In c++, do something like the following.> > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();> ...> > vtkColorTransferFunction *colors = vtkColorTransferFunction::New();> ...> > vtkPiecewiseFunction *opacities = vtkPiecewiseFunction::New();> ...> > vtkVolume *volume = vtkVolume::New();> volume->SetMapper(mapper);> vtkVolumeProperty *property = volume->GetProperty();> property->SetColor(colors);> property->SetScalarOpacity(opacities);> > vtkRenderer *ren = new vtkRenderer();> ren->AddViewProp(volume);> > > - Amy> > Alosha [Dread_Lord] wrote:> > Thanks, it works properly now.> > > > Now I have my vtkVolumeRayCastMapper and I have put the vtkImageData > > as input.> > > > So have I my 3D object or am I dreaming :P ?> > > > I know I'm not far, but there are some last steps I don't understand yet.> > > > Do you or anyone knows how to display it in my 3D View ?> > > > I must admit that I'm new in VTK and I don't understand well all this > > stuff yet.> > I don't know for example if vtkVolumeRayCastMapper gerate a 3D model > > that I can display.> > > > If my questions seem stupid, forgive me.> >> > There's the function I've made and at the end, I have my vtkImageData > > in my vtkVolumeRayCastMapper. Still, I don't know what to do with it > > to display a 3D model.> > > > //code> > > > typedef signed short PixelType;> > const unsigned int Dimension = 3;> > typedef itk::Image< PixelType, Dimension > ImageType;> > typedef itk::ImageToVTKImageFilter< ImageType > ConnectorType;> > 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->SetDirectory("C:/Dicoms/PHENIX/dicoms/OS/");> > > > 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 )> > {> > std::cout << seriesItr->c_str() << "caca" << std::endl;> > seriesItr++;> > }> > > > std::string seriesIdentifier;> > seriesIdentifier = seriesUID.begin()->c_str();> > typedef std::vector< std::string > FileNamesContainer;> > > > FileNamesContainer fileNames;> > fileNames = nameGenerator->GetFileNames( seriesIdentifier );> > reader->SetFileNames( fileNames );> > > > cout << "updating the reader" << endl;> > > > try> > {> > reader->Update();> > }> > catch (itk::ExceptionObject &ex)> > {> > std::cout << ex << std::endl;> > }> > > > ConnectorType::Pointer connector = ConnectorType::New();> > > > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();> > mapper->SetInput(connector->GetOutput());> > > > //end code> >> >> >> > > > ------------------------------------------------------------------------> >> > > Date: Wed, 21 May 2008 10:20:08 -0500> > > From: ahs at cfdrc.com> > > To: cocorim at hotmail.fr> > > CC: vtkusers at vtk.org> > > Subject: Re: [vtkusers] 3d reconstruction> > >> > > Are you linking against the vtkVolumeRendering library? You would need> > > to do that in order to use vtkVolumeRayCastMapper (or any other volume> > > rendering mapper).> > >> > > - Amy> > >> > > Alosha [Dread_Lord] wrote:> > > >> > > > Thank you for your answer.> > > >> > > > The vtkDicomImageReader actually works, but I have some LINK error> > > > while instantiating vtkVolumeRayCastMapper.> > > >> > > > ( vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New() )> > > >> > > > Anyway, is the vtkDicomImageReader build a 3D mesh using the 2D dicom> > > > serie, or just generate a data set ?> > > >> > > > In this last case, how can I display it in my igstk::View3D ? I> > > > suppose I have to build a mesh with it ?> > > >> > > > I guess there is a VTK class which takes a volume VTK data set and> > > > build a mesh with it, but I don't know which class :S.> > > >> > > > Anyway, thanks for your answer, and I'm all ears if anyone knows how> > > > to generate a 3D object from my 2D Dicom series for displaying in a> > > > igstk::View3D> > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com> > > > To: cocorim at hotmail.fr> > > > CC: vtkusers at vtk.org> > > > Subject: RE: [vtkusers] 3d reconstruction> > > > Date: Thu, 22 May 2008 00:44:50 +1000> > > >> > > > You can actually read in a DICOM file as a 3D object just using VTK.> > > >> > > > vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();> > > > dicomReader->SetDirectoryName( "C:\\dicomfolder\\");> > > >> > > > Have a look at Ray Cast Mapping as well (vtkVolumeRayCastMapper).> > > > I'm not sure if there is a better way though. With this approach,> > > > the image has to reduce its image quality (goes a bit blurry)> > > > while you move the camera. Then once you are finished moving> > > > around it will return to its original quality.> > > >> > > > Alternatively you can read it in using ITK, and then convert it> > > > back to VTK. I haven't tried this, so maybe someone can let you> > > > know the best way to do it.> > > >> > > > Regards,> > > > Cameron.> > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > From: cocorim at hotmail.fr> > > > To: vtkusers at vtk.org> > > > Date: Wed, 21 May 2008 13:48:12 +0200> > > > Subject: [vtkusers] 3d reconstruction> > > >> > > > Hi all !> > > >> > > > Maybe the problem has already been exposed, and I'm sorry if> > > > it was.> > > >> > > > I've managed to made a basic DICOM Viewer. It has 4 views ; 3> > > > views to axial, coronal ans sagittal orientation, and a> > > > tridimentionnal view for 3d reconstruction.> > > >> > > > I'm using igstk::View2D and igstk::View3D.> > > >> > > > I instantiate a CTImageSpatialObject in which I put the CT> > > > Image from the CTImageReader.> > > > Then I put the CTImageSpatialObject into a> > > > CTImageSpatialObjectRepresentation and I give it to the> > > > igstk::View2D.> > > >> > > > It's working properly and I can navigate into slides in the> > > > three 2D views.> > > >> > > > My problems is now how to perform a 3D reconstruction of the> > > > DICOM and display it in the 3D View.> > > >> > > > I've search on the net and on the mailing list for some help,> > > > but all this is still a little unclear to me.> > > > I just know that ITK and VTK has to be used, but I have no> > > > idea of how.> > > >> > > > If you can help me on that or at least show me the way for> > > > begin, I would be very greatfull.> > > >> > > > Thanks a lot !> > > >> > > > > > ------------------------------------------------------------------------> > > > Discutez gratuitement avec vos amis en vid?o ! T?l?chargez> > > > Messenger, c'est gratuit ! > > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > Click here Search for local singles online @ Lavalife.> > > > > > > > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > Centralisez tous vos comptes mails dans Hotmail ! Cr?ez un compte> > > > Hotmail, c'est gratuit ! > > > > > > ------------------------------------------------------------------------> > > >> > > > _______________________________________________> > > > This is the private VTK discussion list.> > > > Please keep messages on-topic. Check the FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ> > > > Follow this link to subscribe/unsubscribe:> > > > http://www.vtk.org/mailman/listinfo/vtkusers> > > >> > >> > > --> > > Amy Squillacote Phone: (256) 726-4839> > > Computer Scientist Fax: (256) 726-4806> > > CFD Research Corporation Web: http://www.cfdrc.com> > > 215 Wynn Drive, Suite 501> > > Huntsville, AL 35805> > >> > >> >> >> > ------------------------------------------------------------------------> > Avec Windows Live Messenger restez en contact avec tous vos amis ! > > T?l?chargez Messenger, c'est gratuit ! > > > > -- > Amy Squillacote Phone: (256) 726-4839> Computer Scientist Fax: (256) 726-4806> CFD Research Corporation Web: http://www.cfdrc.com> 215 Wynn Drive, Suite 501> Huntsville, AL 35805> > _________________________________________________________________ Retouchez, classez et partagez vos photos gratuitement avec le logiciel Galerie de Photos ! http://www.windowslive.fr/galerie/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From cocorim at hotmail.fr Wed May 21 13:24:38 2008 From: cocorim at hotmail.fr (Alosha [Dread_Lord]) Date: Wed, 21 May 2008 19:24:38 +0200 Subject: [vtkusers] 3d reconstruction In-Reply-To: <48344C12.60403@cfdrc.com> References: <48343DA8.9010207@cfdrc.com> <48344C12.60403@cfdrc.com> Message-ID: Great !! Tranks a lot. I understand better how it works.Alosh > Date: Wed, 21 May 2008 11:21:38 -0500> From: ahs at cfdrc.com> To: cocorim at hotmail.fr> CC: vtkusers at vtk.org> Subject: Re: [vtkusers] 3d reconstruction> > Create a vtkVolume > (http://www.vtk.org/doc/nightly/html/classvtkVolume.html); this is the > volume rendering equivalent of a vtkActor. Set the mapper on the > vtkVolume, and add the volume to the render window. You will also need > to set up color and opacity transfer functions (see > http://www.vtk.org/doc/nightly/html/classvtkColorTransferFunction.html > and http://www.vtk.org/doc/nightly/html/classvtkPiecewiseFunction.html) > indicating how values in your dataset map to color and opacity for > rendering. In c++, do something like the following.> > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();> ...> > vtkColorTransferFunction *colors = vtkColorTransferFunction::New();> ...> > vtkPiecewiseFunction *opacities = vtkPiecewiseFunction::New();> ...> > vtkVolume *volume = vtkVolume::New();> volume->SetMapper(mapper);> vtkVolumeProperty *property = volume->GetProperty();> property->SetColor(colors);> property->SetScalarOpacity(opacities);> > vtkRenderer *ren = new vtkRenderer();> ren->AddViewProp(volume);> > > - Amy> > Alosha [Dread_Lord] wrote:> > Thanks, it works properly now.> > > > Now I have my vtkVolumeRayCastMapper and I have put the vtkImageData > > as input.> > > > So have I my 3D object or am I dreaming :P ?> > > > I know I'm not far, but there are some last steps I don't understand yet.> > > > Do you or anyone knows how to display it in my 3D View ?> > > > I must admit that I'm new in VTK and I don't understand well all this > > stuff yet.> > I don't know for example if vtkVolumeRayCastMapper gerate a 3D model > > that I can display.> > > > If my questions seem stupid, forgive me.> >> > There's the function I've made and at the end, I have my vtkImageData > > in my vtkVolumeRayCastMapper. Still, I don't know what to do with it > > to display a 3D model.> > > > //code> > > > typedef signed short PixelType;> > const unsigned int Dimension = 3;> > typedef itk::Image< PixelType, Dimension > ImageType;> > typedef itk::ImageToVTKImageFilter< ImageType > ConnectorType;> > 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->SetDirectory("C:/Dicoms/PHENIX/dicoms/OS/");> > > > 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 )> > {> > std::cout << seriesItr->c_str() << "caca" << std::endl;> > seriesItr++;> > }> > > > std::string seriesIdentifier;> > seriesIdentifier = seriesUID.begin()->c_str();> > typedef std::vector< std::string > FileNamesContainer;> > > > FileNamesContainer fileNames;> > fileNames = nameGenerator->GetFileNames( seriesIdentifier );> > reader->SetFileNames( fileNames );> > > > cout << "updating the reader" << endl;> > > > try> > {> > reader->Update();> > }> > catch (itk::ExceptionObject &ex)> > {> > std::cout << ex << std::endl;> > }> > > > ConnectorType::Pointer connector = ConnectorType::New();> > > > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();> > mapper->SetInput(connector->GetOutput());> > > > //end code> >> >> >> > > > ------------------------------------------------------------------------> >> > > Date: Wed, 21 May 2008 10:20:08 -0500> > > From: ahs at cfdrc.com> > > To: cocorim at hotmail.fr> > > CC: vtkusers at vtk.org> > > Subject: Re: [vtkusers] 3d reconstruction> > >> > > Are you linking against the vtkVolumeRendering library? You would need> > > to do that in order to use vtkVolumeRayCastMapper (or any other volume> > > rendering mapper).> > >> > > - Amy> > >> > > Alosha [Dread_Lord] wrote:> > > >> > > > Thank you for your answer.> > > >> > > > The vtkDicomImageReader actually works, but I have some LINK error> > > > while instantiating vtkVolumeRayCastMapper.> > > >> > > > ( vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New() )> > > >> > > > Anyway, is the vtkDicomImageReader build a 3D mesh using the 2D dicom> > > > serie, or just generate a data set ?> > > >> > > > In this last case, how can I display it in my igstk::View3D ? I> > > > suppose I have to build a mesh with it ?> > > >> > > > I guess there is a VTK class which takes a volume VTK data set and> > > > build a mesh with it, but I don't know which class :S.> > > >> > > > Anyway, thanks for your answer, and I'm all ears if anyone knows how> > > > to generate a 3D object from my 2D Dicom series for displaying in a> > > > igstk::View3D> > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com> > > > To: cocorim at hotmail.fr> > > > CC: vtkusers at vtk.org> > > > Subject: RE: [vtkusers] 3d reconstruction> > > > Date: Thu, 22 May 2008 00:44:50 +1000> > > >> > > > You can actually read in a DICOM file as a 3D object just using VTK.> > > >> > > > vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();> > > > dicomReader->SetDirectoryName( "C:\\dicomfolder\\");> > > >> > > > Have a look at Ray Cast Mapping as well (vtkVolumeRayCastMapper).> > > > I'm not sure if there is a better way though. With this approach,> > > > the image has to reduce its image quality (goes a bit blurry)> > > > while you move the camera. Then once you are finished moving> > > > around it will return to its original quality.> > > >> > > > Alternatively you can read it in using ITK, and then convert it> > > > back to VTK. I haven't tried this, so maybe someone can let you> > > > know the best way to do it.> > > >> > > > Regards,> > > > Cameron.> > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > From: cocorim at hotmail.fr> > > > To: vtkusers at vtk.org> > > > Date: Wed, 21 May 2008 13:48:12 +0200> > > > Subject: [vtkusers] 3d reconstruction> > > >> > > > Hi all !> > > >> > > > Maybe the problem has already been exposed, and I'm sorry if> > > > it was.> > > >> > > > I've managed to made a basic DICOM Viewer. It has 4 views ; 3> > > > views to axial, coronal ans sagittal orientation, and a> > > > tridimentionnal view for 3d reconstruction.> > > >> > > > I'm using igstk::View2D and igstk::View3D.> > > >> > > > I instantiate a CTImageSpatialObject in which I put the CT> > > > Image from the CTImageReader.> > > > Then I put the CTImageSpatialObject into a> > > > CTImageSpatialObjectRepresentation and I give it to the> > > > igstk::View2D.> > > >> > > > It's working properly and I can navigate into slides in the> > > > three 2D views.> > > >> > > > My problems is now how to perform a 3D reconstruction of the> > > > DICOM and display it in the 3D View.> > > >> > > > I've search on the net and on the mailing list for some help,> > > > but all this is still a little unclear to me.> > > > I just know that ITK and VTK has to be used, but I have no> > > > idea of how.> > > >> > > > If you can help me on that or at least show me the way for> > > > begin, I would be very greatfull.> > > >> > > > Thanks a lot !> > > >> > > > > > ------------------------------------------------------------------------> > > > Discutez gratuitement avec vos amis en vid?o ! T?l?chargez> > > > Messenger, c'est gratuit ! > > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > Click here Search for local singles online @ Lavalife.> > > > > > > > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > Centralisez tous vos comptes mails dans Hotmail ! Cr?ez un compte> > > > Hotmail, c'est gratuit ! > > > > > > ------------------------------------------------------------------------> > > >> > > > _______________________________________________> > > > This is the private VTK discussion list.> > > > Please keep messages on-topic. Check the FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ> > > > Follow this link to subscribe/unsubscribe:> > > > http://www.vtk.org/mailman/listinfo/vtkusers> > > >> > >> > > --> > > Amy Squillacote Phone: (256) 726-4839> > > Computer Scientist Fax: (256) 726-4806> > > CFD Research Corporation Web: http://www.cfdrc.com> > > 215 Wynn Drive, Suite 501> > > Huntsville, AL 35805> > >> > >> >> >> > ------------------------------------------------------------------------> > Avec Windows Live Messenger restez en contact avec tous vos amis ! > > T?l?chargez Messenger, c'est gratuit ! > > > > -- > Amy Squillacote Phone: (256) 726-4839> Computer Scientist Fax: (256) 726-4806> CFD Research Corporation Web: http://www.cfdrc.com> 215 Wynn Drive, Suite 501> Huntsville, AL 35805> > _________________________________________________________________ Retouchez, classez et partagez vos photos gratuitement avec le logiciel Galerie de Photos ! http://www.windowslive.fr/galerie/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From cocorim at hotmail.fr Wed May 21 13:26:08 2008 From: cocorim at hotmail.fr (Alosha [Dread_Lord]) Date: Wed, 21 May 2008 19:26:08 +0200 Subject: [vtkusers] 3d reconstruction In-Reply-To: <48344C12.60403@cfdrc.com> References: <48343DA8.9010207@cfdrc.com> <48344C12.60403@cfdrc.com> Message-ID: Great !! Tranks a lot. I understand better how it works.Alosh > Date: Wed, 21 May 2008 11:21:38 -0500> From: ahs at cfdrc.com> To: cocorim at hotmail.fr> CC: vtkusers at vtk.org> Subject: Re: [vtkusers] 3d reconstruction> > Create a vtkVolume > (http://www.vtk.org/doc/nightly/html/classvtkVolume.html); this is the > volume rendering equivalent of a vtkActor. Set the mapper on the > vtkVolume, and add the volume to the render window. You will also need > to set up color and opacity transfer functions (see > http://www.vtk.org/doc/nightly/html/classvtkColorTransferFunction.html > and http://www.vtk.org/doc/nightly/html/classvtkPiecewiseFunction.html) > indicating how values in your dataset map to color and opacity for > rendering. In c++, do something like the following.> > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();> ...> > vtkColorTransferFunction *colors = vtkColorTransferFunction::New();> ...> > vtkPiecewiseFunction *opacities = vtkPiecewiseFunction::New();> ...> > vtkVolume *volume = vtkVolume::New();> volume->SetMapper(mapper);> vtkVolumeProperty *property = volume->GetProperty();> property->SetColor(colors);> property->SetScalarOpacity(opacities);> > vtkRenderer *ren = new vtkRenderer();> ren->AddViewProp(volume);> > > - Amy> > Alosha [Dread_Lord] wrote:> > Thanks, it works properly now.> > > > Now I have my vtkVolumeRayCastMapper and I have put the vtkImageData > > as input.> > > > So have I my 3D object or am I dreaming :P ?> > > > I know I'm not far, but there are some last steps I don't understand yet.> > > > Do you or anyone knows how to display it in my 3D View ?> > > > I must admit that I'm new in VTK and I don't understand well all this > > stuff yet.> > I don't know for example if vtkVolumeRayCastMapper gerate a 3D model > > that I can display.> > > > If my questions seem stupid, forgive me.> >> > There's the function I've made and at the end, I have my vtkImageData > > in my vtkVolumeRayCastMapper. Still, I don't know what to do with it > > to display a 3D model.> > > > //code> > > > typedef signed short PixelType;> > const unsigned int Dimension = 3;> > typedef itk::Image< PixelType, Dimension > ImageType;> > typedef itk::ImageToVTKImageFilter< ImageType > ConnectorType;> > 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->SetDirectory("C:/Dicoms/PHENIX/dicoms/OS/");> > > > 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 )> > {> > std::cout << seriesItr->c_str() << "caca" << std::endl;> > seriesItr++;> > }> > > > std::string seriesIdentifier;> > seriesIdentifier = seriesUID.begin()->c_str();> > typedef std::vector< std::string > FileNamesContainer;> > > > FileNamesContainer fileNames;> > fileNames = nameGenerator->GetFileNames( seriesIdentifier );> > reader->SetFileNames( fileNames );> > > > cout << "updating the reader" << endl;> > > > try> > {> > reader->Update();> > }> > catch (itk::ExceptionObject &ex)> > {> > std::cout << ex << std::endl;> > }> > > > ConnectorType::Pointer connector = ConnectorType::New();> > > > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();> > mapper->SetInput(connector->GetOutput());> > > > //end code> >> >> >> > > > ------------------------------------------------------------------------> >> > > Date: Wed, 21 May 2008 10:20:08 -0500> > > From: ahs at cfdrc.com> > > To: cocorim at hotmail.fr> > > CC: vtkusers at vtk.org> > > Subject: Re: [vtkusers] 3d reconstruction> > >> > > Are you linking against the vtkVolumeRendering library? You would need> > > to do that in order to use vtkVolumeRayCastMapper (or any other volume> > > rendering mapper).> > >> > > - Amy> > >> > > Alosha [Dread_Lord] wrote:> > > >> > > > Thank you for your answer.> > > >> > > > The vtkDicomImageReader actually works, but I have some LINK error> > > > while instantiating vtkVolumeRayCastMapper.> > > >> > > > ( vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New() )> > > >> > > > Anyway, is the vtkDicomImageReader build a 3D mesh using the 2D dicom> > > > serie, or just generate a data set ?> > > >> > > > In this last case, how can I display it in my igstk::View3D ? I> > > > suppose I have to build a mesh with it ?> > > >> > > > I guess there is a VTK class which takes a volume VTK data set and> > > > build a mesh with it, but I don't know which class :S.> > > >> > > > Anyway, thanks for your answer, and I'm all ears if anyone knows how> > > > to generate a 3D object from my 2D Dicom series for displaying in a> > > > igstk::View3D> > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com> > > > To: cocorim at hotmail.fr> > > > CC: vtkusers at vtk.org> > > > Subject: RE: [vtkusers] 3d reconstruction> > > > Date: Thu, 22 May 2008 00:44:50 +1000> > > >> > > > You can actually read in a DICOM file as a 3D object just using VTK.> > > >> > > > vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();> > > > dicomReader->SetDirectoryName( "C:\\dicomfolder\\");> > > >> > > > Have a look at Ray Cast Mapping as well (vtkVolumeRayCastMapper).> > > > I'm not sure if there is a better way though. With this approach,> > > > the image has to reduce its image quality (goes a bit blurry)> > > > while you move the camera. Then once you are finished moving> > > > around it will return to its original quality.> > > >> > > > Alternatively you can read it in using ITK, and then convert it> > > > back to VTK. I haven't tried this, so maybe someone can let you> > > > know the best way to do it.> > > >> > > > Regards,> > > > Cameron.> > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > From: cocorim at hotmail.fr> > > > To: vtkusers at vtk.org> > > > Date: Wed, 21 May 2008 13:48:12 +0200> > > > Subject: [vtkusers] 3d reconstruction> > > >> > > > Hi all !> > > >> > > > Maybe the problem has already been exposed, and I'm sorry if> > > > it was.> > > >> > > > I've managed to made a basic DICOM Viewer. It has 4 views ; 3> > > > views to axial, coronal ans sagittal orientation, and a> > > > tridimentionnal view for 3d reconstruction.> > > >> > > > I'm using igstk::View2D and igstk::View3D.> > > >> > > > I instantiate a CTImageSpatialObject in which I put the CT> > > > Image from the CTImageReader.> > > > Then I put the CTImageSpatialObject into a> > > > CTImageSpatialObjectRepresentation and I give it to the> > > > igstk::View2D.> > > >> > > > It's working properly and I can navigate into slides in the> > > > three 2D views.> > > >> > > > My problems is now how to perform a 3D reconstruction of the> > > > DICOM and display it in the 3D View.> > > >> > > > I've search on the net and on the mailing list for some help,> > > > but all this is still a little unclear to me.> > > > I just know that ITK and VTK has to be used, but I have no> > > > idea of how.> > > >> > > > If you can help me on that or at least show me the way for> > > > begin, I would be very greatfull.> > > >> > > > Thanks a lot !> > > >> > > > > > ------------------------------------------------------------------------> > > > Discutez gratuitement avec vos amis en vid?o ! T?l?chargez> > > > Messenger, c'est gratuit ! > > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > Click here Search for local singles online @ Lavalife.> > > > > > > > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > Centralisez tous vos comptes mails dans Hotmail ! Cr?ez un compte> > > > Hotmail, c'est gratuit ! > > > > > > ------------------------------------------------------------------------> > > >> > > > _______________________________________________> > > > This is the private VTK discussion list.> > > > Please keep messages on-topic. Check the FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ> > > > Follow this link to subscribe/unsubscribe:> > > > http://www.vtk.org/mailman/listinfo/vtkusers> > > >> > >> > > --> > > Amy Squillacote Phone: (256) 726-4839> > > Computer Scientist Fax: (256) 726-4806> > > CFD Research Corporation Web: http://www.cfdrc.com> > > 215 Wynn Drive, Suite 501> > > Huntsville, AL 35805> > >> > >> >> >> > ------------------------------------------------------------------------> > Avec Windows Live Messenger restez en contact avec tous vos amis ! > > T?l?chargez Messenger, c'est gratuit ! > > > > -- > Amy Squillacote Phone: (256) 726-4839> Computer Scientist Fax: (256) 726-4806> CFD Research Corporation Web: http://www.cfdrc.com> 215 Wynn Drive, Suite 501> Huntsville, AL 35805> > _________________________________________________________________ Retouchez, classez et partagez vos photos gratuitement avec le logiciel Galerie de Photos ! http://www.windowslive.fr/galerie/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From louxkr at gmail.com Wed May 21 13:40:14 2008 From: louxkr at gmail.com (Kerry Loux) Date: Wed, 21 May 2008 13:40:14 -0400 Subject: [vtkusers] Altering a rendered actor In-Reply-To: <4834212E.3090401@mediri.com> References: <369e9e6b0805201714u6bb61d83r1e7b6bebd3d1d34d@mail.gmail.com> <65c344fe0805210547qe774d6etce18aecdd885f495@mail.gmail.com> <4834212E.3090401@mediri.com> Message-ID: <65c344fe0805211040r3cdb960mb418642998e43561@mail.gmail.com> Thanks, but neither of those helped. When I step through I can see that RenderWhenDisabled and RenderAllowed are both set to 1. Maybe this is something related to wxVTK specifically and not something to do with VTK? -Kerry On Wed, May 21, 2008 at 9:18 AM, Johannes Heitz wrote: > OK, read the thread and tried something myself: > > I'd almost bet that m_pVTKWindow->SetRenderWhenDisabled(true) might help > you? :) Hope it does! > > Best, > Joe > > Kerry Loux schrieb: > > seems as though I'm missing the "update the screen" call. I have since >> found that if I call the Render() method of the renderWindowInteractor >> (actually a wxVTKRenderWindowInteractor) the actor disappears from the >> > > -- > mediri GmbH > Vangerowstrasse 18 > 69115 Heidelberg > GERMANY > > Tel.: +49(0)6221 43338811 > Fax : +49(0)6221 43338820 > > Gesch?ftsf?hrer: Dr. Matthias G?nther > Handelsregister: 337863 Amtsgericht Mannheim > USt-IdentNummer: DE 238569040 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cocorim at hotmail.fr Wed May 21 17:39:41 2008 From: cocorim at hotmail.fr (Alosha [Dread_Lord]) Date: Wed, 21 May 2008 23:39:41 +0200 Subject: [vtkusers] 3d reconstruction In-Reply-To: <48344C12.60403@cfdrc.com> References: <48343DA8.9010207@cfdrc.com> <48344C12.60403@cfdrc.com> Message-ID: Hi again ! Sorry to bother you again, but I have one problem remaining with the vtkRendererWindow. Here's my code : //code vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New(); mapper->SetInput(connector->GetOutput()); vtkVolume *volume = vtkVolume::New(); volume->SetMapper(mapper); vtkColorTransferFunction *colors = vtkColorTransferFunction::New(); colors->SetAlpha(1.0); vtkPiecewiseFunction *opacities = vtkPiecewiseFunction::New(); opacities->SetMaximumNumberOfPieces(-1); vtkVolumeProperty *property = volume->GetProperty(); property->SetColor(colors); property->SetScalarOpacity(opacities); vtkRenderer *ren = vtkRenderer::New(); ren->AddViewProp(volume); vtkRenderWindow *triDView = vtkRenderWindow::New(); triDView->AddRenderer(ren); triDView->Render(); //end code And the problems comes when the vtkRendere is added to the windows. VC++ throws an writing violation exception at a memory bloc. I don't understand why it's doing that. Maybe, my use of the window is incorrect. I'm waiting for my User's Guide book, but i'd like to have a 3d visualisation of my dicom before :). Tranks > Date: Wed, 21 May 2008 11:21:38 -0500> From: ahs at cfdrc.com> To: cocorim at hotmail.fr> CC: vtkusers at vtk.org> Subject: Re: [vtkusers] 3d reconstruction> > Create a vtkVolume > (http://www.vtk.org/doc/nightly/html/classvtkVolume.html); this is the > volume rendering equivalent of a vtkActor. Set the mapper on the > vtkVolume, and add the volume to the render window. You will also need > to set up color and opacity transfer functions (see > http://www.vtk.org/doc/nightly/html/classvtkColorTransferFunction.html > and http://www.vtk.org/doc/nightly/html/classvtkPiecewiseFunction.html) > indicating how values in your dataset map to color and opacity for > rendering. In c++, do something like the following.> > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();> ...> > vtkColorTransferFunction *colors = vtkColorTransferFunction::New();> ...> > vtkPiecewiseFunction *opacities = vtkPiecewiseFunction::New();> ...> > vtkVolume *volume = vtkVolume::New();> volume->SetMapper(mapper);> vtkVolumeProperty *property = volume->GetProperty();> property->SetColor(colors);> property->SetScalarOpacity(opacities);> > vtkRenderer *ren = new vtkRenderer();> ren->AddViewProp(volume);> > > - Amy> > Alosha [Dread_Lord] wrote:> > Thanks, it works properly now.> > > > Now I have my vtkVolumeRayCastMapper and I have put the vtkImageData > > as input.> > > > So have I my 3D object or am I dreaming :P ?> > > > I know I'm not far, but there are some last steps I don't understand yet.> > > > Do you or anyone knows how to display it in my 3D View ?> > > > I must admit that I'm new in VTK and I don't understand well all this > > stuff yet.> > I don't know for example if vtkVolumeRayCastMapper gerate a 3D model > > that I can display.> > > > If my questions seem stupid, forgive me.> >> > There's the function I've made and at the end, I have my vtkImageData > > in my vtkVolumeRayCastMapper. Still, I don't know what to do with it > > to display a 3D model.> > > > //code> > > > typedef signed short PixelType;> > const unsigned int Dimension = 3;> > typedef itk::Image< PixelType, Dimension > ImageType;> > typedef itk::ImageToVTKImageFilter< ImageType > ConnectorType;> > 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->SetDirectory("C:/Dicoms/PHENIX/dicoms/OS/");> > > > 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 )> > {> > std::cout << seriesItr->c_str() << "caca" << std::endl;> > seriesItr++;> > }> > > > std::string seriesIdentifier;> > seriesIdentifier = seriesUID.begin()->c_str();> > typedef std::vector< std::string > FileNamesContainer;> > > > FileNamesContainer fileNames;> > fileNames = nameGenerator->GetFileNames( seriesIdentifier );> > reader->SetFileNames( fileNames );> > > > cout << "updating the reader" << endl;> > > > try> > {> > reader->Update();> > }> > catch (itk::ExceptionObject &ex)> > {> > std::cout << ex << std::endl;> > }> > > > ConnectorType::Pointer connector = ConnectorType::New();> > > > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();> > mapper->SetInput(connector->GetOutput());> > > > //end code> >> >> >> > > > ------------------------------------------------------------------------> >> > > Date: Wed, 21 May 2008 10:20:08 -0500> > > From: ahs at cfdrc.com> > > To: cocorim at hotmail.fr> > > CC: vtkusers at vtk.org> > > Subject: Re: [vtkusers] 3d reconstruction> > >> > > Are you linking against the vtkVolumeRendering library? You would need> > > to do that in order to use vtkVolumeRayCastMapper (or any other volume> > > rendering mapper).> > >> > > - Amy> > >> > > Alosha [Dread_Lord] wrote:> > > >> > > > Thank you for your answer.> > > >> > > > The vtkDicomImageReader actually works, but I have some LINK error> > > > while instantiating vtkVolumeRayCastMapper.> > > >> > > > ( vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New() )> > > >> > > > Anyway, is the vtkDicomImageReader build a 3D mesh using the 2D dicom> > > > serie, or just generate a data set ?> > > >> > > > In this last case, how can I display it in my igstk::View3D ? I> > > > suppose I have to build a mesh with it ?> > > >> > > > I guess there is a VTK class which takes a volume VTK data set and> > > > build a mesh with it, but I don't know which class :S.> > > >> > > > Anyway, thanks for your answer, and I'm all ears if anyone knows how> > > > to generate a 3D object from my 2D Dicom series for displaying in a> > > > igstk::View3D> > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com> > > > To: cocorim at hotmail.fr> > > > CC: vtkusers at vtk.org> > > > Subject: RE: [vtkusers] 3d reconstruction> > > > Date: Thu, 22 May 2008 00:44:50 +1000> > > >> > > > You can actually read in a DICOM file as a 3D object just using VTK.> > > >> > > > vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();> > > > dicomReader->SetDirectoryName( "C:\\dicomfolder\\");> > > >> > > > Have a look at Ray Cast Mapping as well (vtkVolumeRayCastMapper).> > > > I'm not sure if there is a better way though. With this approach,> > > > the image has to reduce its image quality (goes a bit blurry)> > > > while you move the camera. Then once you are finished moving> > > > around it will return to its original quality.> > > >> > > > Alternatively you can read it in using ITK, and then convert it> > > > back to VTK. I haven't tried this, so maybe someone can let you> > > > know the best way to do it.> > > >> > > > Regards,> > > > Cameron.> > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > From: cocorim at hotmail.fr> > > > To: vtkusers at vtk.org> > > > Date: Wed, 21 May 2008 13:48:12 +0200> > > > Subject: [vtkusers] 3d reconstruction> > > >> > > > Hi all !> > > >> > > > Maybe the problem has already been exposed, and I'm sorry if> > > > it was.> > > >> > > > I've managed to made a basic DICOM Viewer. It has 4 views ; 3> > > > views to axial, coronal ans sagittal orientation, and a> > > > tridimentionnal view for 3d reconstruction.> > > >> > > > I'm using igstk::View2D and igstk::View3D.> > > >> > > > I instantiate a CTImageSpatialObject in which I put the CT> > > > Image from the CTImageReader.> > > > Then I put the CTImageSpatialObject into a> > > > CTImageSpatialObjectRepresentation and I give it to the> > > > igstk::View2D.> > > >> > > > It's working properly and I can navigate into slides in the> > > > three 2D views.> > > >> > > > My problems is now how to perform a 3D reconstruction of the> > > > DICOM and display it in the 3D View.> > > >> > > > I've search on the net and on the mailing list for some help,> > > > but all this is still a little unclear to me.> > > > I just know that ITK and VTK has to be used, but I have no> > > > idea of how.> > > >> > > > If you can help me on that or at least show me the way for> > > > begin, I would be very greatfull.> > > >> > > > Thanks a lot !> > > >> > > > > > ------------------------------------------------------------------------> > > > Discutez gratuitement avec vos amis en vid?o ! T?l?chargez> > > > Messenger, c'est gratuit ! > > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > Click here Search for local singles online @ Lavalife.> > > > > > > > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > Centralisez tous vos comptes mails dans Hotmail ! Cr?ez un compte> > > > Hotmail, c'est gratuit ! > > > > > > ------------------------------------------------------------------------> > > >> > > > _______________________________________________> > > > This is the private VTK discussion list.> > > > Please keep messages on-topic. Check the FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ> > > > Follow this link to subscribe/unsubscribe:> > > > http://www.vtk.org/mailman/listinfo/vtkusers> > > >> > >> > > --> > > Amy Squillacote Phone: (256) 726-4839> > > Computer Scientist Fax: (256) 726-4806> > > CFD Research Corporation Web: http://www.cfdrc.com> > > 215 Wynn Drive, Suite 501> > > Huntsville, AL 35805> > >> > >> >> >> > ------------------------------------------------------------------------> > Avec Windows Live Messenger restez en contact avec tous vos amis ! > > T?l?chargez Messenger, c'est gratuit ! > > > > -- > Amy Squillacote Phone: (256) 726-4839> Computer Scientist Fax: (256) 726-4806> CFD Research Corporation Web: http://www.cfdrc.com> 215 Wynn Drive, Suite 501> Huntsville, AL 35805> > _________________________________________________________________ Caroline vient de mettre ? jour son profil Messenger ! Connectez-vous ! http://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1198837564&rver=4.0.1534.0&wp=MBI&wreply=http:%2F%2Fhome.services.spaces.live.com%2F&lc=1036&id=73625 -------------- next part -------------- An HTML attachment was scrubbed... URL: From w_e_b_m_a_s_t_e_r_6_9 at hotmail.com Wed May 21 17:54:44 2008 From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com (Cameron Burnett) Date: Thu, 22 May 2008 07:54:44 +1000 Subject: [vtkusers] 3d reconstruction In-Reply-To: References: <48343DA8.9010207@cfdrc.com> <48344C12.60403@cfdrc.com> Message-ID: Well, I'd say there would definately be an error because you called your vtkVolumeProperty "property" when that is a reserved name (it is blue text). Also, if you're having problems with your colours or opacity try this.... vtkPiecewiseFunction *opacityTransferFunction = vtkPiecewiseFunction::New(); opacityTransferFunction->AddPoint( 70.0, 0.0 ); opacityTransferFunction->AddPoint( 100.0, 0.2 ); opacityTransferFunction->AddPoint( 50000.0, 0.2 ); opacityTransferFunction->AddPoint( 50005.0, 0.0 ); vtkColorTransferFunction* colorTransferFunction = vtkColorTransferFunction::New(); colorTransferFunction->AddRGBPoint( 0.0, 1.0, 0.0, 0.0 ); colorTransferFunction->AddRGBPoint( 300.0, 1.0, 1.0, 0.0 ); colorTransferFunction->AddRGBPoint( 600.0, 0.0, 1.0, 0.0 ); colorTransferFunction->AddRGBPoint( 900.0, 1.0, 1.0, 1.0 ); colorTransferFunction->AddRGBPoint( 1200.0, 0.0, 0.0, 1.0 ); colorTransferFunction->AddRGBPoint( 1500.0, 1.0, 0.0, 1.0 ); colorTransferFunction->AddRGBPoint( 1800.0, 0.0, 0.0, 0.0 ); I have absolutely NO idea how to obtain these points, but I guess it works fine. Maybe try changing the numbers to see what it does. From: cocorim at hotmail.fr To: ahs at cfdrc.com Date: Wed, 21 May 2008 23:39:41 +0200 CC: vtkusers at vtk.org Subject: Re: [vtkusers] 3d reconstruction Hi again ! Sorry to bother you again, but I have one problem remaining with the vtkRendererWindow. Here's my code : //code vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New(); mapper->SetInput(connector->GetOutput()); vtkVolume *volume = vtkVolume::New(); volume->SetMapper(mapper); vtkColorTransferFunction *colors = vtkColorTransferFunction::New(); colors->SetAlpha(1.0); vtkPiecewiseFunction *opacities = vtkPiecewiseFunction::New(); opacities->SetMaximumNumberOfPieces(-1); vtkVolumeProperty *property = volume->GetProperty(); property->SetColor(colors); property->SetScalarOpacity(opacities); vtkRenderer *ren = vtkRenderer::New(); ren->AddViewProp(volume); vtkRenderWindow *triDView = vtkRenderWindow::New(); triDView->AddRenderer(ren); triDView->Render(); //end code And the problems comes when the vtkRendere is added to the windows. VC++ throws an writing violation exception at a memory bloc. I don't understand why it's doing that. Maybe, my use of the window is incorrect. I'm waiting for my User's Guide book, but i'd like to have a 3d visualisation of my dicom before :). Tranks > Date: Wed, 21 May 2008 11:21:38 -0500 > From: ahs at cfdrc.com > To: cocorim at hotmail.fr > CC: vtkusers at vtk.org > Subject: Re: [vtkusers] 3d reconstruction > > Create a vtkVolume > (http://www.vtk.org/doc/nightly/html/classvtkVolume.html); this is the > volume rendering equivalent of a vtkActor. Set the mapper on the > vtkVolume, and add the volume to the render window. You will also need > to set up color and opacity transfer functions (see > http://www.vtk.org/doc/nightly/html/classvtkColorTransferFunction.html > and http://www.vtk.org/doc/nightly/html/classvtkPiecewiseFunction.html) > indicating how values in your dataset map to color and opacity for > rendering. In c++, do something like the following. > > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New(); > ... > > vtkColorTransferFunction *colors = vtkColorTransferFunction::New(); > ... > > vtkPiecewiseFunction *opacities = vtkPiecewiseFunction::New(); > ... > > vtkVolume *volume = vtkVolume::New(); > volume->SetMapper(mapper); > vtkVolumeProperty *property = volume->GetProperty(); > property->SetColor(colors); > property->SetScalarOpacity(opacities); > > vtkRenderer *ren = new vtkRenderer(); > ren->AddViewProp(volume); > > > - Amy > > Alosha [Dread_Lord] wrote: > > Thanks, it works properly now. > > > > Now I have my vtkVolumeRayCastMapper and I have put the vtkImageData > > as input. > > > > So have I my 3D object or am I dreaming :P ? > > > > I know I'm not far, but there are some last steps I don't understand yet. > > > > Do you or anyone knows how to display it in my 3D View ? > > > > I must admit that I'm new in VTK and I don't understand well all this > > stuff yet. > > I don't know for example if vtkVolumeRayCastMapper gerate a 3D model > > that I can display. > > > > If my questions seem stupid, forgive me. > > > > There's the function I've made and at the end, I have my vtkImageData > > in my vtkVolumeRayCastMapper. Still, I don't know what to do with it > > to display a 3D model. > > > > //code > > > > typedef signed short PixelType; > > const unsigned int Dimension = 3; > > typedef itk::Image< PixelType, Dimension > ImageType; > > typedef itk::ImageToVTKImageFilter< ImageType > ConnectorType; > > 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->SetDirectory("C:/Dicoms/PHENIX/dicoms/OS/"); > > > > 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 ) > > { > > std::cout << seriesItr->c_str() << "caca" << std::endl; > > seriesItr++; > > } > > > > std::string seriesIdentifier; > > seriesIdentifier = seriesUID.begin()->c_str(); > > typedef std::vector< std::string > FileNamesContainer; > > > > FileNamesContainer fileNames; > > fileNames = nameGenerator->GetFileNames( seriesIdentifier ); > > reader->SetFileNames( fileNames ); > > > > cout << "updating the reader" << endl; > > > > try > > { > > reader->Update(); > > } > > catch (itk::ExceptionObject &ex) > > { > > std::cout << ex << std::endl; > > } > > > > ConnectorType::Pointer connector = ConnectorType::New(); > > > > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New(); > > mapper->SetInput(connector->GetOutput()); > > > > //end code > > > > > > > > > > ------------------------------------------------------------------------ > > > > > Date: Wed, 21 May 2008 10:20:08 -0500 > > > From: ahs at cfdrc.com > > > To: cocorim at hotmail.fr > > > CC: vtkusers at vtk.org > > > Subject: Re: [vtkusers] 3d reconstruction > > > > > > Are you linking against the vtkVolumeRendering library? You would need > > > to do that in order to use vtkVolumeRayCastMapper (or any other volume > > > rendering mapper). > > > > > > - Amy > > > > > > Alosha [Dread_Lord] wrote: > > > > > > > > Thank you for your answer. > > > > > > > > The vtkDicomImageReader actually works, but I have some LINK error > > > > while instantiating vtkVolumeRayCastMapper. > > > > > > > > ( vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New() ) > > > > > > > > Anyway, is the vtkDicomImageReader build a 3D mesh using the 2D dicom > > > > serie, or just generate a data set ? > > > > > > > > In this last case, how can I display it in my igstk::View3D ? I > > > > suppose I have to build a mesh with it ? > > > > > > > > I guess there is a VTK class which takes a volume VTK data set and > > > > build a mesh with it, but I don't know which class :S. > > > > > > > > Anyway, thanks for your answer, and I'm all ears if anyone knows how > > > > to generate a 3D object from my 2D Dicom series for displaying in a > > > > igstk::View3D > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com > > > > To: cocorim at hotmail.fr > > > > CC: vtkusers at vtk.org > > > > Subject: RE: [vtkusers] 3d reconstruction > > > > Date: Thu, 22 May 2008 00:44:50 +1000 > > > > > > > > You can actually read in a DICOM file as a 3D object just using VTK. > > > > > > > > vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New(); > > > > dicomReader->SetDirectoryName( "C:\\dicomfolder\\"); > > > > > > > > Have a look at Ray Cast Mapping as well (vtkVolumeRayCastMapper). > > > > I'm not sure if there is a better way though. With this approach, > > > > the image has to reduce its image quality (goes a bit blurry) > > > > while you move the camera. Then once you are finished moving > > > > around it will return to its original quality. > > > > > > > > Alternatively you can read it in using ITK, and then convert it > > > > back to VTK. I haven't tried this, so maybe someone can let you > > > > know the best way to do it. > > > > > > > > Regards, > > > > Cameron. > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > From: cocorim at hotmail.fr > > > > To: vtkusers at vtk.org > > > > Date: Wed, 21 May 2008 13:48:12 +0200 > > > > Subject: [vtkusers] 3d reconstruction > > > > > > > > Hi all ! > > > > > > > > Maybe the problem has already been exposed, and I'm sorry if > > > > it was. > > > > > > > > I've managed to made a basic DICOM Viewer. It has 4 views ; 3 > > > > views to axial, coronal ans sagittal orientation, and a > > > > tridimentionnal view for 3d reconstruction. > > > > > > > > I'm using igstk::View2D and igstk::View3D. > > > > > > > > I instantiate a CTImageSpatialObject in which I put the CT > > > > Image from the CTImageReader. > > > > Then I put the CTImageSpatialObject into a > > > > CTImageSpatialObjectRepresentation and I give it to the > > > > igstk::View2D. > > > > > > > > It's working properly and I can navigate into slides in the > > > > three 2D views. > > > > > > > > My problems is now how to perform a 3D reconstruction of the > > > > DICOM and display it in the 3D View. > > > > > > > > I've search on the net and on the mailing list for some help, > > > > but all this is still a little unclear to me. > > > > I just know that ITK and VTK has to be used, but I have no > > > > idea of how. > > > > > > > > If you can help me on that or at least show me the way for > > > > begin, I would be very greatfull. > > > > > > > > Thanks a lot ! > > > > > > > > > > ------------------------------------------------------------------------ > > > > Discutez gratuitement avec vos amis en vid?o ! T?l?chargez > > > > Messenger, c'est gratuit ! > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > Click here Search for local singles online @ Lavalife. > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > Centralisez tous vos comptes mails dans Hotmail ! Cr?ez un compte > > > > Hotmail, c'est gratuit ! > > > > > > ------------------------------------------------------------------------ > > > > > > > > _______________________________________________ > > > > This is the private VTK discussion list. > > > > Please keep messages on-topic. Check the FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > > > > -- > > > Amy Squillacote Phone: (256) 726-4839 > > > Computer Scientist Fax: (256) 726-4806 > > > CFD Research Corporation Web: http://www.cfdrc.com > > > 215 Wynn Drive, Suite 501 > > > Huntsville, AL 35805 > > > > > > > > > > > > ------------------------------------------------------------------------ > > Avec Windows Live Messenger restez en contact avec tous vos amis ! > > T?l?chargez Messenger, c'est gratuit ! > > > > -- > Amy Squillacote Phone: (256) 726-4839 > Computer Scientist Fax: (256) 726-4806 > CFD Research Corporation Web: http://www.cfdrc.com > 215 Wynn Drive, Suite 501 > Huntsville, AL 35805 > > Tous vos amis discutent sur Messenger, et vous ? T?l?chargez Messenger, c'est gratuit ! _________________________________________________________________ It's simple! Sell your car for just $30 at CarPoint.com.au http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT -------------- next part -------------- An HTML attachment was scrubbed... URL: From prabhat246 at yahoo.com Wed May 21 18:09:05 2008 From: prabhat246 at yahoo.com (prabhat246) Date: Wed, 21 May 2008 15:09:05 -0700 (PDT) Subject: [vtkusers] vtkMarchingCubes Message-ID: <17380317.post@talk.nabble.com> Hi, Please if someone can try to answer my questions then please do reply. (I've never got a response for my previous posts.) Even I'll be happy to listen NO from the modertors rather than waiting for a response for a long time. I made following changes in example \ITK\InsightApplications-3.4.0\Auxiliary\vtk\itkReadITKImage3DSegmentShowVTK here is my piece of code vtkMarchingCubes * contour = vtkMarchingCubes::New(); contour->SetInput(vtkImporter1->GetOutput()); contour->SetValue(0, 128); I am new to learn this algorithm. 1. Can you please explain what are these parameters of SetValue function ?? 2. How can I change the cube size to be bigger ?? and 3. How can I run this example without consuming much of memory (say I have 800+ slices) ?? Hoping for a helpful quick response. Thanks a lot Prabhat -- View this message in context: http://www.nabble.com/vtkMarchingCubes-tp17380317p17380317.html Sent from the VTK - Users mailing list archive at Nabble.com. From wesley.hoke at gmail.com Wed May 21 18:18:58 2008 From: wesley.hoke at gmail.com (Wesley Smith) Date: Wed, 21 May 2008 15:18:58 -0700 Subject: [vtkusers] zero flux surfaces Message-ID: <1079b050805211518n16ad08dex639ef90ab0a36e71@mail.gmail.com> Hi, Are there any resources / library functions in the ITK/VTK universe for finding zero flux surfaces? thanks, wes From cocorim at hotmail.fr Wed May 21 18:25:12 2008 From: cocorim at hotmail.fr (Alosha [Dread_Lord]) Date: Thu, 22 May 2008 00:25:12 +0200 Subject: [vtkusers] 3d reconstruction In-Reply-To: References: <48343DA8.9010207@cfdrc.com> <48344C12.60403@cfdrc.com> Message-ID: Hi Cameron, I've tried your code, but it still throwing the same error. I launched debugging mode with breakpoint, ans it appears that the problem comes when I call the Render() method of the window. I must admit that I'm a little lost and I don't understand the problem. From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.comTo: cocorim at hotmail.frCC: vtkusers at vtk.orgSubject: RE: [vtkusers] 3d reconstructionDate: Thu, 22 May 2008 07:54:44 +1000 Well, I'd say there would definately be an error because you called your vtkVolumeProperty "property" when that is a reserved name (it is blue text).Also, if you're having problems with your colours or opacity try this.... vtkPiecewiseFunction *opacityTransferFunction = vtkPiecewiseFunction::New(); opacityTransferFunction->AddPoint( 70.0, 0.0 ); opacityTransferFunction->AddPoint( 100.0, 0.2 ); opacityTransferFunction->AddPoint( 50000.0, 0.2 ); opacityTransferFunction->AddPoint( 50005.0, 0.0 ); vtkColorTransferFunction* colorTransferFunction = vtkColorTransferFunction::New(); colorTransferFunction->AddRGBPoint( 0.0, 1.0, 0.0, 0.0 ); colorTransferFunction->AddRGBPoint( 300.0, 1.0, 1.0, 0.0 ); colorTransferFunction->AddRGBPoint( 600.0, 0.0, 1.0, 0.0 ); colorTransferFunction->AddRGBPoint( 900.0, 1.0, 1.0, 1.0 ); colorTransferFunction->AddRGBPoint( 1200.0, 0.0, 0.0, 1.0 ); colorTransferFunction->AddRGBPoint( 1500.0, 1.0, 0.0, 1.0 ); colorTransferFunction->AddRGBPoint( 1800.0, 0.0, 0.0, 0.0 );I have absolutely NO idea how to obtain these points, but I guess it works fine. Maybe try changing the numbers to see what it does. From: cocorim at hotmail.frTo: ahs at cfdrc.comDate: Wed, 21 May 2008 23:39:41 +0200CC: vtkusers at vtk.orgSubject: Re: [vtkusers] 3d reconstruction Hi again ! Sorry to bother you again, but I have one problem remaining with the vtkRendererWindow. Here's my code : //code vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();mapper->SetInput(connector->GetOutput()); vtkVolume *volume = vtkVolume::New();volume->SetMapper(mapper); vtkColorTransferFunction *colors = vtkColorTransferFunction::New();colors->SetAlpha(1.0); vtkPiecewiseFunction *opacities = vtkPiecewiseFunction::New();opacities->SetMaximumNumberOfPieces(-1); vtkVolumeProperty *property = volume->GetProperty();property->SetColor(colors);property->SetScalarOpacity(opacities); vtkRenderer *ren = vtkRenderer::New();ren->AddViewProp(volume); vtkRenderWindow *triDView = vtkRenderWindow::New();triDView->AddRenderer(ren);triDView->Render(); //end code And the problems comes when the vtkRendere is added to the windows. VC++ throws an writing violation exception at a memory bloc. I don't understand why it's doing that.Maybe, my use of the window is incorrect. I'm waiting for my User's Guide book, but i'd like to have a 3d visualisation of my dicom before :). Tranks > Date: Wed, 21 May 2008 11:21:38 -0500> From: ahs at cfdrc.com> To: cocorim at hotmail.fr> CC: vtkusers at vtk.org> Subject: Re: [vtkusers] 3d reconstruction> > Create a vtkVolume > (http://www.vtk.org/doc/nightly/html/classvtkVolume.html); this is the > volume rendering equivalent of a vtkActor. Set the mapper on the > vtkVolume, and add the volume to the render window. You will also need > to set up color and opacity transfer functions (see > http://www.vtk.org/doc/nightly/html/classvtkColorTransferFunction.html > and http://www.vtk.org/doc/nightly/html/classvtkPiecewiseFunction.html) > indicating how values in your dataset map to color and opacity for > rendering. In c++, do something like the following.> > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();> ...> > vtkColorTransferFunction *colors = vtkColorTransferFunction::New();> ...> > vtkPiecewiseFunction *opacities = vtkPiecewiseFunction::New();> ...> > vtkVolume *volume = vtkVolume::New();> volume->SetMapper(mapper);> vtkVolumeProperty *property = volume->GetProperty();> property->SetColor(colors);> property->SetScalarOpacity(opacities);> > vtkRenderer *ren = new vtkRenderer();> ren->AddViewProp(volume);> > > - Amy> > Alosha [Dread_Lord] wrote:> > Thanks, it works properly now.> > > > Now I have my vtkVolumeRayCastMapper and I have put the vtkImageData > > as input.> > > > So have I my 3D object or am I dreaming :P ?> > > > I know I'm not far, but there are some last steps I don't understand yet.> > > > Do you or anyone knows how to display it in my 3D View ?> > > > I must admit that I'm new in VTK and I don't understand well all this > > stuff yet.> > I don't know for example if vtkVolumeRayCastMapper gerate a 3D model > > that I can display.> > > > If my questions seem stupid, forgive me.> >> > There's the function I've made and at the end, I have my vtkImageData > > in my vtkVolumeRayCastMapper. Still, I don't know what to do with it > > to display a 3D model.> > > > //code> > > > typedef signed short PixelType;> > const unsigned int Dimension = 3;> > typedef itk::Image< PixelType, Dimension > ImageType;> > typedef itk::ImageToVTKImageFilter< ImageType > ConnectorType;> > 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->SetDirectory("C:/Dicoms/PHENIX/dicoms/OS/");> > > > 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 )> > {> > std::cout << seriesItr->c_str() << "caca" << std::endl;> > seriesItr++;> > }> > > > std::string seriesIdentifier;> > seriesIdentifier = seriesUID.begin()->c_str();> > typedef std::vector< std::string > FileNamesContainer;> > > > FileNamesContainer fileNames;> > fileNames = nameGenerator->GetFileNames( seriesIdentifier );> > reader->SetFileNames( fileNames );> > > > cout << "updating the reader" << endl;> > > > try> > {> > reader->Update();> > }> > catch (itk::ExceptionObject &ex)> > {> > std::cout << ex << std::endl;> > }> > > > ConnectorType::Pointer connector = ConnectorType::New();> > > > vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();> > mapper->SetInput(connector->GetOutput());> > > > //end code> >> >> >> > > > ------------------------------------------------------------------------> >> > > Date: Wed, 21 May 2008 10:20:08 -0500> > > From: ahs at cfdrc.com> > > To: cocorim at hotmail.fr> > > CC: vtkusers at vtk.org> > > Subject: Re: [vtkusers] 3d reconstruction> > >> > > Are you linking against the vtkVolumeRendering library? You would need> > > to do that in order to use vtkVolumeRayCastMapper (or any other volume> > > rendering mapper).> > >> > > - Amy> > >> > > Alosha [Dread_Lord] wrote:> > > >> > > > Thank you for your answer.> > > >> > > > The vtkDicomImageReader actually works, but I have some LINK error> > > > while instantiating vtkVolumeRayCastMapper.> > > >> > > > ( vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New() )> > > >> > > > Anyway, is the vtkDicomImageReader build a 3D mesh using the 2D dicom> > > > serie, or just generate a data set ?> > > >> > > > In this last case, how can I display it in my igstk::View3D ? I> > > > suppose I have to build a mesh with it ?> > > >> > > > I guess there is a VTK class which takes a volume VTK data set and> > > > build a mesh with it, but I don't know which class :S.> > > >> > > > Anyway, thanks for your answer, and I'm all ears if anyone knows how> > > > to generate a 3D object from my 2D Dicom series for displaying in a> > > > igstk::View3D> > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com> > > > To: cocorim at hotmail.fr> > > > CC: vtkusers at vtk.org> > > > Subject: RE: [vtkusers] 3d reconstruction> > > > Date: Thu, 22 May 2008 00:44:50 +1000> > > >> > > > You can actually read in a DICOM file as a 3D object just using VTK.> > > >> > > > vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();> > > > dicomReader->SetDirectoryName( "C:\\dicomfolder\\");> > > >> > > > Have a look at Ray Cast Mapping as well (vtkVolumeRayCastMapper).> > > > I'm not sure if there is a better way though. With this approach,> > > > the image has to reduce its image quality (goes a bit blurry)> > > > while you move the camera. Then once you are finished moving> > > > around it will return to its original quality.> > > >> > > > Alternatively you can read it in using ITK, and then convert it> > > > back to VTK. I haven't tried this, so maybe someone can let you> > > > know the best way to do it.> > > >> > > > Regards,> > > > Cameron.> > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > From: cocorim at hotmail.fr> > > > To: vtkusers at vtk.org> > > > Date: Wed, 21 May 2008 13:48:12 +0200> > > > Subject: [vtkusers] 3d reconstruction> > > >> > > > Hi all !> > > >> > > > Maybe the problem has already been exposed, and I'm sorry if> > > > it was.> > > >> > > > I've managed to made a basic DICOM Viewer. It has 4 views ; 3> > > > views to axial, coronal ans sagittal orientation, and a> > > > tridimentionnal view for 3d reconstruction.> > > >> > > > I'm using igstk::View2D and igstk::View3D.> > > >> > > > I instantiate a CTImageSpatialObject in which I put the CT> > > > Image from the CTImageReader.> > > > Then I put the CTImageSpatialObject into a> > > > CTImageSpatialObjectRepresentation and I give it to the> > > > igstk::View2D.> > > >> > > > It's working properly and I can navigate into slides in the> > > > three 2D views.> > > >> > > > My problems is now how to perform a 3D reconstruction of the> > > > DICOM and display it in the 3D View.> > > >> > > > I've search on the net and on the mailing list for some help,> > > > but all this is still a little unclear to me.> > > > I just know that ITK and VTK has to be used, but I have no> > > > idea of how.> > > >> > > > If you can help me on that or at least show me the way for> > > > begin, I would be very greatfull.> > > >> > > > Thanks a lot !> > > >> > > > > > ------------------------------------------------------------------------> > > > Discutez gratuitement avec vos amis en vid?o ! T?l?chargez> > > > Messenger, c'est gratuit ! > > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > Click here Search for local singles online @ Lavalife.> > > > > > > > > >> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > > Centralisez tous vos comptes mails dans Hotmail ! Cr?ez un compte> > > > Hotmail, c'est gratuit ! > > > > > > ------------------------------------------------------------------------> > > >> > > > _______________________________________________> > > > This is the private VTK discussion list.> > > > Please keep messages on-topic. Check the FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ> > > > Follow this link to subscribe/unsubscribe:> > > > http://www.vtk.org/mailman/listinfo/vtkusers> > > >> > >> > > --> > > Amy Squillacote Phone: (256) 726-4839> > > Computer Scientist Fax: (256) 726-4806> > > CFD Research Corporation Web: http://www.cfdrc.com> > > 215 Wynn Drive, Suite 501> > > Huntsville, AL 35805> > >> > >> >> >> > ------------------------------------------------------------------------> > Avec Windows Live Messenger restez en contact avec tous vos amis ! > > T?l?chargez Messenger, c'est gratuit ! > > > > -- > Amy Squillacote Phone: (256) 726-4839> Computer Scientist Fax: (256) 726-4806> CFD Research Corporation Web: http://www.cfdrc.com> 215 Wynn Drive, Suite 501> Huntsville, AL 35805> > Tous vos amis discutent sur Messenger, et vous ? T?l?chargez Messenger, c'est gratuit ! at CarPoint.com.au It's simple! Sell your car for just $30 _________________________________________________________________ Avec Hotmail, vos e-mails vous suivent partout ! Mettez Hotmail sur votre mobile ! http://www.messengersurvotremobile.com/?d=hotmail -------------- next part -------------- An HTML attachment was scrubbed... URL: From xs81525 at 126.com Wed May 21 21:16:05 2008 From: xs81525 at 126.com (=?gb2312?B?z8TLyQ==?=) Date: Thu, 22 May 2008 09:16:05 +0800 Subject: [vtkusers] How to import 113 slices into the pipleline to do volume rendering Message-ID: <4834C91A.0D22E6.04890@m15-111.126.com> Hello everyone: I want to do volume rendering from 113 slices of CT Head raw data.i want to know how to import the raw data into the pipleline.Please give me a hand,Thanks in advance. From sylvainjaume at gmail.com Wed May 21 21:38:05 2008 From: sylvainjaume at gmail.com (Sylvain Jaume) Date: Wed, 21 May 2008 21:38:05 -0400 Subject: [vtkusers] vtkMarchingCubes In-Reply-To: <17380317.post@talk.nabble.com> References: <17380317.post@talk.nabble.com> Message-ID: Hi Prabhat, 1. The first parameter in SetValue is the index of the isosurface (if you have just one isosurface, use 0). The second parameter defines the intensity of the isosurface that will be created. 2. To make the cubes bigger, you can apply vtkImageResample and downsample your volume to a lower resolution. You might need to low pass the intensities first using vtkImageGaussianSmooth. 3. To process huge volumes, you can use vtkSliceCubes. This filter only processes 4 slices at a time to reduce its memory footprint. HTH, Sylvain On Wed, May 21, 2008 at 6:09 PM, prabhat246 wrote: > > Hi, > > Please if someone can try to answer my questions then please do reply. > (I've never got a response for my previous posts.) > Even I'll be happy to listen NO from the modertors rather than waiting for > a > response for a long time. > > > > I made following changes in example > > > > \ITK\InsightApplications-3.4.0\Auxiliary\vtk\itkReadITKImage3DSegmentShowVTK > > here is my piece of code > vtkMarchingCubes * contour = vtkMarchingCubes::New(); > contour->SetInput(vtkImporter1->GetOutput()); > contour->SetValue(0, 128); > > I am new to learn this algorithm. > > > 1. Can you please explain what are these parameters of SetValue function ?? > 2. How can I change the cube size to be bigger ?? and > 3. How can I run this example without consuming much of memory (say I have > 800+ slices) ?? > > Hoping for a helpful quick response. > > > > Thanks a lot > > Prabhat > -- > View this message in context: > http://www.nabble.com/vtkMarchingCubes-tp17380317p17380317.html > Sent from the VTK - Users mailing list archive at Nabble.com. > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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 markww at gmail.com Thu May 22 00:43:47 2008 From: markww at gmail.com (Mark Wyszomierski) Date: Thu, 22 May 2008 00:43:47 -0400 Subject: [vtkusers] How to import 113 slices into the pipleline to do volume rendering In-Reply-To: <4834C91A.0D22E6.04890@m15-111.126.com> References: <4834C91A.0D22E6.04890@m15-111.126.com> Message-ID: Hi, You can try something like this, hope it helps: http://devsample.org/index.php?option=com_content&task=view&id=18&Itemid=1 Mark On Wed, May 21, 2008 at 9:16 PM, ?? wrote: > Hello everyone: > I want to do volume rendering from 113 slices of CT Head raw data.i want to know how to import the raw data into the pipleline.Please give me a hand,Thanks in advance. > > > > > > > > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > From foramuyou at gmail.com Thu May 22 04:16:25 2008 From: foramuyou at gmail.com (Jefferson Thomas) Date: Thu, 22 May 2008 17:16:25 +0900 Subject: [vtkusers] Outputting a 2D ImageData into a JPEG/PNG... Message-ID: Hi, I want to create a JPEG or PNG image file out of a 2D ImageData structure. I create my ImageData like this: data=vtkImageData::New(); int size1=100, size2=100, size3=1; data->SetDimensions(size1,size2,1); data->SetSpacing(1.0, 1.0, 1.0); data->SetOrigin(0.0, 0.0, 0.0); data->SetScalarTypeToUnsignedChar(); vtkUnsignedCharArray* array; array = (vtkUnsignedCharArray*)vtkUnsignedCharArray::New(); array->SetNumberOfValues(size1*size2*size3); array->SetNumberOfComponents(3); unsigned char curval; for(int x=0;xSetTuple3(x+y*size1,curval, curval, curval); } } data->GetPointData()->AddArray(array); //Adding the data array to the image And I write it to JPEG like this: vtkJPEGWriter* jpgw=vtkJPEGWriter::New(); jpgw->SetInput(data); jpgw->SetFileName("test.jpg"); jpgw->Write(); After that I get strange image with gray stripes on the bottom. What am I doing wrong ? Is there any other way to convert a 2D ImageData into a JPEG file ? Thank you, Thomas From foramuyou at gmail.com Thu May 22 05:00:25 2008 From: foramuyou at gmail.com (Jefferson Thomas) Date: Thu, 22 May 2008 18:00:25 +0900 Subject: [vtkusers] Creating a slice of an ImageData Message-ID: Hi, How to create a slice from a 3D ImageData ? Ive been doing it with vtkImageDataGeometryFilter with SetExtent but in this way it is only possible to make a slice parallel to xy, xz or yz plane. I cant figure out a way to get a diagonal slice. Is there any smart way to create a slice for any arbitrary surface ? Thank you for any help, Thomas From hiba_vtk at yahoo.fr Thu May 22 05:30:09 2008 From: hiba_vtk at yahoo.fr (C. Hiba) Date: Thu, 22 May 2008 09:30:09 +0000 (GMT) Subject: [vtkusers] Show object in 2 different renders Message-ID: <304139.92225.qm@web28308.mail.ukl.yahoo.com> An HTML attachment was scrubbed... URL: From chenkaz at yahoo.com Thu May 22 07:05:58 2008 From: chenkaz at yahoo.com (Chavdar Papazov) Date: Thu, 22 May 2008 04:05:58 -0700 (PDT) Subject: [vtkusers] Problem with 3DSImporter and VRMLImporter Message-ID: <749638.77295.qm@web58112.mail.re3.yahoo.com> Dear all, I would like to import a simple box in my vtk-program using vtk3DSImporter or vtkVRMLImporter. The box has three textures attached to it. I have generated the 3ds (vrml) file with 3dsmax. As I import the files I see no textures! Why? In other programs such as DeepExploration the textures are visible! Thanks a lot. Chavo -------------- next part -------------- An HTML attachment was scrubbed... URL: From haloul02 at yahoo.co.uk Thu May 22 07:54:43 2008 From: haloul02 at yahoo.co.uk (Hala ALBakour) Date: Thu, 22 May 2008 11:54:43 +0000 (GMT) Subject: [vtkusers] Reading keyframes in an animated 3DS file Message-ID: <724712.83080.qm@web25404.mail.ukl.yahoo.com> An HTML attachment was scrubbed... URL: From markww at gmail.com Thu May 22 08:23:49 2008 From: markww at gmail.com (Mark Wyszomierski) Date: Thu, 22 May 2008 08:23:49 -0400 Subject: [vtkusers] How to import 113 slices into the pipleline to do volume rendering In-Reply-To: <483502B2.0C32E5.14391@m15-113.126.com> References: <483502B2.0C32E5.14391@m15-113.126.com> Message-ID: Hi, I think the link is ok, it may be blocked from the country you are viewing from (I have had users in China at least tell me this is sometimes the case), Mark 2008/5/22 ?? : > Hello Mark : > Thanks for your replying .But maybe the link is wrong .would you please give me a example on how to import the slices into the pipleline. > >>Hi, >> >>You can try something like this, hope it helps: >> >>http://devsample.org/index.php?option=com_content&task=view&id=18&Itemid=1 >> >>Mark >> >>On Wed, May 21, 2008 at 9:16 PM, ?? wrote: >>> Hello everyone: >>> I want to do volume rendering from 113 slices of CT Head raw data.i want to know how to import the raw data into the pipleline.Please give me a hand,Thanks in advance. >>> >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> This is the private VTK discussion list. >>> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>> Follow this link to subscribe/unsubscribe: >>> http://www.vtk.org/mailman/listinfo/vtkusers >>> >>. > > = = = = = = = = = = = = = = = = = = = = > > > ? > ?? > > > ?? > xs81525 at 126.com > 2008-05-22 > > From hallomaarten at yahoo.com Thu May 22 08:53:34 2008 From: hallomaarten at yahoo.com (Maarten Nieber) Date: Thu, 22 May 2008 05:53:34 -0700 (PDT) Subject: [vtkusers] crash with structuredPointsReader->SetOutput(NULL) Message-ID: <372497.48292.qm@web34201.mail.mud.yahoo.com> Hi, I wrote a test function that reproduces a crash with calling SetOutput(NULL) on a vtkStructuredPointsReader. I'm using vtk 5.1.0 on Windows XP (by the way, I did not see a vtk version history, I wanted to check if my problem was solved in the latest version). The program crashes with the message 'Access violation reading location 0x037ee000'. The test function tries to detach the output from the reader. By now, I know a better way to detach an output by using the ShallowCopy function. Still, I would like to know if I'm doing something wrong, or if this is a bug in vtk. #include "vtkStructuredPoints.h" #include "vtkStructuredPointsReader.h" void TestToReproduceCrashWithVtkImageReader() { vtkStructuredPointsReader* reader = vtkStructuredPointsReader::New(); reader->SetFileName("ironProt.vtk"); reader->Update(); vtkStructuredPoints* image = reader->GetOutput(); image->Register(NULL); reader->SetOutput(NULL); // This line seems to cause problems reader->Delete(); int imageSize = image->GetNumberOfPoints() * image->GetScalarSize(); unsigned char* buffer = new unsigned char[imageSize]; // The crash occurs in this line! memcpy(buffer, image->GetScalarPointer(), imageSize); } Note that the test does not crash if I comment out the call to SetOutput(NULL). Thanks! Maarten -------------- next part -------------- An HTML attachment was scrubbed... URL: From louxkr at gmail.com Thu May 22 08:59:25 2008 From: louxkr at gmail.com (Kerry Loux) Date: Thu, 22 May 2008 08:59:25 -0400 Subject: [vtkusers] Altering a rendered actor In-Reply-To: <369e9e6b0805211841m23611ae9j2ce927beecd09441@mail.gmail.com> References: <369e9e6b0805201714u6bb61d83r1e7b6bebd3d1d34d@mail.gmail.com> <65c344fe0805210547qe774d6etce18aecdd885f495@mail.gmail.com> <369e9e6b0805211841m23611ae9j2ce927beecd09441@mail.gmail.com> Message-ID: <65c344fe0805220559s72062bmd7c6ab5ce2bffe58@mail.gmail.com> Thanks to everyone who helped with this, I think I've got it (partially): In my test app, I'm creating a cone with radius = 0.5 and height = 1. I zoom out (it starts so close to the camera that it is partially clipped) and then click a button to change the position from [0.0, 0.0, 0.0] to [5.0, 5.0. 0.0]. Nothing that I was trying worked, but I thought I'd give Lu's advice another chance and just do this: pConeActor->SetPosition(5.0,5.0,0.0); m_pVTKWindow->Render(); It worked. I tried putting some of the other things back in there to figure out what was breaking it, and it seemed that any/all of them would make it not work. I went back to the simple solution above, and it also was no longer working. I thought I was loosing it, so I ran the app a bunch of times and oriented the cone several different ways before I clicked the button. It worked sometimes, but not always, and it seemed to have to do with how far I zoomed out. I changed the code to set the position to [1.0, 1.0, 0.0] and now it works every time. Is there some clipping plane stuff going on here? In all cases the actor appears as soon as I start to rotate/translate/zoom with the mouse. Thanks, Kerry On Wed, May 21, 2008 at 9:41 PM, Yick Lu wrote: > Hi, Kerry > > Did you get it? > > My method is: everytime when actor's position is set, call the render > method of corresponding vtkRenderWindowInteractor right at once. In this > case, I don't need any vtkevent. > > > > Lu Yi > > > > > > On Wed, May 21, 2008 at 8:47 PM, Kerry Loux wrote: > >> Thanks for your response, Lu. >> >> Yes, that's what I'm doing, but my problem is only with re-rendering the >> image. After updating the actor's position and orientation, the image >> doesn't update until I click on the screen to rotate or zoom, etc. It seems >> as though I'm missing the "update the screen" call. I have since found that >> if I call the Render() method of the renderWindowInteractor (actually a >> wxVTKRenderWindowInteractor) the actor disappears from the original >> position, but it still isn't redrawn until I click on the window. The only >> way I've found that updates the screen without clicking on it is to invoke a >> clicking event with the InvokeEvent() method. This is undesirable because >> then my screen rotates until I click on it. I've tried the following to get >> the screen to update: >> >> pConeActor->SetPosition(5.0,5.0,0.0);// Set new position - for this >> sample, original position was [0.0, 0.0, 0.0] >> m_pVTKWindow->Render(); >> >> This removes the actor from the original position, but doesn't draw it in >> it's new position until I click on the screen, as stated above. >> >> >> pConeActor->SetPosition(5.0,5.0,0.0); >> m_pVTKWindow->Render(); >> m_pVTKWindow->InvokeEvent(vtkCommand::ModifiedEvent, NULL); >> >> The addition of the InvokeEvent call here makes no difference. >> >> >> pConeActor->SetPosition(5.0,5.0,0.0); >> m_pVTKWindow->Render(); >> m_pVTKWindow->Update();// I've tried this with Update first, then Render >> as well >> >> The Update() call here makes no difference. >> >> >> pConeActor->SetPosition(5.0,5.0,0.0); >> m_pVTKWindow->Render(); >> m_pVTKWindow->InvokeEvent(vtkCommand::LeftButtonPressEvent, NULL); >> >> This does make the image redraw, but it also makes it spin (as though you >> were pressing the left mouse button...). That makes the obvious next step: >> >> pConeActor->SetPosition(5.0,5.0,0.0); >> m_pVTKWindow->Render(); >> m_pVTKWindow->InvokeEvent(vtkCommand::LeftButtonPressEvent, NULL); >> m_pVTKWindow->InvokeEvent(vtkCommand::LeftButtonReleaseEvent, NULL); >> >> But this doesn't do anything different than the first few attempts. I've >> been looking at the code that handles the LeftButtonPressEvent >> (vtkSubjectHelper::InvokeEvent in vtkObject.cxx) to try and figure out what >> part of that function makes the screen update, but so far I haven't been >> successful. Any help or advice is still appreciated! >> >> Thanks, >> >> Kerry >> >> >> >> On Tue, May 20, 2008 at 8:14 PM, Yick Lu wrote: >> >>> Maybe you can try "events" >>> >>> The event handler function should be like this: >>> >>> Typing Event Handler( eventArgs ) >>> { >>> //check character at the beginning >>> >>> pActor->Setpostion();//define new position >>> pRenderer->Render(); >>> >>> } >>> >>> The event is invoked as user type anything in the textbox. But make sure >>> the inputed character is checked and valid. >>> >>> >>> -- >>> Lu Yi >>> >> >> > > > -- > Lu Yi > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Thu May 22 09:15:58 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Thu, 22 May 2008 08:15:58 -0500 Subject: [vtkusers] How to import 113 slices into the pipleline to do volume rendering In-Reply-To: References: <4834C91A.0D22E6.04890@m15-111.126.com> Message-ID: <4835720E.7000902@cfdrc.com> There are also examples using the headsq/quarter dataset (a smaller dataset in the same format as the one you want to use) in VTK/Examples/Medical. You'd need to change the dimensions per slice and the number of slices in the examples to make them work for a different dataset. - Amy Mark Wyszomierski wrote: > Hi, > > You can try something like this, hope it helps: > > http://devsample.org/index.php?option=com_content&task=view&id=18&Itemid=1 > > Mark > > On Wed, May 21, 2008 at 9:16 PM, ?? wrote: > >> Hello everyone: >> I want to do volume rendering from 113 slices of CT Head raw data.i want to know how to import the raw data into the pipleline.Please give me a hand,Thanks in advance. >> >> >> >> >> >> >> >> >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> >> > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From ahs at cfdrc.com Thu May 22 09:19:37 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Thu, 22 May 2008 08:19:37 -0500 Subject: [vtkusers] Creating a slice of an ImageData In-Reply-To: References: Message-ID: <483572E9.1040805@cfdrc.com> Hi Thomas, Try using vtkCutter (http://www.vtk.org/doc/nightly/html/classvtkCutter.html) with a vtkPlane (a subclass of vtkImplicitFunction). - Amy Jefferson Thomas wrote: > Hi, > How to create a slice from a 3D ImageData ? Ive been doing it with > vtkImageDataGeometryFilter with SetExtent but in this way it is only > possible to make a slice parallel to xy, xz or yz plane. I cant figure > out a way to get a diagonal slice. > Is there any smart way to create a slice for any arbitrary surface ? > Thank you for any help, > Thomas > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From beromuald at wanadoo.fr Thu May 22 10:25:37 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Thu, 22 May 2008 16:25:37 +0200 (CEST) Subject: [vtkusers] Creating a 3DImageData from slices Message-ID: <33180705.247281211466337818.JavaMail.www@wwinf1a10> Hi all, Someone know how creating a 3DImageData from 2D slices? Thanks for answers, Romu -------------- next part -------------- An HTML attachment was scrubbed... URL: From beromuald at wanadoo.fr Thu May 22 10:36:47 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Thu, 22 May 2008 16:36:47 +0200 (CEST) Subject: [vtkusers] How to change pixel color? Message-ID: <18735688.249191211467007072.JavaMail.www@wwinf1a10> Ok, pPix = (unsigned char*)id->GetScalarPointer(); works for me. But I have a problem : I display a grey image (1 component) and I want to change few pixels in green (for example), I don't know how can I do this. The grey image has 1 scalar component, and I need to transform its to 3 components, and it takes a lot of time, and it's not very interactiv. Someone know can I do my task? Thanks a lot for answers, Romu PS : yenan, make sure you change just one component if you have a grey image, and change 3 components if you have a rgb image. > Message du 19/05/08 20:54 > De : yenanqu at scs.fsu.edu > A : "Romuald BERTRAND" > Copie ? : "Mark Wyszomierski" , vtkusers at vtk.org > Objet : Re: [vtkusers] How to change pixel color? > > No, I am still trying it. if you have other way to or could make it > work, please, please let me know. > > Yenan > > Quoting Romuald BERTRAND : > > > Hi, > > > > Thanks for your answers. > > > > I have tried but pPix = (unsigned char*)id->GetScalarPointer(); > > doesn't work for me. > > > > when I change the components, nothing change, and after I have > > display the array and I have seen it is null. > > Know you why? > > > > Yenan: Have you arrived to manipulate it correctly? > > > > Thanks > > > > > > > >> Message du 16/05/08 21:35 > >> De : "Mark Wyszomierski" > >> A : yenanqu at scs.fsu.edu > >> Copie ? : "Romuald BERTRAND" , vtkusers at vtk.org > >> Objet : Re: [vtkusers] How to change pixel color? > >> > >> >> pPix = (unsigned char*)id->GetScalarPointer(); > >> > >> That should work, I've used it many times for instance in this project: > >> > >> > >> http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 > >> > >> I show the value of the pixel that the mouse is over. Maybe there's > >> something else going on in your pipeline? > >> > >> Mark > >> > >> > >> > >> On 5/16/08, yenanqu at scs.fsu.edu wrote: > >> > How to get pointer from vtkImageData is the hardest thing,which I > >> > still can not make it. > >> > > >> > //id is vtkImageData > >> > int *uExtent = id->GetUpdateExtent(); > >> > pPix = (unsigned char*)id->GetScalarPointer(uExtent[0], uExtent[2], > >> > uExtent[4]); > >> > > >> > or > >> > > >> > pPix = (unsigned char*)id->GetScalarPointer(); > >> > > >> > the only method I could find out. It didn't work for me. try it to see > >> > if it works for you. > >> > > >> > Yenan > >> > > >> > Quoting Mark Wyszomierski : > >> > > >> >> Yeah once you get a pointer to the pixel data in vtkImageData you can > >> >> manipulate it however you want. It's just an array of values. > >> >> > >> >> Mark > >> >> > >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: > >> >>> Did you retrieve pixel data from vtkImageData seccessfully? > >> >>> > >> >>> > >> >>> Yenan > >> >>> Quoting Romuald BERTRAND : > >> >>> > >> >>>> Hi all, > >> >>>> > >> >>>> I have to display an image for my work. After, I have to change the > >> >>>> color of several pixels, I don't know why. I have a vtkImageData, > >> >>>> and I have search some methods to set the scalars of the pixels > >> >>>> which are stored in, but I don't arrived. > >> >>>> > >> >>>> Someone could help me? > >> >>>> > >> >>>> Thanks for answers. > >> >>>> > >> >>>> Romuald > >> >>>> > >> >>>> -- > >> >>>> This message has been scanned for viruses and > >> >>>> dangerous content by MailScanner, and is > >> >>>> believed to be clean. > >> >>>> > >> >>>> > >> >>> > >> >>> > >> >>> > >> >>> ---------------------------------------------------------------- > >> >>> This message was sent using IMP, the Internet Messaging Program. > >> >>> > >> >>> > >> >>> -- > >> >>> This message has been scanned for viruses and > >> >>> dangerous content by MailScanner, and is > >> >>> believed to be clean. > >> >>> > >> >>> _______________________________________________ > >> >>> This is the private VTK discussion list. > >> >>> Please keep messages on-topic. Check the FAQ at: > >> >>> http://www.vtk.org/Wiki/VTK_FAQ > >> >>> Follow this link to subscribe/unsubscribe: > >> >>> http://www.vtk.org/mailman/listinfo/vtkusers > >> >>> > >> >> > >> >> -- > >> >> This message has been scanned for viruses and > >> >> dangerous content by MailScanner, and is > >> >> believed to be clean. > >> >> > >> >> > >> > > >> > > >> > > >> > ---------------------------------------------------------------- > >> > This message was sent using IMP, the Internet Messaging Program. > >> > > >> > > >> > -- > >> > This message has been scanned for viruses and > >> > dangerous content by MailScanner, and is > >> > believed to be clean. > >> > > >> > > >> > >> > > > > -- > > This message has been scanned for viruses and > > dangerous content by MailScanner, and is > > believed to be clean. > > > > > > > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.cole at kitware.com Thu May 22 11:05:51 2008 From: david.cole at kitware.com (David Cole) Date: Thu, 22 May 2008 11:05:51 -0400 Subject: [vtkusers] crash with structuredPointsReader->SetOutput(NULL) In-Reply-To: <372497.48292.qm@web34201.mail.mud.yahoo.com> References: <372497.48292.qm@web34201.mail.mud.yahoo.com> Message-ID: Why are you calling SetOutput(NULL) on a reader object? The reader will clean up after itself when it is deleted, you do not need to call SetOutput(NULL). Did you see this as an example somewhere? On Thu, May 22, 2008 at 8:53 AM, Maarten Nieber wrote: > Hi, > > I wrote a test function that reproduces a crash with calling > SetOutput(NULL) on a vtkStructuredPointsReader. > I'm using vtk 5.1.0 on Windows XP (by the way, I did not see a vtk version > history, I wanted to check if my problem was solved in the latest version). > > The program crashes with the message 'Access violation reading location > 0x037ee000'. > > The test function tries to detach the output from the reader. > By now, I know a better way to detach an output by using the ShallowCopy > function. Still, I would like to know if I'm doing something wrong, or if > this is a bug in vtk. > > #include "vtkStructuredPoints.h" > #include "vtkStructuredPointsReader.h" > > void TestToReproduceCrashWithVtkImageReader() > { > vtkStructuredPointsReader* reader = > vtkStructuredPointsReader::New(); > reader->SetFileName("ironProt.vtk"); > reader->Update(); > vtkStructuredPoints* image = reader->GetOutput(); > image->Register(NULL); > reader->SetOutput(NULL); // This line seems to cause problems > reader->Delete(); > > int imageSize = image->GetNumberOfPoints() * > image->GetScalarSize(); > unsigned char* buffer = new unsigned char[imageSize]; > > // The crash occurs in this line! > memcpy(buffer, image->GetScalarPointer(), imageSize); > } > > Note that the test does not crash if I comment out the call to > SetOutput(NULL). > Thanks! > Maarten > > > > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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 ahs at cfdrc.com Thu May 22 11:08:00 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Thu, 22 May 2008 10:08:00 -0500 Subject: [vtkusers] Creating a 3DImageData from slices In-Reply-To: <33180705.247281211466337818.JavaMail.www@wwinf1a10> References: <33180705.247281211466337818.JavaMail.www@wwinf1a10> Message-ID: <48358C50.8070109@cfdrc.com> Hi Romu, Are the slices already loaded in VTK (i.e., multiple 2D vtkImageData objects), or are you reading the slices from files? If they're already 2D vtkImageData objects, take a look at vtkImageAppend (http://www.vtk.org/doc/nightly/html/classvtkImageAppend.html). If you have X-Y slices, then the "append axis" should be the Z axis. If you're reading the slices from files, subclasses of vtkImageReader2 (http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html) will handle this for you. You can pass in either a list of file names or a file pattern to tell the reader how to get the data files. - Amy Romuald BERTRAND wrote: > > Hi all, > > Someone know how creating a 3DImageData from 2D slices? > Thanks for answers, > > Romu > > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From yenanqu at scs.fsu.edu Thu May 22 12:14:19 2008 From: yenanqu at scs.fsu.edu (yenanqu at scs.fsu.edu) Date: Thu, 22 May 2008 12:14:19 -0400 Subject: [vtkusers] How to change pixel color? In-Reply-To: <18735688.249191211467007072.JavaMail.www@wwinf1a10> References: <18735688.249191211467007072.JavaMail.www@wwinf1a10> Message-ID: <20080522121419.4e6jgzhbb48ocgww@email.scs.fsu.edu> How do you make it work, what is the problem before. all my pixel data is three componen. I just can not retieve it from the id(vtkImageData). Yenan Quoting Romuald BERTRAND : > Ok, pPix = (unsigned char*)id->GetScalarPointer(); works for me. > > But I have a problem : I display a grey image (1 component) and I > want to change few pixels in green (for example), I don't know how > can I do this. > The grey image has 1 scalar component, and I need to transform its > to 3 components, and it takes a lot of time, and it's not very > interactiv. > > Someone know can I do my task? > > Thanks a lot for answers, > > Romu > > PS : yenan, make sure you change just one component if you have a > grey image, and change 3 components if you have a rgb image. > > > > >> Message du 19/05/08 20:54 >> De : yenanqu at scs.fsu.edu >> A : "Romuald BERTRAND" >> Copie ? : "Mark Wyszomierski" , vtkusers at vtk.org >> Objet : Re: [vtkusers] How to change pixel color? >> >> No, I am still trying it. if you have other way to or could make it >> work, please, please let me know. >> >> Yenan >> >> Quoting Romuald BERTRAND : >> >> > Hi, >> > >> > Thanks for your answers. >> > >> > I have tried but pPix = (unsigned char*)id->GetScalarPointer(); >> > doesn't work for me. >> > >> > when I change the components, nothing change, and after I have >> > display the array and I have seen it is null. >> > Know you why? >> > >> > Yenan: Have you arrived to manipulate it correctly? >> > >> > Thanks >> > >> > >> > >> >> Message du 16/05/08 21:35 >> >> De : "Mark Wyszomierski" >> >> A : yenanqu at scs.fsu.edu >> >> Copie ? : "Romuald BERTRAND" , vtkusers at vtk.org >> >> Objet : Re: [vtkusers] How to change pixel color? >> >> >> >> >> pPix = (unsigned char*)id->GetScalarPointer(); >> >> >> >> That should work, I've used it many times for instance in this project: >> >> >> >> >> >> >> http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 >> >> >> >> I show the value of the pixel that the mouse is over. Maybe there's >> >> something else going on in your pipeline? >> >> >> >> Mark >> >> >> >> >> >> >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: >> >> > How to get pointer from vtkImageData is the hardest thing,which I >> >> > still can not make it. >> >> > >> >> > //id is vtkImageData >> >> > int *uExtent = id->GetUpdateExtent(); >> >> > pPix = (unsigned char*)id->GetScalarPointer(uExtent[0], uExtent[2], >> >> > uExtent[4]); >> >> > >> >> > or >> >> > >> >> > pPix = (unsigned char*)id->GetScalarPointer(); >> >> > >> >> > the only method I could find out. It didn't work for me. try it to see >> >> > if it works for you. >> >> > >> >> > Yenan >> >> > >> >> > Quoting Mark Wyszomierski : >> >> > >> >> >> Yeah once you get a pointer to the pixel data in vtkImageData you can >> >> >> manipulate it however you want. It's just an array of values. >> >> >> >> >> >> Mark >> >> >> >> >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: >> >> >>> Did you retrieve pixel data from vtkImageData seccessfully? >> >> >>> >> >> >>> >> >> >>> Yenan >> >> >>> Quoting Romuald BERTRAND : >> >> >>> >> >> >>>> Hi all, >> >> >>>> >> >> >>>> I have to display an image for my work. After, I have to change the >> >> >>>> color of several pixels, I don't know why. I have a vtkImageData, >> >> >>>> and I have search some methods to set the scalars of the pixels >> >> >>>> which are stored in, but I don't arrived. >> >> >>>> >> >> >>>> Someone could help me? >> >> >>>> >> >> >>>> Thanks for answers. >> >> >>>> >> >> >>>> Romuald >> >> >>>> >> >> >>>> -- >> >> >>>> This message has been scanned for viruses and >> >> >>>> dangerous content by MailScanner, and is >> >> >>>> believed to be clean. >> >> >>>> >> >> >>>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> ---------------------------------------------------------------- >> >> >>> This message was sent using IMP, the Internet Messaging Program. >> >> >>> >> >> >>> >> >> >>> -- >> >> >>> This message has been scanned for viruses and >> >> >>> dangerous content by MailScanner, and is >> >> >>> believed to be clean. >> >> >>> >> >> >>> _______________________________________________ >> >> >>> This is the private VTK discussion list. >> >> >>> Please keep messages on-topic. Check the FAQ at: >> >> >>> http://www.vtk.org/Wiki/VTK_FAQ >> >> >>> Follow this link to subscribe/unsubscribe: >> >> >>> http://www.vtk.org/mailman/listinfo/vtkusers >> >> >>> >> >> >> >> >> >> -- >> >> >> This message has been scanned for viruses and >> >> >> dangerous content by MailScanner, and is >> >> >> believed to be clean. >> >> >> >> >> >> >> >> > >> >> > >> >> > >> >> > ---------------------------------------------------------------- >> >> > This message was sent using IMP, the Internet Messaging Program. >> >> > >> >> > >> >> > -- >> >> > This message has been scanned for viruses and >> >> > dangerous content by MailScanner, and is >> >> > believed to be clean. >> >> > >> >> > >> >> >> >> >> > >> > -- >> > This message has been scanned for viruses and >> > dangerous content by MailScanner, and is >> > believed to be clean. >> > >> > >> >> >> >> ---------------------------------------------------------------- >> This message was sent using IMP, the Internet Messaging Program. >> >> >> -- >> This message has been scanned for viruses and >> dangerous content by MailScanner, and is >> believed to be clean. >> >> >> > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From evans at aps.anl.gov Thu May 22 12:43:42 2008 From: evans at aps.anl.gov (Kenneth Evans) Date: Thu, 22 May 2008 11:43:42 -0500 Subject: [vtkusers] Problem with vtkRenderWindowInteractor with more than one widget In-Reply-To: <005501c8b532$e8483e20$950836a4@aps.anl.gov> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805091325l2bf1eef9n6653440673081ef1@mail.gmail.com> <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> <6DAD69CEEC61453C8DDD5E0B1986496B@CICADA> <31ddba770805121013t64e510bco5add2af6edcf515b@mail.gmail.com> <006301c8b465$c5fe67e0$950836a4@aps.anl.gov> <005501c8b532$e8483e20$950836a4@aps.anl.gov> Message-ID: <006901c8bc2a$fe632d60$950836a4@aps.anl.gov> I didn't get any replies, so I am resubmitting this. -Ken -----Original Message----- From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Kenneth Evans Sent: Tuesday, May 13, 2008 2:53 PM To: vtkusers at vtk.org Subject: [vtkusers] Problem with vtkRenderWindowInteractor with more than one widget Hi, I would like to use vtkRenderWindowInteractorwith more than one widget. Attached is an example that is like cone6.py but with a sphere added. The problem is that if I type "i" in the window, it only toggles the vtkBoxWidget on the cone and not on the sphere. In contrast, if I type "p" on either the cone or the sphere, it draws the pick box about that one --- the behavior I would think one would want. Is this a shortcoming of the vtkRenderWindowInteractor or am I doing something wrong? It would be nice to be able to make a vtk3DWidget-type widget appear and disappear independently on _any_ so-equiped object in the scene. Is there a way around it? (I would like to use this in Python or Java, so inheritance is not the way to go. The fact that it happens in C++ indicates it is in the implementation, not in the wrappers. Thanks, -Ken From sajendra at gmail.com Thu May 22 14:10:26 2008 From: sajendra at gmail.com (Sajendra N) Date: Thu, 22 May 2008 14:10:26 -0400 Subject: [vtkusers] Creating a slice of an ImageData In-Reply-To: References: Message-ID: <8151b65f0805221110k785d8905ufe948618a90e1d23@mail.gmail.com> You might want to look at vtkImageReslice (http://www.vtk.org/doc/nightly/html/classvtkImageReslice.html) and ImageSlicing.cxx example. On Thu, May 22, 2008 at 5:00 AM, Jefferson Thomas wrote: > Hi, > How to create a slice from a 3D ImageData ? Ive been doing it with > vtkImageDataGeometryFilter with SetExtent but in this way it is only > possible to make a slice parallel to xy, xz or yz plane. I cant figure > out a way to get a diagonal slice. > Is there any smart way to create a slice for any arbitrary surface ? > Thank you for any help, > Thomas > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- ?crasez l'inf?me! From markww at gmail.com Thu May 22 14:24:49 2008 From: markww at gmail.com (Mark Wyszomierski) Date: Thu, 22 May 2008 14:24:49 -0400 Subject: [vtkusers] How to change pixel color? In-Reply-To: <18735688.249191211467007072.JavaMail.www@wwinf1a10> References: <18735688.249191211467007072.JavaMail.www@wwinf1a10> Message-ID: Yeah that's tricky because converting your original greyscale data into three component color data implies you're only going to be using 255 possible grey values, whereas your original grey data might be in the 16 bit range etc. So, what are you going to do with a grey value of say 3000? This problem occurs even when you're viewing a greyscale image because you need to map the grey values into the range that the monitor can display. I guess this is what window/leveling is for, so you're determining some window/scale to remap all those really big gray values for the user. Can anyone verify that? This isn't a good recommendation, but it's something I hacked together just to get a temporary visualization going. If your greyscale data is being stored in unsigned shorts let's say, you can iterate over all the pixel data and find the max value used. For the images I worked with, this was rarely near the unsigned short max value, it was usually 20,000 let's say. Then if I wanted to display green pixels in the volume, I would use a lookup table and add points like 20001 = (0,255,0), 20002 = (255,0,0) and so on. You're sure your greyscale data never uses those values. Then you replace the voxels of interest with those appropriate lookup table values. When you hand the volume + LUT to VTK, you'll see the voxels in the colors you chose. There are problems with doing that of course. One is that your LUT will always have to be dynamically created which is kind of annoying. You're also overwriting voxel values in the source volume, so you need to keep a reference to a copy of the ones you overwrite if you want to 'remember' the original greyscale values. The list goes on. But it works and maybe it can give you some ideas. I'm sure other people have done this and they probably have better suggestions, Mark On 5/22/08, Romuald BERTRAND wrote: > Ok, pPix = (unsigned char*)id->GetScalarPointer(); works for me. > > But I have a problem : I display a grey image (1 component) and I want to > change few pixels in green (for example), I don't know how can I do this. > The grey image has 1 scalar component, and I need to transform its to 3 > components, and it takes a lot of time, and it's not very interactiv. > > Someone know can I do my task? > > Thanks a lot for answers, > > Romu > > PS : yenan, make sure you change just one component if you have a grey > image, and change 3 components if you have a rgb image. > > > > >> Message du 19/05/08 20:54 >> De : yenanqu at scs.fsu.edu >> A : "Romuald BERTRAND" >> Copie ? : "Mark Wyszomierski" , vtkusers at vtk.org >> Objet : Re: [vtkusers] How to change pixel color? >> >> No, I am still trying it. if you have other way to or could make it >> work, please, please let me know. >> >> Yenan >> >> Quoting Romuald BERTRAND : >> >> > Hi, >> > >> > Thanks for your answers. >> > >> > I have tried but pPix = (unsigned char*)id->GetScalarPointer(); >> > doesn't work for me. >> > >> > when I change the components, nothing change, and after I have >> > display the array and I have seen it is null. >> > Know you why? >> > >> > Yenan: Have you arrived to manipulate it correctly? >> > >> > Thanks >> > >> > >> > >> >> Message du 16/05/08 21:35 >> >> De : "Mark Wyszomierski" >> >> A : yenanqu at scs.fsu.edu >> >> Copie ? : "Romuald BERTRAND" , vtkusers at vtk.org >> >> Objet : Re: [vtkusers] How to change pixel color? >> >> >> >> >> pPix = (unsigned char*)id->GetScalarPointer(); >> >> >> >> That should work, I've used it many times for instance in this project: >> >> >> >> >> >> http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 >> >> >> >> I show the value of the pixel that the mouse is over. Maybe there's >> >> something else going on in your pipeline? >> >> >> >> Mark >> >> >> >> >> >> >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: >> >> > How to get pointer from vtkImageData is the hardest thing,which I >> >> > still can not make it. >> >> > >> >> > //id is vtkImageData >> >> > int *uExtent = id->GetUpdateExtent(); >> >> > pPix = (unsigned char*)id->GetScalarPointer(uExtent[0], uExtent[2], >> >> > uExtent[4]); >> >> > >> >> > or >> >> > >> >> > pPix = (unsigned char*)id->GetScalarPointer(); >> >> > >> >> > the only method I could find out. It didn't work for me. try it to >> >> > see >> >> > if it works for you. >> >> > >> >> > Yenan >> >> > >> >> > Quoting Mark Wyszomierski : >> >> > >> >> >> Yeah once you get a pointer to the pixel data in vtkImageData you >> >> >> can >> >> >> manipulate it however you want. It's just an array of values. >> >> >> >> >> >> Mark >> >> >> >> >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: >> >> >>> Did you retrieve pixel data from vtkImageData seccessfully? >> >> >>> >> >> >>> >> >> >>> Yenan >> >> >>> Quoting Romuald BERTRAND : >> >> >>> >> >> >>>> Hi all, >> >> >>>> >> >> >>>> I have to display an image for my work. After, I have to change >> >> >>>> the >> >> >>>> color of several pixels, I don't know why. I have a vtkImageData, >> >> >>>> and I have search some methods to set the scalars of the pixels >> >> >>>> which are stored in, but I don't arrived. >> >> >>>> >> >> >>>> Someone could help me? >> >> >>>> >> >> >>>> Thanks for answers. >> >> >>>> >> >> >>>> Romuald >> >> >>>> >> >> >>>> -- >> >> >>>> This message has been scanned for viruses and >> >> >>>> dangerous content by MailScanner, and is >> >> >>>> believed to be clean. >> >> >>>> >> >> >>>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> ---------------------------------------------------------------- >> >> >>> This message was sent using IMP, the Internet Messaging Program. >> >> >>> >> >> >>> >> >> >>> -- >> >> >>> This message has been scanned for viruses and >> >> >>> dangerous content by MailScanner, and is >> >> >>> believed to be clean. >> >> >>> >> >> >>> _______________________________________________ >> >> >>> This is the private VTK discussion list. >> >> >>> Please keep messages on-topic. Check the FAQ at: >> >> >>> http://www.vtk.org/Wiki/VTK_FAQ >> >> >>> Follow this link to subscribe/unsubscribe: >> >> >>> http://www.vtk.org/mailman/listinfo/vtkusers >> >> >>> >> >> >> >> >> >> -- >> >> >> This message has been scanned for viruses and >> >> >> dangerous content by MailScanner, and is >> >> >> believed to be clean. >> >> >> >> >> >> >> >> > >> >> > >> >> > >> >> > ---------------------------------------------------------------- >> >> > This message was sent using IMP, the Internet Messaging Program. >> >> > >> >> > >> >> > -- >> >> > This message has been scanned for viruses and >> >> > dangerous content by MailScanner, and is >> >> > believed to be clean. >> >> > >> >> > >> >> >> >> >> > >> > -- >> > This message has been scanned for viruses and >> > dangerous content by MailScanner, and is >> > believed to be clean. >> > >> > >> >> >> >> ---------------------------------------------------------------- >> This message was sent using IMP, the Internet Messaging Program. >> >> >> -- >> This message has been scanned for viruses and >> dangerous content by MailScanner, and is >> believed to be clean. >> >> >> > From louxkr at gmail.com Thu May 22 16:57:02 2008 From: louxkr at gmail.com (Kerry Loux) Date: Thu, 22 May 2008 16:57:02 -0400 Subject: [vtkusers] Altering a rendered actor In-Reply-To: <4835C49C.6000406@mediri.com> References: <369e9e6b0805201714u6bb61d83r1e7b6bebd3d1d34d@mail.gmail.com> <65c344fe0805210547qe774d6etce18aecdd885f495@mail.gmail.com> <369e9e6b0805211841m23611ae9j2ce927beecd09441@mail.gmail.com> <65c344fe0805220559s72062bmd7c6ab5ce2bffe58@mail.gmail.com> <4835AB24.8010009@mediri.com> <65c344fe0805221121lcb9dcacr2ea7e82543559249@mail.gmail.com> <4835C49C.6000406@mediri.com> Message-ID: <65c344fe0805221357p367fa4e4q605886e65df2f78c@mail.gmail.com> That did the trick!! It now works every time no matter how far I move the object or zoom, etc. Thanks Joe!! -Kerry On Thu, May 22, 2008 at 3:08 PM, Johannes Heitz wrote: > I am not saying it might be a solution... Been there, done that ;( > > double bounds[6]; > pRenderer->ComputeVisiblePropBounds(bounds); > pRenderer->ResetCameraClippingRange(bounds); > > Would in theory get the extent of the currently visible "actors" and > (re)set the clipping range accordingly. > > J. > > > // Quick (and unclean) test app to find out how and when to get rendered > actors to update > // Top of the UI -> wxVTK Window with 8 cone actors > // Bottom of UI -> wxTextCtrl to type commands into > // Commands are > // either a number from 0 to 7 followed by an action > // Actions are "hide", "show", "color", "hop" and the numbers > make the cone # x perform that action > // or "renderon", "renderoff", "on" or "off", (all show that I was wrong > ;P), > // "boundson", "boundsoff" (use the set clipping range or not) > // "allcolor", "allhop" (color, move all actors at once) or > // clip NEAR FAR (setting the current cameras clipping range) > > // What this might show is that... > > // vtkRenderer->ComputeVisiblePropBounds(bounds); > // vtkRenderer->ResetCameraClippingRange(bounds); > > // might 'render' all actors no matter what the clipping range is :| > > // Commands are 'sent' by hitting return > > > // For compilers that support precompilation, includes "wx/wx.h". > #include "wx/wxprec.h" > > #ifdef __BORLANDC__ > #pragma hdrstop > #endif > > // for all others, include the necessary headers (this file is usually all > you > // need because it includes almost all "standard" wxWindows headers) > #ifndef WX_PRECOMP > #include "wx/wx.h" > #endif > > #include "wxVTKRenderWindowInteractor.h" > #include "vtkCamera.h" > #include "vtkRenderer.h" > #include "vtkRenderWindow.h" > #include "vtkConeSource.h" > #include "vtkPolyDataMapper.h" > #include "vtkActor.h" > #include "vtkPolyDataReader.h" > #include "vtkProperty.h" > > #include "vtkPNGReader.h" > #include "vtkImageMapper.h" > #include "vtkImageShiftScale.h" > #include "vtkInteractorStyleImage.h" > #include "vtkActor2D.h" > > #include "vtkImageViewer2.h" > #include "vtkImageData.h" > #include "vtkTesting.h" > #include "vtkTestUtilities.h" > > > // the application icon > #ifndef __WXMSW__ > #include "mondrian.xpm" > #endif > > class MyApp; > class MyFrame; > > // Define a new application type, each program should derive a class from > wxApp > class MyApp : public wxApp > { > public: > // this one is called on application startup and is a good place for the > app > // initialization (doing it here and not in the ctor allows to have an > error > // return: if OnInit() returns false, the application terminates) > virtual bool OnInit(); > }; > > // Define a new frame type: this is going to be our main frame > class MyFrame : public wxFrame > { > public: > // ctor(s) > MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size); > ~MyFrame(); > > // event handlers (these functions should _not_ be virtual) > void OnQuit(wxCommandEvent& event); > void OnAbout(wxCommandEvent& event); > void OnTextInput(wxCommandEvent& event); > void doCommand(wxString strCommand); > protected: > void Setup(); > void Cleanup(); > > private: > wxVTKRenderWindowInteractor* m_pVTKWindow; > vtkRenderer* pRenderer; > vtkRenderWindow* pRenderWindow; > vtkPolyDataMapper* pConeMapper[8]; > vtkActor* pConeActor[8]; > vtkConeSource* pConeSource[8]; > wxTextCtrl* m_pTextCtrl; > wxPanel* panel; > > bool m_autorender; > bool m_maxbounds; > > private: > // any class wishing to process wxWindows events must use this macro > DECLARE_EVENT_TABLE() > }; > > // IDs for the controls and the menu commands > enum > { > // menu items > Minimal_Quit = 1, > Minimal_About > }; > > #define MY_FRAME 101 > #define MY_VTK_WINDOW 102 > #define ID_TEXT 103 > > // the event tables connect the wxWindows events with the functions (event > // handlers) which process them. It can be also done at run-time, but for > the > // simple menu events like this the static method is much simpler. > BEGIN_EVENT_TABLE(MyFrame, wxFrame) > EVT_MENU(Minimal_Quit, MyFrame::OnQuit) > EVT_MENU(Minimal_About, MyFrame::OnAbout) > EVT_TEXT_ENTER(ID_TEXT, MyFrame::OnTextInput) > END_EVENT_TABLE() > > // Create a new application object: this macro will allow wxWindows to > create > // the application object during program execution (it's better than using > a > // static object for many reasons) and also declares the accessor function > // wxGetApp() which will return the reference of the right type (i.e. MyApp > and > // not wxApp) > IMPLEMENT_APP(MyApp) > > // 'Main program' equivalent: the program execution "starts" here > bool MyApp::OnInit() > { > > MyFrame *frame = new MyFrame(_T("wxWindows-VTK App"), > wxPoint(50, 50), wxSize(450, 340)); > > frame->Show(TRUE); > > return TRUE; > } > > // frame constructor > MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& > size) > : wxFrame((wxFrame *)NULL, -1, title, pos, size) > { > #ifdef __WXMAC__ > // we need this in order to allow the about menu relocation, since ABOUT > is > // not the default id of the about menu > wxApp::s_macAboutMenuItemId = Minimal_About; > #endif > > SetIcon(wxICON(mondrian)); > > wxMenu *menuFile = new wxMenu(_T(""), wxMENU_TEAROFF); > wxMenu *helpMenu = new wxMenu; > > helpMenu->Append(Minimal_About, _T("&About...\tCtrl-A"), _T("Show > about dialog")); > menuFile->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this > program")); > > wxMenuBar *menuBar = new wxMenuBar(); > menuBar->Append(menuFile, _T("&File")); > menuBar->Append(helpMenu, _T("&Help")); > > SetMenuBar(menuBar); > > > > #if wxUSE_STATUSBAR > // create a status bar just for fun (by default with 1 pane only) > CreateStatusBar(2); > SetStatusText(_T("Zoom out to see cones")); > #endif // wxUSE_STATUSBAR > > panel = new wxPanel(this, -1); > m_pVTKWindow = new wxVTKRenderWindowInteractor(panel, MY_VTK_WINDOW); > m_pVTKWindow->UseCaptureMouseOn(); > m_pTextCtrl = new wxTextCtrl(panel, ID_TEXT, "", wxDefaultPosition, > wxDefaultSize,wxTE_PROCESS_ENTER/*|wxTE_MULTILINE*/); > wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL); > vbox->Add(m_pVTKWindow, 2,wxEXPAND); > vbox->Add(m_pTextCtrl, 1,wxEXPAND); > panel->SetSizer(vbox); > m_maxbounds = false; > m_autorender = false; > Setup(); > } > > MyFrame::~MyFrame() > { > Cleanup(); > } > > > void MyFrame::Setup() > { > pRenderer = vtkRenderer::New(); > pRenderWindow = m_pVTKWindow->GetRenderWindow(); > pRenderWindow->AddRenderer(pRenderer); > > for(int iLoop = 0; iLoop < 8; iLoop++) > { > pConeMapper[iLoop] = vtkPolyDataMapper::New(); > pConeActor[iLoop] = vtkActor::New(); > pConeSource[iLoop] = vtkConeSource::New(); > pConeSource[iLoop]->SetAngle(60-(5*iLoop)); > pConeSource[iLoop]->SetResolution(2*(iLoop+1)); > pConeMapper[iLoop]->SetInput(pConeSource[iLoop]->GetOutput()); > pConeActor[iLoop]->SetMapper(pConeMapper[iLoop]); > > pConeActor[iLoop]->SetPosition(iLoop*(rand()%2==1?-1:1),iLoop*(rand()%2==1?-1:1),iLoop*(rand()%2==1?-1:1)); > pRenderer->AddActor(pConeActor[iLoop]); > } > > pRenderer->SetBackground(0.4,0.4,0.4); > pRenderer->GetActiveCamera()->Zoom(1.0); > pRenderer->GetActiveCamera()->SetClippingRange(1,1000); > } > > void MyFrame::Cleanup() > { > // No check for != 0 and no try/catch > for(int iLoop = 0; iLoop < 8; iLoop++) > { > pConeMapper[iLoop]->Delete(); > pConeActor[iLoop]->Delete(); > pConeSource[iLoop]->Delete(); > } > pRenderer->Delete(); > m_pVTKWindow->Delete(); > } > > > void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) > { > Close(TRUE); > } > > void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) > { > wxString msg; > msg.Printf( _T("This is the about dialog of wx-vtk sample.\n")); > wxMessageBox(msg, _T("About wx-vtk"), wxOK | wxICON_INFORMATION, this); > } > > void MyFrame::OnTextInput(wxCommandEvent& event) > { > if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) > { > doCommand(m_pTextCtrl->GetValue()); > m_pTextCtrl->Clear(); > } > event.Skip(); > } > > void MyFrame::doCommand(wxString strCommand) > { > // This is rather weak but no time for parsing proper... > int iPos = strCommand.Find(" "); > if(-1 != iPos) > { > wxString strOpCode = strCommand.Left(iPos); > strOpCode.Trim(); > wxString strRemains = > strCommand.Right(strCommand.Length()-iPos); > strRemains.Trim(); > > if(!strOpCode.IsEmpty()) > { > strOpCode.MakeLower(); > if(strOpCode.IsNumber()) > { > > double dVal; > strOpCode.ToDouble(&dVal); > if(dVal>7) return; > strRemains.MakeLower(); > strRemains.Trim(false); > if(0 == strRemains.CompareTo("hide")) > > pRenderer->RemoveActor(pConeActor[(int)dVal]); > if(0 == strRemains.CompareTo("show")) > > pRenderer->AddActor(pConeActor[(int)dVal]); > if(0 == strRemains.CompareTo("color")) > > pConeActor[(int)dVal]->GetProperty()->SetColor((float)(rand()%10)/10,(float)(rand()%10)/10,(float)(rand()%10)/10); > if(0 == strRemains.CompareTo("hop")) > > pConeActor[(int)dVal]->SetPosition(rand()%10*(rand()%2==1?-1:1),rand()%10*(rand()%2==1?-1:1),rand()%10*(rand()%2==1?-1:1)); > } > else > { > if(0 == strOpCode.CompareTo("clip")) > { > wxString strNear; > wxString strFar; > wxString strRemains = > strCommand.Right(strCommand.Length()-iPos); > strRemains.Trim(true); > strRemains.Trim(false); > int iPos = strRemains.Find(" "); > if(-1 != iPos) > { > strNear = > strRemains.Left(iPos); > strFar = > strRemains.Right(strRemains.Length()-iPos); > > strNear.Trim(true); > strNear.Trim(false); > strFar.Trim(false); > strFar.Trim(true); > if(!strNear.IsEmpty() && > !strFar.IsEmpty()) > { > double nearVal; > double farVal; > > strNear.ToDouble(&nearVal); > > strFar.ToDouble(&farVal); > > pRenderer->GetActiveCamera()->SetClippingRange(nearVal, farVal); > } > } > } > } > } > } > else > { > wxString strOpCode = strCommand.Left(iPos); > strOpCode.Trim(); > strOpCode.MakeLower(); > > if(0 == strOpCode.CompareTo("allcolor")) > { > for(int iLoop = 0; iLoop < 8; iLoop++) > { > > pConeActor[iLoop]->GetProperty()->SetColor((float)(rand()%10)/10,(float)(rand()%10)/10,(float)(rand()%10)/10); > } > } > > if(0 == strOpCode.CompareTo("allhop")) > { > for(int iLoop = 0; iLoop < 8; iLoop++) > { > > pConeActor[iLoop]->SetPosition(rand()%10*(rand()%2==1?-1:1),rand()%10*(rand()%2==1?-1:1),rand()%10*(rand()%2==1?-1:1)); > } > } > > if(0 == strOpCode.CompareTo("on")) > { > m_pVTKWindow->SetRenderWhenDisabled(true); > SetStatusText("RenderWhenDisabled = true"); > } > if(0 == strOpCode.CompareTo("off")) > { > m_pVTKWindow->SetRenderWhenDisabled(false); > SetStatusText("RenderWhenDisabled = false"); > } > if(0 == strOpCode.CompareTo("renderon")) > { > m_autorender = true; > SetStatusText("AutoRender = on"); > } > if(0 == strOpCode.CompareTo("renderoff")) > { > m_autorender = false; > SetStatusText("AutoRender = off"); > } > if(0 == strOpCode.CompareTo("boundsoff")) > { > m_maxbounds = false; > SetStatusText("Honor clipping range: use > SetClippingRange"); > } > if(0 == strOpCode.CompareTo("boundson")) > { > m_maxbounds = true; > SetStatusText("Ignore clipping range: use > ComputeVisiblePropBounds"); > } > } > > double bounds[6]; > > /* DBG > double pos[3]; > char tmp[1000]; > > for(int iLoop = 0; iLoop < 8; iLoop++) > { > pConeActor[iLoop]->GetBounds(bounds); > pConeActor[iLoop]->GetPosition(pos); > sprintf(tmp,"\r\nActor %i is at %f,%f,%f",iLoop, > pos[0],pos[1],pos[2]); > m_pTextCtrl->AppendText(tmp); > sprintf(tmp,"\r\nActor %i bounds %f,%f,%f",iLoop, > bounds[0],bounds[1],bounds[2],bounds[3],bounds[4],bounds[5]); > m_pTextCtrl->AppendText(tmp); > } > */ > > if(m_maxbounds) > { > pRenderer->ComputeVisiblePropBounds(bounds); > pRenderer->ResetCameraClippingRange(bounds); > } > > if(m_autorender) > { > m_pVTKWindow->GetRenderWindow()->Render(); > } > > } > -------------- next part -------------- An HTML attachment was scrubbed... URL: From louxkr at gmail.com Thu May 22 16:57:02 2008 From: louxkr at gmail.com (Kerry Loux) Date: Thu, 22 May 2008 16:57:02 -0400 Subject: [vtkusers] Altering a rendered actor In-Reply-To: <4835C49C.6000406@mediri.com> References: <369e9e6b0805201714u6bb61d83r1e7b6bebd3d1d34d@mail.gmail.com> <65c344fe0805210547qe774d6etce18aecdd885f495@mail.gmail.com> <369e9e6b0805211841m23611ae9j2ce927beecd09441@mail.gmail.com> <65c344fe0805220559s72062bmd7c6ab5ce2bffe58@mail.gmail.com> <4835AB24.8010009@mediri.com> <65c344fe0805221121lcb9dcacr2ea7e82543559249@mail.gmail.com> <4835C49C.6000406@mediri.com> Message-ID: <65c344fe0805221357p367fa4e4q605886e65df2f78c@mail.gmail.com> That did the trick!! It now works every time no matter how far I move the object or zoom, etc. Thanks Joe!! -Kerry On Thu, May 22, 2008 at 3:08 PM, Johannes Heitz wrote: > I am not saying it might be a solution... Been there, done that ;( > > double bounds[6]; > pRenderer->ComputeVisiblePropBounds(bounds); > pRenderer->ResetCameraClippingRange(bounds); > > Would in theory get the extent of the currently visible "actors" and > (re)set the clipping range accordingly. > > J. > > > // Quick (and unclean) test app to find out how and when to get rendered > actors to update > // Top of the UI -> wxVTK Window with 8 cone actors > // Bottom of UI -> wxTextCtrl to type commands into > // Commands are > // either a number from 0 to 7 followed by an action > // Actions are "hide", "show", "color", "hop" and the numbers > make the cone # x perform that action > // or "renderon", "renderoff", "on" or "off", (all show that I was wrong > ;P), > // "boundson", "boundsoff" (use the set clipping range or not) > // "allcolor", "allhop" (color, move all actors at once) or > // clip NEAR FAR (setting the current cameras clipping range) > > // What this might show is that... > > // vtkRenderer->ComputeVisiblePropBounds(bounds); > // vtkRenderer->ResetCameraClippingRange(bounds); > > // might 'render' all actors no matter what the clipping range is :| > > // Commands are 'sent' by hitting return > > > // For compilers that support precompilation, includes "wx/wx.h". > #include "wx/wxprec.h" > > #ifdef __BORLANDC__ > #pragma hdrstop > #endif > > // for all others, include the necessary headers (this file is usually all > you > // need because it includes almost all "standard" wxWindows headers) > #ifndef WX_PRECOMP > #include "wx/wx.h" > #endif > > #include "wxVTKRenderWindowInteractor.h" > #include "vtkCamera.h" > #include "vtkRenderer.h" > #include "vtkRenderWindow.h" > #include "vtkConeSource.h" > #include "vtkPolyDataMapper.h" > #include "vtkActor.h" > #include "vtkPolyDataReader.h" > #include "vtkProperty.h" > > #include "vtkPNGReader.h" > #include "vtkImageMapper.h" > #include "vtkImageShiftScale.h" > #include "vtkInteractorStyleImage.h" > #include "vtkActor2D.h" > > #include "vtkImageViewer2.h" > #include "vtkImageData.h" > #include "vtkTesting.h" > #include "vtkTestUtilities.h" > > > // the application icon > #ifndef __WXMSW__ > #include "mondrian.xpm" > #endif > > class MyApp; > class MyFrame; > > // Define a new application type, each program should derive a class from > wxApp > class MyApp : public wxApp > { > public: > // this one is called on application startup and is a good place for the > app > // initialization (doing it here and not in the ctor allows to have an > error > // return: if OnInit() returns false, the application terminates) > virtual bool OnInit(); > }; > > // Define a new frame type: this is going to be our main frame > class MyFrame : public wxFrame > { > public: > // ctor(s) > MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size); > ~MyFrame(); > > // event handlers (these functions should _not_ be virtual) > void OnQuit(wxCommandEvent& event); > void OnAbout(wxCommandEvent& event); > void OnTextInput(wxCommandEvent& event); > void doCommand(wxString strCommand); > protected: > void Setup(); > void Cleanup(); > > private: > wxVTKRenderWindowInteractor* m_pVTKWindow; > vtkRenderer* pRenderer; > vtkRenderWindow* pRenderWindow; > vtkPolyDataMapper* pConeMapper[8]; > vtkActor* pConeActor[8]; > vtkConeSource* pConeSource[8]; > wxTextCtrl* m_pTextCtrl; > wxPanel* panel; > > bool m_autorender; > bool m_maxbounds; > > private: > // any class wishing to process wxWindows events must use this macro > DECLARE_EVENT_TABLE() > }; > > // IDs for the controls and the menu commands > enum > { > // menu items > Minimal_Quit = 1, > Minimal_About > }; > > #define MY_FRAME 101 > #define MY_VTK_WINDOW 102 > #define ID_TEXT 103 > > // the event tables connect the wxWindows events with the functions (event > // handlers) which process them. It can be also done at run-time, but for > the > // simple menu events like this the static method is much simpler. > BEGIN_EVENT_TABLE(MyFrame, wxFrame) > EVT_MENU(Minimal_Quit, MyFrame::OnQuit) > EVT_MENU(Minimal_About, MyFrame::OnAbout) > EVT_TEXT_ENTER(ID_TEXT, MyFrame::OnTextInput) > END_EVENT_TABLE() > > // Create a new application object: this macro will allow wxWindows to > create > // the application object during program execution (it's better than using > a > // static object for many reasons) and also declares the accessor function > // wxGetApp() which will return the reference of the right type (i.e. MyApp > and > // not wxApp) > IMPLEMENT_APP(MyApp) > > // 'Main program' equivalent: the program execution "starts" here > bool MyApp::OnInit() > { > > MyFrame *frame = new MyFrame(_T("wxWindows-VTK App"), > wxPoint(50, 50), wxSize(450, 340)); > > frame->Show(TRUE); > > return TRUE; > } > > // frame constructor > MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& > size) > : wxFrame((wxFrame *)NULL, -1, title, pos, size) > { > #ifdef __WXMAC__ > // we need this in order to allow the about menu relocation, since ABOUT > is > // not the default id of the about menu > wxApp::s_macAboutMenuItemId = Minimal_About; > #endif > > SetIcon(wxICON(mondrian)); > > wxMenu *menuFile = new wxMenu(_T(""), wxMENU_TEAROFF); > wxMenu *helpMenu = new wxMenu; > > helpMenu->Append(Minimal_About, _T("&About...\tCtrl-A"), _T("Show > about dialog")); > menuFile->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this > program")); > > wxMenuBar *menuBar = new wxMenuBar(); > menuBar->Append(menuFile, _T("&File")); > menuBar->Append(helpMenu, _T("&Help")); > > SetMenuBar(menuBar); > > > > #if wxUSE_STATUSBAR > // create a status bar just for fun (by default with 1 pane only) > CreateStatusBar(2); > SetStatusText(_T("Zoom out to see cones")); > #endif // wxUSE_STATUSBAR > > panel = new wxPanel(this, -1); > m_pVTKWindow = new wxVTKRenderWindowInteractor(panel, MY_VTK_WINDOW); > m_pVTKWindow->UseCaptureMouseOn(); > m_pTextCtrl = new wxTextCtrl(panel, ID_TEXT, "", wxDefaultPosition, > wxDefaultSize,wxTE_PROCESS_ENTER/*|wxTE_MULTILINE*/); > wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL); > vbox->Add(m_pVTKWindow, 2,wxEXPAND); > vbox->Add(m_pTextCtrl, 1,wxEXPAND); > panel->SetSizer(vbox); > m_maxbounds = false; > m_autorender = false; > Setup(); > } > > MyFrame::~MyFrame() > { > Cleanup(); > } > > > void MyFrame::Setup() > { > pRenderer = vtkRenderer::New(); > pRenderWindow = m_pVTKWindow->GetRenderWindow(); > pRenderWindow->AddRenderer(pRenderer); > > for(int iLoop = 0; iLoop < 8; iLoop++) > { > pConeMapper[iLoop] = vtkPolyDataMapper::New(); > pConeActor[iLoop] = vtkActor::New(); > pConeSource[iLoop] = vtkConeSource::New(); > pConeSource[iLoop]->SetAngle(60-(5*iLoop)); > pConeSource[iLoop]->SetResolution(2*(iLoop+1)); > pConeMapper[iLoop]->SetInput(pConeSource[iLoop]->GetOutput()); > pConeActor[iLoop]->SetMapper(pConeMapper[iLoop]); > > pConeActor[iLoop]->SetPosition(iLoop*(rand()%2==1?-1:1),iLoop*(rand()%2==1?-1:1),iLoop*(rand()%2==1?-1:1)); > pRenderer->AddActor(pConeActor[iLoop]); > } > > pRenderer->SetBackground(0.4,0.4,0.4); > pRenderer->GetActiveCamera()->Zoom(1.0); > pRenderer->GetActiveCamera()->SetClippingRange(1,1000); > } > > void MyFrame::Cleanup() > { > // No check for != 0 and no try/catch > for(int iLoop = 0; iLoop < 8; iLoop++) > { > pConeMapper[iLoop]->Delete(); > pConeActor[iLoop]->Delete(); > pConeSource[iLoop]->Delete(); > } > pRenderer->Delete(); > m_pVTKWindow->Delete(); > } > > > void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) > { > Close(TRUE); > } > > void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) > { > wxString msg; > msg.Printf( _T("This is the about dialog of wx-vtk sample.\n")); > wxMessageBox(msg, _T("About wx-vtk"), wxOK | wxICON_INFORMATION, this); > } > > void MyFrame::OnTextInput(wxCommandEvent& event) > { > if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) > { > doCommand(m_pTextCtrl->GetValue()); > m_pTextCtrl->Clear(); > } > event.Skip(); > } > > void MyFrame::doCommand(wxString strCommand) > { > // This is rather weak but no time for parsing proper... > int iPos = strCommand.Find(" "); > if(-1 != iPos) > { > wxString strOpCode = strCommand.Left(iPos); > strOpCode.Trim(); > wxString strRemains = > strCommand.Right(strCommand.Length()-iPos); > strRemains.Trim(); > > if(!strOpCode.IsEmpty()) > { > strOpCode.MakeLower(); > if(strOpCode.IsNumber()) > { > > double dVal; > strOpCode.ToDouble(&dVal); > if(dVal>7) return; > strRemains.MakeLower(); > strRemains.Trim(false); > if(0 == strRemains.CompareTo("hide")) > > pRenderer->RemoveActor(pConeActor[(int)dVal]); > if(0 == strRemains.CompareTo("show")) > > pRenderer->AddActor(pConeActor[(int)dVal]); > if(0 == strRemains.CompareTo("color")) > > pConeActor[(int)dVal]->GetProperty()->SetColor((float)(rand()%10)/10,(float)(rand()%10)/10,(float)(rand()%10)/10); > if(0 == strRemains.CompareTo("hop")) > > pConeActor[(int)dVal]->SetPosition(rand()%10*(rand()%2==1?-1:1),rand()%10*(rand()%2==1?-1:1),rand()%10*(rand()%2==1?-1:1)); > } > else > { > if(0 == strOpCode.CompareTo("clip")) > { > wxString strNear; > wxString strFar; > wxString strRemains = > strCommand.Right(strCommand.Length()-iPos); > strRemains.Trim(true); > strRemains.Trim(false); > int iPos = strRemains.Find(" "); > if(-1 != iPos) > { > strNear = > strRemains.Left(iPos); > strFar = > strRemains.Right(strRemains.Length()-iPos); > > strNear.Trim(true); > strNear.Trim(false); > strFar.Trim(false); > strFar.Trim(true); > if(!strNear.IsEmpty() && > !strFar.IsEmpty()) > { > double nearVal; > double farVal; > > strNear.ToDouble(&nearVal); > > strFar.ToDouble(&farVal); > > pRenderer->GetActiveCamera()->SetClippingRange(nearVal, farVal); > } > } > } > } > } > } > else > { > wxString strOpCode = strCommand.Left(iPos); > strOpCode.Trim(); > strOpCode.MakeLower(); > > if(0 == strOpCode.CompareTo("allcolor")) > { > for(int iLoop = 0; iLoop < 8; iLoop++) > { > > pConeActor[iLoop]->GetProperty()->SetColor((float)(rand()%10)/10,(float)(rand()%10)/10,(float)(rand()%10)/10); > } > } > > if(0 == strOpCode.CompareTo("allhop")) > { > for(int iLoop = 0; iLoop < 8; iLoop++) > { > > pConeActor[iLoop]->SetPosition(rand()%10*(rand()%2==1?-1:1),rand()%10*(rand()%2==1?-1:1),rand()%10*(rand()%2==1?-1:1)); > } > } > > if(0 == strOpCode.CompareTo("on")) > { > m_pVTKWindow->SetRenderWhenDisabled(true); > SetStatusText("RenderWhenDisabled = true"); > } > if(0 == strOpCode.CompareTo("off")) > { > m_pVTKWindow->SetRenderWhenDisabled(false); > SetStatusText("RenderWhenDisabled = false"); > } > if(0 == strOpCode.CompareTo("renderon")) > { > m_autorender = true; > SetStatusText("AutoRender = on"); > } > if(0 == strOpCode.CompareTo("renderoff")) > { > m_autorender = false; > SetStatusText("AutoRender = off"); > } > if(0 == strOpCode.CompareTo("boundsoff")) > { > m_maxbounds = false; > SetStatusText("Honor clipping range: use > SetClippingRange"); > } > if(0 == strOpCode.CompareTo("boundson")) > { > m_maxbounds = true; > SetStatusText("Ignore clipping range: use > ComputeVisiblePropBounds"); > } > } > > double bounds[6]; > > /* DBG > double pos[3]; > char tmp[1000]; > > for(int iLoop = 0; iLoop < 8; iLoop++) > { > pConeActor[iLoop]->GetBounds(bounds); > pConeActor[iLoop]->GetPosition(pos); > sprintf(tmp,"\r\nActor %i is at %f,%f,%f",iLoop, > pos[0],pos[1],pos[2]); > m_pTextCtrl->AppendText(tmp); > sprintf(tmp,"\r\nActor %i bounds %f,%f,%f",iLoop, > bounds[0],bounds[1],bounds[2],bounds[3],bounds[4],bounds[5]); > m_pTextCtrl->AppendText(tmp); > } > */ > > if(m_maxbounds) > { > pRenderer->ComputeVisiblePropBounds(bounds); > pRenderer->ResetCameraClippingRange(bounds); > } > > if(m_autorender) > { > m_pVTKWindow->GetRenderWindow()->Render(); > } > > } > -------------- next part -------------- An HTML attachment was scrubbed... URL: From louxkr at gmail.com Thu May 22 16:57:02 2008 From: louxkr at gmail.com (Kerry Loux) Date: Thu, 22 May 2008 16:57:02 -0400 Subject: [vtkusers] Altering a rendered actor In-Reply-To: <4835C49C.6000406@mediri.com> References: <369e9e6b0805201714u6bb61d83r1e7b6bebd3d1d34d@mail.gmail.com> <65c344fe0805210547qe774d6etce18aecdd885f495@mail.gmail.com> <369e9e6b0805211841m23611ae9j2ce927beecd09441@mail.gmail.com> <65c344fe0805220559s72062bmd7c6ab5ce2bffe58@mail.gmail.com> <4835AB24.8010009@mediri.com> <65c344fe0805221121lcb9dcacr2ea7e82543559249@mail.gmail.com> <4835C49C.6000406@mediri.com> Message-ID: <65c344fe0805221357p367fa4e4q605886e65df2f78c@mail.gmail.com> That did the trick!! It now works every time no matter how far I move the object or zoom, etc. Thanks Joe!! -Kerry On Thu, May 22, 2008 at 3:08 PM, Johannes Heitz wrote: > I am not saying it might be a solution... Been there, done that ;( > > double bounds[6]; > pRenderer->ComputeVisiblePropBounds(bounds); > pRenderer->ResetCameraClippingRange(bounds); > > Would in theory get the extent of the currently visible "actors" and > (re)set the clipping range accordingly. > > J. > > > // Quick (and unclean) test app to find out how and when to get rendered > actors to update > // Top of the UI -> wxVTK Window with 8 cone actors > // Bottom of UI -> wxTextCtrl to type commands into > // Commands are > // either a number from 0 to 7 followed by an action > // Actions are "hide", "show", "color", "hop" and the numbers > make the cone # x perform that action > // or "renderon", "renderoff", "on" or "off", (all show that I was wrong > ;P), > // "boundson", "boundsoff" (use the set clipping range or not) > // "allcolor", "allhop" (color, move all actors at once) or > // clip NEAR FAR (setting the current cameras clipping range) > > // What this might show is that... > > // vtkRenderer->ComputeVisiblePropBounds(bounds); > // vtkRenderer->ResetCameraClippingRange(bounds); > > // might 'render' all actors no matter what the clipping range is :| > > // Commands are 'sent' by hitting return > > > // For compilers that support precompilation, includes "wx/wx.h". > #include "wx/wxprec.h" > > #ifdef __BORLANDC__ > #pragma hdrstop > #endif > > // for all others, include the necessary headers (this file is usually all > you > // need because it includes almost all "standard" wxWindows headers) > #ifndef WX_PRECOMP > #include "wx/wx.h" > #endif > > #include "wxVTKRenderWindowInteractor.h" > #include "vtkCamera.h" > #include "vtkRenderer.h" > #include "vtkRenderWindow.h" > #include "vtkConeSource.h" > #include "vtkPolyDataMapper.h" > #include "vtkActor.h" > #include "vtkPolyDataReader.h" > #include "vtkProperty.h" > > #include "vtkPNGReader.h" > #include "vtkImageMapper.h" > #include "vtkImageShiftScale.h" > #include "vtkInteractorStyleImage.h" > #include "vtkActor2D.h" > > #include "vtkImageViewer2.h" > #include "vtkImageData.h" > #include "vtkTesting.h" > #include "vtkTestUtilities.h" > > > // the application icon > #ifndef __WXMSW__ > #include "mondrian.xpm" > #endif > > class MyApp; > class MyFrame; > > // Define a new application type, each program should derive a class from > wxApp > class MyApp : public wxApp > { > public: > // this one is called on application startup and is a good place for the > app > // initialization (doing it here and not in the ctor allows to have an > error > // return: if OnInit() returns false, the application terminates) > virtual bool OnInit(); > }; > > // Define a new frame type: this is going to be our main frame > class MyFrame : public wxFrame > { > public: > // ctor(s) > MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size); > ~MyFrame(); > > // event handlers (these functions should _not_ be virtual) > void OnQuit(wxCommandEvent& event); > void OnAbout(wxCommandEvent& event); > void OnTextInput(wxCommandEvent& event); > void doCommand(wxString strCommand); > protected: > void Setup(); > void Cleanup(); > > private: > wxVTKRenderWindowInteractor* m_pVTKWindow; > vtkRenderer* pRenderer; > vtkRenderWindow* pRenderWindow; > vtkPolyDataMapper* pConeMapper[8]; > vtkActor* pConeActor[8]; > vtkConeSource* pConeSource[8]; > wxTextCtrl* m_pTextCtrl; > wxPanel* panel; > > bool m_autorender; > bool m_maxbounds; > > private: > // any class wishing to process wxWindows events must use this macro > DECLARE_EVENT_TABLE() > }; > > // IDs for the controls and the menu commands > enum > { > // menu items > Minimal_Quit = 1, > Minimal_About > }; > > #define MY_FRAME 101 > #define MY_VTK_WINDOW 102 > #define ID_TEXT 103 > > // the event tables connect the wxWindows events with the functions (event > // handlers) which process them. It can be also done at run-time, but for > the > // simple menu events like this the static method is much simpler. > BEGIN_EVENT_TABLE(MyFrame, wxFrame) > EVT_MENU(Minimal_Quit, MyFrame::OnQuit) > EVT_MENU(Minimal_About, MyFrame::OnAbout) > EVT_TEXT_ENTER(ID_TEXT, MyFrame::OnTextInput) > END_EVENT_TABLE() > > // Create a new application object: this macro will allow wxWindows to > create > // the application object during program execution (it's better than using > a > // static object for many reasons) and also declares the accessor function > // wxGetApp() which will return the reference of the right type (i.e. MyApp > and > // not wxApp) > IMPLEMENT_APP(MyApp) > > // 'Main program' equivalent: the program execution "starts" here > bool MyApp::OnInit() > { > > MyFrame *frame = new MyFrame(_T("wxWindows-VTK App"), > wxPoint(50, 50), wxSize(450, 340)); > > frame->Show(TRUE); > > return TRUE; > } > > // frame constructor > MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& > size) > : wxFrame((wxFrame *)NULL, -1, title, pos, size) > { > #ifdef __WXMAC__ > // we need this in order to allow the about menu relocation, since ABOUT > is > // not the default id of the about menu > wxApp::s_macAboutMenuItemId = Minimal_About; > #endif > > SetIcon(wxICON(mondrian)); > > wxMenu *menuFile = new wxMenu(_T(""), wxMENU_TEAROFF); > wxMenu *helpMenu = new wxMenu; > > helpMenu->Append(Minimal_About, _T("&About...\tCtrl-A"), _T("Show > about dialog")); > menuFile->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this > program")); > > wxMenuBar *menuBar = new wxMenuBar(); > menuBar->Append(menuFile, _T("&File")); > menuBar->Append(helpMenu, _T("&Help")); > > SetMenuBar(menuBar); > > > > #if wxUSE_STATUSBAR > // create a status bar just for fun (by default with 1 pane only) > CreateStatusBar(2); > SetStatusText(_T("Zoom out to see cones")); > #endif // wxUSE_STATUSBAR > > panel = new wxPanel(this, -1); > m_pVTKWindow = new wxVTKRenderWindowInteractor(panel, MY_VTK_WINDOW); > m_pVTKWindow->UseCaptureMouseOn(); > m_pTextCtrl = new wxTextCtrl(panel, ID_TEXT, "", wxDefaultPosition, > wxDefaultSize,wxTE_PROCESS_ENTER/*|wxTE_MULTILINE*/); > wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL); > vbox->Add(m_pVTKWindow, 2,wxEXPAND); > vbox->Add(m_pTextCtrl, 1,wxEXPAND); > panel->SetSizer(vbox); > m_maxbounds = false; > m_autorender = false; > Setup(); > } > > MyFrame::~MyFrame() > { > Cleanup(); > } > > > void MyFrame::Setup() > { > pRenderer = vtkRenderer::New(); > pRenderWindow = m_pVTKWindow->GetRenderWindow(); > pRenderWindow->AddRenderer(pRenderer); > > for(int iLoop = 0; iLoop < 8; iLoop++) > { > pConeMapper[iLoop] = vtkPolyDataMapper::New(); > pConeActor[iLoop] = vtkActor::New(); > pConeSource[iLoop] = vtkConeSource::New(); > pConeSource[iLoop]->SetAngle(60-(5*iLoop)); > pConeSource[iLoop]->SetResolution(2*(iLoop+1)); > pConeMapper[iLoop]->SetInput(pConeSource[iLoop]->GetOutput()); > pConeActor[iLoop]->SetMapper(pConeMapper[iLoop]); > > pConeActor[iLoop]->SetPosition(iLoop*(rand()%2==1?-1:1),iLoop*(rand()%2==1?-1:1),iLoop*(rand()%2==1?-1:1)); > pRenderer->AddActor(pConeActor[iLoop]); > } > > pRenderer->SetBackground(0.4,0.4,0.4); > pRenderer->GetActiveCamera()->Zoom(1.0); > pRenderer->GetActiveCamera()->SetClippingRange(1,1000); > } > > void MyFrame::Cleanup() > { > // No check for != 0 and no try/catch > for(int iLoop = 0; iLoop < 8; iLoop++) > { > pConeMapper[iLoop]->Delete(); > pConeActor[iLoop]->Delete(); > pConeSource[iLoop]->Delete(); > } > pRenderer->Delete(); > m_pVTKWindow->Delete(); > } > > > void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) > { > Close(TRUE); > } > > void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) > { > wxString msg; > msg.Printf( _T("This is the about dialog of wx-vtk sample.\n")); > wxMessageBox(msg, _T("About wx-vtk"), wxOK | wxICON_INFORMATION, this); > } > > void MyFrame::OnTextInput(wxCommandEvent& event) > { > if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) > { > doCommand(m_pTextCtrl->GetValue()); > m_pTextCtrl->Clear(); > } > event.Skip(); > } > > void MyFrame::doCommand(wxString strCommand) > { > // This is rather weak but no time for parsing proper... > int iPos = strCommand.Find(" "); > if(-1 != iPos) > { > wxString strOpCode = strCommand.Left(iPos); > strOpCode.Trim(); > wxString strRemains = > strCommand.Right(strCommand.Length()-iPos); > strRemains.Trim(); > > if(!strOpCode.IsEmpty()) > { > strOpCode.MakeLower(); > if(strOpCode.IsNumber()) > { > > double dVal; > strOpCode.ToDouble(&dVal); > if(dVal>7) return; > strRemains.MakeLower(); > strRemains.Trim(false); > if(0 == strRemains.CompareTo("hide")) > > pRenderer->RemoveActor(pConeActor[(int)dVal]); > if(0 == strRemains.CompareTo("show")) > > pRenderer->AddActor(pConeActor[(int)dVal]); > if(0 == strRemains.CompareTo("color")) > > pConeActor[(int)dVal]->GetProperty()->SetColor((float)(rand()%10)/10,(float)(rand()%10)/10,(float)(rand()%10)/10); > if(0 == strRemains.CompareTo("hop")) > > pConeActor[(int)dVal]->SetPosition(rand()%10*(rand()%2==1?-1:1),rand()%10*(rand()%2==1?-1:1),rand()%10*(rand()%2==1?-1:1)); > } > else > { > if(0 == strOpCode.CompareTo("clip")) > { > wxString strNear; > wxString strFar; > wxString strRemains = > strCommand.Right(strCommand.Length()-iPos); > strRemains.Trim(true); > strRemains.Trim(false); > int iPos = strRemains.Find(" "); > if(-1 != iPos) > { > strNear = > strRemains.Left(iPos); > strFar = > strRemains.Right(strRemains.Length()-iPos); > > strNear.Trim(true); > strNear.Trim(false); > strFar.Trim(false); > strFar.Trim(true); > if(!strNear.IsEmpty() && > !strFar.IsEmpty()) > { > double nearVal; > double farVal; > > strNear.ToDouble(&nearVal); > > strFar.ToDouble(&farVal); > > pRenderer->GetActiveCamera()->SetClippingRange(nearVal, farVal); > } > } > } > } > } > } > else > { > wxString strOpCode = strCommand.Left(iPos); > strOpCode.Trim(); > strOpCode.MakeLower(); > > if(0 == strOpCode.CompareTo("allcolor")) > { > for(int iLoop = 0; iLoop < 8; iLoop++) > { > > pConeActor[iLoop]->GetProperty()->SetColor((float)(rand()%10)/10,(float)(rand()%10)/10,(float)(rand()%10)/10); > } > } > > if(0 == strOpCode.CompareTo("allhop")) > { > for(int iLoop = 0; iLoop < 8; iLoop++) > { > > pConeActor[iLoop]->SetPosition(rand()%10*(rand()%2==1?-1:1),rand()%10*(rand()%2==1?-1:1),rand()%10*(rand()%2==1?-1:1)); > } > } > > if(0 == strOpCode.CompareTo("on")) > { > m_pVTKWindow->SetRenderWhenDisabled(true); > SetStatusText("RenderWhenDisabled = true"); > } > if(0 == strOpCode.CompareTo("off")) > { > m_pVTKWindow->SetRenderWhenDisabled(false); > SetStatusText("RenderWhenDisabled = false"); > } > if(0 == strOpCode.CompareTo("renderon")) > { > m_autorender = true; > SetStatusText("AutoRender = on"); > } > if(0 == strOpCode.CompareTo("renderoff")) > { > m_autorender = false; > SetStatusText("AutoRender = off"); > } > if(0 == strOpCode.CompareTo("boundsoff")) > { > m_maxbounds = false; > SetStatusText("Honor clipping range: use > SetClippingRange"); > } > if(0 == strOpCode.CompareTo("boundson")) > { > m_maxbounds = true; > SetStatusText("Ignore clipping range: use > ComputeVisiblePropBounds"); > } > } > > double bounds[6]; > > /* DBG > double pos[3]; > char tmp[1000]; > > for(int iLoop = 0; iLoop < 8; iLoop++) > { > pConeActor[iLoop]->GetBounds(bounds); > pConeActor[iLoop]->GetPosition(pos); > sprintf(tmp,"\r\nActor %i is at %f,%f,%f",iLoop, > pos[0],pos[1],pos[2]); > m_pTextCtrl->AppendText(tmp); > sprintf(tmp,"\r\nActor %i bounds %f,%f,%f",iLoop, > bounds[0],bounds[1],bounds[2],bounds[3],bounds[4],bounds[5]); > m_pTextCtrl->AppendText(tmp); > } > */ > > if(m_maxbounds) > { > pRenderer->ComputeVisiblePropBounds(bounds); > pRenderer->ResetCameraClippingRange(bounds); > } > > if(m_autorender) > { > m_pVTKWindow->GetRenderWindow()->Render(); > } > > } > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Moritz.Bernard.Fricke at rwth-aachen.de Thu May 22 17:56:56 2008 From: Moritz.Bernard.Fricke at rwth-aachen.de (Moritz Bernard Fricke) Date: Thu, 22 May 2008 23:56:56 +0200 Subject: [vtkusers] limiting the volume of vtkContourFilter and Volume Rendering Message-ID: Hello users, i have a problem concerning vtkContourfilter and volume rendering. I want to crop the volume that is rendered, but i don't have parallel planes to crop. i have to visualize a complex room. The walls of the room are polygons. How can i use the those polygon as cropping planes? Thanks in advance, Moritz From gregus at gmail.com Thu May 22 22:41:50 2008 From: gregus at gmail.com (Greg Ushomirsky) Date: Thu, 22 May 2008 22:41:50 -0400 Subject: [vtkusers] Problem with vtkRenderWindowInteractor with more than one widget In-Reply-To: <006901c8bc2a$fe632d60$950836a4@aps.anl.gov> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> <6DAD69CEEC61453C8DDD5E0B1986496B@CICADA> <31ddba770805121013t64e510bco5add2af6edcf515b@mail.gmail.com> <006301c8b465$c5fe67e0$950836a4@aps.anl.gov> <005501c8b532$e8483e20$950836a4@aps.anl.gov> <006901c8bc2a$fe632d60$950836a4@aps.anl.gov> Message-ID: Ken, I posted a similar question to vtkusers about a month ago but never got a reply. Here's what I understood since then: 1. when you press "i", the default interactor enables the first vtk3DWidget that was registered with it. So it does not matter how many vtk3DWidgets you have; only the first one will get activated when you press "i", regardless of where the mouse is pointing. You can see that by tracing around the interactor code -- it never checks where the mouse is pointing (unlike the case when you press "p" -- the interactor then invokes a picker that checks the mouse pointer location) 2. You can turn on any of the vtk3DWidgets you created by invoking their EnabledOn() method. This will display the widget in the scene and will let it receive mouse events. 3. A kludgey way of implementing what you need (doable from Python) is to set up a callback such that you would first pick an actor whose 3DWidget you want to interact with (by pressing "p") and the act of picking the actor would turn on the widget. In more detail, you need to - Keep an array of actors that have associated 3DWidgets - register a callback for the renderer's EndPickEvent event - in the callback, the interactor's vtkAbstractPropPicker will already point to the actor that was picked, if any. So you check if the picked actor is on your list, and, if so, you call its widget's EnableOn() method, and you call all other widgets' EnableOff() method. If no actor was picked, then you call everyone's EnableOff() method. It's a kludge, but it works. The only undesirable side effect is that I have not figured out how to not turn on the outline of the actor that was picked. The real way to fix this would be to re-implement or sublcass the interactor Hope this helps Greg On Thu, May 22, 2008 at 12:43 PM, Kenneth Evans wrote: > I didn't get any replies, so I am resubmitting this. > > -Ken > > -----Original Message----- > From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf > Of Kenneth Evans > Sent: Tuesday, May 13, 2008 2:53 PM > To: vtkusers at vtk.org > Subject: [vtkusers] Problem with vtkRenderWindowInteractor with more than > one widget > > Hi, > > I would like to use vtkRenderWindowInteractorwith more than one widget. > Attached is an example that is like cone6.py but with a sphere added. The > problem is that if I type "i" in the window, it only toggles the > vtkBoxWidget on the cone and not on the sphere. > > In contrast, if I type "p" on either the cone or the sphere, it draws the > pick box about that one --- the behavior I would think one would want. > > Is this a shortcoming of the vtkRenderWindowInteractor or am I doing > something wrong? It would be nice to be able to make a vtk3DWidget-type > widget appear and disappear independently on _any_ so-equiped object in the > scene. > > Is there a way around it? (I would like to use this in Python or Java, so > inheritance is not the way to go. The fact that it happens in C++ indicates > it is in the implementation, not in the wrappers. > > Thanks, > > -Ken > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > From kalpana0611 at gmail.com Thu May 22 22:42:44 2008 From: kalpana0611 at gmail.com (Cally K) Date: Fri, 23 May 2008 10:42:44 +0800 Subject: [vtkusers] Measure the rendering and the loading data time Message-ID: Hi, I am using particle reader to read my data, I now need to measure the rendering time, I found the TimeRenderer.cxx and modified it into my program, it produces the wall time..can I consider my wall time as my rendering time or is there another way to do that.. I was also wondering if there is a way for me to find out the time taken to load the data. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.jefferson at qq.com Thu May 22 23:06:47 2008 From: mark.jefferson at qq.com (=?ISO-8859-1?B?TWFyayBKZWZmZXJzb24=?=) Date: Fri, 23 May 2008 11:6:47 +0800 Subject: [vtkusers] problem of class vtkImageAppendComponents Message-ID: Hi, Amy, I still don't know why. and I still have many questions. 1, how can I know the different type of inputs? if I use the vtkBMPReader, of course, its input is vtkAlgorithmOutput, if another one is vtkImageData, so they are different? if one of input is the object pointer of vtkAlgorithmOutput, another is the object pointer of vtkImageAppendComponents, are they different? if they are different, I should use two input, isn't it? 2, the type of vtkImageAppendComponents's output is vtkImageData, but all the output getting from vtkImageAppendComponents is always the first input when I write its output into a .vti or .vtk file, even though there are multi-inputs. could you tell me why? however, when I use vtkImageAppend, I could get a mixed image, why vtkImageAppendComponents doesn't work? could you give me more suggestion? 3, as you said, "one input determines the position of the glyphs; another input determines the geometry to place at those positions, then multiple input ports are used". that is, if one input is the actor, another one is the actor's position, isn't it? from the document of this class, there should be (1 + 1) components in vtkImageAppendComponents's output, but in fact, there is only one components, it is the actor, isn't it? so, there is something wrong with class vtkImageAppendComponents? 4, if I want to take two image reader as the inputs of vtkImageAppendComponents, they should use input port 0, the same input port, isn't it? but why there is only one image in its output? for example: append->AddInput((vtkDataObject *)reader1->GetOuput()); append->AddInput((vtkDataObject *)reader2->GetOuput()); is there anything wrong? if no, why there is only reader1's output? where it the reader2's output? is there 2 components or 1? thank you for your help, but I still don't know them, could you help me? thanks a lot! M. J. ------------------------------------------------------------------------------------------------------------ Hi Mark, You can have multiple input connections on the same input port, and this is what is expected for vtkImageAppendComponents. Try using port 0 for both input connections. Only the first input port is used by this filter, which explains both the warning message you're seeing and why both components in the output are from the first input. For filters in VTK that take multiple inputs, if the function of the inputs is the same (as is the case here -- all the input datasets will be appended together), then one input port with multiple connections is used. If the function of the inputs is different (e.g., in the glyph filter -- one input determines the position of the glyphs; another input determines the geometry to place at those positions), then multiple input ports are used -- one input port for each different type of input. Thanks for posting the code snippet and the warning message; it made it clearer what was likely going wrong. - Amy -------------- next part -------------- An HTML attachment was scrubbed... URL: From beromuald at wanadoo.fr Fri May 23 03:14:57 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Fri, 23 May 2008 09:14:57 +0200 (CEST) Subject: [vtkusers] Creating a 3DImageData from slices Message-ID: <3820553.881611211526897095.JavaMail.www@wwinf1b32> Thanks Amy, I will try this. Bye, Romu > Message du 22/05/08 17:10 > De : "Amy Squillacote" > A : "Romuald BERTRAND" > Copie ? : vtkusers at vtk.org > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > Hi Romu, > > Are the slices already loaded in VTK (i.e., multiple 2D vtkImageData > objects), or are you reading the slices from files? > > If they're already 2D vtkImageData objects, take a look at > vtkImageAppend > (http://www.vtk.org/doc/nightly/html/classvtkImageAppend.html). If you > have X-Y slices, then the "append axis" should be the Z axis. > > If you're reading the slices from files, subclasses of vtkImageReader2 > (http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html) will > handle this for you. You can pass in either a list of file names or a > file pattern to tell the reader how to get the data files. > > - Amy > > Romuald BERTRAND wrote: > > > > Hi all, > > > > Someone know how creating a 3DImageData from 2D slices? > > Thanks for answers, > > > > Romu > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > This is the private VTK discussion list. > > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > -- > Amy Squillacote Phone: (256) 726-4839 > Computer Scientist Fax: (256) 726-4806 > CFD Research Corporation Web: http://www.cfdrc.com > 215 Wynn Drive, Suite 501 > Huntsville, AL 35805 > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From beromuald at wanadoo.fr Fri May 23 03:24:29 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Fri, 23 May 2008 09:24:29 +0200 (CEST) Subject: [vtkusers] How to change pixel color? Message-ID: <17921423.883251211527469928.JavaMail.www@wwinf1b32> Hi Yenan, I have just use this exemple ==> http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 But in this exmple, Mark used the unsigned char type, and make sure your data are in unsigned char, or change the type which is used in the example. (GetScalarTypeAsString()). I hope this help you, Bye Romu > Message du 22/05/08 18:14 > De : yenanqu at scs.fsu.edu > A : "Romuald BERTRAND" > Copie ? : "Mark Wyszomierski" , vtkusers at vtk.org > Objet : Re: [vtkusers] How to change pixel color? > > How do you make it work, what is the problem before. all my pixel data > is three componen. I just can not retieve it from the id(vtkImageData). > > Yenan > > Quoting Romuald BERTRAND : > > > Ok, pPix = (unsigned char*)id->GetScalarPointer(); works for me. > > > > But I have a problem : I display a grey image (1 component) and I > > want to change few pixels in green (for example), I don't know how > > can I do this. > > The grey image has 1 scalar component, and I need to transform its > > to 3 components, and it takes a lot of time, and it's not very > > interactiv. > > > > Someone know can I do my task? > > > > Thanks a lot for answers, > > > > Romu > > > > PS : yenan, make sure you change just one component if you have a > > grey image, and change 3 components if you have a rgb image. > > > > > > > > > >> Message du 19/05/08 20:54 > >> De : yenanqu at scs.fsu.edu > >> A : "Romuald BERTRAND" > >> Copie ? : "Mark Wyszomierski" , vtkusers at vtk.org > >> Objet : Re: [vtkusers] How to change pixel color? > >> > >> No, I am still trying it. if you have other way to or could make it > >> work, please, please let me know. > >> > >> Yenan > >> > >> Quoting Romuald BERTRAND : > >> > >> > Hi, > >> > > >> > Thanks for your answers. > >> > > >> > I have tried but pPix = (unsigned char*)id->GetScalarPointer(); > >> > doesn't work for me. > >> > > >> > when I change the components, nothing change, and after I have > >> > display the array and I have seen it is null. > >> > Know you why? > >> > > >> > Yenan: Have you arrived to manipulate it correctly? > >> > > >> > Thanks > >> > > >> > > >> > > >> >> Message du 16/05/08 21:35 > >> >> De : "Mark Wyszomierski" > >> >> A : yenanqu at scs.fsu.edu > >> >> Copie ? : "Romuald BERTRAND" , vtkusers at vtk.org > >> >> Objet : Re: [vtkusers] How to change pixel color? > >> >> > >> >> >> pPix = (unsigned char*)id->GetScalarPointer(); > >> >> > >> >> That should work, I've used it many times for instance in this project: > >> >> > >> >> > >> >> > >> http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 > >> >> > >> >> I show the value of the pixel that the mouse is over. Maybe there's > >> >> something else going on in your pipeline? > >> >> > >> >> Mark > >> >> > >> >> > >> >> > >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: > >> >> > How to get pointer from vtkImageData is the hardest thing,which I > >> >> > still can not make it. > >> >> > > >> >> > //id is vtkImageData > >> >> > int *uExtent = id->GetUpdateExtent(); > >> >> > pPix = (unsigned char*)id->GetScalarPointer(uExtent[0], uExtent[2], > >> >> > uExtent[4]); > >> >> > > >> >> > or > >> >> > > >> >> > pPix = (unsigned char*)id->GetScalarPointer(); > >> >> > > >> >> > the only method I could find out. It didn't work for me. try it to see > >> >> > if it works for you. > >> >> > > >> >> > Yenan > >> >> > > >> >> > Quoting Mark Wyszomierski : > >> >> > > >> >> >> Yeah once you get a pointer to the pixel data in vtkImageData you can > >> >> >> manipulate it however you want. It's just an array of values. > >> >> >> > >> >> >> Mark > >> >> >> > >> >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: > >> >> >>> Did you retrieve pixel data from vtkImageData seccessfully? > >> >> >>> > >> >> >>> > >> >> >>> Yenan > >> >> >>> Quoting Romuald BERTRAND : > >> >> >>> > >> >> >>>> Hi all, > >> >> >>>> > >> >> >>>> I have to display an image for my work. After, I have to change the > >> >> >>>> color of several pixels, I don't know why. I have a vtkImageData, > >> >> >>>> and I have search some methods to set the scalars of the pixels > >> >> >>>> which are stored in, but I don't arrived. > >> >> >>>> > >> >> >>>> Someone could help me? > >> >> >>>> > >> >> >>>> Thanks for answers. > >> >> >>>> > >> >> >>>> Romuald > >> >> >>>> > >> >> >>>> -- > >> >> >>>> This message has been scanned for viruses and > >> >> >>>> dangerous content by MailScanner, and is > >> >> >>>> believed to be clean. > >> >> >>>> > >> >> >>>> > >> >> >>> > >> >> >>> > >> >> >>> > >> >> >>> ---------------------------------------------------------------- > >> >> >>> This message was sent using IMP, the Internet Messaging Program. > >> >> >>> > >> >> >>> > >> >> >>> -- > >> >> >>> This message has been scanned for viruses and > >> >> >>> dangerous content by MailScanner, and is > >> >> >>> believed to be clean. > >> >> >>> > >> >> >>> _______________________________________________ > >> >> >>> This is the private VTK discussion list. > >> >> >>> Please keep messages on-topic. Check the FAQ at: > >> >> >>> http://www.vtk.org/Wiki/VTK_FAQ > >> >> >>> Follow this link to subscribe/unsubscribe: > >> >> >>> http://www.vtk.org/mailman/listinfo/vtkusers > >> >> >>> > >> >> >> > >> >> >> -- > >> >> >> This message has been scanned for viruses and > >> >> >> dangerous content by MailScanner, and is > >> >> >> believed to be clean. > >> >> >> > >> >> >> > >> >> > > >> >> > > >> >> > > >> >> > ---------------------------------------------------------------- > >> >> > This message was sent using IMP, the Internet Messaging Program. > >> >> > > >> >> > > >> >> > -- > >> >> > This message has been scanned for viruses and > >> >> > dangerous content by MailScanner, and is > >> >> > believed to be clean. > >> >> > > >> >> > > >> >> > >> >> > >> > > >> > -- > >> > This message has been scanned for viruses and > >> > dangerous content by MailScanner, and is > >> > believed to be clean. > >> > > >> > > >> > >> > >> > >> ---------------------------------------------------------------- > >> This message was sent using IMP, the Internet Messaging Program. > >> > >> > >> -- > >> This message has been scanned for viruses and > >> dangerous content by MailScanner, and is > >> believed to be clean. > >> > >> > >> > > > > -- > > This message has been scanned for viruses and > > dangerous content by MailScanner, and is > > believed to be clean. > > > > > > > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tarekbensaid at gmail.com Fri May 23 04:23:52 2008 From: tarekbensaid at gmail.com (ben said tarek) Date: Fri, 23 May 2008 10:23:52 +0200 Subject: [vtkusers] Download VTK 5.3.0 Message-ID: <8a5cac3a0805230123t3171e9b5h72a720c6d15afc02@mail.gmail.com> Hi, If someone can help me by sending the appropriate link for downloading vtk5.3.0 Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From beromuald at wanadoo.fr Fri May 23 05:40:33 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Fri, 23 May 2008 11:40:33 +0200 (CEST) Subject: [vtkusers] How to change pixel color? Message-ID: <2815475.897851211535633210.JavaMail.www@wwinf1b32> Hi Mark, thanks for your help, I have tried this little algorithm : ??? //Point on the scalars ??? unsigned short* pPix = (unsigned short*)ima->GetScalarPointer(); ??? ??? //Search for the maximum ??? unsigned short max(0); ??? ??? for( int i=0; i max ) ??? ??? ??? max = pPix[i]; ??? } ??? ??? //Creating LUT ??? vtkLookupTable* LUT = vtkLookupTable::New(); ??? LUT->Allocate(65536); ??? ??? LUT->SetTableValue(max+1, 0, 255, 0); //RGB, A=1.0 ??? ??? LUT->Build(); ??? ??? //Creating iterator for the list (pN3 contains points coordinates) ??? list::iterator it; ??? ??? for( it = liste.begin(); it != liste.end(); it++ ) ??? { ??? ??? double ptSeg[3]; ??? ??? ptSeg[0] = (*it).x; ??? ??? ptSeg[1] = (*it).y; ??? ??? ptSeg[2] = (*it).z; ??? ??? ??? ??? //Search for point index ??? ??? int nVolIdx = ima->FindPoint(ptSeg); ??? ??? ??? ??? pPix[nVolIdx] = max+1; ??? } ??? ??? //PROBLEM HERE ??? vtkActorCollection* Collec = pRenderer->GetActors(); ??? Collec->InitTraversal(); ??? Collec->GetNextItem()->GetMapper()->SetLookupTable(LUT); ??? ??? Refresh(); But when Collec->GetNextItem()->GetMapper()->SetLookupTable(LUT); the programm crashes. Do you know why? I made an error? Thanks for your help, Bye Romu > Message du 22/05/08 20:24 > De : "Mark Wyszomierski" > A : "Romuald BERTRAND" > Copie ? : yenanqu at scs.fsu.edu, vtkusers at vtk.org > Objet : Re: [vtkusers] How to change pixel color? > > Yeah that's tricky because converting your original greyscale data > into three component color data implies you're only going to be using > 255 possible grey values, whereas your original grey data might be in > the 16 bit range etc. So, what are you going to do with a grey value > of say 3000? This problem occurs even when you're viewing a greyscale > image because you need to map the grey values into the range that the > monitor can display. I guess this is what window/leveling is for, so > you're determining some window/scale to remap all those really big > gray values for the user. Can anyone verify that? > > This isn't a good recommendation, but it's something I hacked together > just to get a temporary visualization going. If your greyscale data is > being stored in unsigned shorts let's say, you can iterate over all > the pixel data and find the max value used. For the images I worked > with, this was rarely near the unsigned short max value, it was > usually 20,000 let's say. Then if I wanted to display green pixels in > the volume, I would use a lookup table and add points like 20001 = > (0,255,0), 20002 = (255,0,0) and so on. You're sure your greyscale > data never uses those values. Then you replace the voxels of interest > with those appropriate lookup table values. When you hand the volume + > LUT to VTK, you'll see the voxels in the colors you chose. > > There are problems with doing that of course. One is that your LUT > will always have to be dynamically created which is kind of annoying. > You're also overwriting voxel values in the source volume, so you need > to keep a reference to a copy of the ones you overwrite if you want to > 'remember' the original greyscale values. The list goes on. But it > works and maybe it can give you some ideas. > > I'm sure other people have done this and they probably have better suggestions, > > Mark > > > On 5/22/08, Romuald BERTRAND wrote: > > Ok, pPix = (unsigned char*)id->GetScalarPointer(); works for me. > > > > But I have a problem : I display a grey image (1 component) and I want to > > change few pixels in green (for example), I don't know how can I do this. > > The grey image has 1 scalar component, and I need to transform its to 3 > > components, and it takes a lot of time, and it's not very interactiv. > > > > Someone know can I do my task? > > > > Thanks a lot for answers, > > > > Romu > > > > PS : yenan, make sure you change just one component if you have a grey > > image, and change 3 components if you have a rgb image. > > > > > > > > > >> Message du 19/05/08 20:54 > >> De : yenanqu at scs.fsu.edu > >> A : "Romuald BERTRAND" > >> Copie ? : "Mark Wyszomierski" , vtkusers at vtk.org > >> Objet : Re: [vtkusers] How to change pixel color? > >> > >> No, I am still trying it. if you have other way to or could make it > >> work, please, please let me know. > >> > >> Yenan > >> > >> Quoting Romuald BERTRAND : > >> > >> > Hi, > >> > > >> > Thanks for your answers. > >> > > >> > I have tried but pPix = (unsigned char*)id->GetScalarPointer(); > >> > doesn't work for me. > >> > > >> > when I change the components, nothing change, and after I have > >> > display the array and I have seen it is null. > >> > Know you why? > >> > > >> > Yenan: Have you arrived to manipulate it correctly? > >> > > >> > Thanks > >> > > >> > > >> > > >> >> Message du 16/05/08 21:35 > >> >> De : "Mark Wyszomierski" > >> >> A : yenanqu at scs.fsu.edu > >> >> Copie ? : "Romuald BERTRAND" , vtkusers at vtk.org > >> >> Objet : Re: [vtkusers] How to change pixel color? > >> >> > >> >> >> pPix = (unsigned char*)id->GetScalarPointer(); > >> >> > >> >> That should work, I've used it many times for instance in this project: > >> >> > >> >> > >> >> http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27 > >> >> > >> >> I show the value of the pixel that the mouse is over. Maybe there's > >> >> something else going on in your pipeline? > >> >> > >> >> Mark > >> >> > >> >> > >> >> > >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: > >> >> > How to get pointer from vtkImageData is the hardest thing,which I > >> >> > still can not make it. > >> >> > > >> >> > //id is vtkImageData > >> >> > int *uExtent = id->GetUpdateExtent(); > >> >> > pPix = (unsigned char*)id->GetScalarPointer(uExtent[0], uExtent[2], > >> >> > uExtent[4]); > >> >> > > >> >> > or > >> >> > > >> >> > pPix = (unsigned char*)id->GetScalarPointer(); > >> >> > > >> >> > the only method I could find out. It didn't work for me. try it to > >> >> > see > >> >> > if it works for you. > >> >> > > >> >> > Yenan > >> >> > > >> >> > Quoting Mark Wyszomierski : > >> >> > > >> >> >> Yeah once you get a pointer to the pixel data in vtkImageData you > >> >> >> can > >> >> >> manipulate it however you want. It's just an array of values. > >> >> >> > >> >> >> Mark > >> >> >> > >> >> >> On 5/16/08, yenanqu at scs.fsu.edu wrote: > >> >> >>> Did you retrieve pixel data from vtkImageData seccessfully? > >> >> >>> > >> >> >>> > >> >> >>> Yenan > >> >> >>> Quoting Romuald BERTRAND : > >> >> >>> > >> >> >>>> Hi all, > >> >> >>>> > >> >> >>>> I have to display an image for my work. After, I have to change > >> >> >>>> the > >> >> >>>> color of several pixels, I don't know why. I have a vtkImageData, > >> >> >>>> and I have search some methods to set the scalars of the pixels > >> >> >>>> which are stored in, but I don't arrived. > >> >> >>>> > >> >> >>>> Someone could help me? > >> >> >>>> > >> >> >>>> Thanks for answers. > >> >> >>>> > >> >> >>>> Romuald > >> >> >>>> > >> >> >>>> -- > >> >> >>>> This message has been scanned for viruses and > >> >> >>>> dangerous content by MailScanner, and is > >> >> >>>> believed to be clean. > >> >> >>>> > >> >> >>>> > >> >> >>> > >> >> >>> > >> >> >>> > >> >> >>> ---------------------------------------------------------------- > >> >> >>> This message was sent using IMP, the Internet Messaging Program. > >> >> >>> > >> >> >>> > >> >> >>> -- > >> >> >>> This message has been scanned for viruses and > >> >> >>> dangerous content by MailScanner, and is > >> >> >>> believed to be clean. > >> >> >>> > >> >> >>> _______________________________________________ > >> >> >>> This is the private VTK discussion list. > >> >> >>> Please keep messages on-topic. Check the FAQ at: > >> >> >>> http://www.vtk.org/Wiki/VTK_FAQ > >> >> >>> Follow this link to subscribe/unsubscribe: > >> >> >>> http://www.vtk.org/mailman/listinfo/vtkusers > >> >> >>> > >> >> >> > >> >> >> -- > >> >> >> This message has been scanned for viruses and > >> >> >> dangerous content by MailScanner, and is > >> >> >> believed to be clean. > >> >> >> > >> >> >> > >> >> > > >> >> > > >> >> > > >> >> > ---------------------------------------------------------------- > >> >> > This message was sent using IMP, the Internet Messaging Program. > >> >> > > >> >> > > >> >> > -- > >> >> > This message has been scanned for viruses and > >> >> > dangerous content by MailScanner, and is > >> >> > believed to be clean. > >> >> > > >> >> > > >> >> > >> >> > >> > > >> > -- > >> > This message has been scanned for viruses and > >> > dangerous content by MailScanner, and is > >> > believed to be clean. > >> > > >> > > >> > >> > >> > >> ---------------------------------------------------------------- > >> This message was sent using IMP, the Internet Messaging Program. > >> > >> > >> -- > >> This message has been scanned for viruses and > >> dangerous content by MailScanner, and is > >> believed to be clean. > >> > >> > >> > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chunlei.Han at tyks.fi Fri May 23 06:03:17 2008 From: Chunlei.Han at tyks.fi (Han Chunlei) Date: Fri, 23 May 2008 13:03:17 +0300 Subject: [vtkusers] How to get all the pixels in a polygon? Message-ID: <18A7E7877ADDE249ABB19920039173E0011DD67D@PANNU1.vsshp.net> Hei, everyone, I have a polygon of vtkpolydata, it is closed, I want to get all the pixels inside of this polygon. Could you tell me wich class I can use to do this job? Thanks very much in advance. Regards Chunlei -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Fri May 23 09:33:29 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Fri, 23 May 2008 08:33:29 -0500 Subject: [vtkusers] Creating a slice of an ImageData In-Reply-To: References: <483572E9.1040805@cfdrc.com> Message-ID: <4836C7A9.2010602@cfdrc.com> Hi Thomas, I am copying my response back to the vtkusers list. Please keep the discussion on the vtkusers list rather than emailing me directly. That way other people on the list can contribute to the discussion, and the conversation will be archived. Because the output of vtkCutter is vtkPolyData, there is not an easy way to write it to an image file without rendering first. If you instead use vtkImageReslice (as suggested by Sajendra N, who also responded to you on the vtkusers list), then the output is vtkImageData, which can much more easily be passed to an image writer without rendering. The example Sajendra N mentioned is in VTK/Examples/ImageProcessing, and it demonstrates taking a slice from a vtkImageData. The on-line help for vtkImageReslice is here: http://www.vtk.org/doc/nightly/html/classvtkImageReslice.html. - Amy Jefferson Thomas wrote: > Thank you. It works. > By the way, is there any smart way to output the resulting slice into > an image file, like JPG or PNG ? And without using any rendering, just > direct array-writing. I have been trying vtkJPEGWriter but I can not > figure out a good way to transfer the values from the data table into > the vtkJPEGWriter. Nor can I find any example for it on the internet. > How should I do it ? > Thomas > > Thomas > > 2008/5/22 Amy Squillacote : > >> Hi Thomas, >> >> Try using vtkCutter >> (http://www.vtk.org/doc/nightly/html/classvtkCutter.html) with a vtkPlane (a >> subclass of vtkImplicitFunction). >> >> - Amy >> >> Jefferson Thomas wrote: >> >>> Hi, >>> How to create a slice from a 3D ImageData ? Ive been doing it with >>> vtkImageDataGeometryFilter with SetExtent but in this way it is only >>> possible to make a slice parallel to xy, xz or yz plane. I cant figure >>> out a way to get a diagonal slice. >>> Is there any smart way to create a slice for any arbitrary surface ? >>> Thank you for any help, >>> Thomas >>> _______________________________________________ >>> This is the private VTK discussion list. >>> Please keep messages on-topic. Check the FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> Follow this link to subscribe/unsubscribe: >>> http://www.vtk.org/mailman/listinfo/vtkusers >>> >>> >>> >>> >> -- >> Amy Squillacote Phone: (256) 726-4839 >> Computer Scientist Fax: (256) 726-4806 >> CFD Research Corporation Web: http://www.cfdrc.com >> 215 Wynn Drive, Suite 501 >> Huntsville, AL 35805 >> >> >> >> > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From evans at aps.anl.gov Fri May 23 10:53:52 2008 From: evans at aps.anl.gov (Ken Evans) Date: Fri, 23 May 2008 09:53:52 -0500 Subject: [vtkusers] Problem with vtkRenderWindowInteractor with more than one widget In-Reply-To: References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <0F705A3E95BD4BC9B38938F6B2FEE260@CICADA> <31ddba770805110127v4ce21a63hfb780c19c6fa1604@mail.gmail.com> <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> <6DAD69CEEC61453C8DDD5E0B1986496B@CICADA> <31ddba770805121013t64e510bco5add2af6edcf515b@mail.gmail.com> <006301c8b465$c5fe67e0$950836a4@aps.anl.gov> <005501c8b532$e8483e20$950836a4@aps.anl.gov> <006901c8bc2a$fe632d60$950836a4@aps.anl.gov> Message-ID: <002a01c8bce4$d10e2670$103e36a4@MUSE> Greg, Thanks for the reply. I was afraid the situation was as you described. I appreciate the good information and the help with the workaround. >> The real way to fix this would be to re-implement or >> subclass the interactor Yes. It's too bad it can't be reimplemented in the original. It seems a behavior such as with P would be a better interactor for everyone. However, the lack of response indicates no one is likely to be taking on that task. I don't know how to subclass from Python. Perhaps, given enough time I could do it in C, but at this time it's not a sufficiently critical issue for me to spend that amount of time. Thanks again for responding. -Ken From brad.king at kitware.com Fri May 23 11:33:31 2008 From: brad.king at kitware.com (Brad King) Date: Fri, 23 May 2008 11:33:31 -0400 Subject: [vtkusers] problem of class vtkImageAppendComponents In-Reply-To: References: Message-ID: <4836E3CB.3020406@kitware.com> Mark Jefferson wrote: > I still don't know why. and I still have many questions. > 1, how can I know the different type of inputs? if I use the > vtkBMPReader, of course, its input is vtkAlgorithmOutput, if another one > is vtkImageData, so they are different? The word "type" is not quite right here. Each input port is associated with one logical input to an algorithm. In the "glyph" example, the algorithm does something fundamentally different with each input and therefore has two input ports. In the "append" case all inputs are treated equally and serve the same purpose (and therefore connect to only one input port). > 2, the type of vtkImageAppendComponents's output is vtkImageData, but > all the output getting from vtkImageAppendComponents is always the first > input when I write its output into a .vti or .vtk file, even though > there are multi-inputs. could you tell me why? This is something to figure out, see below. > 3, as you said, "one input determines the position of the glyphs; > another input determines the geometry to place at those positions, then > multiple input ports are used". that is, if one input is the actor, > another one is the actor's position, isn't it? Yes, and these are two logically different purposes so they get different input ports. > 4, if I want to take two image reader as the inputs of > vtkImageAppendComponents, they should use input port 0, the same input > port, isn't it? but why there is only one image in its output? > for example: > append->AddInput((vtkDataObject *)reader1->GetOuput()); > append->AddInput((vtkDataObject *)reader2->GetOuput()); > is there anything wrong? if no, why there is only reader1's output? > where it the reader2's output? is there 2 components or 1? Try using the modern interface to make the connections: append->AddInputConnection(reader1->GetOutputPort()); append->AddInputConnection(reader2->GetOutputPort()); (this is mentioned by the documentation of the AddInput method). Meanwhile, there are other ways that one input could be ignored. Do you know that both readers are getting images with the scalars attached to the points (as against the cells)? The vtkImageAppendComponents filter takes the active point scalar array from each input. A quick glance at the implementation of the filter looks like it will ignore inputs that do not have an active scalars array. -Brad From chenkaz at yahoo.com Fri May 23 12:54:34 2008 From: chenkaz at yahoo.com (Chavdar Papazov) Date: Fri, 23 May 2008 09:54:34 -0700 (PDT) Subject: [vtkusers] Loading textured model in VTK???? In-Reply-To: <749638.77295.qm@web58112.mail.re3.yahoo.com> Message-ID: <823717.45668.qm@web58110.mail.re3.yahoo.com> Hi, how can I import a simple cube with some texture attached to it in VTK??? This should be the simplest task on earth.... I have tried all importers (vtk3DSImporter and vtkVRMLImporter) and several Readers (vtkOBJReader, vtkSTLReader) but no one is able to import the texture!! It is unbelievable that there is no simple possibility to do this in VTK! Or maybe there is other way (I cant use the vtk-native- files, because there are no common 3d-programs (like 3dsmax or DeepExploration), that are able to produce vtk-files). Thanks a lot. Chavo -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.jefferson at qq.com Fri May 23 23:08:43 2008 From: mark.jefferson at qq.com (=?ISO-8859-1?B?TWFyayBKZWZmZXJzb24=?=) Date: Sat, 24 May 2008 11:8:43 +0800 Subject: [vtkusers] problem of class vtkImageAppendComponents Message-ID: Thank you, Brad, and I have use vtkImageBlend to test the output of vtkImageAppendComponents, I am sure that all the inputs have been gotten by vtkImageAppendComponents, because the result shown from the vtkImageAppendComponents's output is two different images. that is, I set the output of vtkImageAppendComponents to the input of vtkImageBlend directly, and then render it, there are two different images. however, I would only get the first input image of vtkImageAppendComponents when I write its output to be a .vti file and then use two vtkImageViewer2 to display the two "different" images. the images in the render windows of vtkImageViewer2 are all the same, the first input port's image. so I guess there are two possibility that I could not get the right result. 1) write the output of vtkImageAppendComponents to be a .vti file; 2) read the .vti file and then render the images by vtkImageViewre2. and they are the key problem now. I think maybe the problem comes from the first possibility. in other words, when I use class vtkXMLImageDataWriter, although the output of class vtkImageAppendComponents is vtkImageData, vtkXMLImageDataWriter only take its first input as input, so the output is only one image. and then there is another question: how to write the output of vtkImageAppendComponents to be a .vti file? I have tried write the output of vtkImageAppendComponents to be a .vti file directly, it is failed. so, are there some other transforms? and if it is not so, then the problem comes from the second possibility, but I don't think there is something wrong with my image render codes. because I have tested them using two different images directly without using vtkImageAppendComponents, it is ok. could you tell me what I should do? thank you! M. J. PS. I have used function AddInputConnection(), there is no change. and I have use one input of vtkXMLImageDataWriter, and another is vtkDICOMImageReader, there is no change, too. ------------------------------------------------------------------------------------------------------------------------------------------------ Mark Jefferson wrote: > I still don't know why. and I still have many questions. > 1, how can I know the different type of inputs? if I use the > vtkBMPReader, of course, its input is vtkAlgorithmOutput, if another one > is vtkImageData, so they are different? The word "type" is not quite right here. Each input port is associated with one logical input to an algorithm. In the "glyph" example, the algorithm does something fundamentally different with each input and therefore has two input ports. In the "append" case all inputs are treated equally and serve the same purpose (and therefore connect to only one input port). > 2, the type of vtkImageAppendComponents's output is vtkImageData, but > all the output getting from vtkImageAppendComponents is always the first > input when I write its output into a .vti or .vtk file, even though > there are multi-inputs. could you tell me why? This is something to figure out, see below. > 3, as you said, "one input determines the position of the glyphs; > another input determines the geometry to place at those positions, then > multiple input ports are used". that is, if one input is the actor, > another one is the actor's position, isn't it? Yes, and these are two logically different purposes so they get different input ports. > 4, if I want to take two image reader as the inputs of > vtkImageAppendComponents, they should use input port 0, the same input > port, isn't it? but why there is only one image in its output? > for example: > append->AddInput((vtkDataObject *)reader1->GetOuput()); > append->AddInput((vtkDataObject *)reader2->GetOuput()); > is there anything wrong? if no, why there is only reader1's output? > where it the reader2's output? is there 2 components or 1? Try using the modern interface to make the connections: append->AddInputConnection(reader1->GetOutputPort()); append->AddInputConnection(reader2->GetOutputPort()); (this is mentioned by the documentation of the AddInput method). Meanwhile, there are other ways that one input could be ignored. Do you know that both readers are getting images with the scalars attached to the points (as against the cells)? The vtkImageAppendComponents filter takes the active point scalar array from each input. A quick glance at the implementation of the filter looks like it will ignore inputs that do not have an active scalars array. -Brad -------------- next part -------------- An HTML attachment was scrubbed... URL: From vtoolkit at gmail.com Sat May 24 02:43:52 2008 From: vtoolkit at gmail.com (Deepak Tiwari) Date: Sat, 24 May 2008 00:43:52 -0600 Subject: [vtkusers] vtk beginner Message-ID: <3fa260f90805232343j626bbb59jf07a193ea1f167bb@mail.gmail.com> I am a beginner in VTK. What would be the best resource, where I can find easy examples to get started. I will be programming in C++. I have the vtk textbook but, it doesn't seem to be very helpful in terms of coding in C++. Thanks, ~D -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.p.botha at tudelft.nl Sat May 24 06:47:31 2008 From: c.p.botha at tudelft.nl (Charl Botha) Date: Sat, 24 May 2008 12:47:31 +0200 Subject: [vtkusers] Problem with vtkRenderWindowInteractor with more than one widget In-Reply-To: <002a01c8bce4$d10e2670$103e36a4@MUSE> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> <6DAD69CEEC61453C8DDD5E0B1986496B@CICADA> <31ddba770805121013t64e510bco5add2af6edcf515b@mail.gmail.com> <006301c8b465$c5fe67e0$950836a4@aps.anl.gov> <005501c8b532$e8483e20$950836a4@aps.anl.gov> <006901c8bc2a$fe632d60$950836a4@aps.anl.gov> <002a01c8bce4$d10e2670$103e36a4@MUSE> Message-ID: <31ddba770805240347o67fdca81p5948f3773a056aad@mail.gmail.com> On Fri, May 23, 2008 at 4:53 PM, Ken Evans wrote: >>> The real way to fix this would be to re-implement or >>> subclass the interactor > > Yes. It's too bad it can't be reimplemented in the original. It seems a > behavior such as with P would be a better interactor for everyone. However, > the lack of response indicates no one is likely to be taking on that task. There's really no need to subclass anything. You'll need to do some more reading, but it's also possible to attach a new observer for keyboard events and listen for the 'i' for example. In the event handler, use a vtkPropPicker to find out where the user is pointing. Based on this information, select the correct interactor do what you need to do. You'lle obviously need to keep around some extra data structures for this. There really are a very few things that you cannot do with VTK from Python. You probably won't run into any of them soon (it took me a few years, and I've solved some of them in the meanwhile). Good luck with this, Charl From w_e_b_m_a_s_t_e_r_6_9 at hotmail.com Sat May 24 17:31:16 2008 From: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com (Cameron Burnett) Date: Sun, 25 May 2008 07:31:16 +1000 Subject: [vtkusers] vtk beginner In-Reply-To: <3fa260f90805232343j626bbb59jf07a193ea1f167bb@mail.gmail.com> References: <3fa260f90805232343j626bbb59jf07a193ea1f167bb@mail.gmail.com> Message-ID: You should already be proficient in coding, so the textbook obviously isn't going to help in that regard. Also, if there are pieces of code written in tcl its easy to just convert that straight to c++ by using brackets etc. Not much is different between the two, apart from the fact that most symbols are taken out. Check out the examples in the VTK directory. In particular the cone examples. I found them to be quite good. Maybe try to get the cone examples running then let the message board know if there are any problems. Good luck, Cameron. Date: Sat, 24 May 2008 00:43:52 -0600 From: vtoolkit at gmail.com To: vtkusers at vtk.org Subject: [vtkusers] vtk beginner I am a beginner in VTK. What would be the best resource, where I can find easy examples to get started. I will be programming in C++. I have the vtk textbook but, it doesn't seem to be very helpful in terms of coding in C++. Thanks, ~D _________________________________________________________________ Are you paid what you're worth? Find out: SEEK Salary Centre http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau%2Fcareer%2Dresources%2Fsalary%2Dcentre%2F%3Ftracking%3Dsk%3Ahet%3Asc%3Anine%3A0%3Ahot%3Atext&_t=764565661&_r=OCT07_endtext_salary&_m=EXT -------------- next part -------------- An HTML attachment was scrubbed... URL: From prabhat246 at yahoo.com Sun May 25 17:13:24 2008 From: prabhat246 at yahoo.com (prabhat246) Date: Sun, 25 May 2008 14:13:24 -0700 (PDT) Subject: [vtkusers] vtkMarchingCubes In-Reply-To: References: <17380317.post@talk.nabble.com> Message-ID: <17462464.post@talk.nabble.com> Thanks Sylvain, I closely want to follow the marching cubes algorithm, It is very difficult for me to difficult to understand the code of the algorithm. But Still it is being little difficult for me to understand the function which is actually responsible for the Marching cubes algorithm[vtkMarchingCubesComputeGradient()] Could you tell me which data structure stores the output and in what format(is it still ImageData or PolyData)? also It is being difficult for me to understand which variable is what. It is also a good idea if you could comment this function for me. http://www.nabble.com/file/p17462464/vtkMarchingCubes.cxx vtkMarchingCubes.cxx Thanks a lot. Prabhat Sylvain Jaume-2 wrote: > > Hi Prabhat, > > 1. The first parameter in SetValue is the index of the isosurface (if you > have just one isosurface, use 0). The second parameter defines the > intensity > of the isosurface that will be created. > 2. To make the cubes bigger, you can apply vtkImageResample and downsample > your volume to a lower resolution. You might need to low pass the > intensities first using vtkImageGaussianSmooth. > 3. To process huge volumes, you can use > vtkSliceCubes. > This filter only processes 4 slices at a time to reduce its memory > footprint. > > HTH, > Sylvain > > On Wed, May 21, 2008 at 6:09 PM, prabhat246 wrote: > >> >> Hi, >> >> Please if someone can try to answer my questions then please do reply. >> (I've never got a response for my previous posts.) >> Even I'll be happy to listen NO from the modertors rather than waiting >> for >> a >> response for a long time. >> >> >> >> I made following changes in example >> >> >> >> \ITK\InsightApplications-3.4.0\Auxiliary\vtk\itkReadITKImage3DSegmentShowVTK >> >> here is my piece of code >> vtkMarchingCubes * contour = vtkMarchingCubes::New(); >> contour->SetInput(vtkImporter1->GetOutput()); >> contour->SetValue(0, 128); >> >> I am new to learn this algorithm. >> >> >> 1. Can you please explain what are these parameters of SetValue function >> ?? >> 2. How can I change the cube size to be bigger ?? and >> 3. How can I run this example without consuming much of memory (say I >> have >> 800+ slices) ?? >> >> Hoping for a helpful quick response. >> >> > >> >> Thanks a lot >> >> Prabhat >> -- >> View this message in context: >> http://www.nabble.com/vtkMarchingCubes-tp17380317p17380317.html >> Sent from the VTK - Users mailing list archive at Nabble.com. >> >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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/vtkMarchingCubes-tp17380317p17462464.html Sent from the VTK - Users mailing list archive at Nabble.com. From foramuyou at gmail.com Mon May 26 01:26:15 2008 From: foramuyou at gmail.com (Jefferson Thomas) Date: Mon, 26 May 2008 14:26:15 +0900 Subject: [vtkusers] Creating a slice of an ImageData In-Reply-To: <4836C7A9.2010602@cfdrc.com> References: <483572E9.1040805@cfdrc.com> <4836C7A9.2010602@cfdrc.com> Message-ID: Thank you Amy and Sajendra N. I implemented vtkImageReslice and it is exactly what I wanted. The important clue is the ImageSlicing.cxx example and setting the output of vtkImageMapToColors to the vtkJPEGWriter. Sorry for mailing you directly the last time. I didnt check the address after clicking 'Reply'. Thomas 2008/5/23 Amy Squillacote : > Hi Thomas, > > I am copying my response back to the vtkusers list. Please keep the > discussion on the vtkusers list rather than emailing me directly. That way > other people on the list can contribute to the discussion, and the > conversation will be archived. > > Because the output of vtkCutter is vtkPolyData, there is not an easy way to > write it to an image file without rendering first. If you instead use > vtkImageReslice (as suggested by Sajendra N, who also responded to you on > the vtkusers list), then the output is vtkImageData, which can much more > easily be passed to an image writer without rendering. The example Sajendra > N mentioned is in VTK/Examples/ImageProcessing, and it demonstrates taking a > slice from a vtkImageData. The on-line help for vtkImageReslice is here: > http://www.vtk.org/doc/nightly/html/classvtkImageReslice.html. > > - Amy > > Jefferson Thomas wrote: >> >> Thank you. It works. >> By the way, is there any smart way to output the resulting slice into >> an image file, like JPG or PNG ? And without using any rendering, just >> direct array-writing. I have been trying vtkJPEGWriter but I can not >> figure out a good way to transfer the values from the data table into >> the vtkJPEGWriter. Nor can I find any example for it on the internet. >> How should I do it ? >> Thomas >> >> Thomas >> >> 2008/5/22 Amy Squillacote : >> >>> >>> Hi Thomas, >>> >>> Try using vtkCutter >>> (http://www.vtk.org/doc/nightly/html/classvtkCutter.html) with a vtkPlane >>> (a >>> subclass of vtkImplicitFunction). >>> >>> - Amy >>> >>> Jefferson Thomas wrote: >>> >>>> >>>> Hi, >>>> How to create a slice from a 3D ImageData ? Ive been doing it with >>>> vtkImageDataGeometryFilter with SetExtent but in this way it is only >>>> possible to make a slice parallel to xy, xz or yz plane. I cant figure >>>> out a way to get a diagonal slice. >>>> Is there any smart way to create a slice for any arbitrary surface ? >>>> Thank you for any help, >>>> Thomas >>>> _______________________________________________ >>>> This is the private VTK discussion list. >>>> Please keep messages on-topic. Check the FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> Follow this link to subscribe/unsubscribe: >>>> http://www.vtk.org/mailman/listinfo/vtkusers >>>> >>>> >>>> >>>> >>> >>> -- >>> Amy Squillacote Phone: (256) 726-4839 >>> Computer Scientist Fax: (256) 726-4806 >>> CFD Research Corporation Web: http://www.cfdrc.com >>> 215 Wynn Drive, Suite 501 >>> Huntsville, AL 35805 >>> >>> >>> >>> >> >> >> > > -- > Amy Squillacote Phone: (256) 726-4839 > Computer Scientist Fax: (256) 726-4806 > CFD Research Corporation Web: http://www.cfdrc.com > 215 Wynn Drive, Suite 501 > Huntsville, AL 35805 > > > From d.danewitz at yahoo.de Mon May 26 03:10:29 2008 From: d.danewitz at yahoo.de (Dmitri Danewitz) Date: Mon, 26 May 2008 07:10:29 +0000 (GMT) Subject: [vtkusers] xyplot: More than 50 lines? Message-ID: <354599.17780.qm@web28505.mail.ukl.yahoo.com> Hello all!   Does somebody know how to change the maximumnumber of possible lines in an xyplot to more than 50?   Thanks! Dmitri __________________________________________________________ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.ibarz at gmail.com Mon May 26 04:36:37 2008 From: julian.ibarz at gmail.com (Julian Ibarz) Date: Mon, 26 May 2008 10:36:37 +0200 Subject: [vtkusers] Possibly bug in vtkExtractSelectedFrustum ? Message-ID: <1c4aee80805260136p6052d51ct93e5e66e04c59ebe@mail.gmail.com> Hello everyone, I made a light program (in java but you could easily port it in C++ i think and i need someone to try in C++ to be sure that it's not a Java binding bug...) that use a vtkExtractSelectedFrustum but it does'nt work : the output is always empty. Do you think the program is right ? If it is i think it's a bug so i will make a report. package org.jcae.vtk.test; import javax.swing.JFrame; import vtk.vtkActor; import vtk.vtkCanvas; import vtk.vtkConeSource; import vtk.vtkDataSetMapper; import vtk.vtkExtractSelectedFrustum; import vtk.vtkPolyDataMapper; public class BugFrustum { public static void main(String[] args) { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); vtkCanvas canvas = new vtkCanvas(); vtkExtractSelectedFrustum selector = new vtkExtractSelectedFrustum(); // create sphere geometry vtkConeSource cone = new vtkConeSource(); cone.SetHeight(3.0); cone.SetRadius(1.0); cone.SetResolution(10); // map to graphics objects vtkPolyDataMapper map = new vtkPolyDataMapper(); map.SetInput(cone.GetOutput()); // actor coordinates geometry, properties, transformation vtkActor aSphere = new vtkActor(); aSphere.SetMapper(map); aSphere.GetProperty().SetColor(0, 0, 1); // color blue aSphere.GetProperty().SetRepresentationToWireframe(); canvas.GetRenderer().AddActor(aSphere); frame.add(canvas); frame.setSize(800, 600); frame.setVisible(true); selector.CreateFrustum(new double[] { -10.,-10.,-10.,1.0, -10.,-10.,10.,1.0, -10.,10.,-10.,1.0, -10.,10.,10.,1.0, 10.,-10.,-10.,1.0, 10.,-10.,10.,1.0, 10.,10.,-10.,1.0, 10.,10.,10.,1.0, }); selector.SetInput(cone.GetOutput()); //UNCOMMENT TO CHECK THE BOUNDARIES //selector.ShowBoundsOn(); // UNCOMMENT TO SEE THAT THE frustum extractor doesn't work inside and outside the boundaries //selector.InsideOutOn(); selector.Update(); vtkActor actorFrustum = new vtkActor(); vtkDataSetMapper mapFrustum = new vtkDataSetMapper(); mapFrustum.SetInputConnection(selector.GetOutputPort()); actorFrustum.SetMapper(mapFrustum); canvas.GetRenderer().AddActor(actorFrustum); canvas.lock(); canvas.GetRenderer().ResetCamera(); canvas.unlock(); //UNCOMMENT TO SEE THAT THE CONE IS IN THE BOUNDARIES //canvas.GetRenderer().RemoveActor(aSphere); } } -- Julian Ibarz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.gm.itk at gmail.com Mon May 26 05:49:14 2008 From: ivan.gm.itk at gmail.com (ivan gm) Date: Mon, 26 May 2008 11:49:14 +0200 Subject: [vtkusers] Exception problems In-Reply-To: References: Message-ID: I could solve the problem writing the following lines: this->DistanceMapper->ImmediateModeRenderingOn(); this->BoneMapper->ImmediateModeRenderingOn(); the information about it is in: http://www.vtk.org/Wiki/VTK_FAQ On Mon, Apr 28, 2008 at 11:08 AM, ivan gm wrote: > Hello: > > I have a problem with a not controled exception in runtime. I'm using > windows, MFC, VTK, ITK in Visual Studio 2005. My code looks like this: > > .... > pitkDICOMReader->SetFileNames(files); > pitkDICOMReader->SetImageIO( itk::GDCMImageIO::New() ); > pitkDICOMReader->Update(); > filter = ThresholdType::New(); > filter->SetInput( this->pitkDICOMReader); > filter->ThresholdOutside(minT, maxT); > filter->Update(); > ... > ( typedef itk::ImageToVTKImageFilter ConnectorType; ) > connector->SetInput( filter->GetOutput() ); > connector->Update(); > > /*now I create a 3D polydata*/ > contourFilter->SetInput(connector->GetOutput()); > contourFilter->Update(); > smoothFilter->SetInputConnection(contourFilter->GetOutputPort()); > smoothFilter->SetNumberOfIterations(30); > smoothFilter->SetRelaxationFactor(1.0); > smoothFilter->Update(); > polyDataNormals->SetInputConnection(smoothFilter->GetOutputPort()); > polyDataNormals->Update(); > this->BoneMapper->SetInput(polyDataNormals->GetOutput()); > this->BoneMapper->Update(); > this->BoneActor->SetMapper(this->BoneMapper); > this->BoneActor->GetProperty()->SetColor(1.0, 1.0, 0.0); > this->BoneActor->GetProperty()->SetDiffuse(0.0); > this->BoneActor->GetProperty()->SetSpecular(1.0); > this->BoneActor->GetProperty()->SetSpecularPower(5); > this->pvtkRenderer3D->AddActor(this->BoneActor); > this->pvtkRenderer3D->ResetCamera(); > if (this->pvtkMFCWindow3D) this->pvtkMFCWindow3D->RedrawWindow(); > //"the program crash here" > > When I open 3D images with 100 slices it runs perfect but with one of the > images (with 350 slices) the program crash in runtime and Visual Studio > shows the following error message: > > Excepci?n no controlada en 0x0d9e5c01 en myaplication.exe: 0xC0000005: > Infracci?n de acceso al escribir en la ubicaci?n 0x00000000. > > After that the file ftime64.c apairs in Visual Studio at line 130 where it > calls to _ftime64_s(tp); > > In addition, when I comment the smoothfilter and other previous filters it > works good. > > What could the problem be? Do you know how I can solve it? > > > Thanks a lot. > > Iv?n Garc?a Mart?nez. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Michael.Knopke at gmx.de Mon May 26 11:17:34 2008 From: Michael.Knopke at gmx.de (Michael Knopke) Date: Mon, 26 May 2008 17:17:34 +0200 Subject: [vtkusers] vtkThinPlateSplineTransform and curved slicing Message-ID: <000001c8bf43$a098ed70$3b78a8c0@imagesystems.local> Hello VTK-Users, I'm trying to use vtkThinPlateSplineTransform to generate curved slicing. Unfortunately I get some strange and unexpected results. What I do is similar to the example that comes with vtk: - Load a Volume - Show one slice of this volume - Draw a spline (vtkSplineWidget) and use the handlepositions as input for --> vtkThinplateSpline->SetTargetLandmarks. - Create a plane that is perpendicular to this spline and passes through both endpoints - Project all points of my spline onto the plane and query its new positions -> set those new pointpositions : vtkThinplatSpline->SetSourceLandmarks - Now when I use this Transform as input to vtkImageReslice I often get a warped (e.g. bend) image quite as I expect it to be but sometimes the whole image gets squeezed or inverted or mirrored. Does anybody know what I need to consider when using this class, or does anybody has got a better example? Regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From johne at annidis.com Mon May 26 11:57:43 2008 From: johne at annidis.com (John Eke) Date: Mon, 26 May 2008 11:57:43 -0400 Subject: [vtkusers] QVTKWidget Size In Container Widget Message-ID: <483ADDF7.2020108@annidis.com> Hi, I have subclassed QVTKWidget, and created two of these widgets inside a frame using horizontal layout. I also set their size policies so that combined, they occupy the entire container (the frame). But for some reason when the app runs, these two QVTKWidget sub classes initialize to a tiny boxes at the top left of the area they are supposed to fill. I also noticed that if I watch for a while, the entire application freezes. Then by clicking anywhere in the entire application, both widgets then occupy the actual region they are supposed to then all is fine. This is very wierd behaviour, I am fairly new to VTK as a whole. I have tried to manually call resize() in the constructor of the subclasses, and I have also tried to call resize() in the constructor of the main window that initializes the two instances of the subclass. Still nothing. Has anyone experienced this before? I think maybe there is something QVTK specific that I am not initializing Thanks - John From Alejandro.Merchan at sulzer.com Mon May 26 12:37:42 2008 From: Alejandro.Merchan at sulzer.com (Merchan, Alejandro) Date: Mon, 26 May 2008 18:37:42 +0200 Subject: [vtkusers] Problem connecting vtkImageData with vtImageWrapPad in VTK 5.0 Message-ID: <19B2320E2321AA408DDD332A8F86CB3B44F9F2@corpmail1.corp.sulzer.com> Hi vtkusers I'm updating a vtk-application from version 4.2 to 5.0 and I'm having some problems connecting an instance of vtkImageData with an instance of vtkImageWrapPad in VTK 5.0. VTK 5.0 does accept my vtkImageData as Input and does not complain about it, anyhow it produces a different result than VTK 4.2. I could not load the whole Example because it was bigger than 100 KB. After Reading a VTK-file (with Dataset Format structured points) I extract a Volume of Interest with extractPlane (an instance of vtkExtractVOI) and set some scalars of it to an instance of vtkImageData. (I used SetInputConnection and GetOutputPort for VTK 5.0) vtkStructuredPointsReader reader reader SetFileName "/data/home/vm/Documents/extractedConcentration.vtk" reader UpdateWholeExtent vtkExtractVOI extractPlane #extractPlane DebugOn extractPlane SetInput [reader GetOutput] extractPlane SetVOI 0 201 0 201 1 1 extractPlane UpdateWholeExtent vtkImageData imagePlane imagePlane SetDimensions 200 200 1 [imagePlane GetPointData] SetScalars [[[extractPlane GetOutput] GetCellData] GetScalars] Till this point everything works fine and both VTK 4.2 and 5.0 produce the same results. The problem appears in the next step when passing imagePlane as input to an instance of vtkImageWrapPad. vtkImageWrapPad imageWrap imageWrap SetInput imagePlane #imageWrap SetOutputWholeExtent 0 [expr $power2x - 1] 0 [expr $power2y - 1] 0 0 imageWrap UpdateWholeExtent Since imagePlane as an instance of vtkImageData does not have an output or outputport directly I try to pass it to imageWrap using the SetInput method just like it worked on our program with VTK 4.2 . VTK 5.0 actually accepts this and does not complain about it, however it produces a different result than VTK 4.2 does. Since I saw on the examples of VTK that imageWrap should be actually used with SetInputConnection and GetOuputPort I tried passing imagePlane to other graphic Filters bevor passing it to vtkImageWrapPad ( For example here VTK 4 syntax ) vtkImageMagnify mag mag SetInput ImagePlane mag SetMagnificationFactors 1 1 1 mag UpdateWholeExtent vtkImageWrapPad imageWrap imageWrap SetInput [mag GetOutput] #imageWrap SetOutputWholeExtent 0 [expr $power2x - 1] 0 [expr $power2y - 1] 0 0 imageWrap UpdateWholeExtent But it also only worked as expected on VTK 4.2. The only solution that actually kind of worked was writing imagePlane (vtkImageData) in a temporary file with vtkStructuredPointsWriter and passing the Output of a vtkStructuredPointsReader (which reads the file produced by vtkStructuredPointsWriter) to vtkImageWrapPad. It worked in such a way, that the right image is shown well in the render Window, but it changes the behaviour of my programm, so that other function which are based on the Output of vtkImageWrapPad are not working anymore (neither on vtk 4.2 nor in 5.0). Has anybody of you had such kind of problems?. Isn't it possible anymore to connect a vtkImageData with vtkImageWrapPad directly so that it just works the way it did in VTK 4.2? Thanks for any help! Alejandro CONFIDENTIALITY NOTICE The information in this email may be confidential and/or privileged. This email is intended to be reviewed by only the addressee(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, copying, use or storage of this email and its attachments, if any, or the information contained herein is prohibited. If you have received this email in error, please immediately notify the sender by return email and delete this email from your system. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From johne at annidis.com Mon May 26 15:23:15 2008 From: johne at annidis.com (John Eke) Date: Mon, 26 May 2008 15:23:15 -0400 Subject: [vtkusers] vtkImageReslice::SetOutputSpacing Message-ID: <483B0E23.1070703@annidis.com> Hello Guys, I need to shrink an image. I know vtkImageReslice::SetOutputSpacing can enlarge images so I am assuming the same method can shrink images. Problem is I am finding it difficult to understand how to manipulate the three parameters it accepts so that it resizes my image properly. Could someone please let me know what the three double parameters represent?: void vtkImageReslice::SetOutputSpacing (double, double, double) Thanks From mmavila at unex.es Mon May 26 19:20:36 2008 From: mmavila at unex.es (mmavila at unex.es) Date: Tue, 27 May 2008 01:20:36 +0200 (CEST) Subject: [vtkusers] Problemas con vtkExtractVOI Message-ID: <61886.85.53.196.51.1211844036.squirrel@cartero.unex.es> A ver si alguien me puede ayudar. Yo intento seleccionar una regi?n de inter?s de una imagen pero me falla este c?digo: (Estoy utilizando vtk 4.0) vtkExtractVOI *extract = vtkExtractVOI::New(); extract->SetVOI (31, 31, 0, 63, 0, 92); extract->SetSampleRate (1, 1, 1); extract->SetInput(v16->GetOutput); ///// Aqu? falla, es como si el m?todo SetInput no existiese extract->ReleaseDataFlagOff(); extract->Update(); Alguien me podr?a explicar el porqu?. Muchas gracias. From rogerblum at hawaii.rr.com Mon May 26 22:15:21 2008 From: rogerblum at hawaii.rr.com (Roger Blum) Date: Mon, 26 May 2008 16:15:21 -1000 Subject: [vtkusers] Elevation profile Message-ID: Hello, I am trying to extract an elevation profile from some sample data given in a data file (see attachement). The following TCL script reads the data and probes the data with 2 lines (diagonals from corner to corner). The result should be displayed with a vtkXYPlotActor. The test output also shows the elevation data used. My problem is that the probe filters do not return the desired result. All values are 0. What am I doing wrong? I have searched the mailing list but wasn't able to find a solution. I'm using vtk 5.0.3 with TCL 8.4. Thanks in advance for any hint to solve this problem, Roger == Test Script == package require vtk package require vtkinteraction # Create the standard renderer, render window # and interactor vtkRenderer ren1 vtkRenderWindow renWin renWin AddRenderer ren1 vtkRenderWindowInteractor iren iren SetRenderWindow renWin # Create the reader for the source data vtkPolyDataReader reader reader SetFileName elevData.vtk reader Update set elevData [reader GetOutput] puts "Reader Num points: [$elevData GetNumberOfPoints]" # Do some calculations set bounds [$elevData GetBounds] puts "Bounds: $bounds" set x0 [lindex $bounds 0] set x1 [lindex $bounds 1] set y0 [lindex $bounds 2] set y1 [lindex $bounds 3] set z0 [lindex $bounds 4] set z1 [lindex $bounds 5] set dist [expr {sqrt(pow($x0 - $x1, 2) + pow($y0 - $y1, 2))}] puts "Distance: $dist" set res [expr {int($dist / 25)}] puts "Resolution: $res" # Create a PolyData writer vtkPolyDataWriter PDW # Create first probe vtkLineSource LS1 LS1 SetPoint1 $x0 $y0 0 LS1 SetPoint2 $x1 $y1 0 LS1 SetResolution $res vtkProbeFilter probe1 probe1 SetInput [LS1 GetOutput] probe1 SetSource $elevData # Write probe 1 probe1 Update PDW SetFileName probe1.vtk PDW SetInput [probe1 GetOutput] #PDW Write # Create 2nd probe vtkLineSource LS2 LS2 SetPoint1 $x0 $y1 0 LS2 SetPoint2 $x1 $y0 0 LS2 SetResolution $res vtkProbeFilter probe2 probe2 SetInput [LS2 GetOutput] probe2 SetSource $elevData # Write probe 2 probe2 Update PDW SetFileName probe2.vtk PDW SetInput [probe2 GetOutput] #PDW Write # Create XY plot and add 2 probes vtkXYPlotActor XYPA XYPA AddInput [probe1 GetOutput] XYPA AddInput [probe2 GetOutput] XYPA SetXValuesToIndex XYPA SetDataObjectPlotModeToRows [XYPA GetPositionCoordinate] SetValue 0.0 0.67 0 [XYPA GetPosition2Coordinate] SetValue 1.0 0.33 0;#relative to Position XYPA SetXRange 0 $res XYPA SetYRange $z0 $z1 XYPA SetLabelFormat "%#6.0f" XYPA SetNumberOfXLabels 5 XYPA SetNumberOfYLabels 5 ren1 AddActor XYPA # Show elevation data vtkPolyDataMapper mapper mapper SetInput [reader GetOutput] vtkActor actor actor SetMapper mapper ren1 AddActor actor # Show line 1 vtkPolyDataMapper LM1 LM1 SetInput [LS1 GetOutput] vtkActor LA1 LA1 SetMapper LM1 #ren1 AddActor LA1 # Show line 2 vtkPolyDataMapper LM2 LM2 SetInput [LS2 GetOutput] vtkActor LA2 LA2 SetMapper LM2 #ren1 AddActor LA2 # Update window ren1 ResetCamera ren1 ResetCameraClippingRange renWin Render -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: elevData.vtk URL: From slam_ono at yahoo.com Mon May 26 23:54:19 2008 From: slam_ono at yahoo.com (Anthony) Date: Tue, 27 May 2008 04:54:19 +0100 (BST) Subject: [vtkusers] how to fill interior pixels coverd by contour with color? Message-ID: <998268.84191.qm@web34305.mail.mud.yahoo.com> Hi, I'd like to color all the pixels inside a closed contour by a certain color but I dont know which function/filter should I use. Can anyone help? thanks Send instant messages to your online friends http://uk.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From foramuyou at gmail.com Tue May 27 01:43:52 2008 From: foramuyou at gmail.com (Jefferson Thomas) Date: Tue, 27 May 2008 14:43:52 +0900 Subject: [vtkusers] Writing to vtkMPEGWriter directly from vtkImageData Message-ID: Hi, I have a vtkImageData with size 200x30x1. The data changes with time so I want to make an mpg out of it using the vtkMPEG2Writer. I dont want to use the rendering, just a direct output of 2D frames to an MPG. I do as follows: vtkImageData* data = new vtkImageData::New(); ... (filling the data table) vtkMPEG2Writer *moviewriter = vtkMPEG2Writer::New(); moviewriter->SetFileName("test.mpg"); moviewriter->SetInput(data); moviewriter->Start(); moviewriter->Write(); moviewriter->End(); vtkJPEGWriter* jpgw=vtkJPEGWriter::New(); jpgw->SetInput(data); jpgw->SetFileName("test.jpg"); jpgw->Write(); The output "test.jpg" is very nice but the output "test.mpg" file is ugly, grey and full of lines. I've been trying it with different grid size (always x,y being a multiple of 4 in order not to get the http://www.vtk.org/pipermail/vtkusers/2006-July/086334.html errors) and with different data but the result is always the same. MPG is ugly and JPG is nice. Is there anything Im doing wrong with MPEG output here ? Thank you for any help, Thomas From vtoolkit at gmail.com Tue May 27 02:03:48 2008 From: vtoolkit at gmail.com (Deepak Tiwari) Date: Tue, 27 May 2008 00:03:48 -0600 Subject: [vtkusers] vtk installation error(LINUX) Message-ID: <3fa260f90805262303s71d55dbcv846cfdb1c905c9a@mail.gmail.com> Hello, I am installing vtk on Linux. I am getting the following error when I do the initial configuration. I am not quiet sure what this means. CMake Error: This project requires some variables to be set, and cmake can not find them. Please set the following variables: OPENGL_INCLUDE_DIR (ADVANCED) OPENGL_gl_LIBRARY (ADVANCED) PYTHON_INCLUDE_PATH PYTHON_LIBRARY TK_INCLUDE_PATH (ADVANCED) Thanks, ~D -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.maclennan at gmail.com Tue May 27 02:18:33 2008 From: alex.maclennan at gmail.com (Alexander MacLennan) Date: Tue, 27 May 2008 14:18:33 +0800 Subject: [vtkusers] vtk installation error(LINUX) In-Reply-To: <3fa260f90805262303s71d55dbcv846cfdb1c905c9a@mail.gmail.com> References: <3fa260f90805262303s71d55dbcv846cfdb1c905c9a@mail.gmail.com> Message-ID: <661044d60805262318qb038aabu397d8f01789080a1@mail.gmail.com> Hi Deepak, You need to tell cmake where the include ( .h ) and libraries are ( .so etc.. ) files are so it can create the build scripts for example: opengl_gl_library will be the full path to libGL.so e.g. /usr/X11R6/lib/libGL.so opengl_include_dir will be the name of the directory that contains the header files used by opengl e.g. /usr/include/GL .. or even /usr/include You'll need to do the same for python and tk alex On Tue, May 27, 2008 at 2:03 PM, Deepak Tiwari wrote: > Hello, > > I am installing vtk on Linux. I am getting the following error when I do > the initial configuration. I am not quiet sure what this means. > > CMake Error: This project requires some variables to be set, > and cmake can not find them. > Please set the following variables: > OPENGL_INCLUDE_DIR (ADVANCED) > OPENGL_gl_LIBRARY (ADVANCED) > PYTHON_INCLUDE_PATH > PYTHON_LIBRARY > TK_INCLUDE_PATH (ADVANCED) > > Thanks, > > ~D > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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 mmavila at unex.es Tue May 27 04:19:54 2008 From: mmavila at unex.es (=?iso-8859-1?Q?Mar_=C1vila?=) Date: Tue, 27 May 2008 10:19:54 +0200 Subject: [vtkusers] Problemas con vtkExtractVOI Message-ID: <004a01c8bfd2$72f36410$c4f7319e@Marav> Hola. Estoy seleccionando una regi?n de inter?s y al final he conseguido seleccionarla pero no exactamente la porci?n que yo quiero. Alguien me puede decir exactamente como funciona exactamente. Aqu? pongo el trozo de c?digo: vtkExtractVOI *extract = vtkExtractVOI::New(); extract->SetVOI (193, 324,246, 358, 40, 55); extract->SetSampleRate (1, 1, 1); extract->SetInput(v16->GetOutput()); extract->ReleaseDataFlagOff(); extract->Update(); Muchas gracias -------------- next part -------------- An HTML attachment was scrubbed... URL: From guachong133 at 163.com Tue May 27 06:32:25 2008 From: guachong133 at 163.com (guachong133) Date: Tue, 27 May 2008 18:32:25 +0800 (CST) Subject: [vtkusers] about vtkInputPort.h Message-ID: <23348693.496751211884345968.JavaMail.coremail@bj163app35.163.com> hello, I have met a problem with studying the VTK example "PipelineParallelism.cxx". I complied it using CMAKE and opened in visual .net 2003,and when building the resolution, a message "can't find vtkInputPort.h" turned out. Having search the file manually in the computer,the VTK does have't that file. Then I Searched Google,the file to be found in the version 4.0 and 4.2,but I am not sure if they can work in the version 5.04. So I am very eager to know how I can get a file "vtkInputPort.h" in the version 5.04 or I can use an earlier vresion to in that example. thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmavila at unex.es Tue May 27 06:35:46 2008 From: mmavila at unex.es (=?iso-8859-1?Q?Mar_=C1vila?=) Date: Tue, 27 May 2008 12:35:46 +0200 Subject: [vtkusers] =?iso-8859-1?q?Interpolaci=F3n_de_vol=FAmenes?= Message-ID: <00c001c8bfe5$6c8b1790$c4f7319e@Marav> ?Alguien podr?a decirme cual es la mejor interpolaci?n para realizar con vol?menes? ?Es "SetInterpolationTypeToLinear()"? ?Podr?ais decirme exactamente como funciona? Muchas gracias. -------------- next part -------------- An HTML attachment was scrubbed... URL: From florysf at gmail.com Tue May 27 06:56:24 2008 From: florysf at gmail.com (flory) Date: Tue, 27 May 2008 03:56:24 -0700 (PDT) Subject: [vtkusers] SetDataSpacing in vtkTIFFReader Message-ID: <17487796.post@talk.nabble.com> Hello everyone, I want to read a set of images with vtkTIFFReader, it works fine but if I set the SetSpacingData to some values the x and y spacings are 1 all the time even if I set different values. The z spacing works fine and I don't know what is the problem. Did anyone manage to read tiff files and also set the spacing? I use VTK with Java wrapping. Thanks a lot! Flory -- View this message in context: http://www.nabble.com/SetDataSpacing-in-vtkTIFFReader-tp17487796p17487796.html Sent from the VTK - Users mailing list archive at Nabble.com. From rashed.vtk at googlemail.com Tue May 27 07:06:54 2008 From: rashed.vtk at googlemail.com (rashedk) Date: Tue, 27 May 2008 04:06:54 -0700 (PDT) Subject: [vtkusers] vtkPolygon::PointInPolygon 's parameters In-Reply-To: References: <17364157.post@talk.nabble.com> Message-ID: <17487934.post@talk.nabble.com> Hi, I am still having problems making the vtkPolygon::PointInPolygon work. Can someone clarify the third parameter *pts for me? Are these the vertices of the polygon as x1, y1, z1, x2, y2, z2, and so on ... where (x1,y1,z1) is a vertex? Has anyone had issues with this function? It seems to return 0 for some points which are inside the polygon. Thanks in advance Rashed Goodwin Lawlor wrote: > > Hi Rashed, > > The bounds are indeed the "min-max of each x,y,z component". If you got > the polydata of the plane from your widget, you can try: > > planeWidget->GetPolyData()->GetPoints()->GetBounds() > > hth > > Goodwin > > > rashedk wrote: >> Hi everyone, >> >> I cant find any reference in the documentation about the parameters of >> the >> static function vtkPolygon::PointInPolygon >> >> Here is the signature: >> int PointInPolygon (float x[3], int numPts, float *pts, float bounds[6], >> float n[3]) >> >> Especially with regards to the 4th parameter bounds[6]. If I have four >> corner points of a polygon (i.e. plane) for example, how do I compute >> bounds? Are these the min-max of each x,y,z component for the four corner >> points? >> >> Thanks, >> Rashed > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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/vtkPolygon%3A%3APointInPolygon-%27s-parameters-tp17364157p17487934.html Sent from the VTK - Users mailing list archive at Nabble.com. From mmavila at unex.es Tue May 27 07:12:39 2008 From: mmavila at unex.es (=?iso-8859-1?Q?Mar_=C1vila?=) Date: Tue, 27 May 2008 13:12:39 +0200 Subject: [vtkusers] Interpolate ray casting Message-ID: <011201c8bfea$933b03f0$c4f7319e@Marav> How volume interpolate in VTK (Ray Casting)? How to work? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From beromuald at wanadoo.fr Tue May 27 10:32:06 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Tue, 27 May 2008 16:32:06 +0200 (CEST) Subject: [vtkusers] Creating a 3DImageData from slices Message-ID: <26445600.1891611211898726432.JavaMail.www@wwinf1516> Hi Amy, thanks for your answer, But I have tried to make an algorithm with "vtkImageAppend", and I don't arrived. Someone know how can I use this class? I have severals 2D vtkImageData objects (the slices). Thanks a lot for answers. Romu > Message du 22/05/08 17:10 > De : "Amy Squillacote" > A : "Romuald BERTRAND" > Copie ? : vtkusers at vtk.org > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > Hi Romu, > > Are the slices already loaded in VTK (i.e., multiple 2D vtkImageData > objects), or are you reading the slices from files? > > If they're already 2D vtkImageData objects, take a look at > vtkImageAppend > (http://www.vtk.org/doc/nightly/html/classvtkImageAppend.html). If you > have X-Y slices, then the "append axis" should be the Z axis. > > If you're reading the slices from files, subclasses of vtkImageReader2 > (http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html) will > handle this for you. You can pass in either a list of file names or a > file pattern to tell the reader how to get the data files. > > - Amy > > Romuald BERTRAND wrote: > > > > Hi all, > > > > Someone know how creating a 3DImageData from 2D slices? > > Thanks for answers, > > > > Romu > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > This is the private VTK discussion list. > > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > -- > Amy Squillacote Phone: (256) 726-4839 > Computer Scientist Fax: (256) 726-4806 > CFD Research Corporation Web: http://www.cfdrc.com > 215 Wynn Drive, Suite 501 > Huntsville, AL 35805 > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Tue May 27 10:38:13 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Tue, 27 May 2008 09:38:13 -0500 Subject: [vtkusers] Creating a 3DImageData from slices In-Reply-To: <26445600.1891611211898726432.JavaMail.www@wwinf1516> References: <26445600.1891611211898726432.JavaMail.www@wwinf1516> Message-ID: <483C1CD5.8060601@cfdrc.com> Hi Romu, Please post source code showing how you are trying to use vtkImageAppend. In order for anyone on this list to help you track down the problem, we need to see source code showing what you are doing. - Amy Romuald BERTRAND wrote: > > Hi Amy, thanks for your answer, > > But I have tried to make an algorithm with "vtkImageAppend", and I > don't arrived. > Someone know how can I use this class? > I have severals 2D vtkImageData objects (the slices). > > Thanks a lot for answers. > > Romu > > > > > > > Message du 22/05/08 17:10 > > De : "Amy Squillacote" > > A : "Romuald BERTRAND" > > Copie ? : vtkusers at vtk.org > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > Hi Romu, > > > > Are the slices already loaded in VTK (i.e., multiple 2D > vtkImageData > > objects), or are you reading the slices from files? > > > > If they're already 2D vtkImageData objects, take a look at > > vtkImageAppend > > (http://www.vtk.org/doc/nightly/html/classvtkImageAppend.html). > If you > > have X-Y slices, then the "append axis" should be the Z axis. > > > > If you're reading the slices from files, subclasses of > vtkImageReader2 > > (http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html) > will > > handle this for you. You can pass in either a list of file names > or a > > file pattern to tell the reader how to get the data files. > > > > - Amy > > > > Romuald BERTRAND wrote: > > > > > > Hi all, > > > > > > Someone know how creating a 3DImageData from 2D slices? > > > Thanks for answers, > > > > > > Romu > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > This is the private VTK discussion list. > > > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > > Follow this link to subscribe/unsubscribe: > > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > -- > > Amy Squillacote Phone: (256) 726-4839 > > Computer Scientist Fax: (256) 726-4806 > > CFD Research Corporation Web: http://www.cfdrc.com > > 215 Wynn Drive, Suite 501 > > Huntsville, AL 35805 > > > > > > > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From evans at aps.anl.gov Tue May 27 12:15:14 2008 From: evans at aps.anl.gov (Ken Evans) Date: Tue, 27 May 2008 11:15:14 -0500 Subject: [vtkusers] Problem with vtkRenderWindowInteractor with more than one widget In-Reply-To: <31ddba770805240347o67fdca81p5948f3773a056aad@mail.gmail.com> References: <003a01c8b1f8$c3c89f50$950836a4@aps.anl.gov> <31ddba770805111512w79a39e05k39e98b0edeac7e7e@mail.gmail.com> <6DAD69CEEC61453C8DDD5E0B1986496B@CICADA> <31ddba770805121013t64e510bco5add2af6edcf515b@mail.gmail.com> <006301c8b465$c5fe67e0$950836a4@aps.anl.gov> <005501c8b532$e8483e20$950836a4@aps.anl.gov> <006901c8bc2a$fe632d60$950836a4@aps.anl.gov> <002a01c8bce4$d10e2670$103e36a4@MUSE> <31ddba770805240347o67fdca81p5948f3773a056aad@mail.gmail.com> Message-ID: <00a601c8c014$d9091870$263e36a4@MUSE> Charl, Thanks for the information. It seems doable and perhaps not too hard. I am out of town right now, but will try it when I get a chance. -Ken From vtoolkit at gmail.com Tue May 27 13:27:45 2008 From: vtoolkit at gmail.com (Deepak Tiwari) Date: Tue, 27 May 2008 11:27:45 -0600 Subject: [vtkusers] vtk installation error(LINUX) In-Reply-To: <661044d60805262318qb038aabu397d8f01789080a1@mail.gmail.com> References: <3fa260f90805262303s71d55dbcv846cfdb1c905c9a@mail.gmail.com> <661044d60805262318qb038aabu397d8f01789080a1@mail.gmail.com> Message-ID: <3fa260f90805271027v18401db9h9f202bd677447d32@mail.gmail.com> Thanks, Alex. Can you elaborate a little bit on how to tell cmake where these libraries are. Thanks, ~D On Tue, May 27, 2008 at 12:18 AM, Alexander MacLennan < alex.maclennan at gmail.com> wrote: > Hi Deepak, > > You need to tell cmake where the include ( .h ) and libraries are ( .so > etc.. ) files are so it can create the build scripts > > for example: > > opengl_gl_library will be the full path to libGL.so e.g. > /usr/X11R6/lib/libGL.so > opengl_include_dir will be the name of the directory that contains the > header files used by opengl e.g. /usr/include/GL .. or even /usr/include > > You'll need to do the same for python and tk > > alex > > > > > On Tue, May 27, 2008 at 2:03 PM, Deepak Tiwari wrote: > >> Hello, >> >> I am installing vtk on Linux. I am getting the following error when I do >> the initial configuration. I am not quiet sure what this means. >> >> CMake Error: This project requires some variables to be set, >> and cmake can not find them. >> Please set the following variables: >> OPENGL_INCLUDE_DIR (ADVANCED) >> OPENGL_gl_LIBRARY (ADVANCED) >> PYTHON_INCLUDE_PATH >> PYTHON_LIBRARY >> TK_INCLUDE_PATH (ADVANCED) >> >> Thanks, >> >> ~D >> >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the 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 Tue May 27 14:55:14 2008 From: adzyubak at gmail.com (Oleksandr Dzyubak) Date: Tue, 27 May 2008 13:55:14 -0500 Subject: [vtkusers] crashes N-D Linear Time Exact Signed Euclidean Distance Transform Message-ID: <483C5912.3050805@gmail.com> Dear ITKers, I tried to use N-D Linear Time Exact Signed Euclidean Distance Transform from IJ. http://insight-journal.org/midas/handle.php?handle=1926/171 Compilation went well and I got a brand new and very nice looking executable. However when I tried to run it with the example images provided in the archive, the program keeps crashing with the memory corruption error ( see error below). Am I missing something? Have anybody tried that algorithm implementation? Thanks, Alex *********************** Errors ******** dzyubak at debian: /Images$ ls binaryPhantom.hdr peep0_seg01_out.img binaryPhantom.img SignedMaurerDistanceMapImageFilterTest binaryPhantom_out.hdr SquareBinary201.hdr binaryPhantom_out.img SquareBinary201.img peep0_seg01.hdr SquareBinary201_out.hdr peep0_seg01.img SquareBinary201_out.img peep0_seg01_out.hdr dzyubak at debian: /Images$ ./SignedMaurerDistanceMapImageFilterTest SquareBinary201.hdr *** glibc detected *** malloc(): memory corruption: 0x08176b90 *** Aborted From berk.geveci at kitware.com Tue May 27 17:01:53 2008 From: berk.geveci at kitware.com (Berk Geveci) Date: Tue, 27 May 2008 17:01:53 -0400 Subject: [vtkusers] Problem connecting vtkImageData with vtImageWrapPad in VTK 5.0 In-Reply-To: <19B2320E2321AA408DDD332A8F86CB3B44F9F2@corpmail1.corp.sulzer.com> References: <19B2320E2321AA408DDD332A8F86CB3B44F9F2@corpmail1.corp.sulzer.com> Message-ID: <45d654b0805271401w18ae3217gdb191c46e33adbe4@mail.gmail.com> What do you mean by "different result"? Some images may help. On Mon, May 26, 2008 at 12:37 PM, Merchan, Alejandro wrote: > Hi vtkusers > > I'm updating a vtk-application from version 4.2 to 5.0 and I'm having some > problems connecting an instance of vtkImageData with an instance of > vtkImageWrapPad in VTK 5.0. VTK 5.0 does accept my vtkImageData as Input > and does not complain about it, anyhow it produces a different result than > VTK 4.2. I could not load the whole Example because it was bigger than 100 > KB. > > After Reading a VTK-file (with Dataset Format structured points) I extract > a Volume of Interest with extractPlane (an instance of vtkExtractVOI) and > set some scalars of it to an instance of vtkImageData. (I used > SetInputConnection and GetOutputPort for VTK 5.0) > > vtkStructuredPointsReader reader > reader SetFileName "/data/home/vm/Documents/extractedConcentration.vtk" > reader UpdateWholeExtent > > vtkExtractVOI extractPlane > #extractPlane DebugOn > extractPlane SetInput [reader GetOutput] > extractPlane SetVOI 0 201 0 201 1 1 > extractPlane UpdateWholeExtent > > vtkImageData imagePlane > imagePlane SetDimensions 200 200 1 > [imagePlane GetPointData] SetScalars [[[extractPlane GetOutput] GetCellData] > GetScalars] > > Till this point everything works fine and both VTK 4.2 and 5.0 produce the > same results. The problem appears in the next step when passing imagePlane > as input to an instance of vtkImageWrapPad. > > vtkImageWrapPad imageWrap > imageWrap SetInput imagePlane > #imageWrap SetOutputWholeExtent 0 [expr $power2x - 1] 0 [expr $power2y - > 1] 0 0 > imageWrap UpdateWholeExtent > > Since imagePlane as an instance of vtkImageData does not have an output or > outputport directly I try to pass it to imageWrap using the SetInput method > just like it worked on our program with VTK 4.2 . VTK 5.0 actually accepts > this and does not complain about it, however it produces a different result > than VTK 4.2 does. Since I saw on the examples of VTK that imageWrap should > be actually used with SetInputConnection and GetOuputPort I tried passing > imagePlane to other graphic Filters bevor passing it to vtkImageWrapPad ( > For example here VTK 4 syntax ) > > vtkImageMagnify mag > mag SetInput ImagePlane > mag SetMagnificationFactors 1 1 1 > mag UpdateWholeExtent > > vtkImageWrapPad imageWrap > imageWrap SetInput [mag GetOutput] > #imageWrap SetOutputWholeExtent 0 [expr $power2x - 1] 0 [expr $power2y - > 1] 0 0 > imageWrap UpdateWholeExtent > > But it also only worked as expected on VTK 4.2. The only solution that > actually kind of worked was writing imagePlane (vtkImageData) in a temporary > file with vtkStructuredPointsWriter and passing the Output of a > vtkStructuredPointsReader (which reads the file produced by > vtkStructuredPointsWriter) to vtkImageWrapPad. It worked in such a way, > that the right image is shown well in the render Window, but it changes the > behaviour of my programm, so that other function which are based on the > Output of vtkImageWrapPad are not working anymore (neither on vtk 4.2 nor in > 5.0). > > Has anybody of you had such kind of problems?. Isn't it possible anymore to > connect a vtkImageData with vtkImageWrapPad directly so that it just works > the way it did in VTK 4.2? > > Thanks for any help! > > Alejandro > > CONFIDENTIALITY NOTICE > The information in this email may be confidential and/or privileged. > This email is intended to be reviewed by only the addressee(s) named > above. If you are not the intended recipient, you are hereby notified > that any review, dissemination, copying, use or storage of this email > and its attachments, if any, or the information contained herein is > prohibited. If you have received this email in error, please > immediately notify the sender by return email and delete this email > from your system. Thank you. > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > From rpnabar at gmail.com Tue May 27 19:08:52 2008 From: rpnabar at gmail.com (Rahul Nabar) Date: Tue, 27 May 2008 18:08:52 -0500 Subject: [vtkusers] installing vtk on RHEL; fails to find Python.h Message-ID: I tried installing vtk so that I can use it from Python. I'm not too familiar with cmake but I tried to answer correctly the many questions that it had for me. Yet my make fails to find the header file Python.h; with this message: [ 0%] Building C object Wrapping/CMakeFiles/vtkWrapPython.dir/vtkWrapPython.o In file included from /src/VTK/Wrapping/vtkWrapPython.c:16: /src/VTK/Common/vtkPython.h:44:22: error: Python.h: No such file or directory make[2]: *** [Wrapping/CMakeFiles/vtkWrapPython.dir/vtkWrapPython.o] Error 1 make[1]: *** [Wrapping/CMakeFiles/vtkWrapPython.dir/all] Error 2 make: *** [all] Error 2 Any suggestions which variable I must have set wrong? I list below the path's I thought were relevant; perhaps I'm totally off! PYTHON_INCLUDE_PATH=/usr/local/lib/python2.4 PYTHON_LIBRARY=/usr/local/lib/python2.4 CMAKE_INSTALL_PREFIX= /usr/local/vtk BUILD_SHARED_LIBS=ON CMAKE_BUILD_TYPE='' Is there any other way of installing VTK on my RHEL system? cmake seems very messy. Any rpm / yum / srpm options? -Rahul From rogerblum at hawaii.rr.com Tue May 27 19:49:54 2008 From: rogerblum at hawaii.rr.com (Roger Blum) Date: Tue, 27 May 2008 13:49:54 -1000 Subject: [vtkusers] Problem adding actor to a renderer In-Reply-To: References: Message-ID: Hi Goodwin, Thanks for your reply. Sorry I only get back to you now but I only can work in my time off on this project :-) I finally located the problem. Your hints and some vtk source code analysis did the trick. I originally checked if the actor was added to the renderer by querying the actors collection I retrieved from the renderer with getActors. The vtkImageActor object doesn't seem to be added to this collection. When I checked the ViewProps collection the object showed up as being added to the renderer. I also found the spot in my new Tcl code which caused to image not to be shown. I was not able to find the reason why it showed when added to the 2nd renderer, though. But as it works now, I guess I will not investigate this further. I still have other things to build and fix. Thanks again, Roger Goodwin Lawlor wrote: > Hi Roger, > > What changed since your application used to work? Additional code or > newer vtk version? Or something else... > > Do you add the same actor to the two renderers? Does creating separate > actor/mappers for each renderer do anything? > > Do each of the renderers get added to separate vtkRenderWindow instances? > > Goodwin > > Roger Blum wrote: >> Hi Goodwin, >> >> Unfortunately it's a proprietary application with > 15000 lines of Tcl >> code. Extracting the problematic part isn't easy and I'm not sure if >> writing a special test script would cause the same problem, as it used >> to work the way it is set up. >> I will post a test script if I'm able to reproduce the problem. >> >> Thanks, >> Roger >> >> Goodwin Lawlor wrote: >>> Roger, >>> >>> Can you post a small tcl script illustrating this behaviour? >>> >>> Goodwin >>> >>> Roger Blum wrote: >>>> Hello >>>> >>>> My Tcl application has 2 renderers: 1 showing an overview window and >>>> 1 showing the interactive window where user can zoom, pan, etc. >>>> >>>> The background in both windows is a bitmap displayed with a >>>> vtkImageActor. This used to work perfectly till recently the >>>> overview window stopped showing the image. I can not find the reason >>>> for this sudden change. >>>> >>>> I' ve found that the actor doesn't get added to the renderer. >>>> Writing output before and after the AddActor command shows that the >>>> renderer has the same amount of actors before and after the call. >>>> If I try to add the actor 'manually' from the built-in shell I can >>>> add it to the main window but it wouldn't add to the overview window. >>>> >>>> What would cause a renderer to not accept an (obviously correctly >>>> configured) actor? >>> >>> >>> _______________________________________________ >>> This is the private VTK discussion list. >>> Please keep messages on-topic. Check the FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> Follow this link to subscribe/unsubscribe: >>> http://www.vtk.org/mailman/listinfo/vtkusers >>> >> >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > From kalpana0611 at gmail.com Wed May 28 00:26:57 2008 From: kalpana0611 at gmail.com (Cally K) Date: Wed, 28 May 2008 12:26:57 +0800 Subject: [vtkusers] Problem with compiling and linking static libraries Message-ID: Hi everyone, I tried searching the mailing list and I found out ways to compile and link vtk examples ( Cone.cxx ) . I managed to do it when VTK was built using the shared library option But I need to run VTK on the cluster, parallel VTK. and I need to build static libraries as I am not root, I compiled it, but it is the linking that is giving problem, this is my command to compile a) g++ -c -I/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/include/vtk-5.0 Cone.cxx -Wno-deprecated to link b) g++ -o Cone Cone.o -I/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/include/vtk-5.0 -L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib /home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkFiltering.a /home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkCommon.a L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkGraphics.a L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkIO.a my lib folder is in /home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib, and I can see all the libvtkFiltering. a libvtkCommon.a all what am I doing wrong, please help... From beromuald at wanadoo.fr Wed May 28 03:09:59 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Wed, 28 May 2008 09:09:59 +0200 (CEST) Subject: [vtkusers] Creating a 3DImageData from slices Message-ID: <30558126.243581211958599380.JavaMail.www@wwinf1601> Hi, my code is : ??? vtkImageAppend* transfo3D = vtkImageAppend::New(); ??? ??? int inputPort(0); ??? ??? for( int i=0; iSetInput(inputPort, img[i]); ??? ??? ??? ??? inputPort++; ??? } ??? ??? transfo3D->SetAppendAxis(2); ??? ??? viewer->SetInputConnection(transfo3D->GetOutputPort()); ??? viewer->SetSlice(lastOne); ??? viewer->SetColorWindow(2000); ??? viewer->SetColorLevel(1000); ??? ??? Refresh(); I think there is a lot of errors, but I don't know how to use this class. Thanks for help Romu > Message du 27/05/08 16:36 > De : "Amy Squillacote" > A : "Romuald BERTRAND" > Copie ? : vtkusers at vtk.org > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > Hi Romu, > > Please post source code showing how you are trying to use > vtkImageAppend. In order for anyone on this list to help you track down > the problem, we need to see source code showing what you are doing. > > - Amy > > Romuald BERTRAND wrote: > > > > Hi Amy, thanks for your answer, > > > > But I have tried to make an algorithm with "vtkImageAppend", and I > > don't arrived. > > Someone know how can I use this class? > > I have severals 2D vtkImageData objects (the slices). > > > > Thanks a lot for answers. > > > > Romu > > > > > > > > > > > > > Message du 22/05/08 17:10 > > > De : "Amy Squillacote" > > > A : "Romuald BERTRAND" > > > Copie ? : vtkusers at vtk.org > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > Hi Romu, > > > > > > Are the slices already loaded in VTK (i.e., multiple 2D > > vtkImageData > > > objects), or are you reading the slices from files? > > > > > > If they're already 2D vtkImageData objects, take a look at > > > vtkImageAppend > > > (http://www.vtk.org/doc/nightly/html/classvtkImageAppend.html). > > If you > > > have X-Y slices, then the "append axis" should be the Z axis. > > > > > > If you're reading the slices from files, subclasses of > > vtkImageReader2 > > > (http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html) > > will > > > handle this for you. You can pass in either a list of file names > > or a > > > file pattern to tell the reader how to get the data files. > > > > > > - Amy > > > > > > Romuald BERTRAND wrote: > > > > > > > > Hi all, > > > > > > > > Someone know how creating a 3DImageData from 2D slices? > > > > Thanks for answers, > > > > > > > > Romu > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > _______________________________________________ > > > > This is the private VTK discussion list. > > > > Please keep messages on-topic. Check the FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > > > > -- > > > Amy Squillacote Phone: (256) 726-4839 > > > Computer Scientist Fax: (256) 726-4806 > > > CFD Research Corporation Web: http://www.cfdrc.com > > > 215 Wynn Drive, Suite 501 > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > -- > Amy Squillacote Phone: (256) 726-4839 > Computer Scientist Fax: (256) 726-4806 > CFD Research Corporation Web: http://www.cfdrc.com > 215 Wynn Drive, Suite 501 > Huntsville, AL 35805 > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alejandro.Merchan at sulzer.com Wed May 28 03:42:55 2008 From: Alejandro.Merchan at sulzer.com (Merchan, Alejandro) Date: Wed, 28 May 2008 09:42:55 +0200 Subject: [vtkusers] Problem connecting vtkImageData with vtImageWrapPad in VTK 5.0 In-Reply-To: <45d654b0805271401w18ae3217gdb191c46e33adbe4@mail.gmail.com> References: <19B2320E2321AA408DDD332A8F86CB3B44F9F2@corpmail1.corp.sulzer.com> <45d654b0805271401w18ae3217gdb191c46e33adbe4@mail.gmail.com> Message-ID: <19B2320E2321AA408DDD332A8F86CB3B44FBA3@corpmail1.corp.sulzer.com> Hi Berk! Here are some images, the tcl-scripts for vtk 4.2 and 5.0, and the file from which we build the vtkImageData. ftp://ftp.sulzer.com/2+itag+/imageWrapPad Thanks for your reply. Alejandro -----Urspr?ngliche Nachricht----- Von: Berk Geveci [mailto:berk.geveci at kitware.com] Gesendet: Dienstag, 27. Mai 2008 23:02 An: Merchan, Alejandro Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Problem connecting vtkImageData with vtImageWrapPad in VTK 5.0 What do you mean by "different result"? Some images may help. On Mon, May 26, 2008 at 12:37 PM, Merchan, Alejandro wrote: > Hi vtkusers > > I'm updating a vtk-application from version 4.2 to 5.0 and I'm having > some problems connecting an instance of vtkImageData with an instance > of vtkImageWrapPad in VTK 5.0. VTK 5.0 does accept my vtkImageData as > Input and does not complain about it, anyhow it produces a different > result than VTK 4.2. I could not load the whole Example because it was > bigger than 100 KB. > > After Reading a VTK-file (with Dataset Format structured points) I > extract a Volume of Interest with extractPlane (an instance of > vtkExtractVOI) and set some scalars of it to an instance of > vtkImageData. (I used SetInputConnection and GetOutputPort for VTK > 5.0) > > vtkStructuredPointsReader reader > reader SetFileName "/data/home/vm/Documents/extractedConcentration.vtk" > reader UpdateWholeExtent > > vtkExtractVOI extractPlane > #extractPlane DebugOn > extractPlane SetInput [reader GetOutput] > extractPlane SetVOI 0 201 0 201 1 1 > extractPlane UpdateWholeExtent > > vtkImageData imagePlane > imagePlane SetDimensions 200 200 1 > [imagePlane GetPointData] SetScalars [[[extractPlane GetOutput] > GetCellData] GetScalars] > > Till this point everything works fine and both VTK 4.2 and 5.0 > produce the same results. The problem appears in the next step when > passing imagePlane as input to an instance of vtkImageWrapPad. > > vtkImageWrapPad imageWrap > imageWrap SetInput imagePlane > #imageWrap SetOutputWholeExtent 0 [expr $power2x - 1] 0 [expr > $power2y - 1] 0 0 > imageWrap UpdateWholeExtent > > Since imagePlane as an instance of vtkImageData does not have an > output or outputport directly I try to pass it to imageWrap using the > SetInput method just like it worked on our program with VTK 4.2 . VTK > 5.0 actually accepts this and does not complain about it, however it > produces a different result than VTK 4.2 does. Since I saw on the > examples of VTK that imageWrap should be actually used with > SetInputConnection and GetOuputPort I tried passing imagePlane to > other graphic Filters bevor passing it to vtkImageWrapPad ( For > example here VTK 4 syntax ) > > vtkImageMagnify mag > mag SetInput ImagePlane > mag SetMagnificationFactors 1 1 1 > mag UpdateWholeExtent > > vtkImageWrapPad imageWrap > imageWrap SetInput [mag GetOutput] > #imageWrap SetOutputWholeExtent 0 [expr $power2x - 1] 0 [expr > $power2y - 1] 0 0 > imageWrap UpdateWholeExtent > > But it also only worked as expected on VTK 4.2. The only solution > that actually kind of worked was writing imagePlane (vtkImageData) in > a temporary file with vtkStructuredPointsWriter and passing the Output > of a vtkStructuredPointsReader (which reads the file produced by > vtkStructuredPointsWriter) to vtkImageWrapPad. It worked in such a > way, that the right image is shown well in the render Window, but it > changes the behaviour of my programm, so that other function which are > based on the Output of vtkImageWrapPad are not working anymore > (neither on vtk 4.2 nor in 5.0). > > Has anybody of you had such kind of problems?. Isn't it possible > anymore to connect a vtkImageData with vtkImageWrapPad directly so > that it just works the way it did in VTK 4.2? > > Thanks for any help! > > Alejandro > > CONFIDENTIALITY NOTICE > The information in this email may be confidential and/or privileged. > This email is intended to be reviewed by only the addressee(s) named > above. If you are not the intended recipient, you are hereby notified > that any review, dissemination, copying, use or storage of this email > and its attachments, if any, or the information contained herein is > prohibited. If you have received this email in error, please > immediately notify the sender by return email and delete this email > from your system. Thank you. > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > CONFIDENTIALITY NOTICE The information in this email may be confidential and/or privileged. This email is intended to be reviewed by only the addressee(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, copying, use or storage of this email and its attachments, if any, or the information contained herein is prohibited. If you have received this email in error, please immediately notify the sender by return email and delete this email from your system. Thank you. From foramuyou at gmail.com Wed May 28 05:13:09 2008 From: foramuyou at gmail.com (Jefferson Thomas) Date: Wed, 28 May 2008 18:13:09 +0900 Subject: [vtkusers] Problems using more than one vtkMPEG2Writer simultaneously, only one creates a working MPEG Message-ID: Hi, I want to use more then one vtkMPEG2Writer in the same time and output many MPEG. The problem is that every time I try to do it only one of the MPEG files is working after that. Here is a mininal code : #include "vtkMPEG2Writer.h" #include "vtkWindowToImageFilter.h" #include "vtkCylinderSource.h" #include "vtkPolyDataMapper.h" #include "vtkActor.h" #include "vtkRenderer.h" #include "vtkRenderWindow.h" #include "vtkRenderWindowInteractor.h" #include "vtkProperty.h" #include "vtkCamera.h" int main(void) { vtkCylinderSource *cylinder = vtkCylinderSource::New(); cylinder->SetResolution(8); vtkPolyDataMapper *cylinderMapper = vtkPolyDataMapper::New(); cylinderMapper->SetInputConnection(cylinder->GetOutputPort()); vtkActor *cylinderActor = vtkActor::New(); cylinderActor->SetMapper(cylinderMapper); cylinderActor->GetProperty()->SetColor(1.0000, 0.3882, 0.2784); cylinderActor->RotateX(30.0); cylinderActor->RotateY(-45.0); vtkRenderer *renderer = vtkRenderer::New(); renderer->AddActor(cylinderActor); vtkRenderWindow *window = vtkRenderWindow::New(); window->AddRenderer(renderer); vtkWindowToImageFilter* w2if =vtkWindowToImageFilter::New(); w2if->SetInput(window); vtkMPEG2Writer *moviewriter1 = vtkMPEG2Writer::New(); moviewriter1->SetFileName("test1.mpg"); moviewriter1->SetInputConnection(w2if->GetOutputPort()); moviewriter1->Start(); vtkMPEG2Writer *moviewriter2 = vtkMPEG2Writer::New(); moviewriter2->SetFileName("test2.mpg"); moviewriter2->SetInputConnection(w2if->GetOutputPort()); moviewriter2->Start(); window->Render(); w2if->Modified(); moviewriter1->Write(); moviewriter2->Write(); moviewriter1->End(); moviewriter2->End(); } Linking with : -lvtkRendering -lvtkjpeg -lvtkexpat -lvtkftgl -lvtkfreetype -lGL -lGLw -lOSMesa -lpthread -ldl -lm -lvtkDICOMParser -lvtkpng -lvtktiff -lvtkzlib -lvtkGraphics -lvtkImaging -lvtkIO -lvtkFiltering -lvtkCommon -lvtksys -lvtkMPEG2Encode The output will be two mpeg files "test1.mpg" and "test2.mpg". But only "test1.mpg" can be displayed ! What is strange is that they have the same size and almost the same content. Only few bytes differ... How can it be done properly, so that all the mpgs work after creation ? Thomas From florysf at gmail.com Wed May 28 05:25:38 2008 From: florysf at gmail.com (flory) Date: Wed, 28 May 2008 02:25:38 -0700 (PDT) Subject: [vtkusers] Surface coloring Message-ID: <17508490.post@talk.nabble.com> Hello, I constructed a 3D surface from a set of images with vtkMarchingCubes. I want to color parts of the surface but I don't want to change the scalar values in order to do that(like assigning new scalars). In fact I select a region of interest using vtkBoxWidget and this one is colored all the time in blue even if I set the actor responsible for the selection to another color. I want to be able to change to color of certain parts from that selection. Has anyone tried to change the selection color of the ROI given by such a widget? Thanks a lot, Flory -- View this message in context: http://www.nabble.com/Surface-coloring-tp17508490p17508490.html Sent from the VTK - Users mailing list archive at Nabble.com. From ahs at cfdrc.com Wed May 28 09:40:54 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Wed, 28 May 2008 08:40:54 -0500 Subject: [vtkusers] installing vtk on RHEL; fails to find Python.h In-Reply-To: References: Message-ID: <483D60E6.90605@cfdrc.com> Hi Rahul, Is Python.h in your /usr/local/lib/python2.4 directory? If not, set PYTHON_INCLUDE_PATH to the directory containing this file. Also, PYTHON_LIBRARY should be set to the full path to the python library, including the library name (probably something ending in .a or .so). - Amy Rahul Nabar wrote: > I tried installing vtk so that I can use it from Python. I'm not too > familiar with cmake but I tried to answer correctly the many questions > that it had for me. > > Yet my make fails to find the header file Python.h; with this message: > > [ 0%] Building C object Wrapping/CMakeFiles/vtkWrapPython.dir/vtkWrapPython.o > In file included from /src/VTK/Wrapping/vtkWrapPython.c:16: > /src/VTK/Common/vtkPython.h:44:22: error: Python.h: No such file or directory > make[2]: *** [Wrapping/CMakeFiles/vtkWrapPython.dir/vtkWrapPython.o] Error 1 > make[1]: *** [Wrapping/CMakeFiles/vtkWrapPython.dir/all] Error 2 > make: *** [all] Error 2 > > > Any suggestions which variable I must have set wrong? I list below the > path's I thought were relevant; perhaps I'm totally off! > > PYTHON_INCLUDE_PATH=/usr/local/lib/python2.4 > PYTHON_LIBRARY=/usr/local/lib/python2.4 > CMAKE_INSTALL_PREFIX= /usr/local/vtk > BUILD_SHARED_LIBS=ON > CMAKE_BUILD_TYPE='' > > > Is there any other way of installing VTK on my RHEL system? cmake > seems very messy. Any rpm / yum / srpm options? > > -Rahul > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From ahs at cfdrc.com Wed May 28 09:42:06 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Wed, 28 May 2008 08:42:06 -0500 Subject: [vtkusers] Problem with compiling and linking static libraries In-Reply-To: References: Message-ID: <483D612E.3060405@cfdrc.com> What is the error message you are getting? - Amy Cally K wrote: > Hi everyone, > > I tried searching the mailing list and I found out ways to compile and > link vtk examples ( Cone.cxx ) . I managed to do it when VTK was built > using the shared library option > > But I need to run VTK on the cluster, parallel VTK. and I need to > build static libraries as I am not root, I compiled it, but it is the > linking that is giving problem, > > this is my command to compile > a) g++ -c -I/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/include/vtk-5.0 > Cone.cxx -Wno-deprecated > > to link > b) g++ -o Cone Cone.o > -I/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/include/vtk-5.0 > -L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib > /home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkFiltering.a > /home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkCommon.a > L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkGraphics.a > L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkIO.a > > > my lib folder is in > /home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib, and I > can see all the libvtkFiltering. a libvtkCommon.a all > > what am I doing wrong, please help... > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From ahs at cfdrc.com Wed May 28 09:46:12 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Wed, 28 May 2008 08:46:12 -0500 Subject: [vtkusers] Creating a 3DImageData from slices In-Reply-To: <30558126.243581211958599380.JavaMail.www@wwinf1601> References: <30558126.243581211958599380.JavaMail.www@wwinf1601> Message-ID: <483D6224.5040603@cfdrc.com> Hi Romu, Try replacing your "for" loop with the following. (You also won't need "int importPort(0);".) for (int i = 0; i < lastOne; i++) { transfo3D->AddInput(img[i]); } - Amy Romuald BERTRAND wrote: > > Hi, my code is : > > / vtkImageAppend* transfo3D = vtkImageAppend::New(); > > int inputPort(0); > > for( int i=0; i { > transfo3D->SetInput(inputPort, img[i]); > > inputPort++; > } > > transfo3D->SetAppendAxis(2); > > viewer->SetInputConnection(transfo3D->GetOutputPort()); > viewer->SetSlice(lastOne); > viewer->SetColorWindow(2000); > viewer->SetColorLevel(1000); > > Refresh(); > / > I think there is a lot of errors, but I don't know how to use this class. > > Thanks for help > > Romu > > > > > > > Message du 27/05/08 16:36 > > De : "Amy Squillacote" > > A : "Romuald BERTRAND" > > Copie ? : vtkusers at vtk.org > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > Hi Romu, > > > > Please post source code showing how you are trying to use > > vtkImageAppend. In order for anyone on this list to help you > track down > > the problem, we need to see source code showing what you are doing. > > > > - Amy > > > > Romuald BERTRAND wrote: > > > > > > Hi Amy, thanks for your answer, > > > > > > But I have tried to make an algorithm with "vtkImageAppend", > and I > > > don't arrived. > > > Someone know how can I use this class? > > > I have severals 2D vtkImageData objects (the slices). > > > > > > Thanks a lot for answers. > > > > > > Romu > > > > > > > > > > > > > > > > > > > Message du 22/05/08 17:10 > > > > De : "Amy Squillacote" > > > > A : "Romuald BERTRAND" > > > > Copie ? : vtkusers at vtk.org > > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > > > Hi Romu, > > > > > > > > Are the slices already loaded in VTK (i.e., multiple 2D > > > vtkImageData > > > > objects), or are you reading the slices from files? > > > > > > > > If they're already 2D vtkImageData objects, take a look at > > > > vtkImageAppend > > > > (http://www.vtk.org/doc/nightly/html/classvtkImageAppend.html). > > > If you > > > > have X-Y slices, then the "append axis" should be the Z axis. > > > > > > > > If you're reading the slices from files, subclasses of > > > vtkImageReader2 > > > > (http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html) > > > will > > > > handle this for you. You can pass in either a list of file names > > > or a > > > > file pattern to tell the reader how to get the data files. > > > > > > > > - Amy > > > > > > > > Romuald BERTRAND wrote: > > > > > > > > > > Hi all, > > > > > > > > > > Someone know how creating a 3DImageData from 2D slices? > > > > > Thanks for answers, > > > > > > > > > > Romu > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > > _______________________________________________ > > > > > This is the private VTK discussion list. > > > > > Please keep messages on-topic. Check the FAQ at: > > > http://www.vtk.org/Wiki/VTK_FAQ > > > > > Follow this link to subscribe/unsubscribe: > > > > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > > > > > > > -- > > > > Amy Squillacote Phone: (256) 726-4839 > > > > Computer Scientist Fax: (256) 726-4806 > > > > CFD Research Corporation Web: http://www.cfdrc.com > > > > 215 Wynn Drive, Suite 501 > > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > > > > > > > > -- > > Amy Squillacote Phone: (256) 726-4839 > > Computer Scientist Fax: (256) 726-4806 > > CFD Research Corporation Web: http://www.cfdrc.com > > 215 Wynn Drive, Suite 501 > > Huntsville, AL 35805 > > > > > > > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From beromuald at wanadoo.fr Wed May 28 10:08:32 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Wed, 28 May 2008 16:08:32 +0200 (CEST) Subject: [vtkusers] Creating a 3DImageData from slices Message-ID: <4016616.801371211983712726.JavaMail.www@wwinf1c19> Hi Amy, Thanks for your help, but I have already tried this loop, just after sending the email. And when I display the volume, it doesn't appear (just a black screen). Do you know why? Thanks for your help, Romu > Message du 28/05/08 15:44 > De : "Amy Squillacote" > A : "Romuald BERTRAND" > Copie ? : vtkusers at vtk.org > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > Hi Romu, > > Try replacing your "for" loop with the following. (You also won't need > "int importPort(0);".) > > for (int i = 0; i < lastOne; i++) > { > transfo3D->AddInput(img[i]); > } > > - Amy > > Romuald BERTRAND wrote: > > > > Hi, my code is : > > > > / vtkImageAppend* transfo3D = vtkImageAppend::New(); > > > > int inputPort(0); > > > > for( int i=0; i > > { > > transfo3D->SetInput(inputPort, img[i]); > > > > inputPort++; > > } > > > > transfo3D->SetAppendAxis(2); > > > > viewer->SetInputConnection(transfo3D->GetOutputPort()); > > viewer->SetSlice(lastOne); > > viewer->SetColorWindow(2000); > > viewer->SetColorLevel(1000); > > > > Refresh(); > > / > > I think there is a lot of errors, but I don't know how to use this class. > > > > Thanks for help > > > > Romu > > > > > > > > > > > > > Message du 27/05/08 16:36 > > > De : "Amy Squillacote" > > > A : "Romuald BERTRAND" > > > Copie ? : vtkusers at vtk.org > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > Hi Romu, > > > > > > Please post source code showing how you are trying to use > > > vtkImageAppend. In order for anyone on this list to help you > > track down > > > the problem, we need to see source code showing what you are doing. > > > > > > - Amy > > > > > > Romuald BERTRAND wrote: > > > > > > > > Hi Amy, thanks for your answer, > > > > > > > > But I have tried to make an algorithm with "vtkImageAppend", > > and I > > > > don't arrived. > > > > Someone know how can I use this class? > > > > I have severals 2D vtkImageData objects (the slices). > > > > > > > > Thanks a lot for answers. > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > > > Message du 22/05/08 17:10 > > > > > De : "Amy Squillacote" > > > > > A : "Romuald BERTRAND" > > > > > Copie ? : vtkusers at vtk.org > > > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > > > > > Hi Romu, > > > > > > > > > > Are the slices already loaded in VTK (i.e., multiple 2D > > > > vtkImageData > > > > > objects), or are you reading the slices from files? > > > > > > > > > > If they're already 2D vtkImageData objects, take a look at > > > > > vtkImageAppend > > > > > (http://www.vtk.org/doc/nightly/html/classvtkImageAppend.html). > > > > If you > > > > > have X-Y slices, then the "append axis" should be the Z axis. > > > > > > > > > > If you're reading the slices from files, subclasses of > > > > vtkImageReader2 > > > > > (http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html) > > > > will > > > > > handle this for you. You can pass in either a list of file names > > > > or a > > > > > file pattern to tell the reader how to get the data files. > > > > > > > > > > - Amy > > > > > > > > > > Romuald BERTRAND wrote: > > > > > > > > > > > > Hi all, > > > > > > > > > > > > Someone know how creating a 3DImageData from 2D slices? > > > > > > Thanks for answers, > > > > > > > > > > > > Romu > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > > > > _______________________________________________ > > > > > > This is the private VTK discussion list. > > > > > > Please keep messages on-topic. Check the FAQ at: > > > > http://www.vtk.org/Wiki/VTK_FAQ > > > > > > Follow this link to subscribe/unsubscribe: > > > > > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > > > > > > > > > > -- > > > > > Amy Squillacote Phone: (256) 726-4839 > > > > > Computer Scientist Fax: (256) 726-4806 > > > > > CFD Research Corporation Web: http://www.cfdrc.com > > > > > 215 Wynn Drive, Suite 501 > > > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Amy Squillacote Phone: (256) 726-4839 > > > Computer Scientist Fax: (256) 726-4806 > > > CFD Research Corporation Web: http://www.cfdrc.com > > > 215 Wynn Drive, Suite 501 > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > -- > Amy Squillacote Phone: (256) 726-4839 > Computer Scientist Fax: (256) 726-4806 > CFD Research Corporation Web: http://www.cfdrc.com > 215 Wynn Drive, Suite 501 > Huntsville, AL 35805 > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Wed May 28 10:17:16 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Wed, 28 May 2008 09:17:16 -0500 Subject: [vtkusers] Creating a 3DImageData from slices In-Reply-To: <4016616.801371211983712726.JavaMail.www@wwinf1c19> References: <4016616.801371211983712726.JavaMail.www@wwinf1c19> Message-ID: <483D696C.8050100@cfdrc.com> How are you displaying the volume? - Amy Romuald BERTRAND wrote: > > Hi Amy, > > Thanks for your help, but I have already tried this loop, just after > sending the email. And when I display the volume, it doesn't appear > (just a black screen). Do you know why? > > Thanks for your help, > > Romu > > > > > > > Message du 28/05/08 15:44 > > De : "Amy Squillacote" > > A : "Romuald BERTRAND" > > Copie ? : vtkusers at vtk.org > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > Hi Romu, > > > > Try replacing your "for" loop with the following. (You also > won't need > > "int importPort(0);".) > > > > for (int i = 0; i < lastOne; i++) > > { > > transfo3D->AddInput(img[i]); > > } > > > > - Amy > > > > Romuald BERTRAND wrote: > > > > > > Hi, my code is : > > > > > > / vtkImageAppend* transfo3D = vtkImageAppend::New(); > > > > > > int inputPort(0); > > > > > > for( int i=0; i > > > { > > > transfo3D->SetInput(inputPort, img[i]); > > > > > > inputPort++; > > > } > > > > > > transfo3D->SetAppendAxis(2); > > > > > > viewer->SetInputConnection(transfo3D->GetOutputPort()); > > > viewer->SetSlice(lastOne); > > > viewer->SetColorWindow(2000); > > > viewer->SetColorLevel(1000); > > > > > > Refresh(); > > > / > > > I think there is a lot of errors, but I don't know how to use > this class. > > > > > > Thanks for help > > > > > > Romu > > > > > > > > > > > > > > > > > > > Message du 27/05/08 16:36 > > > > De : "Amy Squillacote" > > > > A : "Romuald BERTRAND" > > > > Copie ? : vtkusers at vtk.org > > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > > > Hi Romu, > > > > > > > > Please post source code showing how you are trying to use > > > > vtkImageAppend. In order for anyone on this list to help you > > > track down > > > > the problem, we need to see source code showing what you are > doing. > > > > > > > > - Amy > > > > > > > > Romuald BERTRAND wrote: > > > > > > > > > > Hi Amy, thanks for your answer, > > > > > > > > > > But I have tried to make an algorithm with "vtkImageAppend", > > > and I > > > > > don't arrived. > > > > > Someone know how can I use this class? > > > > > I have severals 2D vtkImageData objects (the slices). > > > > > > > > > > Thanks a lot for answers. > > > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Message du 22/05/08 17:10 > > > > > > De : "Amy Squillacote" > > > > > > A : "Romuald BERTRAND" > > > > > > Copie ? : vtkusers at vtk.org > > > > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > > > > > > > Hi Romu, > > > > > > > > > > > > Are the slices already loaded in VTK (i.e., multiple 2D > > > > > vtkImageData > > > > > > objects), or are you reading the slices from files? > > > > > > > > > > > > If they're already 2D vtkImageData objects, take a look at > > > > > > vtkImageAppend > > > > > > > (http://www.vtk.org/doc/nightly/html/classvtkImageAppend.html). > > > > > If you > > > > > > have X-Y slices, then the "append axis" should be the Z > axis. > > > > > > > > > > > > If you're reading the slices from files, subclasses of > > > > > vtkImageReader2 > > > > > > > (http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html) > > > > > will > > > > > > handle this for you. You can pass in either a list of > file names > > > > > or a > > > > > > file pattern to tell the reader how to get the data files. > > > > > > > > > > > > - Amy > > > > > > > > > > > > Romuald BERTRAND wrote: > > > > > > > > > > > > > > Hi all, > > > > > > > > > > > > > > Someone know how creating a 3DImageData from 2D slices? > > > > > > > Thanks for answers, > > > > > > > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > > > > > > _______________________________________________ > > > > > > > This is the private VTK discussion list. > > > > > > > Please keep messages on-topic. Check the FAQ at: > > > > > http://www.vtk.org/Wiki/VTK_FAQ > > > > > > > Follow this link to subscribe/unsubscribe: > > > > > > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > > > > > > > > > > > > > -- > > > > > > Amy Squillacote Phone: (256) 726-4839 > > > > > > Computer Scientist Fax: (256) 726-4806 > > > > > > CFD Research Corporation Web: http://www.cfdrc.com > > > > > > 215 Wynn Drive, Suite 501 > > > > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Amy Squillacote Phone: (256) 726-4839 > > > > Computer Scientist Fax: (256) 726-4806 > > > > CFD Research Corporation Web: http://www.cfdrc.com > > > > 215 Wynn Drive, Suite 501 > > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > > > > > > > > -- > > Amy Squillacote Phone: (256) 726-4839 > > Computer Scientist Fax: (256) 726-4806 > > CFD Research Corporation Web: http://www.cfdrc.com > > 215 Wynn Drive, Suite 501 > > Huntsville, AL 35805 > > > > > > > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From beromuald at wanadoo.fr Wed May 28 10:21:06 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Wed, 28 May 2008 16:21:06 +0200 (CEST) Subject: [vtkusers] Creating a 3DImageData from slices Message-ID: <20761112.803011211984466235.JavaMail.www@wwinf1c19> I'm not very familiar with vtk, I have tried this : ??? viewer->SetInputConnection(transfo3D->GetOutputPort()); ??? viewer->SetSlice(lastOne); ??? viewer->SetColorWindow(2000); ??? viewer->SetColorLevel(1000); ??? ??? Refresh(); > Message du 28/05/08 16:15 > De : "Amy Squillacote" > A : "Romuald BERTRAND" > Copie ? : vtkusers at vtk.org > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > How are you displaying the volume? > - Amy > > Romuald BERTRAND wrote: > > > > Hi Amy, > > > > Thanks for your help, but I have already tried this loop, just after > > sending the email. And when I display the volume, it doesn't appear > > (just a black screen). Do you know why? > > > > Thanks for your help, > > > > Romu > > > > > > > > > > > > > Message du 28/05/08 15:44 > > > De : "Amy Squillacote" > > > A : "Romuald BERTRAND" > > > Copie ? : vtkusers at vtk.org > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > Hi Romu, > > > > > > Try replacing your "for" loop with the following. (You also > > won't need > > > "int importPort(0);".) > > > > > > for (int i = 0; i < lastOne; i++) > > > { > > > transfo3D->AddInput(img[i]); > > > } > > > > > > - Amy > > > > > > Romuald BERTRAND wrote: > > > > > > > > Hi, my code is : > > > > > > > > / vtkImageAppend* transfo3D = vtkImageAppend::New(); > > > > > > > > int inputPort(0); > > > > > > > > for( int i=0; i > > > > { > > > > transfo3D->SetInput(inputPort, img[i]); > > > > > > > > inputPort++; > > > > } > > > > > > > > transfo3D->SetAppendAxis(2); > > > > > > > > viewer->SetInputConnection(transfo3D->GetOutputPort()); > > > > viewer->SetSlice(lastOne); > > > > viewer->SetColorWindow(2000); > > > > viewer->SetColorLevel(1000); > > > > > > > > Refresh(); > > > > / > > > > I think there is a lot of errors, but I don't know how to use > > this class. > > > > > > > > Thanks for help > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > > > Message du 27/05/08 16:36 > > > > > De : "Amy Squillacote" > > > > > A : "Romuald BERTRAND" > > > > > Copie ? : vtkusers at vtk.org > > > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > > > > > Hi Romu, > > > > > > > > > > Please post source code showing how you are trying to use > > > > > vtkImageAppend. In order for anyone on this list to help you > > > > track down > > > > > the problem, we need to see source code showing what you are > > doing. > > > > > > > > > > - Amy > > > > > > > > > > Romuald BERTRAND wrote: > > > > > > > > > > > > Hi Amy, thanks for your answer, > > > > > > > > > > > > But I have tried to make an algorithm with "vtkImageAppend", > > > > and I > > > > > > don't arrived. > > > > > > Someone know how can I use this class? > > > > > > I have severals 2D vtkImageData objects (the slices). > > > > > > > > > > > > Thanks a lot for answers. > > > > > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Message du 22/05/08 17:10 > > > > > > > De : "Amy Squillacote" > > > > > > > A : "Romuald BERTRAND" > > > > > > > Copie ? : vtkusers at vtk.org > > > > > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > > > > > > > > > Hi Romu, > > > > > > > > > > > > > > Are the slices already loaded in VTK (i.e., multiple 2D > > > > > > vtkImageData > > > > > > > objects), or are you reading the slices from files? > > > > > > > > > > > > > > If they're already 2D vtkImageData objects, take a look at > > > > > > > vtkImageAppend > > > > > > > > > (http://www.vtk.org/doc/nightly/html/classvtkImageAppend.html). > > > > > > If you > > > > > > > have X-Y slices, then the "append axis" should be the Z > > axis. > > > > > > > > > > > > > > If you're reading the slices from files, subclasses of > > > > > > vtkImageReader2 > > > > > > > > > (http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html) > > > > > > will > > > > > > > handle this for you. You can pass in either a list of > > file names > > > > > > or a > > > > > > > file pattern to tell the reader how to get the data files. > > > > > > > > > > > > > > - Amy > > > > > > > > > > > > > > Romuald BERTRAND wrote: > > > > > > > > > > > > > > > > Hi all, > > > > > > > > > > > > > > > > Someone know how creating a 3DImageData from 2D slices? > > > > > > > > Thanks for answers, > > > > > > > > > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > This is the private VTK discussion list. > > > > > > > > Please keep messages on-topic. Check the FAQ at: > > > > > > http://www.vtk.org/Wiki/VTK_FAQ > > > > > > > > Follow this link to subscribe/unsubscribe: > > > > > > > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > Amy Squillacote Phone: (256) 726-4839 > > > > > > > Computer Scientist Fax: (256) 726-4806 > > > > > > > CFD Research Corporation Web: http://www.cfdrc.com > > > > > > > 215 Wynn Drive, Suite 501 > > > > > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Amy Squillacote Phone: (256) 726-4839 > > > > > Computer Scientist Fax: (256) 726-4806 > > > > > CFD Research Corporation Web: http://www.cfdrc.com > > > > > 215 Wynn Drive, Suite 501 > > > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Amy Squillacote Phone: (256) 726-4839 > > > Computer Scientist Fax: (256) 726-4806 > > > CFD Research Corporation Web: http://www.cfdrc.com > > > 215 Wynn Drive, Suite 501 > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > -- > Amy Squillacote Phone: (256) 726-4839 > Computer Scientist Fax: (256) 726-4806 > CFD Research Corporation Web: http://www.cfdrc.com > 215 Wynn Drive, Suite 501 > Huntsville, AL 35805 > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Wed May 28 10:31:10 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Wed, 28 May 2008 09:31:10 -0500 Subject: [vtkusers] Creating a 3DImageData from slices In-Reply-To: <20761112.803011211984466235.JavaMail.www@wwinf1c19> References: <20761112.803011211984466235.JavaMail.www@wwinf1c19> Message-ID: <483D6CAE.7030907@cfdrc.com> What is the scalar range of your data? The color window and level need to be set based on this range. You can get the scalar range as follows. transfo3D->Update(); double range[2]; transfo3D->GetOutput()->GetPointData()->GetScalars()->GetRange(range); Try setting the color window to "range[1] - range[0]". Set the color level to the middle of that range: "(range[0]+range[1])*0.5". - Amy Romuald BERTRAND wrote: > > I'm not very familiar with vtk, I have tried this : > > / viewer->SetInputConnection(transfo3D->GetOutputPort()); > viewer->SetSlice(lastOne); > viewer->SetColorWindow(2000); > viewer->SetColorLevel(1000); > > Refresh();/ > > > > > > > Message du 28/05/08 16:15 > > De : "Amy Squillacote" > > A : "Romuald BERTRAND" > > Copie ? : vtkusers at vtk.org > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > How are you displaying the volume? > > - Amy > > > > Romuald BERTRAND wrote: > > > > > > Hi Amy, > > > > > > Thanks for your help, but I have already tried this loop, just > after > > > sending the email. And when I display the volume, it doesn't > appear > > > (just a black screen). Do you know why? > > > > > > Thanks for your help, > > > > > > Romu > > > > > > > > > > > > > > > > > > > Message du 28/05/08 15:44 > > > > De : "Amy Squillacote" > > > > A : "Romuald BERTRAND" > > > > Copie ? : vtkusers at vtk.org > > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > > > Hi Romu, > > > > > > > > Try replacing your "for" loop with the following. (You also > > > won't need > > > > "int importPort(0);".) > > > > > > > > for (int i = 0; i < lastOne; i++) > > > > { > > > > transfo3D->AddInput(img[i]); > > > > } > > > > > > > > - Amy > > > > > > > > Romuald BERTRAND wrote: > > > > > > > > > > Hi, my code is : > > > > > > > > > > / vtkImageAppend* transfo3D = vtkImageAppend::New(); > > > > > > > > > > int inputPort(0); > > > > > > > > > > for( int i=0; i > > > > > { > > > > > transfo3D->SetInput(inputPort, img[i]); > > > > > > > > > > inputPort++; > > > > > } > > > > > > > > > > transfo3D->SetAppendAxis(2); > > > > > > > > > > viewer->SetInputConnection(transfo3D->GetOutputPort()); > > > > > viewer->SetSlice(lastOne); > > > > > viewer->SetColorWindow(2000); > > > > > viewer->SetColorLevel(1000); > > > > > > > > > > Refresh(); > > > > > / > > > > > I think there is a lot of errors, but I don't know how to use > > > this class. > > > > > > > > > > Thanks for help > > > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Message du 27/05/08 16:36 > > > > > > De : "Amy Squillacote" > > > > > > A : "Romuald BERTRAND" > > > > > > Copie ? : vtkusers at vtk.org > > > > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > > > > > > > Hi Romu, > > > > > > > > > > > > Please post source code showing how you are trying to use > > > > > > vtkImageAppend. In order for anyone on this list to help you > > > > > track down > > > > > > the problem, we need to see source code showing what you are > > > doing. > > > > > > > > > > > > - Amy > > > > > > > > > > > > Romuald BERTRAND wrote: > > > > > > > > > > > > > > Hi Amy, thanks for your answer, > > > > > > > > > > > > > > But I have tried to make an algorithm with > "vtkImageAppend", > > > > > and I > > > > > > > don't arrived. > > > > > > > Someone know how can I use this class? > > > > > > > I have severals 2D vtkImageData objects (the slices). > > > > > > > > > > > > > > Thanks a lot for answers. > > > > > > > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Message du 22/05/08 17:10 > > > > > > > > De : "Amy Squillacote" > > > > > > > > A : "Romuald BERTRAND" > > > > > > > > Copie ? : vtkusers at vtk.org > > > > > > > > Objet : Re: [vtkusers] Creating a 3DImageData from > slices > > > > > > > > > > > > > > > > Hi Romu, > > > > > > > > > > > > > > > > Are the slices already loaded in VTK (i.e., multiple 2D > > > > > > > vtkImageData > > > > > > > > objects), or are you reading the slices from files? > > > > > > > > > > > > > > > > If they're already 2D vtkImageData objects, take a > look at > > > > > > > > vtkImageAppend > > > > > > > > > > > (http://www.vtk.org/doc/nightly/html/classvtkImageAppend.html). > > > > > > > If you > > > > > > > > have X-Y slices, then the "append axis" should be the Z > > > axis. > > > > > > > > > > > > > > > > If you're reading the slices from files, subclasses of > > > > > > > vtkImageReader2 > > > > > > > > > > > (http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html) > > > > > > > will > > > > > > > > handle this for you. You can pass in either a list of > > > file names > > > > > > > or a > > > > > > > > file pattern to tell the reader how to get the data > files. > > > > > > > > > > > > > > > > - Amy > > > > > > > > > > > > > > > > Romuald BERTRAND wrote: > > > > > > > > > > > > > > > > > > Hi all, > > > > > > > > > > > > > > > > > > Someone know how creating a 3DImageData from 2D > slices? > > > > > > > > > Thanks for answers, > > > > > > > > > > > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > This is the private VTK discussion list. > > > > > > > > > Please keep messages on-topic. Check the FAQ at: > > > > > > > http://www.vtk.org/Wiki/VTK_FAQ > > > > > > > > > Follow this link to subscribe/unsubscribe: > > > > > > > > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > Amy Squillacote Phone: (256) 726-4839 > > > > > > > > Computer Scientist Fax: (256) 726-4806 > > > > > > > > CFD Research Corporation Web: http://www.cfdrc.com > > > > > > > > 215 Wynn Drive, Suite 501 > > > > > > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Amy Squillacote Phone: (256) 726-4839 > > > > > > Computer Scientist Fax: (256) 726-4806 > > > > > > CFD Research Corporation Web: http://www.cfdrc.com > > > > > > 215 Wynn Drive, Suite 501 > > > > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Amy Squillacote Phone: (256) 726-4839 > > > > Computer Scientist Fax: (256) 726-4806 > > > > CFD Research Corporation Web: http://www.cfdrc.com > > > > 215 Wynn Drive, Suite 501 > > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > > > > > > > > -- > > Amy Squillacote Phone: (256) 726-4839 > > Computer Scientist Fax: (256) 726-4806 > > CFD Research Corporation Web: http://www.cfdrc.com > > 215 Wynn Drive, Suite 501 > > Huntsville, AL 35805 > > > > > > > > > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From beromuald at wanadoo.fr Wed May 28 10:50:21 2008 From: beromuald at wanadoo.fr (Romuald BERTRAND) Date: Wed, 28 May 2008 16:50:21 +0200 (CEST) Subject: [vtkusers] Creating a 3DImageData from slices Message-ID: <12791027.2230761211986221419.JavaMail.www@wwinf2214> There is my code : ??? vtkImageAppend* transfo3D = vtkImageAppend::New(); ??? ??? transfo3D->SetAppendAxis(2); ??? ??? for( int i=0; iAddInput(img[i]); ??? } ??? ??? transfo3D->Update(); ??? double range[2]; ??? transfo3D->GetOutput()->GetPointData()->GetScalars()->GetRange(range); ???? ??? viewer->SetInputConnection(transfo3D->GetOutputPort()); ??? viewer->SetSlice(lastOne); ??? viewer->SetColorWindow(range[1] - range[0]); ??? viewer->SetColorLevel((range[0]+range[1])*0.5); ??? ??? Refresh(); //wxWidgets method It says the range is 0, 0, and when I want to see the dimension, x=0, y=0, z=0. I don't understand why, but there is no data. When I display "img" slice by slice, the images appears in the screen. > Message du 28/05/08 16:29 > De : "Amy Squillacote" > A : "Romuald BERTRAND" > Copie ? : vtkusers at vtk.org > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > What is the scalar range of your data? The color window and level need > to be set based on this range. You can get the scalar range as follows. > > transfo3D->Update(); > double range[2]; > transfo3D->GetOutput()->GetPointData()->GetScalars()->GetRange(range); > > Try setting the color window to "range[1] - range[0]". Set the color > level to the middle of that range: "(range[0]+range[1])*0.5". > > - Amy > > Romuald BERTRAND wrote: > > > > I'm not very familiar with vtk, I have tried this : > > > > / viewer->SetInputConnection(transfo3D->GetOutputPort()); > > viewer->SetSlice(lastOne); > > viewer->SetColorWindow(2000); > > viewer->SetColorLevel(1000); > > > > Refresh();/ > > > > > > > > > > > > > Message du 28/05/08 16:15 > > > De : "Amy Squillacote" > > > A : "Romuald BERTRAND" > > > Copie ? : vtkusers at vtk.org > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > How are you displaying the volume? > > > - Amy > > > > > > Romuald BERTRAND wrote: > > > > > > > > Hi Amy, > > > > > > > > Thanks for your help, but I have already tried this loop, just > > after > > > > sending the email. And when I display the volume, it doesn't > > appear > > > > (just a black screen). Do you know why? > > > > > > > > Thanks for your help, > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > > > Message du 28/05/08 15:44 > > > > > De : "Amy Squillacote" > > > > > A : "Romuald BERTRAND" > > > > > Copie ? : vtkusers at vtk.org > > > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > > > > > Hi Romu, > > > > > > > > > > Try replacing your "for" loop with the following. (You also > > > > won't need > > > > > "int importPort(0);".) > > > > > > > > > > for (int i = 0; i < lastOne; i++) > > > > > { > > > > > transfo3D->AddInput(img[i]); > > > > > } > > > > > > > > > > - Amy > > > > > > > > > > Romuald BERTRAND wrote: > > > > > > > > > > > > Hi, my code is : > > > > > > > > > > > > / vtkImageAppend* transfo3D = vtkImageAppend::New(); > > > > > > > > > > > > int inputPort(0); > > > > > > > > > > > > for( int i=0; i > > > > > > { > > > > > > transfo3D->SetInput(inputPort, img[i]); > > > > > > > > > > > > inputPort++; > > > > > > } > > > > > > > > > > > > transfo3D->SetAppendAxis(2); > > > > > > > > > > > > viewer->SetInputConnection(transfo3D->GetOutputPort()); > > > > > > viewer->SetSlice(lastOne); > > > > > > viewer->SetColorWindow(2000); > > > > > > viewer->SetColorLevel(1000); > > > > > > > > > > > > Refresh(); > > > > > > / > > > > > > I think there is a lot of errors, but I don't know how to use > > > > this class. > > > > > > > > > > > > Thanks for help > > > > > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Message du 27/05/08 16:36 > > > > > > > De : "Amy Squillacote" > > > > > > > A : "Romuald BERTRAND" > > > > > > > Copie ? : vtkusers at vtk.org > > > > > > > Objet : Re: [vtkusers] Creating a 3DImageData from slices > > > > > > > > > > > > > > Hi Romu, > > > > > > > > > > > > > > Please post source code showing how you are trying to use > > > > > > > vtkImageAppend. In order for anyone on this list to help you > > > > > > track down > > > > > > > the problem, we need to see source code showing what you are > > > > doing. > > > > > > > > > > > > > > - Amy > > > > > > > > > > > > > > Romuald BERTRAND wrote: > > > > > > > > > > > > > > > > Hi Amy, thanks for your answer, > > > > > > > > > > > > > > > > But I have tried to make an algorithm with > > "vtkImageAppend", > > > > > > and I > > > > > > > > don't arrived. > > > > > > > > Someone know how can I use this class? > > > > > > > > I have severals 2D vtkImageData objects (the slices). > > > > > > > > > > > > > > > > Thanks a lot for answers. > > > > > > > > > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Message du 22/05/08 17:10 > > > > > > > > > De : "Amy Squillacote" > > > > > > > > > A : "Romuald BERTRAND" > > > > > > > > > Copie ? : vtkusers at vtk.org > > > > > > > > > Objet : Re: [vtkusers] Creating a 3DImageData from > > slices > > > > > > > > > > > > > > > > > > Hi Romu, > > > > > > > > > > > > > > > > > > Are the slices already loaded in VTK (i.e., multiple 2D > > > > > > > > vtkImageData > > > > > > > > > objects), or are you reading the slices from files? > > > > > > > > > > > > > > > > > > If they're already 2D vtkImageData objects, take a > > look at > > > > > > > > > vtkImageAppend > > > > > > > > > > > > > (http://www.vtk.org/doc/nightly/html/classvtkImageAppend.html). > > > > > > > > If you > > > > > > > > > have X-Y slices, then the "append axis" should be the Z > > > > axis. > > > > > > > > > > > > > > > > > > If you're reading the slices from files, subclasses of > > > > > > > > vtkImageReader2 > > > > > > > > > > > > > (http://www.vtk.org/doc/nightly/html/classvtkImageReader2.html) > > > > > > > > will > > > > > > > > > handle this for you. You can pass in either a list of > > > > file names > > > > > > > > or a > > > > > > > > > file pattern to tell the reader how to get the data > > files. > > > > > > > > > > > > > > > > > > - Amy > > > > > > > > > > > > > > > > > > Romuald BERTRAND wrote: > > > > > > > > > > > > > > > > > > > > Hi all, > > > > > > > > > > > > > > > > > > > > Someone know how creating a 3DImageData from 2D > > slices? > > > > > > > > > > Thanks for answers, > > > > > > > > > > > > > > > > > > > > Romu > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > This is the private VTK discussion list. > > > > > > > > > > Please keep messages on-topic. Check the FAQ at: > > > > > > > > http://www.vtk.org/Wiki/VTK_FAQ > > > > > > > > > > Follow this link to subscribe/unsubscribe: > > > > > > > > > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > Amy Squillacote Phone: (256) 726-4839 > > > > > > > > > Computer Scientist Fax: (256) 726-4806 > > > > > > > > > CFD Research Corporation Web: http://www.cfdrc.com > > > > > > > > > 215 Wynn Drive, Suite 501 > > > > > > > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > Amy Squillacote Phone: (256) 726-4839 > > > > > > > Computer Scientist Fax: (256) 726-4806 > > > > > > > CFD Research Corporation Web: http://www.cfdrc.com > > > > > > > 215 Wynn Drive, Suite 501 > > > > > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Amy Squillacote Phone: (256) 726-4839 > > > > > Computer Scientist Fax: (256) 726-4806 > > > > > CFD Research Corporation Web: http://www.cfdrc.com > > > > > 215 Wynn Drive, Suite 501 > > > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Amy Squillacote Phone: (256) 726-4839 > > > Computer Scientist Fax: (256) 726-4806 > > > CFD Research Corporation Web: http://www.cfdrc.com > > > 215 Wynn Drive, Suite 501 > > > Huntsville, AL 35805 > > > > > > > > > > > > > > > > -- > Amy Squillacote Phone: (256) 726-4839 > Computer Scientist Fax: (256) 726-4806 > CFD Research Corporation Web: http://www.cfdrc.com > 215 Wynn Drive, Suite 501 > Huntsville, AL 35805 > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Remik.Ziemlinski at noaa.gov Wed May 28 14:01:16 2008 From: Remik.Ziemlinski at noaa.gov (Remik.Ziemlinski) Date: Wed, 28 May 2008 14:01:16 -0400 Subject: [vtkusers] Updated Release of Imporvtk plugin for Maya Message-ID: <483D9DEC.1080908@noaa.gov> FYI I updated the Maya plugin to allow direct import of live VTK Python objects via Python or MEL. The old option of importing VTK files is still supported, too. Check it out at: http://importvtk.sourceforge.net/ Enjoy, Remik From rpnabar at gmail.com Wed May 28 15:29:17 2008 From: rpnabar at gmail.com (Rahul Nabar) Date: Wed, 28 May 2008 14:29:17 -0500 Subject: [vtkusers] installing vtk on RHEL; fails to find Python.h In-Reply-To: <483D60E6.90605@cfdrc.com> References: <483D60E6.90605@cfdrc.com> Message-ID: On Wed, May 28, 2008 at 8:40 AM, Amy Squillacote wrote: > Is Python.h in your /usr/local/lib/python2.4 directory? If not, set > PYTHON_INCLUDE_PATH to the directory containing this file. Also, > PYTHON_LIBRARY should be set to the full path to the python library, > including the library name (probably something ending in .a or .so). Hi Amy, Thanks for those tips. I set the PYTHON_INCLUDE_PATH and also the TCL and TK paths and now the cmake was perfect. No errors. The compilation proceeded 98% and then I had a new error. I**************************************************************************************** [ 98%] Building CXX object Wrapping/Python/CMakeFiles/vtkpython.dir/vtkPythonAppInit.o Linking CXX executable ../../bin/vtkpython CMakeFiles/vtkpython.dir/vtkPythonAppInit.o: In function `vtkPythonAppInitPrependPythonPath(char const*)': vtkPythonAppInit.cxx:(.text+0x366): undefined reference to `PySys_GetObject' vtkPythonAppInit.cxx:(.text+0x3a3): undefined reference to `PyString_FromString' vtkPythonAppInit.cxx:(.text+0x3c0): undefined reference to `PyList_Insert' CMakeFiles/vtkpython.dir/vtkPythonAppInit.o: In function `main': vtkPythonAppInit.cxx:(.text+0x814): undefined reference to `Py_SetProgramName' vtkPythonAppInit.cxx:(.text+0x819): undefined reference to `Py_Initialize' vtkPythonAppInit.cxx:(.text+0x849): undefined reference to `PySys_GetObject' vtkPythonAppInit.cxx:(.text+0x857): undefined reference to `PyString_AsString' vtkPythonAppInit.cxx:(.text+0x933): undefined reference to `Py_Main' collect2: ld returned 1 exit status make[2]: *** [bin/vtkpython] Error 1 make[1]: *** [Wrapping/Python/CMakeFiles/vtkpython.dir/all] Error 2 make: *** [all] Error 2 **************************************************************************************** I am not sure where I should point my PYTHON_LIBRARY to. I was pointing to /CMake/libcmVTK_WRAP_PYTHON2.so Is that the right place? Maybe you can tell me a filename that resides in PYTHON_LIBRARY so that I can run a 'locate filename.so' and find my correct path. -- Rahul From ahs at cfdrc.com Wed May 28 15:41:09 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Wed, 28 May 2008 14:41:09 -0500 Subject: [vtkusers] installing vtk on RHEL; fails to find Python.h In-Reply-To: References: <483D60E6.90605@cfdrc.com> Message-ID: <483DB555.7050101@cfdrc.com> Rahul Nabar wrote: > On Wed, May 28, 2008 at 8:40 AM, Amy Squillacote wrote: > > >> Is Python.h in your /usr/local/lib/python2.4 directory? If not, set >> PYTHON_INCLUDE_PATH to the directory containing this file. Also, >> PYTHON_LIBRARY should be set to the full path to the python library, >> including the library name (probably something ending in .a or .so). >> > > Hi Amy, > > Thanks for those tips. I set the PYTHON_INCLUDE_PATH and also the TCL > and TK paths and now the cmake was perfect. No errors. The compilation > proceeded 98% and then I had a new error. > > I**************************************************************************************** > [ 98%] Building CXX object > Wrapping/Python/CMakeFiles/vtkpython.dir/vtkPythonAppInit.o > Linking CXX executable ../../bin/vtkpython > CMakeFiles/vtkpython.dir/vtkPythonAppInit.o: In function > `vtkPythonAppInitPrependPythonPath(char const*)': > vtkPythonAppInit.cxx:(.text+0x366): undefined reference to `PySys_GetObject' > vtkPythonAppInit.cxx:(.text+0x3a3): undefined reference to `PyString_FromString' > vtkPythonAppInit.cxx:(.text+0x3c0): undefined reference to `PyList_Insert' > CMakeFiles/vtkpython.dir/vtkPythonAppInit.o: In function `main': > vtkPythonAppInit.cxx:(.text+0x814): undefined reference to `Py_SetProgramName' > vtkPythonAppInit.cxx:(.text+0x819): undefined reference to `Py_Initialize' > vtkPythonAppInit.cxx:(.text+0x849): undefined reference to `PySys_GetObject' > vtkPythonAppInit.cxx:(.text+0x857): undefined reference to `PyString_AsString' > vtkPythonAppInit.cxx:(.text+0x933): undefined reference to `Py_Main' > collect2: ld returned 1 exit status > make[2]: *** [bin/vtkpython] Error 1 > make[1]: *** [Wrapping/Python/CMakeFiles/vtkpython.dir/all] Error 2 > make: *** [all] Error 2 > > **************************************************************************************** > > I am not sure where I should point my PYTHON_LIBRARY to. I was > pointing to /CMake/libcmVTK_WRAP_PYTHON2.so Is that the right place? > > Maybe you can tell me a filename that resides in PYTHON_LIBRARY so > that I can run a 'locate filename.so' and find my correct path. > > For the VTK build on my linux box, PYTHON_LIBRARY is set to /usr/lib64/python2.3/config/libpython2.3.a. Since you're using Python 2.4, I'd expect the library name to be something like libpython2.4.a. (The library you were pointing to is a CMake library for wrapping C/C++ code into Python, so it is not the correct value for PYTHON_LIBRARY.) - Amy -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From rpnabar at gmail.com Wed May 28 16:04:58 2008 From: rpnabar at gmail.com (Rahul Nabar) Date: Wed, 28 May 2008 15:04:58 -0500 Subject: [vtkusers] installing vtk on RHEL; fails to find Python.h In-Reply-To: <483DB555.7050101@cfdrc.com> References: <483D60E6.90605@cfdrc.com> <483DB555.7050101@cfdrc.com> Message-ID: On Wed, May 28, 2008 at 2:41 PM, Amy Squillacote wrote: > For the VTK build on my linux box, PYTHON_LIBRARY is set to > /usr/lib64/python2.3/config/libpython2.3.a. Since you're using Python 2.4, > I'd expect the library name to be something like libpython2.4.a. (The > library you were pointing to is a CMake library for wrapping C/C++ code into > Python, so it is not the correct value for PYTHON_LIBRARY.) Thanks again Amy. I found the file and now have a successful install (almost). After the make I could not make install. (make: *** No rule to make target `install'. Stop.) I had set the variable CMAKE_INSTALL_PREFIX to the directory /usr/local/vtk in the hope that the binaries etc. would reside there after the install. Unfortunately that dir remains empty. I do find that I can run vtk by pointing to ./bin/vtk from my install-source dir. Can I just copy this file to my desired location. Or is there a preferred way out. Why is there no install target? I'm confused! Thanks for all your help so far! -- Rahul From bollig at scs.fsu.edu Wed May 28 17:36:28 2008 From: bollig at scs.fsu.edu (Evan Bollig) Date: Wed, 28 May 2008 17:36:28 -0400 Subject: [vtkusers] stereo movie rendering In-Reply-To: <1e93c9c0805211437k179398b0x6edf4bd99f4612ec@mail.gmail.com> References: <1e93c9c0805211437k179398b0x6edf4bd99f4612ec@mail.gmail.com> Message-ID: <1e93c9c0805281436r26dab723o24f2bc4e4cc40908@mail.gmail.com> Hey guys, is it possible to render stereo side-by-side movies with VTK? If so, how would I do that? Do applications like ParaView have flags/command line args to support this? -Evan -- -Evan Bollig bollig at gmail.com bollig at scs.fsu.edu -- -Evan Bollig bollig at gmail.com bollig at scs.fsu.edu From rpnabar at gmail.com Wed May 28 21:54:50 2008 From: rpnabar at gmail.com (Rahul Nabar) Date: Wed, 28 May 2008 20:54:50 -0500 Subject: [vtkusers] installing vtk on RHEL; fails to find Python.h In-Reply-To: References: <483D60E6.90605@cfdrc.com> <483DB555.7050101@cfdrc.com> Message-ID: On Wed, May 28, 2008 at 3:04 PM, Rahul Nabar wrote: > > Thanks again Amy. I found the file and now have a successful install > (almost). After the make I could not make install. (make: *** No rule > to make target `install'. Stop.) > > I had set the variable CMAKE_INSTALL_PREFIX to the directory > /usr/local/vtk in the hope that the binaries etc. would reside > there after the install. Unfortunately that dir remains empty. > > I do find that I can run vtk by pointing to ./bin/vtk from my > install-source dir. Can I just copy this file to my desired location. > Or is there a preferred way out. Why is there no install target? I'm > confused! Finally I got it working. The make install target is not made if the VTK_USE_RPATH is set to ON. -- Rahul From rpnabar at gmail.com Wed May 28 22:12:16 2008 From: rpnabar at gmail.com (Rahul Nabar) Date: Wed, 28 May 2008 21:12:16 -0500 Subject: [vtkusers] vtk import fails from python Message-ID: I have vtk working now but from python 'import vtk' still fails. Question: The README.txt within VTK/Wrappings/Python says I must set the LD_LIBRARY_PATH and PYTHONPATH. Is that before compilation or before using it? Will the setup.py in the Python directory automatically be run by make install or do I have to run it manually? Any other tips about getting python and vtk working together? Or perhaps a set of instructions somewhere? Thanks! -- Rahul From foramuyou at gmail.com Wed May 28 22:35:04 2008 From: foramuyou at gmail.com (Jefferson Thomas) Date: Thu, 29 May 2008 11:35:04 +0900 Subject: [vtkusers] Compiling VTK with FFMPEG Message-ID: Hi, How to compile VTK with FFMPEG ? I would like to use the vtkFFMPEGWriter so I have to compile FFMPEG. I can get it i.e. from page http://www.vtk.org/get-software.php and compile it, but than, how to tell VTK to use it ? There is no VTK_USE_FFMPEG -like thing in VTK ccmake. What variable should I set up ? It is not explained on that page nor in any other place. Thomas From dave.demarle at kitware.com Wed May 28 22:41:33 2008 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 28 May 2008 22:41:33 -0400 Subject: [vtkusers] Compiling VTK with FFMPEG In-Reply-To: References: Message-ID: VTK_USE_FFMPEG_ENCODER is on the advanced page for VTK. On Wed, May 28, 2008 at 10:35 PM, Jefferson Thomas wrote: > Hi, > How to compile VTK with FFMPEG ? I would like to use the > vtkFFMPEGWriter so I have to compile FFMPEG. > I can get it i.e. from page http://www.vtk.org/get-software.php and > compile it, but than, how to tell VTK to use it ? > There is no VTK_USE_FFMPEG -like thing in VTK ccmake. What variable > should I set up ? > It is not explained on that page nor in any other place. > Thomas > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > From kalpana0611 at gmail.com Thu May 29 00:05:59 2008 From: kalpana0611 at gmail.com (Cally K) Date: Thu, 29 May 2008 12:05:59 +0800 Subject: [vtkusers] Problem with compiling and linking static libraries In-Reply-To: <483D612E.3060405@cfdrc.com> References: <483D612E.3060405@cfdrc.com> Message-ID: this is the error vtkVolumeProperty.cxx:(.text+0x1a81): undefined reference to `vtkColorTransferFunction::New()' vtkVolumeProperty.cxx:(.text+0x1afb): undefined reference to `vtkColorTransferFunction::AddRGBPoint(double, double, double, double)' vtkVolumeProperty.cxx:(.text+0x1b29): undefined reference to `vtkColorTransferFunction::AddRGBPoint(double, double, double, double)' and so much more... all about undefined reference, and when I try using the libraries in VTKbuild/bin linked them this way -- g++ -o Cone Cone.o -I/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/include/vtk-5.0 -L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib -lGL -lGLU -L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkCommon.a -L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkFiltering.a -L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkGraphics.a -L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkIO.a -L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkRendering.a -L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkVolumeRendering.a -L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkGenericFiltering.a -L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkHybrid.a -L/home/kalpanak/Installation_Files/VTKProject/VTKbuild/bin/libvtkImaging.a I get this error Cone.o: In function `main': Cone.cxx:(.text+0x87): undefined reference to `vtkConeSource::New()' Cone.cxx:(.text+0xe3): undefined reference to `vtkPolyDataMapper::New()' Cone.cxx:(.text+0x10e): undefined reference to `vtkActor::New()' Cone.cxx:(.text+0x131): undefined reference to `vtkRenderer::New()' Cone.cxx:(.text+0x146): undefined reference to `vtkRenderer::AddActor(vtkProp*)' Cone.cxx:(.text+0x17b): undefined reference to `vtkRenderWindow::New()' Cone.cxx:(.text+0x1e5): undefined reference to `vtkRenderer::GetActiveCamera()' Cone.cxx:(.text+0x1f3): undefined reference to `vtkCamera::Azimuth(double)' Cone.o: In function `vtkAlgorithm::GetOutputPort()': Cone.cxx:(.gnu.linkonce.t._ZN12vtkAlgorithm13GetOutputPortEv+0x15): undefined reference to `vtkAlgorithm::GetOutputPort(int)' collect2: ld returned 1 exit status On 5/28/08, Amy Squillacote wrote: > > What is the error message you are getting? > > - Amy > > Cally K wrote: > >> Hi everyone, >> >> I tried searching the mailing list and I found out ways to compile and >> link vtk examples ( Cone.cxx ) . I managed to do it when VTK was built >> using the shared library option >> >> But I need to run VTK on the cluster, parallel VTK. and I need to >> build static libraries as I am not root, I compiled it, but it is the >> linking that is giving problem, >> >> this is my command to compile >> a) g++ -c >> -I/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/include/vtk-5.0 >> Cone.cxx -Wno-deprecated >> >> to link >> b) g++ -o Cone Cone.o >> >> -I/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/include/vtk-5.0 >> -L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib >> >> /home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkFiltering.a >> >> /home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkCommon.a >> >> L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkGraphics.a >> >> L/home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib/libvtkIO.a >> >> >> my lib folder is in >> /home/kalpanak/Installation_Files/VTKProject/VTKbuildprefix/lib, and I >> can see all the libvtkFiltering. a libvtkCommon.a all >> >> what am I doing wrong, please help... >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> >> >> >> > > -- > Amy Squillacote Phone: (256) 726-4839 > Computer Scientist Fax: (256) 726-4806 > CFD Research Corporation Web: http://www.cfdrc.com > 215 Wynn Drive, Suite 501 > Huntsville, AL 35805 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From foramuyou at gmail.com Thu May 29 05:21:09 2008 From: foramuyou at gmail.com (Jefferson Thomas) Date: Thu, 29 May 2008 18:21:09 +0900 Subject: [vtkusers] Compiling VTK with FFMPEG In-Reply-To: References: Message-ID: I dont have it. Only VTK_USE_MPEG2_ENCODER. Advanced mode (t) is turned on. I have version 5.0.3. Is support for FFMPEG included in this version ? Thomas 2008/5/29 David E DeMarle : > VTK_USE_FFMPEG_ENCODER is on the advanced page for VTK. > > On Wed, May 28, 2008 at 10:35 PM, Jefferson Thomas wrote: >> Hi, >> How to compile VTK with FFMPEG ? I would like to use the >> vtkFFMPEGWriter so I have to compile FFMPEG. >> I can get it i.e. from page http://www.vtk.org/get-software.php and >> compile it, but than, how to tell VTK to use it ? >> There is no VTK_USE_FFMPEG -like thing in VTK ccmake. What variable >> should I set up ? >> It is not explained on that page nor in any other place. >> Thomas >> _______________________________________________ >> This is the private VTK discussion list. >> Please keep messages on-topic. Check the 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 29 08:39:53 2008 From: emonson at cs.duke.edu (Eric E. Monson) Date: Thu, 29 May 2008 08:39:53 -0400 Subject: [vtkusers] vtk import fails from python In-Reply-To: References: Message-ID: <0BBA3F66-C9B7-4529-B443-DB6BF17E78AF@cs.duke.edu> Hey Rahul, The LD_LIBRARY_PATH and PYTHONPATH would need to be set before you use VTK in Python. The setup.py should be run automatically when you run 'make install' for the VTK build if you are using something UNIXy. Can you import vtk from within the vtkpython that is built along with VTK? What platform are you using (so someone with specific experience might be able to chime in). -Eric ------------------------------------------------------ Eric E Monson Duke Visualization Technology Group On May 28, 2008, at 10:12 PM, Rahul Nabar wrote: > I have vtk working now but from python 'import vtk' still fails. > > Question: The README.txt within VTK/Wrappings/Python says I must set > the LD_LIBRARY_PATH and PYTHONPATH. Is that before compilation or > before using it? > > Will the setup.py in the Python directory automatically be run by make > install or do I have to run it manually? Any other tips about getting > python and vtk working together? Or perhaps a set of instructions > somewhere? > > Thanks! > > > -- > Rahul > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers From kmorel at sandia.gov Thu May 29 10:49:15 2008 From: kmorel at sandia.gov (Moreland, Kenneth) Date: Thu, 29 May 2008 08:49:15 -0600 Subject: [vtkusers] Problemas con vtkExtractVOI In-Reply-To: <61886.85.53.196.51.1211844036.squirrel@cartero.unex.es> References: <61886.85.53.196.51.1211844036.squirrel@cartero.unex.es> Message-ID: <0BA5ECE2D409814B9A324DDEDA2C29FC1FD11E4BF2@ES04SNLNT.srn.sandia.gov> My Spanish is bad, but I think you said the SetInput line is failing. I believe the fix is: extract->SetInput(v16->GetOutput()); -Ken > -----Original Message----- > From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf > Of mmavila at unex.es > Sent: Monday, May 26, 2008 5:21 PM > To: vtkusers at vtk.org > Subject: [vtkusers] Problemas con vtkExtractVOI > > A ver si alguien me puede ayudar. Yo intento seleccionar una regi?n de > inter?s de una imagen pero me falla este c?digo: (Estoy utilizando vtk > 4.0) > > vtkExtractVOI *extract = vtkExtractVOI::New(); > extract->SetVOI (31, 31, 0, 63, 0, 92); > extract->SetSampleRate (1, 1, 1); > extract->SetInput(v16->GetOutput); ///// Aqu? falla, es como si el > m?todo SetInput no existiese > extract->ReleaseDataFlagOff(); > extract->Update(); > > Alguien me podr?a explicar el porqu?. > > Muchas gracias. > > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the 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 29 11:03:05 2008 From: clinton at elemtech.com (clinton at elemtech.com) Date: Thu, 29 May 2008 09:03:05 -0600 Subject: [vtkusers] self intersecting polygons Message-ID: <200805290903.05300.clinton@elemtech.com> Does VTK have a way to break up self intersecting polygons into multiple polygons as can be done with GLU? For example, I'd like to convert a bow-tie into 2 triangles. Thanks, Clint From mcoursolle at rogue-research.com Thu May 29 11:35:04 2008 From: mcoursolle at rogue-research.com (Mathieu Coursolle) Date: Thu, 29 May 2008 11:35:04 -0400 Subject: [vtkusers] Opening .stp file format with VTK Message-ID: <67955B08-87DC-4033-A7AA-756B3BC6D683@rogue-research.com> Hi VTK users, I have .stp files which represent 3D objects I would like to display using VTK. Is there a way to open those files using VTK, or does anybody knows a tool to convert them into a VTK supported file format? Thanks! Mathieu From rpnabar at gmail.com Thu May 29 12:57:18 2008 From: rpnabar at gmail.com (Rahul Nabar) Date: Thu, 29 May 2008 11:57:18 -0500 Subject: [vtkusers] vtk import fails from python In-Reply-To: <0BBA3F66-C9B7-4529-B443-DB6BF17E78AF@cs.duke.edu> References: <0BBA3F66-C9B7-4529-B443-DB6BF17E78AF@cs.duke.edu> Message-ID: On Thu, May 29, 2008 at 7:39 AM, Eric E. Monson wrote: > The LD_LIBRARY_PATH and PYTHONPATH would need to be set before you use VTK > in Python. The setup.py should be run automatically when you run 'make > install' for the VTK build if you are using something UNIXy. Thanks for your suggestions Eric. I've made some progress now: import vtk works. But I still cannot import some objects eg. vtkTkRenderWidget. I think this might be because I don't have tkinter installed? > Can you import vtk from within the vtkpython that is built along with VTK? Yes. And I can import vtkTkRenderWidget too. I just cannot import it if I use simply python. > What platform are you using (so someone with specific experience might be > able to chime in). I'm on RHEL. I have both Python 2.4.3 (RHEL yum comes with the older version) and Python 2.4.4 on my system. -- Rahul From nileshup at yahoo.com Thu May 29 15:13:02 2008 From: nileshup at yahoo.com (Nilesh Powar) Date: Thu, 29 May 2008 12:13:02 -0700 (PDT) Subject: [vtkusers] MFC and VTK using VTKDlg Message-ID: <548044.27347.qm@web54502.mail.re2.yahoo.com> Hello, I am trying to compile and run the vtkDlg example in the "C:\VTK504\Examples\GUI\Win32\vtkMFC\vtkDLG" . The example compiles fine, but it gives me a linker error as below. vtkDLG error LNK2019: unresolved external symbol "public: __thiscall vtkMFCWindow::vtkMFCWindow(class CWnd *)" (??0vtkMFCWindow@@QAE at PAVCWnd@@@Z) referenced in function "protected: virtual int __thiscall CvtkDLGDlg::OnInitDialog(void)" (?OnInitDialog at CvtkDLGDlg@@MAEHXZ) Does anybody has any thoughts on how to link it properly??? I defiinitely appreciate the help and the time. Thanks, Nilesh. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpnabar at gmail.com Thu May 29 16:41:20 2008 From: rpnabar at gmail.com (Rahul Nabar) Date: Thu, 29 May 2008 15:41:20 -0500 Subject: [vtkusers] vtk installation ends up with a bloated PYTHONPATH Message-ID: I finally got my vtk working via python. But along the way I kept having to add different entries to my path. So much so, that now I have a very bloated PYTHONPATH. /src/VTK/Wrapping/Python /usr/local/vtk/lib /usr/local/vtk/lib/python2.4/site-packages/vtk /usr/local/lib/python2.4/site-packages/ASE/Visualization/VTK/ *This one is for my application code that uses vtk* /src/VTK/Wrapping/Python/vtk/tk/ In addition my LD_LIBRARY_PATH has: /usr/local/vtk/lib Is there any way to shorten these paths? I had specified /usr/local/vtk as the root of the installation. Or are all these seperate entries always essential in your path to have vtk running (I use the vtk-tk modules too). I suspect I've something redundant in there. I must say that installing vtk was one of the most difficult packages I have come across! Is it always so tricky?! -Rahul From briand at aracnet.com Thu May 29 23:57:12 2008 From: briand at aracnet.com (brian) Date: Thu, 29 May 2008 20:57:12 -0700 Subject: [vtkusers] best way to represent a (planar) irregular polygon ? Message-ID: <96088413-F2DF-4EF0-B180-0B80FD19A692@aracnet.com> Hi all, I'm trying to represent a polygon which is cartesian-grid based (all of the points lie in the same plane), i.e. the entire polygon can be separated into rectangles. Using paraview I tried the most obvious representation, i.e. simply set up the boundary points, connected them all and then formed a single cell. Paraview didn't seem to like that very much, it attempted to draw lines between unconnected points when shading was turned on (although wireframe looked OK). It doesn't seem to like "inside" corners - does that make sense ? Are there any gotchas in trying to represent a polygon in this manner ? Assuming that I do need to represent my structure differently, I could "scan convert" the polygon into it' component rectangles, but there are couple of choices (using an XML file representation): Simply create the polygon as PolyData with each piece composed of a rectangle. Use an unstructured grid with each piece represented by a vtk_pikel cell. Does either method have a particular advantage ? Is there a better way ? Which of the VTK books, the user guide or the textbook would be better at answering this sort of question ? Obviously all the questions mark me as a VTK beginner, all help appreciated. Thanks Brian From ivan.gm.itk at gmail.com Fri May 30 05:22:46 2008 From: ivan.gm.itk at gmail.com (ivan gm) Date: Fri, 30 May 2008 11:22:46 +0200 Subject: [vtkusers] No vector data defined Message-ID: Hello: I know there are lots of people who has the same problem as me but, for my readings, nobody could solve it. I receive the following vtk error: ERROR: In .\vtkStreamer.cxx, line 488 vtkStreamLine (0D92B060): No vector data defined! This is my code: this->pvtkLine->SetInput(this->temp3d); this->pvtkLine->SetSource(this->pvtkSeeds); this->pvtkLine->SetMaximumPropagationTime(100); this->pvtkLine->SetIntegrationStepLength(.2); this->pvtkLine->SetStepLength(.001); this->pvtkLine->SetNumberOfThreads(1); this->pvtkLine->SetIntegrationDirectionToForward(); this->pvtkLine->VorticityOn(); this->pvtkLine->Update(); this->DistanceMapper->SetInputConnection(this->pvtkLine->GetOutputPort()); double tmp[2]; this->temp3d->GetScalarRange(tmp); this->DistanceMapper->SetScalarRange(tmp[0], tmp[1]); this->DistanceMapper->ImmediateModeRenderingOn(); this->DistanceMapper->Update(); this->DistanceActor->SetMapper(this->DistanceMapper); this->DistanceActor->VisibilityOff(); this->BoneMapper->SetInput(this->temp3d); this->BoneMapper->ImmediateModeRenderingOn(); this->BoneMapper->Update(); this->BoneActor->SetMapper(this->BoneMapper); this->BoneActor->GetProperty()->SetColor(1.0, 1.0, 0.0); this->BoneActor->GetProperty()->SetDiffuse(0.0); this->BoneActor->GetProperty()->SetSpecular(1.0); this->BoneActor->GetProperty()->SetSpecularPower(5); I could read that a possible solution is to add the vtkAssignAttribute so I did it like this: vtkAssignAttribute *aa = vtkAssignAttribute::New(); aa->Assign( vtkDataSetAttributes::SCALARS, vtkDataSetAttributes::VECTORS, vtkAssignAttribute::POINT_DATA ); aa->SetInput( this->temp3d ); aa->Update(); this->pvtkLine->SetInputConnection(aa->GetOutputPort()); // this->pvtkLine->SetInput(this->temp3d); this->pvtkLine->SetSource(this->pvtkSeeds); this->pvtkLine->SetMaximumPropagationTime(100); this->pvtkLine->SetIntegrationStepLength(.2); this->pvtkLine->SetStepLength(.001); this->pvtkLine->SetNumberOfThreads(1); this->pvtkLine->SetIntegrationDirectionToForward(); this->pvtkLine->VorticityOn(); this->pvtkLine->Update(); ................ But now I have another error: Warning: In .\vtkDataSetAttributes.cxx, line 945 vtkPointData (0D9F6D00): Can not set attribute Vectors. Incorrect number of components. ERROR: In .\vtkStreamer.cxx, line 488 vtkStreamLine (0D92B060): No vector data defined! I can't understand what the problem, could anybody helps me!!?? Thanks a lot. I need to solve it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahs at cfdrc.com Fri May 30 09:07:01 2008 From: ahs at cfdrc.com (Amy Squillacote) Date: Fri, 30 May 2008 08:07:01 -0500 Subject: [vtkusers] No vector data defined In-Reply-To: References: Message-ID: <483FFBF5.2060104@cfdrc.com> Hi Ivan, VTK is trying to tell you that it can't find a 3-component point-based array (point-based vectors) to use in computing streamlines. Does your input data set (this->temp3d) have such an array? If it does, then you can use the assign attribute filter to tell VTK that your 3-component array should be treated as vectors, but the warning message from vtkDataSetAttributes indicates, there will be problems if you try to use a single-component array as vectors because vectors are assumed to have three components. - Amy ivan gm wrote: > Hello: > > I know there are lots of people who has the same problem as me but, > for my readings, nobody could solve it. > I receive the following vtk error: > > ERROR: In .\vtkStreamer.cxx, line 488 > vtkStreamLine (0D92B060): No vector data defined! > > This is my code: > > this->pvtkLine->SetInput(this->temp3d); > this->pvtkLine->SetSource(this->pvtkSeeds); > this->pvtkLine->SetMaximumPropagationTime(100); > this->pvtkLine->SetIntegrationStepLength(.2); > this->pvtkLine->SetStepLength(.001); > this->pvtkLine->SetNumberOfThreads(1); > this->pvtkLine->SetIntegrationDirectionToForward(); > this->pvtkLine->VorticityOn(); > this->pvtkLine->Update(); > > > this->DistanceMapper->SetInputConnection(this->pvtkLine->GetOutputPort()); > double tmp[2]; > this->temp3d->GetScalarRange(tmp); > this->DistanceMapper->SetScalarRange(tmp[0], tmp[1]); > this->DistanceMapper->ImmediateModeRenderingOn(); > this->DistanceMapper->Update(); > this->DistanceActor->SetMapper(this->DistanceMapper); > this->DistanceActor->VisibilityOff(); > > this->BoneMapper->SetInput(this->temp3d); > this->BoneMapper->ImmediateModeRenderingOn(); > this->BoneMapper->Update(); > this->BoneActor->SetMapper(this->BoneMapper); > this->BoneActor->GetProperty()->SetColor(1.0, 1.0, 0.0); > this->BoneActor->GetProperty()->SetDiffuse(0.0); > this->BoneActor->GetProperty()->SetSpecular(1.0); > this->BoneActor->GetProperty()->SetSpecularPower(5); > > I could read that a possible solution is to add the vtkAssignAttribute > so I did it like this: > > vtkAssignAttribute *aa = vtkAssignAttribute::New(); > aa->Assign( vtkDataSetAttributes::SCALARS, > vtkDataSetAttributes::VECTORS, > vtkAssignAttribute::POINT_DATA ); > aa->SetInput( this->temp3d ); > aa->Update(); > this->pvtkLine->SetInputConnection(aa->GetOutputPort()); > // this->pvtkLine->SetInput(this->temp3d); > this->pvtkLine->SetSource(this->pvtkSeeds); > this->pvtkLine->SetMaximumPropagationTime(100); > this->pvtkLine->SetIntegrationStepLength(.2); > this->pvtkLine->SetStepLength(.001); > this->pvtkLine->SetNumberOfThreads(1); > this->pvtkLine->SetIntegrationDirectionToForward(); > this->pvtkLine->VorticityOn(); > this->pvtkLine->Update(); > ................ > > But now I have another error: > > Warning: In .\vtkDataSetAttributes.cxx, line 945 > vtkPointData (0D9F6D00): Can not set attribute Vectors. Incorrect > number of components. > > ERROR: In .\vtkStreamer.cxx, line 488 > vtkStreamLine (0D92B060): No vector data defined! > > I can't understand what the problem, could anybody helps me!!?? > > Thanks a lot. I need to solve it. > > ------------------------------------------------------------------------ > > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Amy Squillacote Phone: (256) 726-4839 Computer Scientist Fax: (256) 726-4806 CFD Research Corporation Web: http://www.cfdrc.com 215 Wynn Drive, Suite 501 Huntsville, AL 35805 From luis.ibanez at kitware.com Fri May 30 09:45:40 2008 From: luis.ibanez at kitware.com (Luis Ibanez) Date: Fri, 30 May 2008 09:45:40 -0400 Subject: [vtkusers] OPEN ACCESS: Rapid Development of Medical Imaging Tools with Open-Source Libraries Message-ID: <48400504.1080901@kitware.com> http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=2039808 Rapid Development of Medical Imaging Tools with Open-Source Libraries Jesus J. Caban, Alark Joshi, and Paul Nagy [Authors took the "Open Access" option in a Springer publication] [See http://www.springer-sbm.com/index.php?id=13036] [This paper comments on ITK, VTK, KWWidgets and IGSTK] Abstract Rapid prototyping is an important element in researching new imaging analysis techniques and developing custom medical applications. In the last ten years, the open source community and the number of open source libraries and freely available frameworks for biomedical research have grown significantly. What they offer are now considered standards in medical image analysis, computer-aided diagnosis, and medical visualization. A cursory review of the peer-reviewed literature in imaging informatics (indeed, in almost any information technology-dependent scientific discipline) indicates the current reliance on open source libraries to accelerate development and validation of processes and techniques. In this survey paper, we review and compare a few of the most successful open source libraries and frameworks for medical application development. Our dual intentions are to provide evidence that these approaches already constitute a vital and essential part of medical image analysis, diagnosis, and visualization and to motivate the reader to use open source libraries and software for rapid prototyping of medical applications and tools. This work was supported by Telemedicine and Advanced Technology Research Center (TATRC) ----- Luis From johne at annidis.com Fri May 30 12:42:22 2008 From: johne at annidis.com (John Eke) Date: Fri, 30 May 2008 12:42:22 -0400 Subject: [vtkusers] QVTKWidget crashes the entire Qt Application on click Message-ID: <48402E6E.1040804@annidis.com> Hello People, I have a main QWidget, inside which I have added QVTKWidgets. I was wondering what the propper way was to initialize QVTKInteractors so that everything works fine. The way I have it setup right now, everything loads fine, but once I click on the QVTKWidgets, the entire app crashes with a seg fault error. Heres an example of what I am doing, these are called from within the constructor of a subclass of the QVTKWidget: //initialize member variables m_pImageActor = vtkImageActor::New(); m_pRenderer = vtkRenderer::New(); //add renderer m_pRenderer->SetBackground(0.0, 0.0, 0.0); GetRenderWindow()->AddRenderer(m_pRenderer); GetRenderWindow()->Render(); //load an image using ITK typedef itk::Image ImageType; typedef itk::ImageFileReader ReaderType; typedef itk::ImageToVTKImageFilter ConnectorType; ReaderType::Pointer reader = ReaderType::New(); ConnectorType::Pointer connector = ConnectorType::New(); //read image and pass it onto the image actor reader->SetFileName("temp.png"); connector->SetInput (reader->GetOutput()); m_pImageActor->SetInput(connector->GetOutput()); //add the image actor to the renderer m_pRenderer->AddActor(m_pImageActor); When I do this, all loads well, but when I click on the QVTKWidget, the app crashes with a segmentation fault error. I am assuming maybe I am not properly initializing the QVTKInteractor. GetInteractor() gives me the QVTKInteractor and SetInteractor() sets it right back. So I am assuming the default constructor has already initialized the QVTKInteractor. Any thoughts/ideas/help will be greatly appreciated! Thanks - John From int64380 at stud.uni-stuttgart.de Fri May 30 11:52:49 2008 From: int64380 at stud.uni-stuttgart.de (Mohammad Nazrul Islam) Date: Fri, 30 May 2008 17:52:49 +0200 Subject: [vtkusers] No vector data defined Message-ID: <200805301752.AA2528051408@studsv07.stud.uni-stuttgart.de> could you please send the header of your data file? Because I was facing the same problem for a long time and finally I solved it.If your data file is in vtk format then I can help you. thanks. Mohammad ---------- Original Message ---------------------------------- From: "ivan gm" Date: Fri, 30 May 2008 11:22:46 +0200 >Hello: > >I know there are lots of people who has the same problem as me but, for my >readings, nobody could solve it. >I receive the following vtk error: > > ERROR: In .\vtkStreamer.cxx, line 488 > vtkStreamLine (0D92B060): No vector data defined! > >This is my code: > > this->pvtkLine->SetInput(this->temp3d); > this->pvtkLine->SetSource(this->pvtkSeeds); > this->pvtkLine->SetMaximumPropagationTime(100); > this->pvtkLine->SetIntegrationStepLength(.2); > this->pvtkLine->SetStepLength(.001); > this->pvtkLine->SetNumberOfThreads(1); > this->pvtkLine->SetIntegrationDirectionToForward(); > this->pvtkLine->VorticityOn(); > this->pvtkLine->Update(); > > >this->DistanceMapper->SetInputConnection(this->pvtkLine->GetOutputPort()); > double tmp[2]; > this->temp3d->GetScalarRange(tmp); > this->DistanceMapper->SetScalarRange(tmp[0], tmp[1]); > this->DistanceMapper->ImmediateModeRenderingOn(); > this->DistanceMapper->Update(); > this->DistanceActor->SetMapper(this->DistanceMapper); > this->DistanceActor->VisibilityOff(); > > this->BoneMapper->SetInput(this->temp3d); > this->BoneMapper->ImmediateModeRenderingOn(); > this->BoneMapper->Update(); > this->BoneActor->SetMapper(this->BoneMapper); > this->BoneActor->GetProperty()->SetColor(1.0, 1.0, 0.0); > this->BoneActor->GetProperty()->SetDiffuse(0.0); > this->BoneActor->GetProperty()->SetSpecular(1.0); > this->BoneActor->GetProperty()->SetSpecularPower(5); > >I could read that a possible solution is to add the vtkAssignAttribute so I >did it like this: > > vtkAssignAttribute *aa = vtkAssignAttribute::New(); > aa->Assign( vtkDataSetAttributes::SCALARS, > vtkDataSetAttributes::VECTORS, > vtkAssignAttribute::POINT_DATA ); > aa->SetInput( this->temp3d ); > aa->Update(); > this->pvtkLine->SetInputConnection(aa->GetOutputPort()); >// this->pvtkLine->SetInput(this->temp3d); > this->pvtkLine->SetSource(this->pvtkSeeds); > this->pvtkLine->SetMaximumPropagationTime(100); > this->pvtkLine->SetIntegrationStepLength(.2); > this->pvtkLine->SetStepLength(.001); > this->pvtkLine->SetNumberOfThreads(1); > this->pvtkLine->SetIntegrationDirectionToForward(); > this->pvtkLine->VorticityOn(); > this->pvtkLine->Update(); >................ > >But now I have another error: > > Warning: In .\vtkDataSetAttributes.cxx, line 945 > vtkPointData (0D9F6D00): Can not set attribute Vectors. Incorrect number >of components. > > ERROR: In .\vtkStreamer.cxx, line 488 > vtkStreamLine (0D92B060): No vector data defined! > >I can't understand what the problem, could anybody helps me!!?? > >Thanks a lot. I need to solve it. > > > From dave.demarle at kitware.com Fri May 30 13:04:44 2008 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 30 May 2008 13:04:44 -0400 Subject: [vtkusers] Compiling VTK with FFMPEG In-Reply-To: References: Message-ID: It is only in cvs head and 5.2. cheers Dave On Thu, May 29, 2008 at 5:21 AM, Jefferson Thomas wrote: > I dont have it. Only VTK_USE_MPEG2_ENCODER. Advanced mode (t) is turned on. > I have version 5.0.3. Is support for FFMPEG included in this version ? > Thomas > > > 2008/5/29 David E DeMarle : >> VTK_USE_FFMPEG_ENCODER is on the advanced page for VTK. >> >> On Wed, May 28, 2008 at 10:35 PM, Jefferson Thomas wrote: >>> Hi, >>> How to compile VTK with FFMPEG ? I would like to use the >>> vtkFFMPEGWriter so I have to compile FFMPEG. >>> I can get it i.e. from page http://www.vtk.org/get-software.php and >>> compile it, but than, how to tell VTK to use it ? >>> There is no VTK_USE_FFMPEG -like thing in VTK ccmake. What variable >>> should I set up ? >>> It is not explained on that page nor in any other place. >>> Thomas >>> _______________________________________________ >>> This is the private VTK discussion list. >>> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>> Follow this link to subscribe/unsubscribe: >>> http://www.vtk.org/mailman/listinfo/vtkusers >>> >> > _______________________________________________ > This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > From kalpana0611 at gmail.com Fri May 30 13:21:53 2008 From: kalpana0611 at gmail.com (Cally K) Date: Sat, 31 May 2008 01:21:53 +0800 Subject: [vtkusers] Problem running DistributedData.cxx Message-ID: hi, I have some problem running DistributedData.cxx ( in the parallel/testing folder ) I have compiled the compiled the DistributedData using this Cmakelists.txt PROJECT (DistributedData.cxx) 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(DistributedData DistributedData.cxx) TARGET_LINK_LIBRARIES(DistributedData vtkCommon vtkDICOMParser vtkexpat vtkfreetype vtkftgl vtkGenericFiltering vtkHybrid vtkImaging vtkNetCDF vtkIO.a vtkGraphics vtkRendering vtkFiltering vtkWidgets vtkParallel) I, however have problem running the executable, I loaded both the executabe into 2 machines Machine A ( 192.168.10.20 ) Machine B ( 192.168.10.21) and I am accesing it from my computer( DHCP enabled ) after running the following command - I use OpenMPI mpirun -hostfile myhostfile -np 2 -bynode ./DistributedData and I keep getting these errors ERROR: In /home/kalpanak/Installation_Files/VTKProject/VTK/Rendering/vtkXOpenGLRenderWindow.cxx, line 326 vtkXOpenGLRenderWindow (0x8664438): bad X server connection. ERROR: In /home/kalpanak/Installation_Files/VTKProject/VTK/Rendering/vtkXOpenGLRenderWindow.cxx, line 169 vtkXOpenGLRenderWindow (0x8664438): bad X server connection. [vrc1:27394] *** Process received signal *** [vrc1:27394] Signal: Segmentation fault (11) [vrc1:27394] Signal code: Address not mapped (1) [vrc1:27394] Failing at address: 0x84 [vrc1:27394] [ 0] [0xffffe440] [vrc1:27394] [ 1] ./DistributedData(_ZN22vtkXOpenGLRenderWindow20GetDesiredVisualInfoEv+0x229) [0x8227e7d] [vrc1:27394] [ 2] ./DistributedData(_ZN22vtkXOpenGLRenderWindow16WindowInitializeEv+0x340) [0x8226812] [vrc1:27394] [ 3] ./DistributedData(_ZN22vtkXOpenGLRenderWindow10InitializeEv+0x29) [0x82234f9] [vrc1:27394] [ 4] ./DistributedData(_ZN22vtkXOpenGLRenderWindow5StartEv+0x29) [0x82235eb] [vrc1:27394] [ 5] ./DistributedData(_ZN15vtkRenderWindow14DoStereoRenderEv+0x1a) [0x82342ac] [vrc1:27394] [ 6] ./DistributedData(_ZN15vtkRenderWindow10DoFDRenderEv+0x427) [0x8234757] [vrc1:27394] [ 7] ./DistributedData(_ZN15vtkRenderWindow10DoAARenderEv+0x5b7) [0x8234d19] [vrc1:27394] [ 8] ./DistributedData(_ZN15vtkRenderWindow6RenderEv+0x690) [0x82353b4] [vrc1:27394] [ 9] ./DistributedData(_ZN22vtkXOpenGLRenderWindow6RenderEv+0x52) [0x82245e2] [vrc1:27394] [10] ./DistributedData [0x819e355] [vrc1:27394] [11] ./DistributedData(_ZN16vtkMPIController19SingleMethodExecuteEv+0x1ab) [0x837a447] [vrc1:27394] [12] ./DistributedData(main+0x180) [0x819de78] [vrc1:27394] [13] /lib/libc.so.6(__libc_start_main+0xe0) [0xb79c0fe0] [vrc1:27394] [14] ./DistributedData [0x819dc21] [vrc1:27394] *** End of error message *** mpirun noticed that job rank 0 with PID 27394 on node 202.185.77.86 exited on signal 11 (Segmentation fault). I am not really sure if it is a VTK error or an openmpi error, maybe I am not doing the xforwading properly, I am posting this to the openmpi group also, but has anyone ever encountered the same problem, it works fine on one pc, and I read the mailing list but I just don't know if my prob is similiar to their, I even tried changing the DISPLAY env This is what I want to do my mpirun should run on 2 machines ( A and B ) and I should be able to view the output ( on my PC ), are there any specfic commands to use. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mgv.research at gmail.com Fri May 30 15:21:53 2008 From: mgv.research at gmail.com (Marie-Gabrielle Vallet) Date: Fri, 30 May 2008 15:21:53 -0400 Subject: [vtkusers] best way to represent a (planar) irregular polygon ? Message-ID: <30f906de0805301221j5807c2f7x77b96d61c259481@mail.gmail.com> Hi Brian, I remember having some problem to render a non-convex polygon. I found an example, I can't find again where it comes from, and I worked on it. Finally the following python script does what you want. You should try to add two filters : a GeometryFilter and a TriangleFilter. Marie-Gabrielle #!/usr/bin/env python # This example shows how to visualize polygons, convex or not. import vtk # Define a set of points - these are the ordered polygon vertices polygonPoints = vtk.vtkPoints() polygonPoints.SetNumberOfPoints(6) polygonPoints.InsertPoint(0, 0, 0, 0) polygonPoints.InsertPoint(1,.4,.4, 0) polygonPoints.InsertPoint(2, 1, 0, 0) polygonPoints.InsertPoint(3, 1, 1, 0) polygonPoints.InsertPoint(4,.1,.7, 0) polygonPoints.InsertPoint(5, 0, 1, 0) # Make a cell with these points aPolygon = vtk.vtkPolygon() aPolygon.GetPointIds().SetNumberOfIds(6) aPolygon.GetPointIds().SetId(0, 0) aPolygon.GetPointIds().SetId(1, 1) aPolygon.GetPointIds().SetId(2, 2) aPolygon.GetPointIds().SetId(3, 3) aPolygon.GetPointIds().SetId(4, 4) aPolygon.GetPointIds().SetId(5, 5) # The cell is put into a mesh (containing only one cell) aPolygonGrid = vtk.vtkUnstructuredGrid() aPolygonGrid.Allocate(1, 1) aPolygonGrid.InsertNextCell(aPolygon.GetCellType(), aPolygon.GetPointIds()) aPolygonGrid.SetPoints(polygonPoints) # This part is needed for non-convex polygon rendering aPolygonGeomFilter = vtk.vtkGeometryFilter() aPolygonGeomFilter.SetInput(aPolygonGrid) aPolygonTriangleFilter = vtk.vtkTriangleFilter() aPolygonTriangleFilter.SetInput(aPolygonGeomFilter.GetOutput()) # # This one is only to check the triangulation (when factor < 1) aPolygonShrinkFilter = vtk.vtkShrinkFilter() aPolygonShrinkFilter.SetShrinkFactor( 0.9 ) #aPolygonShrinkFilter.SetShrinkFactor( 1.0 ) aPolygonShrinkFilter.SetInput( aPolygonGrid) # Make ready for rendering aPolygonMapper = vtk.vtkDataSetMapper() aPolygonMapper.SetInput(aPolygonShrinkFilter.GetOutput()) aPolygonActor = vtk.vtkActor() aPolygonActor.SetMapper(aPolygonMapper) aPolygonActor.GetProperty().SetDiffuseColor(1, .4, .5) # Create the usual rendering stuff. ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) renWin.SetSize(300, 150) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) ren.SetBackground(.1, .2, .4) ren.AddActor(aPolygonActor) ren.ResetCamera() # Render the scene and start interaction. iren.Initialize() renWin.Render() iren.Start() -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.malaterre at gmail.com Fri May 30 15:48:26 2008 From: mathieu.malaterre at gmail.com (Mathieu Malaterre) Date: Fri, 30 May 2008 21:48:26 +0200 Subject: [vtkusers] GDCM 2.0.5 is out ! Message-ID: GDCM 2.0.5 is the next GDCM generation. It comes with an improved vtkGCMImageReader with support for: - ACR 1.0 and ACR 2.0 - DICOM v3 - Multiframes Image - Enhanced MR/CT Image Storage - Icon Sequence - Curve Data - Overlay Data vtkGCMImageWriter will allow one to create a DICOM file from scratch, thanks to the use of the vtkMedicalImageProperties. Changelog: http://gdcm.sourceforge.net/wiki/index.php/GDCM_Release_2.0#GDCM_2.0.5 Download area: http://sourceforge.net/project/showfiles.php?group_id=137895&package_id=197047&release_id=603195 Enjoy, -- Mathieu From jelleferinga at gmail.com Sat May 31 13:02:20 2008 From: jelleferinga at gmail.com (jelle) Date: Sat, 31 May 2008 17:02:20 +0000 (UTC) Subject: [vtkusers] Updated Release of Imporvtk plugin for Maya References: <483D9DEC.1080908@noaa.gov> Message-ID: great to see the importvtk project progressing! i'm curious; have you implemented the live objects with the wrapped API? many thanks for this project! -jelle From johne at annidis.com Sat May 31 13:35:02 2008 From: johne at annidis.com (John Eke) Date: Sat, 31 May 2008 13:35:02 -0400 Subject: [vtkusers] QVTKWidget crashes the entire Qt Application on click References: <48402E6E.1040804@annidis.com> Message-ID: I figured out what was wrong. I had to manually override all the mouse event handlers, and left them empty to make sure nothing is done on each mouse event. And now it doesn't crash anymore. The handlers for the super class were pure virtual which caused the seg fault -----Original Message----- From: vtkusers-bounces at vtk.org on behalf of John Eke Sent: Fri 5/30/2008 12:42 PM To: vtkusers at vtk.org Subject: [vtkusers] QVTKWidget crashes the entire Qt Application on click Hello People, I have a main QWidget, inside which I have added QVTKWidgets. I was wondering what the propper way was to initialize QVTKInteractors so that everything works fine. The way I have it setup right now, everything loads fine, but once I click on the QVTKWidgets, the entire app crashes with a seg fault error. Heres an example of what I am doing, these are called from within the constructor of a subclass of the QVTKWidget: //initialize member variables m_pImageActor = vtkImageActor::New(); m_pRenderer = vtkRenderer::New(); //add renderer m_pRenderer->SetBackground(0.0, 0.0, 0.0); GetRenderWindow()->AddRenderer(m_pRenderer); GetRenderWindow()->Render(); //load an image using ITK typedef itk::Image ImageType; typedef itk::ImageFileReader ReaderType; typedef itk::ImageToVTKImageFilter ConnectorType; ReaderType::Pointer reader = ReaderType::New(); ConnectorType::Pointer connector = ConnectorType::New(); //read image and pass it onto the image actor reader->SetFileName("temp.png"); connector->SetInput (reader->GetOutput()); m_pImageActor->SetInput(connector->GetOutput()); //add the image actor to the renderer m_pRenderer->AddActor(m_pImageActor); When I do this, all loads well, but when I click on the QVTKWidget, the app crashes with a segmentation fault error. I am assuming maybe I am not properly initializing the QVTKInteractor. GetInteractor() gives me the QVTKInteractor and SetInteractor() sets it right back. So I am assuming the default constructor has already initialized the QVTKInteractor. Any thoughts/ideas/help will be greatly appreciated! Thanks - John _______________________________________________ This is the private VTK discussion list. Please keep messages on-topic. Check the 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: