From prakeshofficial at gmail.com Wed Dec 1 02:35:04 2010 From: prakeshofficial at gmail.com (rakesh patil) Date: Wed, 1 Dec 2010 13:05:04 +0530 Subject: [vtkusers] Simple arithmeticquestion..! Message-ID: Hello, I have a single dimension array of say 'n' elements. I need to subtract each and every value(from this array) from a scalar value say 'x'. for example, I have array with values, {2,3,5,2,7,8,3}, and let x=4, then the final ouput should me x - arr(i) i.e. final output shud be, {2,1,-1,2,-3,-4,1} Then after getting this resultant array, I have to replace all the negative values with 0. Can anyone help me to accomplish this without iterating through the array...? Thanks Regards Rakesh Patil -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Wed Dec 1 03:39:32 2010 From: jothybasu at gmail.com (Jothy) Date: Wed, 1 Dec 2010 08:39:32 +0000 Subject: [vtkusers] help with reading dicom files as a volume and rendering it in vtk In-Reply-To: <1291151170513-3286769.post@n5.nabble.com> References: <1291151170513-3286769.post@n5.nabble.com> Message-ID: You are not using the correct mapper and I think your pipeline is also wrong (correct me if I am wrong). Have a look at the example at this link http://www.cmake.org/Wiki/VTK/Examples/Cxx/VolumeRendering/MinIntensityRendering Jothy On Tue, Nov 30, 2010 at 9:06 PM, ankit.master at gmail.com < ankit.master at gmail.com> wrote: > > Hello , > > Kindly pardon my question here. I know this has been asked several times in > the past and yet ask it again. I am trying to read dicom files and view it > interactively using windowInteractor. My ulitmate goal is to be able to > pump > this image through the volume rendering algorithm. > > However, when I run the following script (python script), I only get to see > one slice as opposed to the entire volume. Could > someone please help me trouble shoot this. > > > #! /usr/bin/env python > > import vtk as v > from vtk.libvtkGraphicsPython import* > from vtk.libvtkCommonPython import* > > reader=v.vtkDICOMImageReader() > reader.SetDirectoryName('$DICOM DIR') > reader.Update() > > slope=1 > shift=0 > > shifter=v.vtkImageShiftScale() > shifter.SetShift(shift) > shifter.SetScale(slope) > shifter.SetOutputScalarTypeToUnsignedChar() > shifter.SetInput(reader.GetOutput()) > shifter.Update() > > voxeldata=v.vtkImageData() > voxeldata=shifter.GetOutput() > voxeldata.AllocateScalars() > > > actor=v.vtkImageActor() > actor.SetInput(voxeldata) > > ren=v.vtkRenderer() > renWin = v.vtkRenderWindow() > renWin.AddRenderer(ren) > renWin.SetSize(300,300) > > iren = v.vtkRenderWindowInteractor() > iren.SetRenderWindow(renWin) > ren.AddActor(actor) > iren.Initialize() > iren.Start() > > Thank you > Sincerely, > Ankit > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/help-with-reading-dicom-files-as-a-volume-and-rendering-it-in-vtk-tp3286769p3286769.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Wed Dec 1 03:41:08 2010 From: jothybasu at gmail.com (Jothy) Date: Wed, 1 Dec 2010 08:41:08 +0000 Subject: [vtkusers] python bindings build failed In-Reply-To: References: <201011301227.51631.clinton@elemtech.com> Message-ID: Did you set any flag in cmake such as NUmpy support,etc.. related to python? Jothy On Tue, Nov 30, 2010 at 10:08 PM, Lic. Jos? M. Rodriguez Bacallao < jmrbcu at gmail.com> wrote: > every thing build just fine and work like a charm > > On Tue, Nov 30, 2010 at 3:26 PM, Lic. Jos? M. Rodriguez Bacallao > wrote: > > sorry, my mistake, SIP_INCLUDE_DIR was pointing to another dir, for > > now it is building, I mail U later the results. > > > > On Tue, Nov 30, 2010 at 2:27 PM, Clinton Stimpson > wrote: > >> On Tuesday, November 30, 2010 12:11:33 pm Lic. Jos? M. Rodriguez > Bacallao > >> wrote: > >>> I downloaded today snapshot from vtk git repo, when I try to build it > >>> with the sip bindings activated I get the following error: > >>> > >>> > >>> [ 10%] Building CXX object > >>> Wrapping/Python/CMakeFiles/vtkPythonCore.dir/vtkPythonUtil.cxx.o > >>> > /home/jmrbcu/installs/linux/development/imagis/vtk/VTK-HEAD-42be244/Wrappin > >>> g/Python/vtkPythonUtil.cxx:37: fatal error: sip.h: No such file or > >>> directory > >>> compilation terminated. > >>> make[2]: *** > >>> [Wrapping/Python/CMakeFiles/vtkPythonCore.dir/vtkPythonUtil.cxx.o] > Error 1 > >>> make[1]: *** [Wrapping/Python/CMakeFiles/vtkPythonCore.dir/all] Error 2 > >>> make: *** [all] Error 2 > >>> > >>> I have my own build of sip (4.11.2), qt4 (4.7.1) and pyqt4 (4.8.1) > >>> installed under a location different from original. > >> > >> Does your cmake variable SIP_INCLUDE_DIR point to your directory > containing > >> sip.h? > >> > >> -- > >> Clinton Stimpson > >> Elemental Technologies, Inc > >> Computational Simulation Software, LLC > >> www.csimsoft.com > >> _______________________________________________ > >> Powered by www.kitware.com > >> > >> Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > >> > >> Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > >> > >> Follow this link to subscribe/unsubscribe: > >> http://www.vtk.org/mailman/listinfo/vtkusers > >> > > > > > > > > -- > > Lic. Jos? M. Rodriguez Bacallao > > Centro de Biofisica Medica > > ----------------------------------------------------------------- > > Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo > mismo. > > > > Recuerda: El arca de Noe fue construida por aficionados, el titanic > > por profesionales > > ----------------------------------------------------------------- > > > > > > -- > Lic. Jos? M. Rodriguez Bacallao > Centro de Biofisica Medica > ----------------------------------------------------------------- > Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo > mismo. > > Recuerda: El arca de Noe fue construida por aficionados, el titanic > por profesionales > ----------------------------------------------------------------- > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From avtkuser at arcor.de Wed Dec 1 06:28:45 2010 From: avtkuser at arcor.de (avtkuser at arcor.de) Date: Wed, 1 Dec 2010 12:28:45 +0100 (CET) Subject: [vtkusers] Abort a rendering process in java Message-ID: <290938531.13348.1291202925795.JavaMail.ngmail@webmail11.arcor-online.net> Hello VTK users, I want to abort a rendering process by clicking into the scene with the mouse to start or continue the interaction. I am using VTK in a java environment and I added my own java mouse listeners to the vtkPanel. My problem is, that the vtkFixedPointVolumeRayCastMapper downsamples the volume during interaction, but it takes a very long time to resample the volume after releasing the mouse button. During this time no further interaction is possible. I found some old posts in the mailing list concerning this issue. But I couldn't find a useful answer. I tried to add an observer to the renderWindow renWin.AddObserver("AbortCheckEvent", this, "checkAbortRender"); and implemented the checkAbortRender method: void checkAbortRender() { if (renWin.GetEventPending() != 0) { renWin.SetAbortRender(1); } } But this doesn't work. GetEventPending always returns 0. I also tried to use the java MouseClickHandler.isLeftMouseButtonPressed() instead of GetEventPending. Then the SetAbortRender method is called, but the mouse interaction has still no effect on the scene until the render process is done. My OS is Windows 7 (64 bit). Are there any other ways to abort a rendering process? Thanks in advance for any kind of help. Michael From daviddoria at gmail.com Wed Dec 1 07:36:11 2010 From: daviddoria at gmail.com (David Doria) Date: Wed, 1 Dec 2010 07:36:11 -0500 Subject: [vtkusers] vtkImageRFFT In-Reply-To: References: Message-ID: On Tue, Nov 30, 2010 at 8:53 PM, Anthonyd29 wrote: > Hi... > I'm new using VTK... > > there is my problem. > I have a function created by myself called ProjectionPlane on the frecuency > space, and it will return two vectors: > real and imaginary data. > > So i want to use vtkImageRFFT to take it back to the domain space, > but i don't know to use my results of the ProjectionPlane as the input to > the vtkImageRFFT. > > Could someone want to help me ..?? If someone could fix this example, it would be a good place to start: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/Images/ImageRFFT David From jmrbcu at gmail.com Wed Dec 1 09:35:52 2010 From: jmrbcu at gmail.com (=?UTF-8?Q?Lic=2E_Jos=C3=A9_M=2E_Rodriguez_Bacallao?=) Date: Wed, 1 Dec 2010 09:35:52 -0500 Subject: [vtkusers] python bindings build failed In-Reply-To: References: <201011301227.51631.clinton@elemtech.com> Message-ID: no, just VTK_USE_PYTHON and VTK_USE_PYTHON_SIP On Wed, Dec 1, 2010 at 3:41 AM, Jothy wrote: > Did you set any flag in cmake such as NUmpy support,etc.. related to python? > > Jothy > > On Tue, Nov 30, 2010 at 10:08 PM, Lic. Jos? M. Rodriguez Bacallao > wrote: >> >> every thing build just fine and work like a charm >> >> On Tue, Nov 30, 2010 at 3:26 PM, Lic. Jos? M. Rodriguez Bacallao >> wrote: >> > sorry, my mistake, SIP_INCLUDE_DIR was pointing to another dir, for >> > now it is building, I mail U later the results. >> > >> > On Tue, Nov 30, 2010 at 2:27 PM, Clinton Stimpson >> > wrote: >> >> On Tuesday, November 30, 2010 12:11:33 pm Lic. Jos? M. Rodriguez >> >> Bacallao >> >> wrote: >> >>> I downloaded today snapshot from vtk git repo, when I try to build it >> >>> with the sip bindings activated I get the following error: >> >>> >> >>> >> >>> [ 10%] Building CXX object >> >>> Wrapping/Python/CMakeFiles/vtkPythonCore.dir/vtkPythonUtil.cxx.o >> >>> >> >>> /home/jmrbcu/installs/linux/development/imagis/vtk/VTK-HEAD-42be244/Wrappin >> >>> g/Python/vtkPythonUtil.cxx:37: fatal error: sip.h: No such file or >> >>> directory >> >>> compilation terminated. >> >>> make[2]: *** >> >>> [Wrapping/Python/CMakeFiles/vtkPythonCore.dir/vtkPythonUtil.cxx.o] >> >>> Error 1 >> >>> make[1]: *** [Wrapping/Python/CMakeFiles/vtkPythonCore.dir/all] Error >> >>> 2 >> >>> make: *** [all] Error 2 >> >>> >> >>> I have my own build of sip (4.11.2), qt4 (4.7.1) and pyqt4 (4.8.1) >> >>> installed under a location different from original. >> >> >> >> Does your cmake variable SIP_INCLUDE_DIR point to your directory >> >> containing >> >> sip.h? >> >> >> >> -- >> >> Clinton Stimpson >> >> Elemental Technologies, Inc >> >> Computational Simulation Software, LLC >> >> www.csimsoft.com >> >> _______________________________________________ >> >> Powered by www.kitware.com >> >> >> >> Visit other Kitware open-source projects at >> >> http://www.kitware.com/opensource/opensource.html >> >> >> >> Please keep messages on-topic and check the VTK FAQ at: >> >> http://www.vtk.org/Wiki/VTK_FAQ >> >> >> >> Follow this link to subscribe/unsubscribe: >> >> http://www.vtk.org/mailman/listinfo/vtkusers >> >> >> > >> > >> > >> > -- >> > Lic. Jos? M. Rodriguez Bacallao >> > Centro de Biofisica Medica >> > ----------------------------------------------------------------- >> > Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo >> > mismo. >> > >> > Recuerda: El arca de Noe fue construida por aficionados, el titanic >> > por profesionales >> > ----------------------------------------------------------------- >> > >> >> >> >> -- >> Lic. Jos? M. Rodriguez Bacallao >> Centro de Biofisica Medica >> ----------------------------------------------------------------- >> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo >> mismo. >> >> Recuerda: El arca de Noe fue construida por aficionados, el titanic >> por profesionales >> ----------------------------------------------------------------- >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers > > -- Lic. Jos? M. Rodriguez Bacallao Centro de Biofisica Medica ----------------------------------------------------------------- Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo. Recuerda: El arca de Noe fue construida por aficionados, el titanic por profesionales ----------------------------------------------------------------- From marcus.hanwell at kitware.com Wed Dec 1 10:47:06 2010 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Wed, 1 Dec 2010 10:47:06 -0500 Subject: [vtkusers] Question on Viewports/vtkChartXY/SetGeometry in example TestMultipleChartRenderers.cxx In-Reply-To: <758150D667C235458DE231BB50B9A2B30ACFDCAF8B@de01ex07.GLOBAL.JHCN.NET> References: <758150D667C235458DE231BB50B9A2B30ACFDCA9B9@de01ex07.GLOBAL.JHCN.NET> <758150D667C235458DE231BB50B9A2B30ACFDCAF8B@de01ex07.GLOBAL.JHCN.NET> Message-ID: Hi Daniel, 2010/11/30 Frese Daniel Dr. : > Hello Marcus, > > thank you for your fast answer. Such a feature (multiple graphs - maybe also images ? - > in one scene) would be very useful. As I understand it now, this basically means that > there are still some open issues in the 2D API, which you are working on. Multiple images is already possible, the charts have the issue that they always grow to fill the scene. So there is some extra code that needs to go in there to allow that behavior to be toggled. The charts themselves have child items in the scene (the axes, plots etc), and so make full use of the scene. > > We are looking here for some visualization kit for some very basic 3D stuff, but mainly > to look at some XY charts and some matrix data - and for this your 2D API looks > very nice ! So I try to figure out, whether it makes sense for our purposes > to use VTK and the 2D API for this. Two questions on this : > > - Is there anywhere some kind of overview, which areas of this API are still work > in progress, and which are already more stable ? That would help me (as a newbie) > trying desperately to get some things running, while they simply don't work the > expected way yet... I will see if I can put something together, this wiki page does not yet exist. The VTK examples, and the tests in Charts/Testing/ give many examples of what works, along with ParaView which uses the VTK charts in its GUI (you can download binaries and see what it already exposed). > > - I know this a difficult one, but what are the priorities on the 2D API stuff ? > Is there some kind of target date as when things will kind of settle down ? > Does it make sense for me, to check out sources regularly via git ? So far I use the > 5.6.1 release. I think it would make sense to check out the source via git. I am working on several new features, there is an article in the Source, http://www.kitware.com/products/html/NewChartAPIInVTK.html We have a new release (VTK 5.8), and I will be getting things ready for that release. There are a few new chart types, along with the work we are doing on Marks (Protovis like API in C++ over the 2D API/2D scene). I monitor the mailing lists, but will see about making a high level summary of this work. I will post to the list when I do so. There are a few topic branches I am getting ready to merge into VTK master for things like 2D histograms (color maps), fixed size charts (enabling multiple charts with interaction in one scene). Marcus From frese at heidenhain.de Wed Dec 1 11:04:03 2010 From: frese at heidenhain.de (Frese Daniel Dr.) Date: Wed, 1 Dec 2010 17:04:03 +0100 Subject: [vtkusers] =?iso-8859-15?q?Question_on_Viewports/vtkChartXY/SetGe?= =?iso-8859-15?q?ometry_in__example_TestMultipleChartRenderers=2Ecxx?= In-Reply-To: References: <758150D667C235458DE231BB50B9A2B30ACFDCA9B9@de01ex07.GLOBAL.JHCN.NET> <758150D667C235458DE231BB50B9A2B30ACFDCAF8B@de01ex07.GLOBAL.JHCN.NET> Message-ID: <758150D667C235458DE231BB50B9A2B30AD021198F@de01ex07.GLOBAL.JHCN.NET> Hi Marcus, thanks again for your answer and the work you put into this. So I'll switch to the git stuff. I guess if there is so much new stuff to come, I'll basically wait for the 5.8 release and retest then again, using the git sources. Daniel -----Urspr?ngliche Nachricht----- Von: Marcus D. Hanwell [mailto:marcus.hanwell at kitware.com] Gesendet: Mittwoch, 1. Dezember 2010 16:47 An: Frese Daniel Dr. Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Question on Viewports/vtkChartXY/SetGeometry in example TestMultipleChartRenderers.cxx Hi Daniel, 2010/11/30 Frese Daniel Dr. : > Hello Marcus, > > thank you for your fast answer. Such a feature (multiple graphs - maybe also images ? - > in one scene) would be very useful. As I understand it now, this basically means that > there are still some open issues in the 2D API, which you are working on. Multiple images is already possible, the charts have the issue that they always grow to fill the scene. So there is some extra code that needs to go in there to allow that behavior to be toggled. The charts themselves have child items in the scene (the axes, plots etc), and so make full use of the scene. > > We are looking here for some visualization kit for some very basic 3D stuff, but mainly > to look at some XY charts and some matrix data - and for this your 2D API looks > very nice ! So I try to figure out, whether it makes sense for our purposes > to use VTK and the 2D API for this. Two questions on this : > > - Is there anywhere some kind of overview, which areas of this API are still work > in progress, and which are already more stable ? That would help me (as a newbie) > trying desperately to get some things running, while they simply don't work the > expected way yet... I will see if I can put something together, this wiki page does not yet exist. The VTK examples, and the tests in Charts/Testing/ give many examples of what works, along with ParaView which uses the VTK charts in its GUI (you can download binaries and see what it already exposed). > > - I know this a difficult one, but what are the priorities on the 2D API stuff ? > Is there some kind of target date as when things will kind of settle down ? > Does it make sense for me, to check out sources regularly via git ? So far I use the > 5.6.1 release. I think it would make sense to check out the source via git. I am working on several new features, there is an article in the Source, http://www.kitware.com/products/html/NewChartAPIInVTK.html We have a new release (VTK 5.8), and I will be getting things ready for that release. There are a few new chart types, along with the work we are doing on Marks (Protovis like API in C++ over the 2D API/2D scene). I monitor the mailing lists, but will see about making a high level summary of this work. I will post to the list when I do so. There are a few topic branches I am getting ready to merge into VTK master for things like 2D histograms (color maps), fixed size charts (enabling multiple charts with interaction in one scene). Marcus -------------- next part -------------- ------------------------------------------------------------------------------------------------------- Registergericht: Traunstein / Registry Court: HRB 275 ? Sitz / Head Office: Traunreut Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman), Michael Grimm, Matthias Fauser, Sebastian Tondorf E-Mail Haftungsausschluss / E-Mail Disclaimer: http://www.heidenhain.de/disclaimer From david.gobbi at gmail.com Wed Dec 1 13:01:46 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 1 Dec 2010 11:01:46 -0700 Subject: [vtkusers] vtkImageData::FindCell In-Reply-To: References: Message-ID: On Tue, Nov 30, 2010 at 10:41 AM, David Gobbi wrote: > On Tue, Nov 30, 2010 at 9:25 AM, David Doria wrote: > >> >> So it considers a point on the boundary to be "outside" no matter the >> tolerance? Doesn't that seem silly? Often you may know the coordinates >> of the grid points and want to get the cell id they are associated >> with. This method should work for all such points, but it seems to >> work only on points that aren't on the boundary faces of the >> structured grid? >> > > Hmm... I looked at the FindCell implementation in vtkImageData, and it > ignores > the tolerance completely. This is not good. As you said, boundary points > should be considered to be inside the cell unless the tolerance is strictly > set > to zero (and even then, it should be an even 50/50 chance that the boundary > points are considered to be inside). > > In fact this is precisely the sort of boundary issue that tolerances are > for: > to ensure that points on the boundary are not mistakenly marked as > "outside" > due to roundoff error. > David, can you put this into the bug tracker? The entry doesn't have to say much, it just has to say that vtkImageData::FindCell ignores the tolerance and that, because of this, there is no way to ensure that FindCell will return a cell when given a point that lies on the boundary of the data set. There is a good chance that I can do a fix for this in the coming weeks. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Wed Dec 1 13:13:38 2010 From: daviddoria at gmail.com (David Doria) Date: Wed, 1 Dec 2010 13:13:38 -0500 Subject: [vtkusers] vtkImageData::FindCell In-Reply-To: References: Message-ID: > David, can you put this into the bug tracker? ?The entry doesn't have to say > much, it just has to say that vtkImageData::FindCell ignores the tolerance > and that, because of this, there is no way to ensure that FindCell will > return > a cell?when given a point that lies on the boundary of the data set. > There is a good chance that I can do a fix for this in the coming weeks. > ??David > Here you go: http://public.kitware.com/Bug/view.php?id=11550 That'd be great, thanks. While you add it, can you add a FindCell(double[3]) convenience function? The interface is crazy if all you want is the cell id. int vtkImageData::FindCell(double p[3]) { int subId; double pcoords[3] = {0,0,0}; double weights[8]; return image->FindCell(p, NULL, 0, epsilon, subId, pcoords, weights); } David From david.gobbi at gmail.com Wed Dec 1 13:32:58 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 1 Dec 2010 11:32:58 -0700 Subject: [vtkusers] vtkImageData::FindCell In-Reply-To: References: Message-ID: On Wed, Dec 1, 2010 at 11:13 AM, David Doria wrote: > > Here you go: > http://public.kitware.com/Bug/view.php?id=11550 > > That'd be great, thanks. > > While you add it, can you add a FindCell(double[3]) convenience function? > > The interface is crazy if all you want is the cell id. > > int vtkImageData::FindCell(double p[3]) > { > int subId; > double pcoords[3] = {0,0,0}; > double weights[8]; > return image->FindCell(p, NULL, 0, epsilon, subId, pcoords, weights); > } The FindCell() method is part of the abstract interface for vtkDataSet, so you shouldn't add a FindCell methods that only applies to a specific kind of data set. I'm not saying that that VTK's data interface is ideal. It could definitely stand some improvement. But it has to be improved holistically. So any time you ask to add one specific method for one specific data set, I'll always be on the "no" side. If someone was to put forth a proposal to globally improve VTK's data interface, I'd be much more amenable. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From darshanpai at gmail.com Wed Dec 1 23:08:28 2010 From: darshanpai at gmail.com (Darshan Pai) Date: Wed, 1 Dec 2010 23:08:28 -0500 Subject: [vtkusers] Simple arithmeticquestion..! In-Reply-To: References: Message-ID: If you are making a new array after negating from x , why not just have a condition for negative before making new array ? Regards On Wed, Dec 1, 2010 at 2:35 AM, rakesh patil wrote: > Hello, > > I have a single dimension array of say 'n' elements. I need to subtract > each and every value(from this array) from a scalar value say 'x'. > > for example, I have array with values, {2,3,5,2,7,8,3}, and let x=4, then > the final ouput should me x - arr(i) > > i.e. final output shud be, {2,1,-1,2,-3,-4,1} > > Then after getting this resultant array, I have to replace all the negative > values with 0. > > Can anyone help me to accomplish this without iterating through the > array...? > > Thanks > > Regards > Rakesh Patil > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmroden at gmail.com Thu Dec 2 00:01:27 2010 From: mmroden at gmail.com (Mark Roden) Date: Wed, 1 Dec 2010 21:01:27 -0800 Subject: [vtkusers] vtk 5.6.1 on a mac wrapped in Java Message-ID: Hi all, So I managed to get vtk 5.6.1 to work on a mac with java wrappings on (10.6.5) and with gdcm. The following code is producing errors that I don't see on windows: IPPSorter sorter = new IPPSorter(); sorter.SetComputeZSpacing(true); sorter.SetZSpacingTolerance(0.000001); Boolean sorted = sorter.Sort(theSeriesFiles); //sorter.Sort(ft); //have to make a vtk string array FilenamesType sortedFT = sorter.GetFilenames(); long theSize = sortedFT.size(); vtkStringArray sa = new vtkStringArray(); for (int j = 0; j < theSize; j++) { String theString2 = sortedFT.get(j); sa.InsertNextValue(sortedFT.get(j)); } gdcmReader.SetFileNames(sa); gdcmReader.Update(); imageData = gdcmReader.GetOutput(); //make sure that we're getting spacing and orientation info double[] spacing = imageData.GetSpacing(); spacing[2] = sorter.GetZSpacing(); imageData.SetSpacing(spacing); double[] origin = imageData.GetOrigin(); double[] bounds = imageData.GetBounds(); double[] extraOrigin = {0,0,0};//because vtk will only flip about 0,0,0 vtkImageChangeInformation imageSpacingChange = new vtkImageChangeInformation(); imageSpacingChange.SetInput(imageData); imageSpacingChange.SetOutputSpacing(spacing[0], spacing[1], spacing[2]); imageSpacingChange.SetOutputOrigin(extraOrigin); imageSpacingChange.Update(); Once the last line is hit, the following error is reported in netbeans: ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/VTK-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx, line 802 vtkStreamingDemandDrivenPipeline (0x135884c10): Input for connection index 0 on input port index 0 for algorithm vtkImageChangeInformation(0x1358853c0) is NULL, but a vtkImageData is required. This code works perfectly well in Windows, and the spacing, origin, and bounds arrays all match the values in windows when loading the same series there. So, I know that the gdcm side of things is working, at least to the point that those arrays are being reported correctly. Because the pipeline is breaking there, nothing else is working. What can I do to fix it? Thanks, Mark From abayiz at yahoo.com Thu Dec 2 04:50:42 2010 From: abayiz at yahoo.com (akbarjan bayiz) Date: Thu, 2 Dec 2010 01:50:42 -0800 (PST) Subject: [vtkusers] How can I save vtkOBJReader output? Message-ID: <148038.14979.qm@web56306.mail.re3.yahoo.com> Hello, all! I am using the vtkOBJReader to read and render an .obj file, which works well. But, I also want to save its output, I mean those polydata generated by vtkOBJReader, into another single file. How can I do this? I want to save all the data in the right form, so that I can reach and render them later. I need an C++ example. By the way, I tried the "GetOutput" command, but it didn't work properly. I am new to VTK, and I really need an explicit, full example. Thank you very much in advance. Best regards, Abayiz From daviddoria at gmail.com Thu Dec 2 07:19:25 2010 From: daviddoria at gmail.com (David Doria) Date: Thu, 2 Dec 2010 07:19:25 -0500 Subject: [vtkusers] How can I save vtkOBJReader output? In-Reply-To: <148038.14979.qm@web56306.mail.re3.yahoo.com> References: <148038.14979.qm@web56306.mail.re3.yahoo.com> Message-ID: On Thu, Dec 2, 2010 at 4:50 AM, akbarjan bayiz wrote: > Hello, all! > I am using the vtkOBJReader to read and render an .obj file, which works well. But, I also want to save its output, I mean those polydata generated by vtkOBJReader, into another single file. How can I do this? I want to save all the data in the right form, so that I can reach and render them later. I need an C++ example. > By the way, I tried the "GetOutput" command, but it didn't work properly. I am new to VTK, and I really need an explicit, full example. > Thank you very much in advance. > > Best regards, > Abayiz If you are looking to write an obj file, it is not possible with the "off the shelf" VTK. I wrote a vtkOBJWriter which you can get here: https://github.com/daviddoria/daviddoria-vtk/tree/VTK-vtkObjWriter If you can live with a different type of file, here is an example of how to write a ply file: http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/WritePLY Just replace the SphereSource in the example with your reader. I'm not sure what you are doing, but I find it convenient to use the VTK file formats so you can go back and forth between Paraview and VTK easily. Here is an example of writing a vtk file: http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/WriteVTP David From sebastien.jourdain at kitware.com Thu Dec 2 08:02:20 2010 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 2 Dec 2010 08:02:20 -0500 Subject: [vtkusers] vtk 5.6.1 on a mac wrapped in Java In-Reply-To: References: Message-ID: Hi Mark, did you try your windows (Java) binary on your mac to see if you get the same behavior ? Are you sure that on your mac, the filename provided to the reader are correct ? (no space or special string ?) Seb On Thu, Dec 2, 2010 at 12:01 AM, Mark Roden wrote: > Hi all, > > So I managed to get vtk 5.6.1 to work on a mac with java wrappings on > (10.6.5) and with gdcm. > > The following code is producing errors that I don't see on windows: > > ? ? ? ? ? ? ? IPPSorter sorter = new IPPSorter(); > ? ? ? ? ? ? ? ?sorter.SetComputeZSpacing(true); > ? ? ? ? ? ? ? ?sorter.SetZSpacingTolerance(0.000001); > ? ? ? ? ? ? ? ?Boolean sorted = sorter.Sort(theSeriesFiles); > ? ? ? ? ? ? ? ?//sorter.Sort(ft); > > ? ? ? ? ? ? ? ?//have to make a vtk string array > ? ? ? ? ? ? ? ?FilenamesType sortedFT = sorter.GetFilenames(); > ? ? ? ? ? ? ? ?long theSize = sortedFT.size(); > ? ? ? ? ? ? ? ?vtkStringArray sa = new vtkStringArray(); > ? ? ? ? ? ? ? ?for (int j = 0; j < theSize; j++) { > ? ? ? ? ? ? ? ? ? ?String theString2 = sortedFT.get(j); > ? ? ? ? ? ? ? ? ? ?sa.InsertNextValue(sortedFT.get(j)); > ? ? ? ? ? ? ? ?} > ? ? ? ? ? ? ? ?gdcmReader.SetFileNames(sa); > > ? ? ? ? ? ? ? ?gdcmReader.Update(); > > ? ? ? ? ? ? ? ?imageData = gdcmReader.GetOutput(); > > ? ? ? ? ? ? ? ?//make sure that we're getting spacing and orientation info > ? ? ? ? ? ? ? ?double[] spacing = imageData.GetSpacing(); > ? ? ? ? ? ? ? ?spacing[2] = sorter.GetZSpacing(); > ? ? ? ? ? ? ? ?imageData.SetSpacing(spacing); > ? ? ? ? ? ? ? ?double[] origin = imageData.GetOrigin(); > ? ? ? ? ? ? ? ?double[] bounds = imageData.GetBounds(); > ? ? ? ? ? ? ? ?double[] extraOrigin = {0,0,0};//because vtk will only > flip about 0,0,0 > > ? ? ? ? ? ? ? ?vtkImageChangeInformation imageSpacingChange = new > vtkImageChangeInformation(); > ? ? ? ? ? ? ? ?imageSpacingChange.SetInput(imageData); > ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputSpacing(spacing[0], > spacing[1], spacing[2]); > ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputOrigin(extraOrigin); > ? ? ? ? ? ? ? ?imageSpacingChange.Update(); > > Once the last line is hit, the following error is reported in netbeans: > > ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/VTK-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx, > line 802 > vtkStreamingDemandDrivenPipeline (0x135884c10): Input for connection > index 0 on input port index 0 for algorithm > vtkImageChangeInformation(0x1358853c0) is NULL, but a vtkImageData is > required. > > This code works perfectly well in Windows, and the spacing, origin, > and bounds arrays all match the values in windows when loading the > same series there. ?So, I know that the gdcm side of things is > working, at least to the point that those arrays are being reported > correctly. > > Because the pipeline is breaking there, nothing else is working. ?What > can I do to fix it? > > Thanks, > Mark > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > From mmroden at gmail.com Thu Dec 2 09:17:46 2010 From: mmroden at gmail.com (Mark Roden) Date: Thu, 2 Dec 2010 06:17:46 -0800 Subject: [vtkusers] vtk 5.6.1 on a mac wrapped in Java In-Reply-To: References: Message-ID: Hi Sebastien, I can't use the windows binary on the mac-- the vtk underpinnings are still C++, which means that it's compiled into a dll on windows, which means (as far as I know, and as my experiments confirm), it doesn't work on a mac. I have to recompile vtk for the mac directly. The java wrappings (the jar) should be identical, though. Just to be safe, I'm using the mac-generated jars now. I am sure that the filenames have no spaces or special strings. If you look at the line String theString2 = sortedFT.get(i) I can stop there with the debugger and see the contents of the string, and it's clean. For what it's worth, Fred Fred asked about this error message a year ago, and he got no response: http://public.kitware.com/pipermail/vtkusers/2009-October/102935.html I don't know if he was in the same situation as me, though. Thanks, Mark On Thu, Dec 2, 2010 at 5:02 AM, Sebastien Jourdain wrote: > Hi Mark, > > did you try your windows (Java) binary on your mac to see if you get > the same behavior ? > Are you sure that on your mac, the filename provided to the reader are > correct ? (no space or special string ?) > > Seb > > On Thu, Dec 2, 2010 at 12:01 AM, Mark Roden wrote: >> Hi all, >> >> So I managed to get vtk 5.6.1 to work on a mac with java wrappings on >> (10.6.5) and with gdcm. >> >> The following code is producing errors that I don't see on windows: >> >> ? ? ? ? ? ? ? IPPSorter sorter = new IPPSorter(); >> ? ? ? ? ? ? ? ?sorter.SetComputeZSpacing(true); >> ? ? ? ? ? ? ? ?sorter.SetZSpacingTolerance(0.000001); >> ? ? ? ? ? ? ? ?Boolean sorted = sorter.Sort(theSeriesFiles); >> ? ? ? ? ? ? ? ?//sorter.Sort(ft); >> >> ? ? ? ? ? ? ? ?//have to make a vtk string array >> ? ? ? ? ? ? ? ?FilenamesType sortedFT = sorter.GetFilenames(); >> ? ? ? ? ? ? ? ?long theSize = sortedFT.size(); >> ? ? ? ? ? ? ? ?vtkStringArray sa = new vtkStringArray(); >> ? ? ? ? ? ? ? ?for (int j = 0; j < theSize; j++) { >> ? ? ? ? ? ? ? ? ? ?String theString2 = sortedFT.get(j); >> ? ? ? ? ? ? ? ? ? ?sa.InsertNextValue(sortedFT.get(j)); >> ? ? ? ? ? ? ? ?} >> ? ? ? ? ? ? ? ?gdcmReader.SetFileNames(sa); >> >> ? ? ? ? ? ? ? ?gdcmReader.Update(); >> >> ? ? ? ? ? ? ? ?imageData = gdcmReader.GetOutput(); >> >> ? ? ? ? ? ? ? ?//make sure that we're getting spacing and orientation info >> ? ? ? ? ? ? ? ?double[] spacing = imageData.GetSpacing(); >> ? ? ? ? ? ? ? ?spacing[2] = sorter.GetZSpacing(); >> ? ? ? ? ? ? ? ?imageData.SetSpacing(spacing); >> ? ? ? ? ? ? ? ?double[] origin = imageData.GetOrigin(); >> ? ? ? ? ? ? ? ?double[] bounds = imageData.GetBounds(); >> ? ? ? ? ? ? ? ?double[] extraOrigin = {0,0,0};//because vtk will only >> flip about 0,0,0 >> >> ? ? ? ? ? ? ? ?vtkImageChangeInformation imageSpacingChange = new >> vtkImageChangeInformation(); >> ? ? ? ? ? ? ? ?imageSpacingChange.SetInput(imageData); >> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputSpacing(spacing[0], >> spacing[1], spacing[2]); >> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputOrigin(extraOrigin); >> ? ? ? ? ? ? ? ?imageSpacingChange.Update(); >> >> Once the last line is hit, the following error is reported in netbeans: >> >> ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/VTK-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx, >> line 802 >> vtkStreamingDemandDrivenPipeline (0x135884c10): Input for connection >> index 0 on input port index 0 for algorithm >> vtkImageChangeInformation(0x1358853c0) is NULL, but a vtkImageData is >> required. >> >> This code works perfectly well in Windows, and the spacing, origin, >> and bounds arrays all match the values in windows when loading the >> same series there. ?So, I know that the gdcm side of things is >> working, at least to the point that those arrays are being reported >> correctly. >> >> Because the pipeline is breaking there, nothing else is working. ?What >> can I do to fix it? >> >> Thanks, >> Mark >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> > From sebastien.jourdain at kitware.com Thu Dec 2 09:53:19 2010 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 2 Dec 2010 09:53:19 -0500 Subject: [vtkusers] vtk 5.6.1 on a mac wrapped in Java In-Reply-To: References: Message-ID: I was talking about your Java code that was using VTK, not VTK itself. Moreover, I think that you can not inherit from VTK classes in Java... Seb On Thu, Dec 2, 2010 at 9:17 AM, Mark Roden wrote: > Hi Sebastien, > > I can't use the windows binary on the mac-- the vtk underpinnings are > still C++, which means that it's compiled into a dll on windows, which > means (as far as I know, and as my experiments confirm), it doesn't > work on a mac. ?I have to recompile vtk for the mac directly. ?The > java wrappings (the jar) should be identical, though. ?Just to be > safe, I'm using the mac-generated jars now. > > I am sure that the filenames have no spaces or special strings. ?If > you look at the line > > ? ? String theString2 = sortedFT.get(i) > > I can stop there with the debugger and see the contents of the string, > and it's clean. > > For what it's worth, Fred Fred asked about this error message a year > ago, and he got no response: > http://public.kitware.com/pipermail/vtkusers/2009-October/102935.html > I don't know if he was in the same situation as me, though. > > Thanks, > Mark > > On Thu, Dec 2, 2010 at 5:02 AM, Sebastien Jourdain > wrote: >> Hi Mark, >> >> did you try your windows (Java) binary on your mac to see if you get >> the same behavior ? >> Are you sure that on your mac, the filename provided to the reader are >> correct ? (no space or special string ?) >> >> Seb >> >> On Thu, Dec 2, 2010 at 12:01 AM, Mark Roden wrote: >>> Hi all, >>> >>> So I managed to get vtk 5.6.1 to work on a mac with java wrappings on >>> (10.6.5) and with gdcm. >>> >>> The following code is producing errors that I don't see on windows: >>> >>> ? ? ? ? ? ? ? IPPSorter sorter = new IPPSorter(); >>> ? ? ? ? ? ? ? ?sorter.SetComputeZSpacing(true); >>> ? ? ? ? ? ? ? ?sorter.SetZSpacingTolerance(0.000001); >>> ? ? ? ? ? ? ? ?Boolean sorted = sorter.Sort(theSeriesFiles); >>> ? ? ? ? ? ? ? ?//sorter.Sort(ft); >>> >>> ? ? ? ? ? ? ? ?//have to make a vtk string array >>> ? ? ? ? ? ? ? ?FilenamesType sortedFT = sorter.GetFilenames(); >>> ? ? ? ? ? ? ? ?long theSize = sortedFT.size(); >>> ? ? ? ? ? ? ? ?vtkStringArray sa = new vtkStringArray(); >>> ? ? ? ? ? ? ? ?for (int j = 0; j < theSize; j++) { >>> ? ? ? ? ? ? ? ? ? ?String theString2 = sortedFT.get(j); >>> ? ? ? ? ? ? ? ? ? ?sa.InsertNextValue(sortedFT.get(j)); >>> ? ? ? ? ? ? ? ?} >>> ? ? ? ? ? ? ? ?gdcmReader.SetFileNames(sa); >>> >>> ? ? ? ? ? ? ? ?gdcmReader.Update(); >>> >>> ? ? ? ? ? ? ? ?imageData = gdcmReader.GetOutput(); >>> >>> ? ? ? ? ? ? ? ?//make sure that we're getting spacing and orientation info >>> ? ? ? ? ? ? ? ?double[] spacing = imageData.GetSpacing(); >>> ? ? ? ? ? ? ? ?spacing[2] = sorter.GetZSpacing(); >>> ? ? ? ? ? ? ? ?imageData.SetSpacing(spacing); >>> ? ? ? ? ? ? ? ?double[] origin = imageData.GetOrigin(); >>> ? ? ? ? ? ? ? ?double[] bounds = imageData.GetBounds(); >>> ? ? ? ? ? ? ? ?double[] extraOrigin = {0,0,0};//because vtk will only >>> flip about 0,0,0 >>> >>> ? ? ? ? ? ? ? ?vtkImageChangeInformation imageSpacingChange = new >>> vtkImageChangeInformation(); >>> ? ? ? ? ? ? ? ?imageSpacingChange.SetInput(imageData); >>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputSpacing(spacing[0], >>> spacing[1], spacing[2]); >>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputOrigin(extraOrigin); >>> ? ? ? ? ? ? ? ?imageSpacingChange.Update(); >>> >>> Once the last line is hit, the following error is reported in netbeans: >>> >>> ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/VTK-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx, >>> line 802 >>> vtkStreamingDemandDrivenPipeline (0x135884c10): Input for connection >>> index 0 on input port index 0 for algorithm >>> vtkImageChangeInformation(0x1358853c0) is NULL, but a vtkImageData is >>> required. >>> >>> This code works perfectly well in Windows, and the spacing, origin, >>> and bounds arrays all match the values in windows when loading the >>> same series there. ?So, I know that the gdcm side of things is >>> working, at least to the point that those arrays are being reported >>> correctly. >>> >>> Because the pipeline is breaking there, nothing else is working. ?What >>> can I do to fix it? >>> >>> Thanks, >>> Mark >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://www.vtk.org/mailman/listinfo/vtkusers >>> >> > From mmroden at gmail.com Thu Dec 2 10:00:05 2010 From: mmroden at gmail.com (Mark Roden) Date: Thu, 2 Dec 2010 07:00:05 -0800 Subject: [vtkusers] vtk 5.6.1 on a mac wrapped in Java In-Reply-To: References: Message-ID: The java code works fine on windows, it's the same code, shared via git on the different machines I'm not trying to inherit. vtkImageChangeInformation is exposed by the vtk java wrapping, but the vtlImageData I'm passing in isn't working. This code works in java on windows. It doesn't on mac. I use the same libraries underneath, or at least, the same versions of gdcm and vtk are built and used. On Thu, Dec 2, 2010 at 6:53 AM, Sebastien Jourdain wrote: > I was talking about your Java code that was using VTK, not VTK itself. > > Moreover, I think that you can not inherit from VTK classes in Java... > > Seb > > On Thu, Dec 2, 2010 at 9:17 AM, Mark Roden wrote: >> Hi Sebastien, >> >> I can't use the windows binary on the mac-- the vtk underpinnings are >> still C++, which means that it's compiled into a dll on windows, which >> means (as far as I know, and as my experiments confirm), it doesn't >> work on a mac. ?I have to recompile vtk for the mac directly. ?The >> java wrappings (the jar) should be identical, though. ?Just to be >> safe, I'm using the mac-generated jars now. >> >> I am sure that the filenames have no spaces or special strings. ?If >> you look at the line >> >> ? ? String theString2 = sortedFT.get(i) >> >> I can stop there with the debugger and see the contents of the string, >> and it's clean. >> >> For what it's worth, Fred Fred asked about this error message a year >> ago, and he got no response: >> http://public.kitware.com/pipermail/vtkusers/2009-October/102935.html >> I don't know if he was in the same situation as me, though. >> >> Thanks, >> Mark >> >> On Thu, Dec 2, 2010 at 5:02 AM, Sebastien Jourdain >> wrote: >>> Hi Mark, >>> >>> did you try your windows (Java) binary on your mac to see if you get >>> the same behavior ? >>> Are you sure that on your mac, the filename provided to the reader are >>> correct ? (no space or special string ?) >>> >>> Seb >>> >>> On Thu, Dec 2, 2010 at 12:01 AM, Mark Roden wrote: >>>> Hi all, >>>> >>>> So I managed to get vtk 5.6.1 to work on a mac with java wrappings on >>>> (10.6.5) and with gdcm. >>>> >>>> The following code is producing errors that I don't see on windows: >>>> >>>> ? ? ? ? ? ? ? IPPSorter sorter = new IPPSorter(); >>>> ? ? ? ? ? ? ? ?sorter.SetComputeZSpacing(true); >>>> ? ? ? ? ? ? ? ?sorter.SetZSpacingTolerance(0.000001); >>>> ? ? ? ? ? ? ? ?Boolean sorted = sorter.Sort(theSeriesFiles); >>>> ? ? ? ? ? ? ? ?//sorter.Sort(ft); >>>> >>>> ? ? ? ? ? ? ? ?//have to make a vtk string array >>>> ? ? ? ? ? ? ? ?FilenamesType sortedFT = sorter.GetFilenames(); >>>> ? ? ? ? ? ? ? ?long theSize = sortedFT.size(); >>>> ? ? ? ? ? ? ? ?vtkStringArray sa = new vtkStringArray(); >>>> ? ? ? ? ? ? ? ?for (int j = 0; j < theSize; j++) { >>>> ? ? ? ? ? ? ? ? ? ?String theString2 = sortedFT.get(j); >>>> ? ? ? ? ? ? ? ? ? ?sa.InsertNextValue(sortedFT.get(j)); >>>> ? ? ? ? ? ? ? ?} >>>> ? ? ? ? ? ? ? ?gdcmReader.SetFileNames(sa); >>>> >>>> ? ? ? ? ? ? ? ?gdcmReader.Update(); >>>> >>>> ? ? ? ? ? ? ? ?imageData = gdcmReader.GetOutput(); >>>> >>>> ? ? ? ? ? ? ? ?//make sure that we're getting spacing and orientation info >>>> ? ? ? ? ? ? ? ?double[] spacing = imageData.GetSpacing(); >>>> ? ? ? ? ? ? ? ?spacing[2] = sorter.GetZSpacing(); >>>> ? ? ? ? ? ? ? ?imageData.SetSpacing(spacing); >>>> ? ? ? ? ? ? ? ?double[] origin = imageData.GetOrigin(); >>>> ? ? ? ? ? ? ? ?double[] bounds = imageData.GetBounds(); >>>> ? ? ? ? ? ? ? ?double[] extraOrigin = {0,0,0};//because vtk will only >>>> flip about 0,0,0 >>>> >>>> ? ? ? ? ? ? ? ?vtkImageChangeInformation imageSpacingChange = new >>>> vtkImageChangeInformation(); >>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetInput(imageData); >>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputSpacing(spacing[0], >>>> spacing[1], spacing[2]); >>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputOrigin(extraOrigin); >>>> ? ? ? ? ? ? ? ?imageSpacingChange.Update(); >>>> >>>> Once the last line is hit, the following error is reported in netbeans: >>>> >>>> ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/VTK-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx, >>>> line 802 >>>> vtkStreamingDemandDrivenPipeline (0x135884c10): Input for connection >>>> index 0 on input port index 0 for algorithm >>>> vtkImageChangeInformation(0x1358853c0) is NULL, but a vtkImageData is >>>> required. >>>> >>>> This code works perfectly well in Windows, and the spacing, origin, >>>> and bounds arrays all match the values in windows when loading the >>>> same series there. ?So, I know that the gdcm side of things is >>>> working, at least to the point that those arrays are being reported >>>> correctly. >>>> >>>> Because the pipeline is breaking there, nothing else is working. ?What >>>> can I do to fix it? >>>> >>>> Thanks, >>>> Mark >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://www.vtk.org/mailman/listinfo/vtkusers >>>> >>> >> > From paul.m.edwards at gmail.com Thu Dec 2 10:40:51 2010 From: paul.m.edwards at gmail.com (Paul Edwards) Date: Thu, 2 Dec 2010 15:40:51 +0000 Subject: [vtkusers] ShallowCopy with composite datasets Message-ID: Hi, Is there a reason why CompositeDataSet::ShallowCopy just copies the pointer rather than calling ShallowCopy on the vtkDataSets it contains? Thanks, Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Thu Dec 2 12:21:28 2010 From: daviddoria at gmail.com (David Doria) Date: Thu, 2 Dec 2010 12:21:28 -0500 Subject: [vtkusers] quickly iterate over voxel data in vtkImageData in Java In-Reply-To: References: Message-ID: On Tue, Nov 30, 2010 at 11:33 AM, Jonathan Morra wrote: > I'm running vtk with Java and want to quickly iterate over the voxels in a > 3D vtkImageData. ?Right now, the only methods I found were > GetScalarComponentAsFloat > and > SetScalarComponentFromFloat > however, these methods appear to be very slow. > 1. ?Are these methods actually slow? > 2. ?Is there a quicker way to iterate over a section of voxels in > vtkImageData. > My problem specifically is that I have 2 3D vtkImageData's. ?I want to copy > one plane of one vtkImageData into one plane of the other vtkImageData. ?The > only way I found of doing that is to iterate over the plane and use the > get/set scalar components method. ?Is there another way? ?If not, how can I > speed up what I'm doing. > Thanks, > Jon ITK has excellent iterators that VTK should definitely try to copy. I tried to setup some of the structure here: https://github.com/daviddoria/vtkImageTraversal but I am still using the inefficient access methods you mentioned to traverse the image. Pointer arithmetic should definitely be used. If anyone has time and agrees that this is useful feel free to work in the above repository (give me your user name and I will add you as a collaborator). David From daviddoria at gmail.com Thu Dec 2 12:41:29 2010 From: daviddoria at gmail.com (David Doria) Date: Thu, 2 Dec 2010 12:41:29 -0500 Subject: [vtkusers] How can I save vtkOBJReader output? In-Reply-To: <456039.14656.qm@web56306.mail.re3.yahoo.com> References: <456039.14656.qm@web56306.mail.re3.yahoo.com> Message-ID: On Thu, Dec 2, 2010 at 12:32 PM, akbarjan bayiz wrote: > Hello, David! > Thank you for your answers and suggestions. > What I am trying to do is, to open and render an existing obj file, save > its polydata, then open and change those saved polydata and render them. So, > it is expected to see the corresponding changes of the newly rendered > object. Do you have any other suggestions to do this? > > Thank you again! > Please keep the discusson on the list so everyone can help and benefit. You can open the obj using vtkOBJReader, you can write it to a vtp file using vtkXMLPolyDataWriter, you can read that new file with vtkXMLPolyDataReader. So which part are you missing? David -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmroden at gmail.com Thu Dec 2 13:49:19 2010 From: mmroden at gmail.com (Mark Roden) Date: Thu, 2 Dec 2010 10:49:19 -0800 Subject: [vtkusers] vtk 5.6.1 on a mac wrapped in Java In-Reply-To: References: Message-ID: Maybe the problem is the build method I'm using for the libraries. I'm building both gdcm and vtk using Unix makefiles on the mac, since the xcode stuff isn't working. How can I make sure that I'm building release versions on both machines? There's a suggestion here: http://comments.gmane.org/gmane.comp.lib.mitk.user/1052 that this bug could be due to compilation problems. Specifically, I'd like for 64 bit release versions to be made. On XCode, that's a dropdown selection, but typing 'make release' results in 'don't know how to build release, stop', and I'm not sure what 'make all' is doing. Thanks, Mark On Thu, Dec 2, 2010 at 7:00 AM, Mark Roden wrote: > The java code works fine on windows, it's the same code, shared via > git on the different machines > > I'm not trying to inherit. ?vtkImageChangeInformation is exposed by > the vtk java wrapping, but the vtlImageData I'm passing in isn't > working. > > This code works in java on windows. ?It doesn't on mac. ?I use the > same libraries underneath, or at least, the same versions of gdcm and > vtk are built and used. > > On Thu, Dec 2, 2010 at 6:53 AM, Sebastien Jourdain > wrote: >> I was talking about your Java code that was using VTK, not VTK itself. >> >> Moreover, I think that you can not inherit from VTK classes in Java... >> >> Seb >> >> On Thu, Dec 2, 2010 at 9:17 AM, Mark Roden wrote: >>> Hi Sebastien, >>> >>> I can't use the windows binary on the mac-- the vtk underpinnings are >>> still C++, which means that it's compiled into a dll on windows, which >>> means (as far as I know, and as my experiments confirm), it doesn't >>> work on a mac. ?I have to recompile vtk for the mac directly. ?The >>> java wrappings (the jar) should be identical, though. ?Just to be >>> safe, I'm using the mac-generated jars now. >>> >>> I am sure that the filenames have no spaces or special strings. ?If >>> you look at the line >>> >>> ? ? String theString2 = sortedFT.get(i) >>> >>> I can stop there with the debugger and see the contents of the string, >>> and it's clean. >>> >>> For what it's worth, Fred Fred asked about this error message a year >>> ago, and he got no response: >>> http://public.kitware.com/pipermail/vtkusers/2009-October/102935.html >>> I don't know if he was in the same situation as me, though. >>> >>> Thanks, >>> Mark >>> >>> On Thu, Dec 2, 2010 at 5:02 AM, Sebastien Jourdain >>> wrote: >>>> Hi Mark, >>>> >>>> did you try your windows (Java) binary on your mac to see if you get >>>> the same behavior ? >>>> Are you sure that on your mac, the filename provided to the reader are >>>> correct ? (no space or special string ?) >>>> >>>> Seb >>>> >>>> On Thu, Dec 2, 2010 at 12:01 AM, Mark Roden wrote: >>>>> Hi all, >>>>> >>>>> So I managed to get vtk 5.6.1 to work on a mac with java wrappings on >>>>> (10.6.5) and with gdcm. >>>>> >>>>> The following code is producing errors that I don't see on windows: >>>>> >>>>> ? ? ? ? ? ? ? IPPSorter sorter = new IPPSorter(); >>>>> ? ? ? ? ? ? ? ?sorter.SetComputeZSpacing(true); >>>>> ? ? ? ? ? ? ? ?sorter.SetZSpacingTolerance(0.000001); >>>>> ? ? ? ? ? ? ? ?Boolean sorted = sorter.Sort(theSeriesFiles); >>>>> ? ? ? ? ? ? ? ?//sorter.Sort(ft); >>>>> >>>>> ? ? ? ? ? ? ? ?//have to make a vtk string array >>>>> ? ? ? ? ? ? ? ?FilenamesType sortedFT = sorter.GetFilenames(); >>>>> ? ? ? ? ? ? ? ?long theSize = sortedFT.size(); >>>>> ? ? ? ? ? ? ? ?vtkStringArray sa = new vtkStringArray(); >>>>> ? ? ? ? ? ? ? ?for (int j = 0; j < theSize; j++) { >>>>> ? ? ? ? ? ? ? ? ? ?String theString2 = sortedFT.get(j); >>>>> ? ? ? ? ? ? ? ? ? ?sa.InsertNextValue(sortedFT.get(j)); >>>>> ? ? ? ? ? ? ? ?} >>>>> ? ? ? ? ? ? ? ?gdcmReader.SetFileNames(sa); >>>>> >>>>> ? ? ? ? ? ? ? ?gdcmReader.Update(); >>>>> >>>>> ? ? ? ? ? ? ? ?imageData = gdcmReader.GetOutput(); >>>>> >>>>> ? ? ? ? ? ? ? ?//make sure that we're getting spacing and orientation info >>>>> ? ? ? ? ? ? ? ?double[] spacing = imageData.GetSpacing(); >>>>> ? ? ? ? ? ? ? ?spacing[2] = sorter.GetZSpacing(); >>>>> ? ? ? ? ? ? ? ?imageData.SetSpacing(spacing); >>>>> ? ? ? ? ? ? ? ?double[] origin = imageData.GetOrigin(); >>>>> ? ? ? ? ? ? ? ?double[] bounds = imageData.GetBounds(); >>>>> ? ? ? ? ? ? ? ?double[] extraOrigin = {0,0,0};//because vtk will only >>>>> flip about 0,0,0 >>>>> >>>>> ? ? ? ? ? ? ? ?vtkImageChangeInformation imageSpacingChange = new >>>>> vtkImageChangeInformation(); >>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetInput(imageData); >>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputSpacing(spacing[0], >>>>> spacing[1], spacing[2]); >>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputOrigin(extraOrigin); >>>>> ? ? ? ? ? ? ? ?imageSpacingChange.Update(); >>>>> >>>>> Once the last line is hit, the following error is reported in netbeans: >>>>> >>>>> ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/VTK-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx, >>>>> line 802 >>>>> vtkStreamingDemandDrivenPipeline (0x135884c10): Input for connection >>>>> index 0 on input port index 0 for algorithm >>>>> vtkImageChangeInformation(0x1358853c0) is NULL, but a vtkImageData is >>>>> required. >>>>> >>>>> This code works perfectly well in Windows, and the spacing, origin, >>>>> and bounds arrays all match the values in windows when loading the >>>>> same series there. ?So, I know that the gdcm side of things is >>>>> working, at least to the point that those arrays are being reported >>>>> correctly. >>>>> >>>>> Because the pipeline is breaking there, nothing else is working. ?What >>>>> can I do to fix it? >>>>> >>>>> Thanks, >>>>> Mark >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://www.vtk.org/mailman/listinfo/vtkusers >>>>> >>>> >>> >> > From sean at rogue-research.com Thu Dec 2 14:32:36 2010 From: sean at rogue-research.com (Sean McBride) Date: Thu, 2 Dec 2010 14:32:36 -0500 Subject: [vtkusers] vtk 5.6.1 on a mac wrapped in Java In-Reply-To: References: Message-ID: <20101202193236.1057974708@mail.rogue-research.com> On Thu, 2 Dec 2010 10:49:19 -0800, Mark Roden said: >I'm building both gdcm and vtk using Unix makefiles on the mac, since >the xcode stuff isn't working. > >How can I make sure that I'm building release versions on both >machines? There's a suggestion here: >http://comments.gmane.org/gmane.comp.lib.mitk.user/1052 > >that this bug could be due to compilation problems. > >Specifically, I'd like for 64 bit release versions to be made. On >XCode, that's a dropdown selection, but typing 'make release' results >in 'don't know how to build release, stop', and I'm not sure what >'make all' is doing. That's something you should configure in cmake. Specifically, you want CMAKE_OSX_ARCHITECTURES and CMAKE_BUILD_TYPE. -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From sebastien.jourdain at kitware.com Thu Dec 2 14:32:45 2010 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 2 Dec 2010 14:32:45 -0500 Subject: [vtkusers] vtk 5.6.1 on a mac wrapped in Java In-Reply-To: References: Message-ID: the Unix makefile is fine. To setup release you just need to write Release in the CMake config for the build type (CMAKE_BUILD_TYPE). You can switch also the optimisation to -02 instead of -03 in the ..._FLAGS_RELEASE options. But I doubt that it could come from that. Seb On Thu, Dec 2, 2010 at 1:49 PM, Mark Roden wrote: > Maybe the problem is the build method I'm using for the libraries. > > I'm building both gdcm and vtk using Unix makefiles on the mac, since > the xcode stuff isn't working. > > How can I make sure that I'm building release versions on both > machines? ?There's a suggestion here: > http://comments.gmane.org/gmane.comp.lib.mitk.user/1052 > > that this bug could be due to compilation problems. > > Specifically, I'd like for 64 bit release versions to be made. ?On > XCode, that's a dropdown selection, but typing 'make release' results > in 'don't know how to build release, stop', and I'm not sure what > 'make all' is doing. > > Thanks, > Mark > > On Thu, Dec 2, 2010 at 7:00 AM, Mark Roden wrote: >> The java code works fine on windows, it's the same code, shared via >> git on the different machines >> >> I'm not trying to inherit. ?vtkImageChangeInformation is exposed by >> the vtk java wrapping, but the vtlImageData I'm passing in isn't >> working. >> >> This code works in java on windows. ?It doesn't on mac. ?I use the >> same libraries underneath, or at least, the same versions of gdcm and >> vtk are built and used. >> >> On Thu, Dec 2, 2010 at 6:53 AM, Sebastien Jourdain >> wrote: >>> I was talking about your Java code that was using VTK, not VTK itself. >>> >>> Moreover, I think that you can not inherit from VTK classes in Java... >>> >>> Seb >>> >>> On Thu, Dec 2, 2010 at 9:17 AM, Mark Roden wrote: >>>> Hi Sebastien, >>>> >>>> I can't use the windows binary on the mac-- the vtk underpinnings are >>>> still C++, which means that it's compiled into a dll on windows, which >>>> means (as far as I know, and as my experiments confirm), it doesn't >>>> work on a mac. ?I have to recompile vtk for the mac directly. ?The >>>> java wrappings (the jar) should be identical, though. ?Just to be >>>> safe, I'm using the mac-generated jars now. >>>> >>>> I am sure that the filenames have no spaces or special strings. ?If >>>> you look at the line >>>> >>>> ? ? String theString2 = sortedFT.get(i) >>>> >>>> I can stop there with the debugger and see the contents of the string, >>>> and it's clean. >>>> >>>> For what it's worth, Fred Fred asked about this error message a year >>>> ago, and he got no response: >>>> http://public.kitware.com/pipermail/vtkusers/2009-October/102935.html >>>> I don't know if he was in the same situation as me, though. >>>> >>>> Thanks, >>>> Mark >>>> >>>> On Thu, Dec 2, 2010 at 5:02 AM, Sebastien Jourdain >>>> wrote: >>>>> Hi Mark, >>>>> >>>>> did you try your windows (Java) binary on your mac to see if you get >>>>> the same behavior ? >>>>> Are you sure that on your mac, the filename provided to the reader are >>>>> correct ? (no space or special string ?) >>>>> >>>>> Seb >>>>> >>>>> On Thu, Dec 2, 2010 at 12:01 AM, Mark Roden wrote: >>>>>> Hi all, >>>>>> >>>>>> So I managed to get vtk 5.6.1 to work on a mac with java wrappings on >>>>>> (10.6.5) and with gdcm. >>>>>> >>>>>> The following code is producing errors that I don't see on windows: >>>>>> >>>>>> ? ? ? ? ? ? ? IPPSorter sorter = new IPPSorter(); >>>>>> ? ? ? ? ? ? ? ?sorter.SetComputeZSpacing(true); >>>>>> ? ? ? ? ? ? ? ?sorter.SetZSpacingTolerance(0.000001); >>>>>> ? ? ? ? ? ? ? ?Boolean sorted = sorter.Sort(theSeriesFiles); >>>>>> ? ? ? ? ? ? ? ?//sorter.Sort(ft); >>>>>> >>>>>> ? ? ? ? ? ? ? ?//have to make a vtk string array >>>>>> ? ? ? ? ? ? ? ?FilenamesType sortedFT = sorter.GetFilenames(); >>>>>> ? ? ? ? ? ? ? ?long theSize = sortedFT.size(); >>>>>> ? ? ? ? ? ? ? ?vtkStringArray sa = new vtkStringArray(); >>>>>> ? ? ? ? ? ? ? ?for (int j = 0; j < theSize; j++) { >>>>>> ? ? ? ? ? ? ? ? ? ?String theString2 = sortedFT.get(j); >>>>>> ? ? ? ? ? ? ? ? ? ?sa.InsertNextValue(sortedFT.get(j)); >>>>>> ? ? ? ? ? ? ? ?} >>>>>> ? ? ? ? ? ? ? ?gdcmReader.SetFileNames(sa); >>>>>> >>>>>> ? ? ? ? ? ? ? ?gdcmReader.Update(); >>>>>> >>>>>> ? ? ? ? ? ? ? ?imageData = gdcmReader.GetOutput(); >>>>>> >>>>>> ? ? ? ? ? ? ? ?//make sure that we're getting spacing and orientation info >>>>>> ? ? ? ? ? ? ? ?double[] spacing = imageData.GetSpacing(); >>>>>> ? ? ? ? ? ? ? ?spacing[2] = sorter.GetZSpacing(); >>>>>> ? ? ? ? ? ? ? ?imageData.SetSpacing(spacing); >>>>>> ? ? ? ? ? ? ? ?double[] origin = imageData.GetOrigin(); >>>>>> ? ? ? ? ? ? ? ?double[] bounds = imageData.GetBounds(); >>>>>> ? ? ? ? ? ? ? ?double[] extraOrigin = {0,0,0};//because vtk will only >>>>>> flip about 0,0,0 >>>>>> >>>>>> ? ? ? ? ? ? ? ?vtkImageChangeInformation imageSpacingChange = new >>>>>> vtkImageChangeInformation(); >>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetInput(imageData); >>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputSpacing(spacing[0], >>>>>> spacing[1], spacing[2]); >>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputOrigin(extraOrigin); >>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.Update(); >>>>>> >>>>>> Once the last line is hit, the following error is reported in netbeans: >>>>>> >>>>>> ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/VTK-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx, >>>>>> line 802 >>>>>> vtkStreamingDemandDrivenPipeline (0x135884c10): Input for connection >>>>>> index 0 on input port index 0 for algorithm >>>>>> vtkImageChangeInformation(0x1358853c0) is NULL, but a vtkImageData is >>>>>> required. >>>>>> >>>>>> This code works perfectly well in Windows, and the spacing, origin, >>>>>> and bounds arrays all match the values in windows when loading the >>>>>> same series there. ?So, I know that the gdcm side of things is >>>>>> working, at least to the point that those arrays are being reported >>>>>> correctly. >>>>>> >>>>>> Because the pipeline is breaking there, nothing else is working. ?What >>>>>> can I do to fix it? >>>>>> >>>>>> Thanks, >>>>>> Mark >>>>>> _______________________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>>>>> >>>>>> Follow this link to subscribe/unsubscribe: >>>>>> http://www.vtk.org/mailman/listinfo/vtkusers >>>>>> >>>>> >>>> >>> >> > From alessandromartini at gmail.com Thu Dec 2 15:37:03 2010 From: alessandromartini at gmail.com (Alessandro Martini) Date: Thu, 2 Dec 2010 16:37:03 -0400 Subject: [vtkusers] [ILINK32 Error] Fatal: Out of memory Message-ID: Hello All, Anyone has see this error "[ILINK32 Error] Fatal: Out of memory"? I'm compile a vtkBorlandRenderWindow on a software using a C++ Builder from RAD Studio 2010, with a little piece of software, and use this vtkBorlandRenderWindow to open and show a Dicom Volume. the Link command is: c:\program files (x86)\embarcadero\rad studio\7.0\bin\ilink32.exe -LRelease;"c:\program files (x86)\embarcadero\rad studio\7.0\lib\release";D:\Vtk56\bin\bin;"C:\Program Files (x86)\Devart\UniDac for RAD Studio 2010\Lib";"c:\program files (x86)\embarcadero\rad studio\7.0\lib";"c:\program files (x86)\embarcadero\rad studio\7.0\lib\obj";"c:\program files (x86)\embarcadero\rad studio\7.0\lib\psdk";"C:\Program Files (x86)\LMD2011\source";"C:\Program Files (x86)\LMD2011\lib\d14";"c:\program files (x86)\embarcadero\rad studio\7.0\lib";"c:\program files (x86)\embarcadero\rad studio\7.0\lib\psdk";"c:\program files (x86)\embarcadero\rad studio\7.0\lib\Indy10";"C:\Program Files (x86)\FastReports\FastReport 4\LibD14";"C:\Program Files (x86)\Raize\RC5\Lib\RS2010";"C:\Program Files (x86)\Devart\UniDac for RAD Studio 2010\Lib";"C:\Users\Developer\Documents\tmssoftware\TMS Component Pack\Delphi2010";"C:\Users\Developer\Documents\tmssoftware\TMS Component Pack";"C:\Users\Developer\Documents\tmssoftware\TMS Component Pack\XlsAdapter";"C:\Users\Developer\Documents\tmssoftware\TMS Component Pack\Delphi2010";"C:\Users\Developer\Documents\tmssoftware\TMS Component Pack";"C:\Users\Developer\Documents\tmssoftware\TMS Component Pack\XlsAdapter";D:\Vtk56\Examples\GUI\Win32\vtkBorland\Package;D:\Vtk56\Examples\GUI\Win32\vtkBorland\Package\Release_Build;D:\Vtk56\IO;"C:\Users\Public\Documents\RAD Studio\7.0\DCP" -jRelease;"c:\program files (x86)\embarcadero\rad studio\7.0\lib\release";D:\Vtk56\bin\bin;"C:\Program Files (x86)\Devart\UniDac for RAD Studio 2010\Lib";"c:\program files (x86)\embarcadero\rad studio\7.0\lib";"c:\program files (x86)\embarcadero\rad studio\7.0\lib\obj";"c:\program files (x86)\embarcadero\rad studio\7.0\lib\psdk";"C:\Program Files (x86)\LMD2011\source";"C:\Program Files (x86)\LMD2011\lib\d14";"c:\program files (x86)\embarcadero\rad studio\7.0\lib";"c:\program files (x86)\embarcadero\rad studio\7.0\lib\psdk";"c:\program files (x86)\embarcadero\rad studio\7.0\lib\Indy10";"C:\Program Files (x86)\FastReports\FastReport 4\LibD14";"C:\Program Files (x86)\Raize\RC5\Lib\RS2010";"C:\Program Files (x86)\Devart\UniDac for RAD Studio 2010\Lib";"C:\Users\Developer\Documents\tmssoftware\TMS Component Pack\Delphi2010";"C:\Users\Developer\Documents\tmssoftware\TMS Component Pack";"C:\Users\Developer\Documents\tmssoftware\TMS Component Pack\XlsAdapter";"C:\Users\Developer\Documents\tmssoftware\TMS Component Pack\Delphi2010";"C:\Users\Developer\Documents\tmssoftware\TMS Component Pack";"C:\Users\Developer\Documents\tmssoftware\TMS Component Pack\XlsAdapter";D:\Vtk56\Examples\GUI\Win32\vtkBorland\Package;D:\Vtk56\Examples\GUI\Win32\vtkBorland\Package\Release_Build;D:\Vtk56\IO;"C:\Users\Public\Documents\RAD Studio\7.0\DCP" -lRelease -v -GA"C:\Users\DEVELO~1\AppData\Local\Temp\vfs4BC2.tmp"="D:\Work\Research\DicomReader\DicomReader.res" -GA"C:\Users\DEVELO~1\AppData\Local\Temp\vfs4BD2.tmp"="D:\Work\Research\DicomReader\eVunt005.dfm" -GA"C:\Users\DEVELO~1\AppData\Local\Temp\vfs4BE3.tmp"="D:\Work\Research\DicomReader\eVunt002.dfm" -GA"C:\Users\DEVELO~1\AppData\Local\Temp\vfs4BE4.tmp"="D:\Work\Research\DicomReader\eVunt003.dfm" -GA"C:\Users\DEVELO~1\AppData\Local\Temp\vfs4BF4.tmp"="D:\Work\Research\DicomReader\eVunt001.dfm" -GA"C:\Users\DEVELO~1\AppData\Local\Temp\vfs4BF5.tmp"="D:\Work\Research\DicomReader\eVunt004.dfm" -aa -H:0x01000000 -V5.0 -G8 c0w32 memmgr.lib sysinit.obj Release\eVunt005.obj "Release\DicomReader.obj" Release\eVunt002.obj Release\eVunt003.obj Release\eVunt001.obj Release\eVunt004.obj , "Release\DicomReader.exe" , "Release\DicomReader.map" , rtl.lib vcl.lib RaizeComponentsVcl.lib vclx.lib vclimg.lib dbrtl.lib dac140.lib unidac140.lib vclie.lib tmsexd2010.lib tmsd2010.lib adortl.lib bdertl.lib xmlrtl.lib vclactnband.lib vcldb.lib VclSmp.lib RaizeComponentsVclDb.lib lmddocking11rt_140.lib lmdrtl11rt_140.lib lmdrtf11rt_140.lib lmdprint11rt_140.lib lmdrtlx11rt_140.lib lmdrtfdb11rt_140.lib vtkBorlandRenderWindowPkg.lib vtkjpeg.lib vtkNetCDF.lib vtkpng.lib vtkHybrid.lib vtkImaging.lib vtkIO.lib vtkWidgets.lib vtkzlib.lib vtkRendering.lib vtksys.lib vtkVolumeRendering.lib vtkGraphics.lib ibprovider140.lib vtkFiltering.lib vtkfreetype.lib vtkftgl.lib vtkCommon.lib vtkDICOMParser.lib vtktiff.lib vtkexpat.lib vtkexoIIc.lib import32.lib cp32mti.lib , , "C:\Users\DEVELO~1\AppData\Local\Temp\vfs4BC2.tmp" And the result is only: c:\program files (x86)\embarcadero\rad studio\7.0\Bin\CodeGear.Cpp.Targets(2175,3): error : Fatal: Out of memory -- Alessandro Martini alessandromartini at gmail.com ------------------------------------------------- 'Existem 10 tipos de pessoas no mundo: aquelem que entendem bin?rio, e aqueles que n?o!' -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Thu Dec 2 16:55:03 2010 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 03 Dec 2010 10:55:03 +1300 Subject: [vtkusers] QVTKApplication.h Message-ID: <4CF815B7.5060800@auckland.ac.nz> I'm trying to build the example GUI/Qt/Events/GUI4.cxx, but it requires QVTKApplication.h, which I haven't been able to locate. Is this an obsolete example? Thanks Gib From steffenbrinkmann at ymail.com Thu Dec 2 16:51:20 2010 From: steffenbrinkmann at ymail.com (Steffen Brinkmann) Date: Thu, 2 Dec 2010 13:51:20 -0800 (PST) Subject: [vtkusers] combine vtkjava bindings with swig wrapper Message-ID: <31303.95541.qm@web120906.mail.ne1.yahoo.com> Hi everybody! Studying the wrapping technique of the java bindings to vtk showed that the wrapper code is generated by several C programs that have been written only for this purpose. Now I have a C++ software package that outputs a number of vtk objects (vtkPolyDataSet, vtkStructuredGrid, ...). I would need a java wrapper of this package, which I'd like to generate using SWIG, and I would like to display the vtk objects that are produced by the package directly with the help of the default vtk java bindings. How can I write the SWIG interface definition so that the produced vtk java objects are compatible with the default vtk java bindings? Thanks Steffen From david.gobbi at gmail.com Thu Dec 2 17:09:35 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 2 Dec 2010 15:09:35 -0700 Subject: [vtkusers] QVTKApplication.h In-Reply-To: <4CF815B7.5060800@auckland.ac.nz> References: <4CF815B7.5060800@auckland.ac.nz> Message-ID: I just ran that example to be sure. It works, so it seems to be up-to-date. The only thing I did was ran cmake and then make, there were some warnings but no errors. The header file QVTKApplication.h is in VTK/GUISupport/Qt, but cmake should automatically configure the include path for you (like it did for me). Are you sure that VTK_USE_QT was ON when you built VTK? David On Thu, Dec 2, 2010 at 2:55 PM, Gib Bogle wrote: > I'm trying to build the example GUI/Qt/Events/GUI4.cxx, but it requires > QVTKApplication.h, which I haven't been able to locate. Is this an obsolete > example? > > Thanks > Gib > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonmorra at gmail.com Thu Dec 2 17:14:30 2010 From: jonmorra at gmail.com (Jonathan Morra) Date: Thu, 2 Dec 2010 14:14:30 -0800 Subject: [vtkusers] image island removal and hole filling Message-ID: I have a binary vtkImageData class and I want to do 2 things with it, and I don't know how. 1. I want to remove all islands from the image except one. I want to identify the island not to be removed by a pixel location. I have seen vtkImageIslandRemoval2D, and I don't think that'll work for me, because I do not know anything about the island's size that I want to keep (it could be big, small, or in the middle), all that I know is one point which is guaranteed to be interior to one island, and that's the island I want to keep. 2. I want to do hole filling on the output of step 1 and I don't know how to do that. I saw vtkFillHolesFilter but that appears only to work on poly data. I'd like something analogous to that for vtkImageData. If anyone knows how to do these things, I'd appreciate it. Also, if it matters, I'm coding in Java. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Dec 2 17:14:33 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 2 Dec 2010 15:14:33 -0700 Subject: [vtkusers] QVTKApplication.h In-Reply-To: References: <4CF815B7.5060800@auckland.ac.nz> Message-ID: On Thu, Dec 2, 2010 at 3:09 PM, David Gobbi wrote: > I just ran that example to be sure. It works, so it seems to be > up-to-date. The only thing I did was ran cmake and then make, > there were some warnings but no errors. > > The header file QVTKApplication.h is in VTK/GUISupport/Qt, but > cmake should automatically configure the include path for you (like > it did for me). > > Are you sure that VTK_USE_QT was ON when you built VTK? > Just a note: I forgot, you also need VTK_USE_GUISUPPORT=ON. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Thu Dec 2 17:26:13 2010 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 03 Dec 2010 11:26:13 +1300 Subject: [vtkusers] QVTKApplication.h In-Reply-To: References: <4CF815B7.5060800@auckland.ac.nz> Message-ID: <4CF81D05.7080907@auckland.ac.nz> Well, that's a puzzle. QVTKApplication.h is not in my VTK/GUISupport/Qt. I feel certain that I must have had VTK_USE_QT set ON when I build VTK - my whole aim has been using VTK with Qt, and everything is working. I notice that another Qt example that I built, and my own project, uses . Could you remind me how to check what settings I used to build VTK? Thanks Gib On 3/12/2010 11:09 a.m., David Gobbi wrote: > I just ran that example to be sure. It works, so it seems to be > up-to-date. The only thing I did was ran cmake and then make, > there were some warnings but no errors. > > The header file QVTKApplication.h is in VTK/GUISupport/Qt, but > cmake should automatically configure the include path for you (like > it did for me). > > Are you sure that VTK_USE_QT was ON when you built VTK? > > David > > > On Thu, Dec 2, 2010 at 2:55 PM, Gib Bogle > wrote: > > I'm trying to build the example GUI/Qt/Events/GUI4.cxx, but it requires > QVTKApplication.h, which I haven't been able to locate. Is this an obsolete > example? > > Thanks > Gib > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > From david.gobbi at gmail.com Thu Dec 2 17:33:37 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 2 Dec 2010 15:33:37 -0700 Subject: [vtkusers] QVTKApplication.h In-Reply-To: <4CF81D05.7080907@auckland.ac.nz> References: <4CF815B7.5060800@auckland.ac.nz> <4CF81D05.7080907@auckland.ac.nz> Message-ID: According to the logs, QVTKApplication.h was created in May 2010. So it is only in the vtk head, it isn't in any releases yet. Could it be that you have a mix of different versions of VTK on your system? All the configuration info is saved in the CMakeCache.txt David On Thu, Dec 2, 2010 at 3:26 PM, Gib Bogle wrote: > Well, that's a puzzle. QVTKApplication.h is not in my VTK/GUISupport/Qt. > I feel certain that I must have had VTK_USE_QT set ON when I build VTK - my > whole aim has been using VTK with Qt, and everything is working. I notice > that another Qt example that I built, and my own project, uses > . Could you remind me how to check what settings I used to > build VTK? > > Thanks > Gib > > > On 3/12/2010 11:09 a.m., David Gobbi wrote: > >> I just ran that example to be sure. It works, so it seems to be >> up-to-date. The only thing I did was ran cmake and then make, >> there were some warnings but no errors. >> >> The header file QVTKApplication.h is in VTK/GUISupport/Qt, but >> cmake should automatically configure the include path for you (like >> it did for me). >> >> Are you sure that VTK_USE_QT was ON when you built VTK? >> >> David >> >> >> On Thu, Dec 2, 2010 at 2:55 PM, Gib Bogle > > wrote: >> >> I'm trying to build the example GUI/Qt/Events/GUI4.cxx, but it requires >> QVTKApplication.h, which I haven't been able to locate. Is this an >> obsolete >> example? >> >> Thanks >> Gib >> _______________________________________________ >> Powered by www.kitware.com >> >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Dec 2 17:36:36 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 2 Dec 2010 15:36:36 -0700 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: For Step 1, I have a VTK flood-fill class that do the job. I'll upload it to gerrit so that you can try it out. I don't think anything exists for your Step 2, though. David On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra wrote: > I have a binary vtkImageData class and I want to do 2 things with it, and I > don't know how. > > 1. I want to remove all islands from the image except one. I want to > identify the island not to be removed by a pixel location. I have seen > vtkImageIslandRemoval2D, and I don't think that'll work for me, because I do > not know anything about the island's size that I want to keep (it could be > big, small, or in the middle), all that I know is one point which > is guaranteed to be interior to one island, and that's the island I want to > keep. > > 2. I want to do hole filling on the output of step 1 and I don't know how > to do that. I saw vtkFillHolesFilter but that appears only to work on poly > data. I'd like something analogous to that for vtkImageData. > > If anyone knows how to do these things, I'd appreciate it. Also, if it > matters, I'm coding in Java. > > Thanks > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonmorra at gmail.com Thu Dec 2 17:39:44 2010 From: jonmorra at gmail.com (Jonathan Morra) Date: Thu, 2 Dec 2010 14:39:44 -0800 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: Thanks, let me know where I can download it from. On Thu, Dec 2, 2010 at 2:36 PM, David Gobbi wrote: > For Step 1, I have a VTK flood-fill class that do the job. I'll upload it > to > gerrit so that you can try it out. I don't think anything exists for your > Step 2, though. > > David > > > On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra wrote: > >> I have a binary vtkImageData class and I want to do 2 things with it, and >> I don't know how. >> >> 1. I want to remove all islands from the image except one. I want to >> identify the island not to be removed by a pixel location. I have seen >> vtkImageIslandRemoval2D, and I don't think that'll work for me, because I do >> not know anything about the island's size that I want to keep (it could be >> big, small, or in the middle), all that I know is one point which >> is guaranteed to be interior to one island, and that's the island I want to >> keep. >> >> 2. I want to do hole filling on the output of step 1 and I don't know how >> to do that. I saw vtkFillHolesFilter but that appears only to work on poly >> data. I'd like something analogous to that for vtkImageData. >> >> If anyone knows how to do these things, I'd appreciate it. Also, if it >> matters, I'm coding in Java. >> >> Thanks >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Thu Dec 2 17:40:59 2010 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 03 Dec 2010 11:40:59 +1300 Subject: [vtkusers] QVTKApplication.h In-Reply-To: References: <4CF815B7.5060800@auckland.ac.nz> Message-ID: <4CF8207B.1080002@auckland.ac.nz> Sorry, I didn't make it clear that I located the example online, while searching on a particular topic, on [VTK.git]/Examples. I also failed to realize, or forgot, that the same example is on my disk as part of the VTK distribution. Looking at the code on my machine, I see that the examples are different, and the one in my distribution uses QApplication.h, not QVTKApplication.h. I've just seen your response, and learned that in fact the online example is not obsolete, it's newer. One lesson is not to try to grab stuff naively from the git repository. Please forget that I spoke. On 3/12/2010 11:14 a.m., David Gobbi wrote: > On Thu, Dec 2, 2010 at 3:09 PM, David Gobbi > wrote: > > I just ran that example to be sure. It works, so it seems to be > up-to-date. The only thing I did was ran cmake and then make, > there were some warnings but no errors. > > The header file QVTKApplication.h is in VTK/GUISupport/Qt, but > cmake should automatically configure the include path for you (like > it did for me). > > Are you sure that VTK_USE_QT was ON when you built VTK? > > > Just a note: I forgot, you also need VTK_USE_GUISUPPORT=ON. > > David From mmroden at gmail.com Thu Dec 2 19:16:34 2010 From: mmroden at gmail.com (Mark Roden) Date: Thu, 2 Dec 2010 16:16:34 -0800 Subject: [vtkusers] vtk 5.6.1 on a mac wrapped in Java In-Reply-To: References: Message-ID: You are correct, it doesn't work. Is there an example somewhere of vtk 5.6.1 working on the mac with java on? Because so far, I've determined that: 1) xcode on the mac with vtk doesn't work 2) vtk 5.7 changed something from 5.6 with vtkStringArray, so gdcm's image reader class no longer works (on mac or pc) 3) vtk 5.6 with java wrapping causes input errors. These things combined lead me to believe that I'm the only one trying to do java development with vtk on the mac-- is that true? Is there another project doing this? Successfully? On Thu, Dec 2, 2010 at 11:32 AM, Sebastien Jourdain wrote: > the Unix makefile is fine. > To setup release you just need to write Release in the CMake config > for the build type (CMAKE_BUILD_TYPE). > You can switch also the optimisation to -02 instead of -03 in the > ..._FLAGS_RELEASE options. > > But I doubt that it could come from that. > > Seb > > > On Thu, Dec 2, 2010 at 1:49 PM, Mark Roden wrote: >> Maybe the problem is the build method I'm using for the libraries. >> >> I'm building both gdcm and vtk using Unix makefiles on the mac, since >> the xcode stuff isn't working. >> >> How can I make sure that I'm building release versions on both >> machines? ?There's a suggestion here: >> http://comments.gmane.org/gmane.comp.lib.mitk.user/1052 >> >> that this bug could be due to compilation problems. >> >> Specifically, I'd like for 64 bit release versions to be made. ?On >> XCode, that's a dropdown selection, but typing 'make release' results >> in 'don't know how to build release, stop', and I'm not sure what >> 'make all' is doing. >> >> Thanks, >> Mark >> >> On Thu, Dec 2, 2010 at 7:00 AM, Mark Roden wrote: >>> The java code works fine on windows, it's the same code, shared via >>> git on the different machines >>> >>> I'm not trying to inherit. ?vtkImageChangeInformation is exposed by >>> the vtk java wrapping, but the vtlImageData I'm passing in isn't >>> working. >>> >>> This code works in java on windows. ?It doesn't on mac. ?I use the >>> same libraries underneath, or at least, the same versions of gdcm and >>> vtk are built and used. >>> >>> On Thu, Dec 2, 2010 at 6:53 AM, Sebastien Jourdain >>> wrote: >>>> I was talking about your Java code that was using VTK, not VTK itself. >>>> >>>> Moreover, I think that you can not inherit from VTK classes in Java... >>>> >>>> Seb >>>> >>>> On Thu, Dec 2, 2010 at 9:17 AM, Mark Roden wrote: >>>>> Hi Sebastien, >>>>> >>>>> I can't use the windows binary on the mac-- the vtk underpinnings are >>>>> still C++, which means that it's compiled into a dll on windows, which >>>>> means (as far as I know, and as my experiments confirm), it doesn't >>>>> work on a mac. ?I have to recompile vtk for the mac directly. ?The >>>>> java wrappings (the jar) should be identical, though. ?Just to be >>>>> safe, I'm using the mac-generated jars now. >>>>> >>>>> I am sure that the filenames have no spaces or special strings. ?If >>>>> you look at the line >>>>> >>>>> ? ? String theString2 = sortedFT.get(i) >>>>> >>>>> I can stop there with the debugger and see the contents of the string, >>>>> and it's clean. >>>>> >>>>> For what it's worth, Fred Fred asked about this error message a year >>>>> ago, and he got no response: >>>>> http://public.kitware.com/pipermail/vtkusers/2009-October/102935.html >>>>> I don't know if he was in the same situation as me, though. >>>>> >>>>> Thanks, >>>>> Mark >>>>> >>>>> On Thu, Dec 2, 2010 at 5:02 AM, Sebastien Jourdain >>>>> wrote: >>>>>> Hi Mark, >>>>>> >>>>>> did you try your windows (Java) binary on your mac to see if you get >>>>>> the same behavior ? >>>>>> Are you sure that on your mac, the filename provided to the reader are >>>>>> correct ? (no space or special string ?) >>>>>> >>>>>> Seb >>>>>> >>>>>> On Thu, Dec 2, 2010 at 12:01 AM, Mark Roden wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> So I managed to get vtk 5.6.1 to work on a mac with java wrappings on >>>>>>> (10.6.5) and with gdcm. >>>>>>> >>>>>>> The following code is producing errors that I don't see on windows: >>>>>>> >>>>>>> ? ? ? ? ? ? ? IPPSorter sorter = new IPPSorter(); >>>>>>> ? ? ? ? ? ? ? ?sorter.SetComputeZSpacing(true); >>>>>>> ? ? ? ? ? ? ? ?sorter.SetZSpacingTolerance(0.000001); >>>>>>> ? ? ? ? ? ? ? ?Boolean sorted = sorter.Sort(theSeriesFiles); >>>>>>> ? ? ? ? ? ? ? ?//sorter.Sort(ft); >>>>>>> >>>>>>> ? ? ? ? ? ? ? ?//have to make a vtk string array >>>>>>> ? ? ? ? ? ? ? ?FilenamesType sortedFT = sorter.GetFilenames(); >>>>>>> ? ? ? ? ? ? ? ?long theSize = sortedFT.size(); >>>>>>> ? ? ? ? ? ? ? ?vtkStringArray sa = new vtkStringArray(); >>>>>>> ? ? ? ? ? ? ? ?for (int j = 0; j < theSize; j++) { >>>>>>> ? ? ? ? ? ? ? ? ? ?String theString2 = sortedFT.get(j); >>>>>>> ? ? ? ? ? ? ? ? ? ?sa.InsertNextValue(sortedFT.get(j)); >>>>>>> ? ? ? ? ? ? ? ?} >>>>>>> ? ? ? ? ? ? ? ?gdcmReader.SetFileNames(sa); >>>>>>> >>>>>>> ? ? ? ? ? ? ? ?gdcmReader.Update(); >>>>>>> >>>>>>> ? ? ? ? ? ? ? ?imageData = gdcmReader.GetOutput(); >>>>>>> >>>>>>> ? ? ? ? ? ? ? ?//make sure that we're getting spacing and orientation info >>>>>>> ? ? ? ? ? ? ? ?double[] spacing = imageData.GetSpacing(); >>>>>>> ? ? ? ? ? ? ? ?spacing[2] = sorter.GetZSpacing(); >>>>>>> ? ? ? ? ? ? ? ?imageData.SetSpacing(spacing); >>>>>>> ? ? ? ? ? ? ? ?double[] origin = imageData.GetOrigin(); >>>>>>> ? ? ? ? ? ? ? ?double[] bounds = imageData.GetBounds(); >>>>>>> ? ? ? ? ? ? ? ?double[] extraOrigin = {0,0,0};//because vtk will only >>>>>>> flip about 0,0,0 >>>>>>> >>>>>>> ? ? ? ? ? ? ? ?vtkImageChangeInformation imageSpacingChange = new >>>>>>> vtkImageChangeInformation(); >>>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetInput(imageData); >>>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputSpacing(spacing[0], >>>>>>> spacing[1], spacing[2]); >>>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputOrigin(extraOrigin); >>>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.Update(); >>>>>>> >>>>>>> Once the last line is hit, the following error is reported in netbeans: >>>>>>> >>>>>>> ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/VTK-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx, >>>>>>> line 802 >>>>>>> vtkStreamingDemandDrivenPipeline (0x135884c10): Input for connection >>>>>>> index 0 on input port index 0 for algorithm >>>>>>> vtkImageChangeInformation(0x1358853c0) is NULL, but a vtkImageData is >>>>>>> required. >>>>>>> >>>>>>> This code works perfectly well in Windows, and the spacing, origin, >>>>>>> and bounds arrays all match the values in windows when loading the >>>>>>> same series there. ?So, I know that the gdcm side of things is >>>>>>> working, at least to the point that those arrays are being reported >>>>>>> correctly. >>>>>>> >>>>>>> Because the pipeline is breaking there, nothing else is working. ?What >>>>>>> can I do to fix it? >>>>>>> >>>>>>> Thanks, >>>>>>> Mark >>>>>>> _______________________________________________ >>>>>>> Powered by www.kitware.com >>>>>>> >>>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>>>>> >>>>>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>>>>>> >>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>> http://www.vtk.org/mailman/listinfo/vtkusers >>>>>>> >>>>>> >>>>> >>>> >>> >> > From luisrpp at gmail.com Thu Dec 2 20:04:32 2010 From: luisrpp at gmail.com (Luis Roberto P. Paula) Date: Thu, 2 Dec 2010 23:04:32 -0200 Subject: [vtkusers] VTK help with LUT Message-ID: Hi All, I'm playing for some days with Lookup tables in VTK but still no luck. I have a grayscale image and I would like to create a look-up table that starts with black, then goes from purple (close to 0) to yellow (close to max-pixel). Does anyone know how can I do that? Thanks & Regards, Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Thu Dec 2 20:44:04 2010 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 03 Dec 2010 14:44:04 +1300 Subject: [vtkusers] VTK static crash on Mac Message-ID: <4CF84B64.30009@auckland.ac.nz> I've built VTK statically, and can link a test program that uses QVTKWidget, but when executed it crashes while invoking Render(). The error is EXC_BAD_ACCESS (SIGBUS) The OS is Mac OS X 10.6.4 VTK built non-static works OK. From daviddoria at gmail.com Thu Dec 2 21:22:59 2010 From: daviddoria at gmail.com (David Doria) Date: Thu, 2 Dec 2010 21:22:59 -0500 Subject: [vtkusers] VTK help with LUT In-Reply-To: References: Message-ID: On Thu, Dec 2, 2010 at 8:04 PM, Luis Roberto P. Paula wrote: > Hi All, > > I'm playing for some days with Lookup tables in VTK but still no luck. > > I have a grayscale image and I would like to create a look-up table that > starts with black, then goes from purple (close to 0) to yellow (close to > max-pixel). > > Does anyone know how can I do that? > > Thanks & Regards, > Luis > > I think the transparent and green mask in this example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/Transparency is exactly what you're looking for. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Thu Dec 2 21:25:08 2010 From: daviddoria at gmail.com (David Doria) Date: Thu, 2 Dec 2010 21:25:08 -0500 Subject: [vtkusers] QVTKApplication.h In-Reply-To: <4CF8207B.1080002@auckland.ac.nz> References: <4CF815B7.5060800@auckland.ac.nz> <4CF8207B.1080002@auckland.ac.nz> Message-ID: On Thu, Dec 2, 2010 at 5:40 PM, Gib Bogle wrote: > Sorry, I didn't make it clear that I located the example online, while > searching on a particular topic, on [VTK.git]/Examples. I also failed to > realize, or forgot, that the same example is on my disk as part of the VTK > distribution. Looking at the code on my machine, I see that the examples are > different, and the one in my distribution uses QApplication.h, not > QVTKApplication.h. > > I've just seen your response, and learned that in fact the online example > is not obsolete, it's newer. One lesson is not to try to grab stuff naively > from the git repository. > > Please forget that I spoke. > I have been trying to record everything necessary to setup Qt for VTK: http://www.vtk.org/Wiki/VTK/Tutorials/QtSetup Please add to it if you find additional steps necessary. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Thu Dec 2 21:39:03 2010 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 03 Dec 2010 15:39:03 +1300 Subject: [vtkusers] QVTKApplication.h In-Reply-To: References: <4CF815B7.5060800@auckland.ac.nz> <4CF8207B.1080002@auckland.ac.nz> Message-ID: <4CF85847.20003@auckland.ac.nz> On 3/12/2010 3:25 p.m., David Doria wrote: > On Thu, Dec 2, 2010 at 5:40 PM, Gib Bogle > wrote: > > Sorry, I didn't make it clear that I located the example online, while > searching on a particular topic, on [VTK.git]/Examples. I also failed to > realize, or forgot, that the same example is on my disk as part of the VTK > distribution. Looking at the code on my machine, I see that the examples are > different, and the one in my distribution uses QApplication.h, not > QVTKApplication.h. > > I've just seen your response, and learned that in fact the online example is > not obsolete, it's newer. One lesson is not to try to grab stuff naively > from the git repository. > > Please forget that I spoke. > > > I have been trying to record everything necessary to setup Qt for VTK: > > http://www.vtk.org/Wiki/VTK/Tutorials/QtSetup > > Please add to it if you find additional steps necessary. > > David This is quite different from the way I figured out to access QVTKWidget. I didn't know about deploying the widget from QtDesigner. Somehow I managed to fumble around and get something that works. From jonmorra at gmail.com Thu Dec 2 22:29:48 2010 From: jonmorra at gmail.com (Jonathan Morra) Date: Thu, 2 Dec 2010 19:29:48 -0800 Subject: [vtkusers] Java remove vtkImageViewer2 not working In-Reply-To: References: Message-ID: I have a java swing JPanel that contains another JPanel that contains a vtkRenderWindowPanel which is hooked up to a vtkImageViewer2. In the course of my program I want to remove the inner JPanel from the outer JPanel with JPanel.remove(). I then want to add the inner JPanel to a different outer JPanel. However when I do this VTK throws the following exception ERROR: In ..\..\src\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 247 vtkWin32OpenGLRenderWindow (00000004C8E4830): wglMakeCurrent failed in MakeCurrent(), error: The handle is invalid. This seems like a very simple swing operation that I'm trying to do, but it's failing. Does anyone know what I'm doing wrong? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From jimcp at cox.net Thu Dec 2 23:10:53 2010 From: jimcp at cox.net (Jim Peterson) Date: Thu, 02 Dec 2010 23:10:53 -0500 Subject: [vtkusers] Java remove vtkImageViewer2 not working In-Reply-To: References: Message-ID: <4CF86DCD.7060003@cox.net> Jonathan Morra wrote: > > I have a java swing JPanel that contains another JPanel that contains > a vtkRenderWindowPanel which is hooked up to a vtkImageViewer2. In the > course of my program I want to remove the inner JPanel from the outer > JPanel with JPanel.remove(). I then want to add the inner JPanel to a > different outer JPanel. However when I do this VTK throws the > following exception > > ERROR: In ..\..\src\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 247 > vtkWin32OpenGLRenderWindow (00000004C8E4830): wglMakeCurrent failed in > MakeCurrent(), error: The handle is invalid. > > This seems like a very simple swing operation that I'm trying to do, > but it's failing. Does anyone know what I'm doing wrong? > Thanks > Jonathan, you do understand that the vtk classes are JNI interfaces to the shared library version of vtk. I suspect you are causing Java to free resources that are still referenced by the memory instantiated by the still active structures outside Java in vtk. Without an example it is pretty hard to try to visualize the java and native system memory from your description. What you are doing might be sensible with all java objects, but when JNI objects are involved memory references may not be as clear as desired. are not always completely in sync. Chances are if you coded the same kind of operation in C++ the make current routine would have detected the different potential interaction source and issued this message: (from the MakeCurrent() function in vtkWin32OpenGLRenderWindow.Cxx) if(this->IsPicking && current) { vtkErrorMacro("Attempting to call MakeCurrent for a different window" " than the one doing the picking, this can causes crashes" " and/or bad pick results"); } Unless you want to post an example, I would say "If it hurts, don't do that". Hope that helps, Jim From jonmorra at gmail.com Fri Dec 3 01:12:04 2010 From: jonmorra at gmail.com (Jonathan Morra) Date: Thu, 2 Dec 2010 22:12:04 -0800 Subject: [vtkusers] Java remove vtkImageViewer2 not working In-Reply-To: <4CF86DCD.7060003@cox.net> References: <4CF86DCD.7060003@cox.net> Message-ID: I apologize for the length of this example (it's a little long), but it is totally self contained and shows my the error that I'm having. Please let me know if you need any more information, or the tweaks to make what I have work. import vtk.*; import javax.swing.*; import java.awt.event.*; import java.awt.*; public class VTKSwingError { static { System.loadLibrary("vtkCommonJava"); System.loadLibrary("vtkFilteringJava"); } static JPanel topPanel; static JPanel bottomPanel; static JFrame frame; // This is just creating two different images so we can tell when they're swapped public static JPanel createImagePanel(boolean useMod0) { vtkImageData image = new vtkImageData(); image.SetSpacing(1, 1, 1); image.SetOrigin(0, 0, 0); image.SetExtent(0, 511, 0, 511, 0, 0); image.AllocateScalars(); for (int x=0; x<512; x++) { for (int y=0; y<512; y++) { if ((useMod0 && y%2 == 0) || (!useMod0 && y%2 == 1)) image.SetScalarComponentFromDouble(x, y, 0, 0, 1); } } vtkRenderWindowPanel renWin = new vtkRenderWindowPanel(); renWin.setInteractorStyle(new vtkInteractorStyleImage()); vtkImageViewer2 imageViewer = new vtkImageViewer2(); imageViewer.SetInput(image); imageViewer.SetColorLevel(0.5); imageViewer.SetColorWindow(1); imageViewer.SetSliceOrientationToXY(); imageViewer.SetSlice(1); imageViewer.SetRenderWindow(renWin.GetRenderWindow()); imageViewer.GetRenderer().ResetCamera(); JPanel renWinPanel = new JPanel(new BorderLayout()); renWinPanel.add(renWin, BorderLayout.CENTER); return renWinPanel; } public static void main(String[] args) { topPanel = new JPanel(new BorderLayout()); topPanel.setMinimumSize(new Dimension(400, 200)); topPanel.setPreferredSize(new Dimension(400, 200)); topPanel.add(createImagePanel(true), BorderLayout.CENTER); bottomPanel = new JPanel(new BorderLayout()); bottomPanel.setMinimumSize(new Dimension(400, 200)); bottomPanel.setPreferredSize(new Dimension(400, 200)); bottomPanel.add(createImagePanel(false), BorderLayout.CENTER); JButton switchButton = new JButton("Switch Panels"); switchButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // This is where VTK is going haywire Component oldTop = topPanel.getComponent(0); Component oldBottom = bottomPanel.getComponent(0); topPanel.remove(oldTop); bottomPanel.remove(oldBottom); topPanel.add(oldBottom, BorderLayout.CENTER); bottomPanel.add(oldTop, BorderLayout.CENTER); frame.getContentPane().validate(); frame.getContentPane().repaint(); } }); frame = new JFrame(); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(topPanel, BorderLayout.NORTH); frame.getContentPane().add(bottomPanel, BorderLayout.CENTER); frame.getContentPane().add(switchButton, BorderLayout.SOUTH); frame.setSize(400, 400); frame.setLocationRelativeTo(null); frame.setVisible(true); } } On Thu, Dec 2, 2010 at 8:10 PM, Jim Peterson wrote: > Jonathan Morra wrote: > >> >> I have a java swing JPanel that contains another JPanel that contains a >> vtkRenderWindowPanel which is hooked up to a vtkImageViewer2. In the course >> of my program I want to remove the inner JPanel from the outer JPanel with >> JPanel.remove(). I then want to add the inner JPanel to a different outer >> JPanel. However when I do this VTK throws the following exception >> >> ERROR: In ..\..\src\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 247 >> vtkWin32OpenGLRenderWindow (00000004C8E4830): wglMakeCurrent failed in >> MakeCurrent(), error: The handle is invalid. >> >> This seems like a very simple swing operation that I'm trying to do, but >> it's failing. Does anyone know what I'm doing wrong? >> Thanks >> >> Jonathan, > you do understand that the vtk classes are JNI interfaces to the shared > library version of vtk. I suspect you are causing Java to free resources > that are still referenced by the memory instantiated by the still active > structures outside Java in vtk. Without an example it is pretty hard to try > to visualize the java and native system memory from your description. What > you are doing might be sensible with all java objects, but when JNI objects > are involved memory references may not be as clear as desired. are not > always completely in sync. > Chances are if you coded the same kind of operation in C++ the make current > routine would have detected the different potential interaction source and > issued this message: (from the MakeCurrent() function in > vtkWin32OpenGLRenderWindow.Cxx) > > if(this->IsPicking && current) > { > vtkErrorMacro("Attempting to call MakeCurrent for a different window" > " than the one doing the picking, this can causes > crashes" > " and/or bad pick results"); > } > > Unless you want to post an example, I would say "If it hurts, don't do > that". > > Hope that helps, > Jim > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From quantum.leaf at googlemail.com Fri Dec 3 01:40:18 2010 From: quantum.leaf at googlemail.com (Liam Kurmos) Date: Fri, 3 Dec 2010 06:40:18 +0000 Subject: [vtkusers] generating EndInteractionEvent Message-ID: Hi All, I have a vtkSliderWidget isoSliderWidget->AddObserver(vtkCommand::EndInteractionEvent,sliderCallback); sometimes i want to set the slider to a particular value, and run the associated callback as though the user had moved the slider to that value. Can someone outline how to do this? / point me to an example ? cheers, Liam From pbruyant at yahoo.com Fri Dec 3 04:44:04 2010 From: pbruyant at yahoo.com (Philippe Bruyant) Date: Fri, 3 Dec 2010 01:44:04 -0800 (PST) Subject: [vtkusers] Importing a RIB file Message-ID: <148880.15669.qm@web110409.mail.gq1.yahoo.com> Hello experts, I'd like to know if it is possible to display in a VTK window a 3D scene as described in a RIB file (RenderMan language). TXS Phil -------------- next part -------------- An HTML attachment was scrubbed... URL: From abayiz at yahoo.com Fri Dec 3 07:03:48 2010 From: abayiz at yahoo.com (akbarjan bayiz) Date: Fri, 3 Dec 2010 04:03:48 -0800 (PST) Subject: [vtkusers] How can I save vtkOBJReader output? In-Reply-To: Message-ID: <666086.27642.qm@web56305.mail.re3.yahoo.com> Thank you very much! --- On Thu, 12/2/10, David Doria wrote: From: David Doria Subject: Re: [vtkusers] How can I save vtkOBJReader output? To: "akbarjan bayiz" , vtkusers at vtk.org Date: Thursday, December 2, 2010, 11:41 AM On Thu, Dec 2, 2010 at 12:32 PM, akbarjan bayiz wrote: Hello, David! Thank you for your answers and suggestions. What I am trying to do is, to open and render an existing obj file, save its polydata, then open and change those saved polydata and render them. So, it is expected to see the corresponding changes of the newly rendered object. Do you have any other suggestions to do this? Thank you again! Please keep the discusson on the list so everyone can help and benefit. You can open the obj using vtkOBJReader, you can write it to a vtp file using vtkXMLPolyDataWriter, you can read that new file with vtkXMLPolyDataReader. So which part are you missing?? David -------------- next part -------------- An HTML attachment was scrubbed... URL: From endlosschleife1 at googlemail.com Fri Dec 3 07:37:00 2010 From: endlosschleife1 at googlemail.com (endlosschleife1) Date: Fri, 3 Dec 2010 13:37:00 +0100 Subject: [vtkusers] vtkImageActor and scaling In-Reply-To: References: Message-ID: Hi David, thanks for all the help. I have looked at the OpenGL primitves for vtkImageActor and vtkImageMapper and it helped me understanding the basic differences, and I played around a bit with performance testing with non-VTK glDrawPixels vs. glTexImage2D programs. The performance difference that I saw with vtkImageActor/vtkWindowLeveLookupTable/vtkImageMapToColors does not seem to come from the Open/GL part. It really seems to be the LUT operation (with linear ramps / luminance output format) that makes the difference. When I passed a ready pre-calculated 8 bit image to the actor instead of going through this filter the ImageActor based implementation was quicker than the vtkActor2D based implementation (so 20 seconds faster for the testing procedure below). Mark 2010/11/30 David Gobbi > Hi Mark, > > The underlying OpenGL mechanism for vtkImageActor is completely different > from vtkImageMapper, so if all other things are equal, any differences in > speed are due to how fast the GPU and its drivers can do glTexImage2D (for > ImageActor) versus glDrawPixels (for ImageMapper). > > You can make the comparison between them more fair by making certain that > each of them uses the same number of pixel components. By default, > vtkImageMapToColors will output an RGBA image. Use > MapToColors->SetOutputFormatToLuminance() to ensure that it produces 8-bit > greyscale images instead. > > David > > > On Tue, Nov 30, 2010 at 9:56 AM, endlosschleife1 < > endlosschleife1 at googlemail.com> wrote: > >> It's possible that I'm misinterpreting the performance results of my >> implementation and that applying the window level lookup table is actually >> not what makes the difference. I'm comparing a vtkActor2D/vtkImageMapper >> based and a vtkImageActor based implementation of something that shows a >> series of images one by one with a specific window/level. >> >> If the window/level is not the issue, how much of a difference in >> performance drop for the vtkImageActor implementation would be expected? >> >> I have 700 images (512 x 512, 12 bits stored), rendered into a 512 x 512 >> viewport). vtkActor2D/vtkImageMapper takes about 8 seconds, vtkImageActor >> about 26 seconds to render the whole series. If I additionally resample my >> data to add a scale to best fit to the vtkActor2D/vtkImageMapper >> implementation I get to 18 seconds (that was my starting point to look for >> accelarated scaling). There is no visible difference when I add scaling to >> the vtkImageActor. That means that I'm getting much faster scaling for the >> vtkImageActor based implementation, but that overall it still performs >> slower. Unless there is some other bottleneck in my implementation. >> >> Mark >> >> >> >> 2010/11/30 David Gobbi >> >> On Tue, Nov 30, 2010 at 7:10 AM, endlosschleife1 < >>> endlosschleife1 at googlemail.com> wrote: >>> >>> I was actually looking for accelerated scaling, so this sounds like >>>> vtkActor2D is not be the right thing for that. >>>> >>> >>> For accelerated scaling, you need to use vtkImageActor. >>> >>> I'm not sure, but it looks like my implementation probably doesn't use >>>> any GPU acceleration (it seems to be pure image data filtering). It still >>>> seemed to be not as performant as I expected (compared to an implementation >>>> where I only used VTK for the imaging pipeline, but did the LUT application >>>> and visualization separetely). >>>> >>> >>> The vtkImageMapper doesn't have accelerated window/level either. It does >>> all the computations on the CPU and then uses glDrawPixels() to render the >>> image. >>> >>> >>>> I create a vtkWindowLevelTable, set the window and center, and then >>>> call build on the lut. Then I used it with a vtkImageMapToColors instance: >>>> >>>> vtkImageMapToColors *color = vtkImageMapToColors::New(); >>>> color->SetLookupTable(lut); // lut is the vtkWindowLevelTable >>>> color->SetInput(...) // some vtkImageData >>>> >>> >>> Yes, that looks typical. Make sure that you call >>> table->SetRampToLinear() because by default, a VTK lookup table uses a >>> curved ramp instead of a linear ramp (I was shocked when I discovered this >>> for the first time). >>> >>> David >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Fri Dec 3 07:41:55 2010 From: daviddoria at gmail.com (David Doria) Date: Fri, 3 Dec 2010 07:41:55 -0500 Subject: [vtkusers] generating EndInteractionEvent In-Reply-To: References: Message-ID: On Fri, Dec 3, 2010 at 1:40 AM, Liam Kurmos wrote: > > Hi All, > > I have a vtkSliderWidget > > isoSliderWidget->AddObserver(vtkCommand::EndInteractionEvent,sliderCallback); > > sometimes i want to set the slider to a particular value, and run the > associated callback as though the user had moved the slider to that > value. > Can someone outline how to do this? / point me to an example ? > > cheers, > > Liam > Does this trigger the event? sliderWidget->GetRepresentation()->SetValue(value); If not you could probably do sliderWidget->GetRepresentation()->SetValue(value); sliderWidget->InvokeEvent(vtkCommand::EndInteractionEvent); David From bill.lorensen at gmail.com Fri Dec 3 09:20:23 2010 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Fri, 3 Dec 2010 09:20:23 -0500 Subject: [vtkusers] How to create triangle strips? In-Reply-To: References: Message-ID: The example now works correctly: http://vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/TriangleStrip Replaced SetPolys() with SetStrips(). Also the original coordinates produced a bad strip. On Fri, Nov 19, 2010 at 2:52 PM, David Doria wrote: > On Fri, Nov 19, 2010 at 2:39 PM, Hugo Valdebenito wrote: >> >> Anyone can help me please? >> :( > > This is probably pretty close, but it segfaults: > > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/GeometricObjects/TriangleStrip > > Maybe someone will fix it for you? > > David > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > From nico.schloemer at gmail.com Fri Dec 3 09:34:19 2010 From: nico.schloemer at gmail.com (=?ISO-8859-1?Q?Nico_Schl=F6mer?=) Date: Fri, 3 Dec 2010 15:34:19 +0100 Subject: [vtkusers] vtk.vtkExodusIIReader: information in GetOutput()? Message-ID: Hi all, when reading an ExodusII file with ====================== *snip* ====================== reader = vtk.vtkExodusIIReader() reader.Update() out = reader.GetOutput() ====================== *snap* ====================== 'out' would contain a whole lot of output the significance of which I don't quite understant; ====================== *snip* ====================== $ print out vtkMultiBlockDataSet (0xed9580) Debug: Off Modified Time: 295 Reference Count: 2 Registered Events: (none) Source: (none) Information: 0xecd080 Data Released: False Global Release Data: Off UpdateTime: 299 Release Data: Off UpdateExtent: Not Initialized Update Number Of Pieces: 1 Update Piece: 0 Update Ghost Level: 0 MaximumNumberOfPieces: 1 RequestExactExtent: Off Field Data: Debug: Off Modified Time: 144 Reference Count: 1 Registered Events: (none) Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Number Of Children: 8 Child 0: vtkMultiBlockDataSet Debug: Off Modified Time: 177 Reference Count: 1 Registered Events: (none) Source: (none) Information: 0xfdbe70 Data Released: False Global Release Data: Off UpdateTime: 0 Field Data: Debug: Off Modified Time: 155 Reference Count: 1 Registered Events: (none) Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Number Of Children: 1 Child 0: vtkUnstructuredGrid Debug: Off Modified Time: 220 Reference Count: 1 Registered Events: (none) Source: (none) Information: 0x101e840 Data Released: False Global Release Data: Off UpdateTime: 0 Field Data: Debug: Off Modified Time: 220 Reference Count: 1 Registered Events: (none) Number Of Arrays: 1 Array 0 name = ElementBlockIds Number Of Components: 1 Number Of Tuples: 1 Number Of Points: 5700 Number Of Cells: 11020 Cell Data: Debug: Off Modified Time: 216 Reference Count: 1 Registered Events: (none) Number Of Arrays: 1 Array 0 name = ObjectId Number Of Components: 1 Number Of Tuples: 11020 Copy Tuple Flags: ( 1 1 1 1 1 0 1 ) Interpolate Flags: ( 1 1 1 1 1 0 0 ) Pass Through Flags: ( 1 1 1 1 1 1 1 ) Scalars: (none) Vectors: (none) Normals: (none) TCoords: (none) Tensors: (none) GlobalIds: (none) PedigreeIds: (none) Point Data: Debug: Off Modified Time: 205 Reference Count: 1 Registered Events: (none) Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Copy Tuple Flags: ( 1 1 1 1 1 0 1 ) Interpolate Flags: ( 1 1 1 1 1 0 0 ) Pass Through Flags: ( 1 1 1 1 1 1 1 ) Scalars: (none) Vectors: (none) Normals: (none) TCoords: (none) Tensors: (none) GlobalIds: (none) PedigreeIds: (none) Bounds: Xmin,Xmax: (-10.2953, 15) Ymin,Ymax: (-13.6422, 13.6422) Zmin,Zmax: (-5, 5) Compute Time: 317 Number Of Points: 5700 Point Coordinates: 0xe61720 Locator: 0 Number Of Pieces: 1 Piece: -1 Ghost Level: 0 Child 1: vtkMultiBlockDataSet Debug: Off Modified Time: 234 Reference Count: 1 Registered Events: (none) Source: (none) Information: 0x101ef50 Data Released: False Global Release Data: Off UpdateTime: 0 Field Data: Debug: Off Modified Time: 232 Reference Count: 1 Registered Events: (none) Number Of Arra... [...] ====================== *snap* ====================== Aiming for an unstructured grid, I usually parse this with vtk_grid = out.GetBlock(0).GetBlock(0) but really, I'm not quite sure what I'm doing there. Is there any documentation on vtk.vtkExodusIIReader()? Cheers, Nico From steffenbrinkmann at ymail.com Fri Dec 3 09:52:35 2010 From: steffenbrinkmann at ymail.com (Steffen Brinkmann) Date: Fri, 3 Dec 2010 06:52:35 -0800 (PST) Subject: [vtkusers] combine vtkjava bindings with swig wrapper In-Reply-To: <31303.95541.qm@web120906.mail.ne1.yahoo.com> References: <31303.95541.qm@web120906.mail.ne1.yahoo.com> Message-ID: <478714.39360.qm@web120905.mail.ne1.yahoo.com> Hi again, in case I didn't describe my problem clear enough, here is a very clear post from 2000 about the same problem related to python instead of java: http://public.kitware.com/pipermail/vtkusers/2000-October/004660.html There a solution was announced that would allow to generate vtk-wrapped classed from swig-mangled vtk pointers like: newObject = vtkObject() I looked around in the vtkjava wrapper to find such typecast, but couldn't find any. Is it available for java? If yes, where can I find it? If no, does a work-around exist? Thanks Steffen ----- Original Message ---- From: Steffen Brinkmann To: vtkusers at vtk.org Sent: Thu, December 2, 2010 10:51:20 PM Subject: [vtkusers] combine vtkjava bindings with swig wrapper Hi everybody! Studying the wrapping technique of the java bindings to vtk showed that the wrapper code is generated by several C programs that have been written only for this purpose. Now I have a C++ software package that outputs a number of vtk objects (vtkPolyDataSet, vtkStructuredGrid, ...). I would need a java wrapper of this package, which I'd like to generate using SWIG, and I would like to display the vtk objects that are produced by the package directly with the help of the default vtk java bindings. How can I write the SWIG interface definition so that the produced vtk java objects are compatible with the default vtk java bindings? Thanks Steffen _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers From bill.lorensen at gmail.com Fri Dec 3 10:31:28 2010 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Fri, 3 Dec 2010 10:31:28 -0500 Subject: [vtkusers] Importing a RIB file In-Reply-To: <148880.15669.qm@web110409.mail.gq1.yahoo.com> References: <148880.15669.qm@web110409.mail.gq1.yahoo.com> Message-ID: No. vtk can create a rib file with vtkRIBExporter but cannot import a rib file. On Fri, Dec 3, 2010 at 4:44 AM, Philippe Bruyant wrote: > Hello experts, > I'd like to know if it is possible to display in a VTK window a 3D scene as > described in a RIB file (RenderMan language). > TXS > Phil > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > From david.gobbi at gmail.com Fri Dec 3 10:31:26 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 3 Dec 2010 08:31:26 -0700 Subject: [vtkusers] vtkImageActor and scaling In-Reply-To: References: Message-ID: Hi Mark, You can try using vtkImageShiftScale to remap your 16-bit data to 8-bit, it might be slightly faster than using vtkImageMapToColors. David On Fri, Dec 3, 2010 at 5:37 AM, endlosschleife1 < endlosschleife1 at googlemail.com> wrote: > Hi David, > > thanks for all the help. I have looked at the OpenGL primitves for > vtkImageActor and vtkImageMapper and it helped me understanding the basic > differences, and I played around a bit with performance testing with non-VTK > glDrawPixels vs. glTexImage2D programs. > > The performance difference that I saw with > vtkImageActor/vtkWindowLeveLookupTable/vtkImageMapToColors does not seem to > come from the Open/GL part. It really seems to be the LUT operation (with > linear ramps / luminance output format) that makes the difference. When I > passed a ready pre-calculated 8 bit image to the actor instead of going > through this filter the ImageActor based implementation was quicker than the > vtkActor2D based implementation (so 20 seconds faster for the testing > procedure below). > > Mark > > 2010/11/30 David Gobbi > >> Hi Mark, >> >> The underlying OpenGL mechanism for vtkImageActor is completely different >> from vtkImageMapper, so if all other things are equal, any differences in >> speed are due to how fast the GPU and its drivers can do glTexImage2D (for >> ImageActor) versus glDrawPixels (for ImageMapper). >> >> You can make the comparison between them more fair by making certain that >> each of them uses the same number of pixel components. By default, >> vtkImageMapToColors will output an RGBA image. Use >> MapToColors->SetOutputFormatToLuminance() to ensure that it produces 8-bit >> greyscale images instead. >> >> David >> >> >> On Tue, Nov 30, 2010 at 9:56 AM, endlosschleife1 < >> endlosschleife1 at googlemail.com> wrote: >> >>> It's possible that I'm misinterpreting the performance results of my >>> implementation and that applying the window level lookup table is actually >>> not what makes the difference. I'm comparing a vtkActor2D/vtkImageMapper >>> based and a vtkImageActor based implementation of something that shows a >>> series of images one by one with a specific window/level. >>> >>> If the window/level is not the issue, how much of a difference in >>> performance drop for the vtkImageActor implementation would be expected? >>> >>> I have 700 images (512 x 512, 12 bits stored), rendered into a 512 x 512 >>> viewport). vtkActor2D/vtkImageMapper takes about 8 seconds, vtkImageActor >>> about 26 seconds to render the whole series. If I additionally resample my >>> data to add a scale to best fit to the vtkActor2D/vtkImageMapper >>> implementation I get to 18 seconds (that was my starting point to look for >>> accelarated scaling). There is no visible difference when I add scaling to >>> the vtkImageActor. That means that I'm getting much faster scaling for the >>> vtkImageActor based implementation, but that overall it still performs >>> slower. Unless there is some other bottleneck in my implementation. >>> >>> Mark >>> >>> >>> >>> 2010/11/30 David Gobbi >>> >>> On Tue, Nov 30, 2010 at 7:10 AM, endlosschleife1 < >>>> endlosschleife1 at googlemail.com> wrote: >>>> >>>> I was actually looking for accelerated scaling, so this sounds like >>>>> vtkActor2D is not be the right thing for that. >>>>> >>>> >>>> For accelerated scaling, you need to use vtkImageActor. >>>> >>>> I'm not sure, but it looks like my implementation probably doesn't use >>>>> any GPU acceleration (it seems to be pure image data filtering). It still >>>>> seemed to be not as performant as I expected (compared to an implementation >>>>> where I only used VTK for the imaging pipeline, but did the LUT application >>>>> and visualization separetely). >>>>> >>>> >>>> The vtkImageMapper doesn't have accelerated window/level either. It >>>> does all the computations on the CPU and then uses glDrawPixels() to render >>>> the image. >>>> >>>> >>>>> I create a vtkWindowLevelTable, set the window and center, and then >>>>> call build on the lut. Then I used it with a vtkImageMapToColors instance: >>>>> >>>>> vtkImageMapToColors *color = vtkImageMapToColors::New(); >>>>> color->SetLookupTable(lut); // lut is the vtkWindowLevelTable >>>>> color->SetInput(...) // some vtkImageData >>>>> >>>> >>>> Yes, that looks typical. Make sure that you call >>>> table->SetRampToLinear() because by default, a VTK lookup table uses a >>>> curved ramp instead of a linear ramp (I was shocked when I discovered this >>>> for the first time). >>>> >>>> David >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Fri Dec 3 10:34:15 2010 From: daviddoria at gmail.com (David Doria) Date: Fri, 3 Dec 2010 10:34:15 -0500 Subject: [vtkusers] Importing a RIB file In-Reply-To: References: <148880.15669.qm@web110409.mail.gq1.yahoo.com> Message-ID: > On Fri, Dec 3, 2010 at 4:44 AM, Philippe Bruyant wrote: >> Hello experts, >> I'd like to know if it is possible to display in a VTK window a 3D scene as >> described in a RIB file (RenderMan language). >> TXS >> Phil If you are familiar with this format and would like to write a filter to read it surely it would be a welcome addition. I'm of the opinion that VTK should be able to read all formats that it can write, and vice versa. David From sean at rogue-research.com Fri Dec 3 10:40:21 2010 From: sean at rogue-research.com (Sean McBride) Date: Fri, 3 Dec 2010 10:40:21 -0500 Subject: [vtkusers] VTK static crash on Mac In-Reply-To: <4CF84B64.30009@auckland.ac.nz> References: <4CF84B64.30009@auckland.ac.nz> Message-ID: <20101203154021.986001253@mail.rogue-research.com> On Fri, 3 Dec 2010 14:44:04 +1300, Gib Bogle said: >I've built VTK statically, and can link a test program that uses >QVTKWidget, but >when executed it crashes while invoking Render(). The error is >EXC_BAD_ACCESS (SIGBUS) > >The OS is Mac OS X 10.6.4 > >VTK built non-static works OK. That's not enough info for anyone to help. What the backtrace? Any info in Console.app? -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From bill.lorensen at gmail.com Fri Dec 3 11:42:16 2010 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Fri, 3 Dec 2010 11:42:16 -0500 Subject: [vtkusers] Importing a RIB file In-Reply-To: References: <148880.15669.qm@web110409.mail.gq1.yahoo.com> Message-ID: RIB files are pretty complex (they are written in the Renderman language). This would be a major undertaking and I'm not sure of the wide range usage of RIB outside of entertainment. On Fri, Dec 3, 2010 at 10:34 AM, David Doria wrote: >> On Fri, Dec 3, 2010 at 4:44 AM, Philippe Bruyant wrote: >>> Hello experts, >>> I'd like to know if it is possible to display in a VTK window a 3D scene as >>> described in a RIB file (RenderMan language). >>> TXS >>> Phil > > If you are familiar with this format and would like to write a filter > to read it surely it would be a welcome addition. I'm of the opinion > that VTK should be able to read all formats that it can write, and > vice versa. > > David > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > From david.gobbi at gmail.com Fri Dec 3 14:13:44 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 3 Dec 2010 12:13:44 -0700 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: Hi Jonathan, I put my flood-fill filter on github, and tested it to make sure it still works: http://github.com/dgobbi/VTK/tree/flood-fill/Imaging/ The interface is just like the vtkThresholdFilter, except that it has a method called SetSeedPoints() to allow you to set your seeds. For a binary image, call ThresholdByUpper(1) so that you can set seeds inside any non-zero islands that you want to keep in your output. I'll probably contribute this class to VTK after I have brought it up-to-date (it was originally written for VTK 4). David On Thu, Dec 2, 2010 at 3:39 PM, Jonathan Morra wrote: > Thanks, let me know where I can download it from. > > > On Thu, Dec 2, 2010 at 2:36 PM, David Gobbi wrote: > >> For Step 1, I have a VTK flood-fill class that do the job. I'll upload it >> to >> gerrit so that you can try it out. I don't think anything exists for your >> Step 2, though. >> >> David >> >> >> On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra wrote: >> >>> I have a binary vtkImageData class and I want to do 2 things with it, and >>> I don't know how. >>> >>> 1. I want to remove all islands from the image except one. I want to >>> identify the island not to be removed by a pixel location. I have seen >>> vtkImageIslandRemoval2D, and I don't think that'll work for me, because I do >>> not know anything about the island's size that I want to keep (it could be >>> big, small, or in the middle), all that I know is one point which >>> is guaranteed to be interior to one island, and that's the island I want to >>> keep. >>> >>> 2. I want to do hole filling on the output of step 1 and I don't know >>> how to do that. I saw vtkFillHolesFilter but that appears only to work on >>> poly data. I'd like something analogous to that for vtkImageData. >>> >>> If anyone knows how to do these things, I'd appreciate it. Also, if it >>> matters, I'm coding in Java. >>> >>> Thanks >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://www.vtk.org/mailman/listinfo/vtkusers >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonmorra at gmail.com Fri Dec 3 14:27:32 2010 From: jonmorra at gmail.com (Jonathan Morra) Date: Fri, 3 Dec 2010 11:27:32 -0800 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: Fantastic, thanks for your help! On Fri, Dec 3, 2010 at 11:13 AM, David Gobbi wrote: > Hi Jonathan, > > I put my flood-fill filter on github, and tested it to make sure it > still works: > http://github.com/dgobbi/VTK/tree/flood-fill/Imaging/ > > The interface is just like the vtkThresholdFilter, except that it > has a method called SetSeedPoints() to allow you to set your > seeds. For a binary image, call ThresholdByUpper(1) so that > you can set seeds inside any non-zero islands that you want > to keep in your output. > > I'll probably contribute this class to VTK after I have brought > it up-to-date (it was originally written for VTK 4). > > David > > > On Thu, Dec 2, 2010 at 3:39 PM, Jonathan Morra wrote: > >> Thanks, let me know where I can download it from. >> >> >> On Thu, Dec 2, 2010 at 2:36 PM, David Gobbi wrote: >> >>> For Step 1, I have a VTK flood-fill class that do the job. I'll upload >>> it to >>> gerrit so that you can try it out. I don't think anything exists for >>> your >>> Step 2, though. >>> >>> David >>> >>> >>> On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra wrote: >>> >>>> I have a binary vtkImageData class and I want to do 2 things with it, >>>> and I don't know how. >>>> >>>> 1. I want to remove all islands from the image except one. I want to >>>> identify the island not to be removed by a pixel location. I have seen >>>> vtkImageIslandRemoval2D, and I don't think that'll work for me, because I do >>>> not know anything about the island's size that I want to keep (it could be >>>> big, small, or in the middle), all that I know is one point which >>>> is guaranteed to be interior to one island, and that's the island I want to >>>> keep. >>>> >>>> 2. I want to do hole filling on the output of step 1 and I don't know >>>> how to do that. I saw vtkFillHolesFilter but that appears only to work on >>>> poly data. I'd like something analogous to that for vtkImageData. >>>> >>>> If anyone knows how to do these things, I'd appreciate it. Also, if it >>>> matters, I'm coding in Java. >>>> >>>> Thanks >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://www.vtk.org/mailman/listinfo/vtkusers >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zkhan at modusmed.com Fri Dec 3 16:04:53 2010 From: zkhan at modusmed.com (Zamir Khan) Date: Fri, 3 Dec 2010 16:04:53 -0500 Subject: [vtkusers] 3D Radon transform Message-ID: <24402C04465DF3439AF65818811BB51229DA46B88D@SERVER.modusmed.local> I am interested in computing the 3D Radon transform of a data-set. This is as I understand it, inverse backprojection, and gives all the 2d projections (given angles phi, theta, psi) through a 3d image. Before re-inventing the wheel, I wanted to make sure I'm not missing any potentially re-usable elements of VTK for this problem. There is not a direct Radon transform in VTK, but in this paper (http://bioinformatics.oxfordjournals.org/content/14/2/212.abstract), the computation is elegantly broken down to a few steps that involve 2-D and 1-D FFTs, conversion to polar coordinates, and 3-d matrix transposition. My question to the VTK community (especially those more familiar with the API) is if there are any classes within VTK that would be useful in tackling this problem. Of course, if you have suggestions outside of VTK, those would be welcome as well. Unfortunately, based on my search so far, it seems that this will be something that needs to be written nearly from scratch. Thanks in advance for any insights, Zamir -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Dec 3 17:26:14 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 3 Dec 2010 15:26:14 -0700 Subject: [vtkusers] 3D Radon transform In-Reply-To: <24402C04465DF3439AF65818811BB51229DA46B88D@SERVER.modusmed.local> References: <24402C04465DF3439AF65818811BB51229DA46B88D@SERVER.modusmed.local> Message-ID: Hi Zamir, If you are set on doing things with Fourier transforms, you can get your various projection angles by using vtkImageReslice in the Fourier domain to extract the "central slice" that corresponds to the projection. Or, if you are fine with skipping Fourier space altogether, I have a projection filter for VTK, http://github.com/dgobbi/VTK/commit/e7f87237 It only does projections along X, Y, or Z so it has to be preceded by vtkImageReslice if you require arbitrary angles. But even that will not give you a sinogram, it will just give a bunch of images corresponding to the various projections. You'd still have to stack the images together, e.g. with vtkImageAppend. I honestly can't say whether it would be better to do this with a VTK pipeline or whether it would be better to write a dedicated Radon transform filter. David On Fri, Dec 3, 2010 at 2:04 PM, Zamir Khan wrote: > I am interested in computing the 3D Radon transform of a data-set. This is > as I understand it, inverse backprojection, and gives all the 2d projections > (given angles phi, theta, psi) through a 3d image. Before re-inventing the > wheel, I wanted to make sure I?m not missing any potentially re-usable > elements of VTK for this problem. There is not a direct Radon transform in > VTK, but in this paper ( > http://bioinformatics.oxfordjournals.org/content/14/2/212.abstract), the > computation is elegantly broken down to a few steps that involve 2-D and 1-D > FFTs, conversion to polar coordinates, and 3-d matrix transposition. > > > > My question to the VTK community (especially those more familiar with the > API) is if there are any classes within VTK that would be useful in tackling > this problem. Of course, if you have suggestions outside of VTK, those would > be welcome as well. Unfortunately, based on my search so far, it seems that > this will be something that needs to be written nearly from scratch. > > > > Thanks in advance for any insights, > > Zamir > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jimcp at cox.net Fri Dec 3 17:54:32 2010 From: jimcp at cox.net (Jim Peterson) Date: Fri, 03 Dec 2010 17:54:32 -0500 Subject: [vtkusers] Java remove vtkImageViewer2 not working In-Reply-To: References: <4CF86DCD.7060003@cox.net> Message-ID: <4CF97528.7050401@cox.net> Jonathan, I am able to reproduce your problem, I made a minor change so that one image would be vertical lines and one horizontal, scrolling the image sizes as a test of the viewer interactor makes the two horizontal line images ambiguous. I still believe we are hitting the different interactor window for renderer problem. I believe a correct swap would need to be by switching the images being rendered, and leave the renderer associated with the frame it was created upon. You will notice that the top panel loses its data when you zoom. I believe this is the problem noted in this error message that would occur in a similar swap using C++: "Attempting to call MakeCurrent for a different window" " than the one doing the picking, this can causes crashes" " and/or bad pick results" My understanding is that the Viewer is an interactor with the render window, and my test does show bad pick resullts. I believe you are trying to simplify VTK Java beyond its limits, In all things we should make them as simple as possible, but no simpler. I think if you swap the input to the renderwindow instead of swapping the panels, you will achieve the same result without the vtk errors. Maybe Seb can provide some related insight in using the viewer approach in Java. Hope that helps, Jim Jonathan Morra wrote: > I apologize for the length of this example (it's a little long), but > it is totally self contained and shows my the error that I'm having. > Please let me know if you need any more information, or the tweaks to > make what I have work. > > import vtk.*; > import javax.swing.*; > import java.awt.event.*; > import java.awt.*; > > public class VTKSwingError { > static { > System.loadLibrary("vtkCommonJava"); > System.loadLibrary("vtkFilteringJava"); > } > > static JPanel topPanel; > static JPanel bottomPanel; > static JFrame frame; > > // This is just creating two different images so we can tell when > they're swapped > public static JPanel createImagePanel(boolean useMod0) { > vtkImageData image = new vtkImageData(); > image.SetSpacing(1, 1, 1); > image.SetOrigin(0, 0, 0); > image.SetExtent(0, 511, 0, 511, 0, 0); > image.AllocateScalars(); > for (int x=0; x<512; x++) for (int y=0; y<512; y++) { > if ((useMod0 && y%2 == 0) || (!useMod0 && y%2 == 1)) > image.SetScalarComponentFromDouble(x, y, 0, 0, 1); > } > } > vtkRenderWindowPanel renWin = new vtkRenderWindowPanel(); > renWin.setInteractorStyle(new vtkInteractorStyleImage()); > vtkImageViewer2 imageViewer = new vtkImageViewer2(); > imageViewer.SetInput(image); > imageViewer.SetColorLevel(0.5); > imageViewer.SetColorWindow(1); > imageViewer.SetSliceOrientationToXY(); > imageViewer.SetSlice(1); > imageViewer.SetRenderWindow(renWin.GetRenderWindow()); > imageViewer.GetRenderer().ResetCamera(); > > JPanel renWinPanel = new JPanel(new BorderLayout()); > renWinPanel.add(renWin, BorderLayout.CENTER); > return renWinPanel; > } > > public static void main(String[] args) { > topPanel = new JPanel(new BorderLayout()); > topPanel.setMinimumSize(new Dimension(400, 200)); > topPanel.setPreferredSize(new Dimension(400, 200)); > topPanel.add(createImagePanel(true), BorderLayout.CENTER); > > bottomPanel = new JPanel(new BorderLayout()); > bottomPanel.setMinimumSize(new Dimension(400, 200)); > bottomPanel.setPreferredSize(new Dimension(400, 200)); > bottomPanel.add(createImagePanel(false), BorderLayout.CENTER); > > JButton switchButton = new JButton("Switch Panels"); > switchButton.addActionListener(new ActionListener() { > public void actionPerformed(ActionEvent e) { > // This is where VTK is going haywire > Component oldTop = topPanel.getComponent(0); > Component oldBottom = bottomPanel.getComponent(0); > > topPanel.remove(oldTop); > bottomPanel.remove(oldBottom); topPanel.add(oldBottom, BorderLayout.CENTER); > bottomPanel.add(oldTop, BorderLayout.CENTER); > frame.getContentPane().validate(); > frame.getContentPane().repaint(); > } > }); > > frame = new JFrame(); > frame.getContentPane().setLayout(new BorderLayout()); > frame.getContentPane().add(topPanel, BorderLayout.NORTH); > frame.getContentPane().add(bottomPanel, BorderLayout.CENTER); > frame.getContentPane().add(switchButton, BorderLayout.SOUTH); > frame.setSize(400, 400); > frame.setLocationRelativeTo(null); > frame.setVisible(true); > } > } > > > On Thu, Dec 2, 2010 at 8:10 PM, Jim Peterson > wrote: > > Jonathan Morra wrote: > > > I have a java swing JPanel that contains another JPanel that > contains a vtkRenderWindowPanel which is hooked up to a > vtkImageViewer2. In the course of my program I want to remove > the inner JPanel from the outer JPanel with JPanel.remove(). I > then want to add the inner JPanel to a different outer JPanel. > However when I do this VTK throws the following exception > > ERROR: In ..\..\src\Rendering\vtkWin32OpenGLRenderWindow.cxx, > line 247 > vtkWin32OpenGLRenderWindow (00000004C8E4830): wglMakeCurrent > failed in MakeCurrent(), error: The handle is invalid. > > This seems like a very simple swing operation that I'm trying > to do, but it's failing. Does anyone know what I'm doing wrong? > Thanks > > Jonathan, > you do understand that the vtk classes are JNI interfaces to the > shared library version of vtk. I suspect you are causing Java to > free resources that are still referenced by the memory > instantiated by the still active structures outside Java in vtk. > Without an example it is pretty hard to try to visualize the java > and native system memory from your description. What you are doing > might be sensible with all java objects, but when JNI objects are > involved memory references may not be as clear as desired. are not > always completely in sync. > Chances are if you coded the same kind of operation in C++ the > make current routine would have detected the different potential > interaction source and issued this message: (from the > MakeCurrent() function in vtkWin32OpenGLRenderWindow.Cxx) > > if(this->IsPicking && current) > { > vtkErrorMacro("Attempting to call MakeCurrent for a different > window" > " than the one doing the picking, this can > causes crashes" > " and/or bad pick results"); > } > > Unless you want to post an example, I would say "If it hurts, > don't do that". > > Hope that helps, > Jim > > > From jonmorra at gmail.com Fri Dec 3 18:28:46 2010 From: jonmorra at gmail.com (Jonathan Morra) Date: Fri, 3 Dec 2010 15:28:46 -0800 Subject: [vtkusers] Java remove vtkImageViewer2 not working In-Reply-To: <4CF97528.7050401@cox.net> References: <4CF86DCD.7060003@cox.net> <4CF97528.7050401@cox.net> Message-ID: Thanks for the response. Your solution of just switching the inputs to the vtkImageViewer2's did work, however I still have two outstanding problems. 1. In my application I have one vtkImageData, and three vtkImageViewer2's, each at a different orientation, so switching the inputs doesn't make sense (the inputs are all the same) 2. I also have a fourth window which has to be moved around as well which is composed of three vtkImagePlaneWidgets. Here is a method that I'm currently using to do the rotation, hopefully this'll make my situation more clear. public void rotateImagesCounterclockwise() { // In this example, all of the panel variables are JPanel's and all of the old Components are actually // an extension of JPanel that contains either a vtkImageViewer2 or a vtkImagePlane widget. Ideally, // I shouldn't be concerned with what the old panels are Component oldCenter = centerPanel.getComponent(0); Component oldUpperRight = upperRightPanel.getComponent(0); Component oldCenterRight = centerRightPanel.getComponent(0); Component oldBottomRight = bottomRightPanel.getComponent(0); centerPanel.remove(oldCenter); upperRightPanel.remove(oldUpperRight); centerRightPanel.remove(oldCenterRight); bottomRightPanel.remove(oldBottomRight); centerPanel.add(oldUpperRight, BorderLayout.CENTER, 0); upperRightPanel.add(oldCenterRight, BorderLayout.CENTER, 0); centerRightPanel.add(oldBottomRight, BorderLayout.CENTER, 0); bottomRightPanel.add(oldCenter, BorderLayout.CENTER, 0); validate(); repaint(); } Thoughts? On Fri, Dec 3, 2010 at 2:54 PM, Jim Peterson wrote: > Jonathan, > I am able to reproduce your problem, I made a minor change so that one > image would be vertical lines and one horizontal, scrolling the image sizes > as a test of the viewer interactor makes the two horizontal line images > ambiguous. I still believe we are hitting the different interactor window > for renderer problem. I believe a correct swap would need to be by switching > the images being rendered, and leave the renderer associated with the frame > it was created upon. You will notice that the top panel loses its data when > you zoom. I believe this is the problem noted in this error message that > would occur in a similar swap using C++: > > > "Attempting to call MakeCurrent for a different window" > " than the one doing the picking, this can causes crashes" > " and/or bad pick results" > > My understanding is that the Viewer is an interactor with the render > window, and my test does show bad pick resullts. > > I believe you are trying to simplify VTK Java beyond its limits, In all > things we should make them as simple as possible, but no simpler. I think if > you swap the input to the renderwindow instead of swapping the panels, you > will achieve the same result without the vtk errors. > Maybe Seb can provide some related insight in using the viewer approach in > Java. > Hope that helps, > Jim > > > Jonathan Morra wrote: > >> I apologize for the length of this example (it's a little long), but it is >> totally self contained and shows my the error that I'm having. Please let >> me know if you need any more information, or the tweaks to make what I have >> work. >> >> import vtk.*; >> import javax.swing.*; >> import java.awt.event.*; >> import java.awt.*; >> >> public class VTKSwingError { >> static { >> System.loadLibrary("vtkCommonJava"); >> System.loadLibrary("vtkFilteringJava"); >> } >> >> static JPanel topPanel; >> static JPanel bottomPanel; >> static JFrame frame; >> >> // This is just creating two different images so we can tell when >> they're swapped >> public static JPanel createImagePanel(boolean useMod0) { >> vtkImageData image = new vtkImageData(); >> image.SetSpacing(1, 1, 1); >> image.SetOrigin(0, 0, 0); >> image.SetExtent(0, 511, 0, 511, 0, 0); >> image.AllocateScalars(); >> for (int x=0; x<512; x++) for (int y=0; y<512; y++) { >> if ((useMod0 && y%2 == 0) || (!useMod0 && y%2 == 1)) >> image.SetScalarComponentFromDouble(x, y, 0, 0, 1); >> } >> } >> vtkRenderWindowPanel renWin = new vtkRenderWindowPanel(); >> renWin.setInteractorStyle(new vtkInteractorStyleImage()); >> vtkImageViewer2 imageViewer = new vtkImageViewer2(); >> imageViewer.SetInput(image); >> imageViewer.SetColorLevel(0.5); >> imageViewer.SetColorWindow(1); >> imageViewer.SetSliceOrientationToXY(); >> imageViewer.SetSlice(1); >> imageViewer.SetRenderWindow(renWin.GetRenderWindow()); >> imageViewer.GetRenderer().ResetCamera(); >> >> JPanel renWinPanel = new JPanel(new BorderLayout()); >> renWinPanel.add(renWin, BorderLayout.CENTER); >> return renWinPanel; >> } >> >> public static void main(String[] args) { >> topPanel = new JPanel(new BorderLayout()); >> topPanel.setMinimumSize(new Dimension(400, 200)); >> topPanel.setPreferredSize(new Dimension(400, 200)); >> topPanel.add(createImagePanel(true), BorderLayout.CENTER); >> >> bottomPanel = new JPanel(new BorderLayout()); >> bottomPanel.setMinimumSize(new Dimension(400, 200)); >> bottomPanel.setPreferredSize(new Dimension(400, 200)); >> bottomPanel.add(createImagePanel(false), BorderLayout.CENTER); >> >> JButton switchButton = new JButton("Switch Panels"); >> switchButton.addActionListener(new ActionListener() { >> public void actionPerformed(ActionEvent e) { >> // This is where VTK is going haywire >> Component oldTop = topPanel.getComponent(0); >> Component oldBottom = bottomPanel.getComponent(0); >> >> topPanel.remove(oldTop); >> bottomPanel.remove(oldBottom); >> > topPanel.add(oldBottom, BorderLayout.CENTER); > >> bottomPanel.add(oldTop, BorderLayout.CENTER); >> frame.getContentPane().validate(); >> frame.getContentPane().repaint(); >> } >> }); >> >> frame = new JFrame(); >> frame.getContentPane().setLayout(new BorderLayout()); >> frame.getContentPane().add(topPanel, BorderLayout.NORTH); >> frame.getContentPane().add(bottomPanel, BorderLayout.CENTER); >> frame.getContentPane().add(switchButton, BorderLayout.SOUTH); >> frame.setSize(400, 400); >> frame.setLocationRelativeTo(null); >> frame.setVisible(true); >> } >> } >> >> >> On Thu, Dec 2, 2010 at 8:10 PM, Jim Peterson > jimcp at cox.net>> wrote: >> >> Jonathan Morra wrote: >> >> >> I have a java swing JPanel that contains another JPanel that >> contains a vtkRenderWindowPanel which is hooked up to a >> vtkImageViewer2. In the course of my program I want to remove >> the inner JPanel from the outer JPanel with JPanel.remove(). I >> then want to add the inner JPanel to a different outer JPanel. >> However when I do this VTK throws the following exception >> >> ERROR: In ..\..\src\Rendering\vtkWin32OpenGLRenderWindow.cxx, >> line 247 >> vtkWin32OpenGLRenderWindow (00000004C8E4830): wglMakeCurrent >> failed in MakeCurrent(), error: The handle is invalid. >> >> This seems like a very simple swing operation that I'm trying >> to do, but it's failing. Does anyone know what I'm doing wrong? >> Thanks >> >> Jonathan, >> you do understand that the vtk classes are JNI interfaces to the >> shared library version of vtk. I suspect you are causing Java to >> free resources that are still referenced by the memory >> instantiated by the still active structures outside Java in vtk. >> Without an example it is pretty hard to try to visualize the java >> and native system memory from your description. What you are doing >> might be sensible with all java objects, but when JNI objects are >> involved memory references may not be as clear as desired. are not >> always completely in sync. >> Chances are if you coded the same kind of operation in C++ the >> make current routine would have detected the different potential >> interaction source and issued this message: (from the >> MakeCurrent() function in vtkWin32OpenGLRenderWindow.Cxx) >> >> if(this->IsPicking && current) >> { >> vtkErrorMacro("Attempting to call MakeCurrent for a different >> window" >> " than the one doing the picking, this can >> causes crashes" >> " and/or bad pick results"); >> } >> >> Unless you want to post an example, I would say "If it hurts, >> don't do that". >> >> Hope that helps, >> Jim >> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jimcp at cox.net Fri Dec 3 18:52:54 2010 From: jimcp at cox.net (Jim Peterson) Date: Fri, 03 Dec 2010 18:52:54 -0500 Subject: [vtkusers] Java remove vtkImageViewer2 not working In-Reply-To: References: <4CF86DCD.7060003@cox.net> <4CF97528.7050401@cox.net> Message-ID: <4CF982D6.6090702@cox.net> Jonathan, I am really just a hobbiest programmer of vtk with Java, so if someone more involved directly with imaging and the standard processes involved wants to comment, you are welcome. Are the slice orientations arbitrary or do they use the setSliceOrientationxx methods? I think the general solution we are arriving at is to expose the vtk components to a level that allows you to interact with the vtk elements in your interaction methods rather than swapping panels at the java level without any vtk interaction. So instead of switching jpanels, you might set orientations or add transforms to the vtk objects to achieve the desired result. I hope that helps, I think I am out of ideas... Jim Jonathan Morra wrote: > Thanks for the response. Your solution of just switching the inputs > to the vtkImageViewer2's did work, however I still have two > outstanding problems. > 1. In my application I have one vtkImageData, and three > vtkImageViewer2's, each at a different orientation, so switching the > inputs doesn't make sense (the inputs are all the same) > 2. I also have a fourth window which has to be moved around as well > which is composed of three vtkImagePlaneWidgets. > > Here is a method that I'm currently using to do the rotation, > hopefully this'll make my situation more clear. > > public void rotateImagesCounterclockwise() { > // In this example, all of the panel variables are JPanel's > and all of the old Components are actually > // an extension of JPanel that contains either a > vtkImageViewer2 or a vtkImagePlane widget. Ideally, > // I shouldn't be concerned with what the old panels are > Component oldCenter = centerPanel.getComponent(0); > Component oldUpperRight = upperRightPanel.getComponent(0); > Component oldCenterRight = centerRightPanel.getComponent(0); > Component oldBottomRight = bottomRightPanel.getComponent(0); > > centerPanel.remove(oldCenter); > upperRightPanel.remove(oldUpperRight); > centerRightPanel.remove(oldCenterRight); > bottomRightPanel.remove(oldBottomRight); > > centerPanel.add(oldUpperRight, BorderLayout.CENTER, 0); > upperRightPanel.add(oldCenterRight, BorderLayout.CENTER, 0); > centerRightPanel.add(oldBottomRight, BorderLayout.CENTER, 0); > bottomRightPanel.add(oldCenter, BorderLayout.CENTER, 0); > > validate(); > repaint(); > } > > Thoughts? > > On Fri, Dec 3, 2010 at 2:54 PM, Jim Peterson > wrote: > > Jonathan, > I am able to reproduce your problem, I made a minor change so that > one image would be vertical lines and one horizontal, scrolling > the image sizes as a test of the viewer interactor makes the two > horizontal line images ambiguous. I still believe we are hitting > the different interactor window for renderer problem. I believe a > correct swap would need to be by switching the images being > rendered, and leave the renderer associated with the frame it was > created upon. You will notice that the top panel loses its data > when you zoom. I believe this is the problem noted in this error > message that would occur in a similar swap using C++: > > > "Attempting to call MakeCurrent for a different > window" > " than the one doing the picking, this can causes > crashes" > " and/or bad pick results" > > My understanding is that the Viewer is an interactor with the > render window, and my test does show bad pick resullts. > > I believe you are trying to simplify VTK Java beyond its limits, > In all things we should make them as simple as possible, but no > simpler. I think if you swap the input to the renderwindow instead > of swapping the panels, you will achieve the same result without > the vtk errors. > Maybe Seb can provide some related insight in using the viewer > approach in Java. > Hope that helps, > Jim > > > Jonathan Morra wrote: > > I apologize for the length of this example (it's a little > long), but it is totally self contained and shows my the error > that I'm having. Please let me know if you need any more > information, or the tweaks to make what I have work. > > import vtk.*; > import javax.swing.*; > import java.awt.event.*; > import java.awt.*; > > public class VTKSwingError { > static { > System.loadLibrary("vtkCommonJava"); > System.loadLibrary("vtkFilteringJava"); > } > > static JPanel topPanel; > static JPanel bottomPanel; > static JFrame frame; > > // This is just creating two different images so we can > tell when they're swapped > public static JPanel createImagePanel(boolean useMod0) { > vtkImageData image = new vtkImageData(); > image.SetSpacing(1, 1, 1); > image.SetOrigin(0, 0, 0); > image.SetExtent(0, 511, 0, 511, 0, 0); > image.AllocateScalars(); > for (int x=0; x<512; x++) for (int y=0; > y<512; y++) { > if ((useMod0 && y%2 == 0) || (!useMod0 && y%2 > == 1)) > image.SetScalarComponentFromDouble(x, y, 0, > 0, 1); > } > } > vtkRenderWindowPanel renWin = new vtkRenderWindowPanel(); > renWin.setInteractorStyle(new vtkInteractorStyleImage()); > vtkImageViewer2 imageViewer = new vtkImageViewer2(); > imageViewer.SetInput(image); > imageViewer.SetColorLevel(0.5); > imageViewer.SetColorWindow(1); > imageViewer.SetSliceOrientationToXY(); > imageViewer.SetSlice(1); > imageViewer.SetRenderWindow(renWin.GetRenderWindow()); > imageViewer.GetRenderer().ResetCamera(); > > JPanel renWinPanel = new JPanel(new BorderLayout()); > renWinPanel.add(renWin, BorderLayout.CENTER); > return renWinPanel; > } > > public static void main(String[] args) { > topPanel = new JPanel(new BorderLayout()); > topPanel.setMinimumSize(new Dimension(400, 200)); > topPanel.setPreferredSize(new Dimension(400, 200)); > topPanel.add(createImagePanel(true), BorderLayout.CENTER); > > bottomPanel = new JPanel(new BorderLayout()); > bottomPanel.setMinimumSize(new Dimension(400, 200)); > bottomPanel.setPreferredSize(new Dimension(400, 200)); > bottomPanel.add(createImagePanel(false), > BorderLayout.CENTER); > > JButton switchButton = new JButton("Switch Panels"); > switchButton.addActionListener(new ActionListener() { > public void actionPerformed(ActionEvent e) { > // This is where VTK is going haywire > Component oldTop = topPanel.getComponent(0); > Component oldBottom = bottomPanel.getComponent(0); > > topPanel.remove(oldTop); > bottomPanel.remove(oldBottom); > > topPanel.add(oldBottom, BorderLayout.CENTER); > > bottomPanel.add(oldTop, BorderLayout.CENTER); > frame.getContentPane().validate(); > frame.getContentPane().repaint(); > } > }); > > frame = new JFrame(); > frame.getContentPane().setLayout(new BorderLayout()); > frame.getContentPane().add(topPanel, BorderLayout.NORTH); > frame.getContentPane().add(bottomPanel, > BorderLayout.CENTER); > frame.getContentPane().add(switchButton, > BorderLayout.SOUTH); > frame.setSize(400, 400); > frame.setLocationRelativeTo(null); > frame.setVisible(true); > } > } > > > On Thu, Dec 2, 2010 at 8:10 PM, Jim Peterson >> wrote: > > Jonathan Morra wrote: > > > I have a java swing JPanel that contains another JPanel > that > contains a vtkRenderWindowPanel which is hooked up to a > vtkImageViewer2. In the course of my program I want to > remove > the inner JPanel from the outer JPanel with > JPanel.remove(). I > then want to add the inner JPanel to a different outer > JPanel. > However when I do this VTK throws the following exception > > ERROR: In > ..\..\src\Rendering\vtkWin32OpenGLRenderWindow.cxx, > line 247 > vtkWin32OpenGLRenderWindow (00000004C8E4830): > wglMakeCurrent > failed in MakeCurrent(), error: The handle is invalid. > > This seems like a very simple swing operation that I'm > trying > to do, but it's failing. Does anyone know what I'm > doing wrong? > Thanks > > Jonathan, > you do understand that the vtk classes are JNI interfaces > to the > shared library version of vtk. I suspect you are causing > Java to > free resources that are still referenced by the memory > instantiated by the still active structures outside Java in > vtk. > Without an example it is pretty hard to try to visualize > the java > and native system memory from your description. What you > are doing > might be sensible with all java objects, but when JNI > objects are > involved memory references may not be as clear as desired. > are not > always completely in sync. > Chances are if you coded the same kind of operation in C++ the > make current routine would have detected the different > potential > interaction source and issued this message: (from the > MakeCurrent() function in vtkWin32OpenGLRenderWindow.Cxx) > > if(this->IsPicking && current) > { > vtkErrorMacro("Attempting to call MakeCurrent for a > different > window" > " than the one doing the picking, this can > causes crashes" > " and/or bad pick results"); > } > > Unless you want to post an example, I would say "If it hurts, > don't do that". > > Hope that helps, > Jim > > > > > From scottrharris at gmail.com Fri Dec 3 19:58:35 2010 From: scottrharris at gmail.com (Scott Harris) Date: Fri, 3 Dec 2010 17:58:35 -0700 Subject: [vtkusers] wxPython+Cocoa+VTK? In-Reply-To: References: <31ddba771002280817j2260e6f4pda3516ce827ce319@mail.gmail.com> <31ddba771002281458m67b28360k6da8015bc36f6a37@mail.gmail.com> <31ddba771003010016x109ce667u92a65aa1b785ab4d@mail.gmail.com> <31ddba771003010747m3ed99505m82b2b810f6dfd436@mail.gmail.com> Message-ID: Is this combination supposed to work? I've installed VTK 5.6.1 (64 bit, cocoa, wrap python) and wxPython 2.9.1.1 with the system Python 2.6.1 in OS X 10.6 and when I run: python wxVTKRenderWindow.py I get the renderer in a separate window from the wx.Frame. It fails with the following error and sometimes a seg fault. Warning: In /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.h, line 112 vtkCocoaRenderWindow (0x10306da60): SetNextWindowInfo not implemented (WindowRemap not implemented). Warning: In /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.mm, line 944 vtkCocoaRenderWindow (0x10306da60): Can't remap the window. Any ideas? Should I move to 32 bits, Carbon, and wxPython for Carbon? What I would really like is PyObjC+Cocoa+VTK, but I haven't been able to get that combination to work since OS X 10.4. Thanks, -Scott From pbruyant at yahoo.com Sat Dec 4 03:32:34 2010 From: pbruyant at yahoo.com (Philippe Bruyant) Date: Sat, 4 Dec 2010 00:32:34 -0800 (PST) Subject: [vtkusers] Importing a RIB file Message-ID: <420674.1370.qm@web110409.mail.gq1.yahoo.com> Thanks for your replies. Phil -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbruyant at yahoo.com Sat Dec 4 05:12:00 2010 From: pbruyant at yahoo.com (Philippe Bruyant) Date: Sat, 4 Dec 2010 02:12:00 -0800 (PST) Subject: [vtkusers] Importing a RIB file Message-ID: <176193.86750.qm@web110416.mail.gq1.yahoo.com> [Sorry for creating a new thread on the same topic, but I haven't found how to reply to your mails] Do you think I could convert my RIB files to VRML files or 3DS files, which can be imported in VTK ? TXS Phil -------------- next part -------------- An HTML attachment was scrubbed... URL: From donnyz at charter.net Sat Dec 4 08:55:34 2010 From: donnyz at charter.net (Donny) Date: Sat, 4 Dec 2010 07:55:34 -0600 Subject: [vtkusers] Discovered And Fixed Bug In vtkDecimatePolylineFilter Message-ID: <99659D14C00B47A1846B5D8F57A38477@donny> Hello. I have discovered and fixed a bug in vtkDecimatePolylineFilter. The bug occurs if you have a mixture of lines with 3 or more points and also lines that are only 2 points. The following is in the RequestData function: for (cellId=0, inputLines->InitTraversal(); inputLines->GetNextCell(npts,pts); cellId++) { if ( npts < 3 ) { newId = newLines->InsertNextCell(npts,pts); outCD->CopyData(inCD,cellId,newId); for (i=0; i < npts; i++) { newId = newPts->InsertNextPoint(inputPoints->GetPoint(pts[i])); outPD->CopyData(inPD,pts[i],newId); } continue; //skip the rest } The call to newLines->InsertNextCell(npts,pts); is the incorrect overload to call since we are inserting new points in the loop that follows the call. This would work ok if we only had lines that were 2 points, but since we are also decimating and then inserting points for lines that have 3 or more points the "pts" argument is incorrect for the new polydata. I have tested the code that produced the bug with the following fixes and it works as intended. Here is the fixed code with modified lines commented with red: for (cellId=0, inputLines->InitTraversal(); inputLines->GetNextCell(npts,pts); cellId++) { if ( npts < 3 ) { newId = newLines->InsertNextCell(npts); // Modified to call different overload outCD->CopyData(inCD,cellId,newId); for (i=0; i < npts; i++) { newId = newPts->InsertNextPoint(inputPoints->GetPoint(pts[i])); newLines->InsertCellPoint(newId); // Added to correctly assign ID's outPD->CopyData(inPD,pts[i],newId); } continue; //skip the rest } I do not know how to submit this to git, or if this is the correct procedure for submitting bugs, so if somebody could kindly make the changes and submit I would be greatful. Thanks. Donny Zimmerman donnyz at charter.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Sat Dec 4 09:10:20 2010 From: daviddoria at gmail.com (David Doria) Date: Sat, 4 Dec 2010 09:10:20 -0500 Subject: [vtkusers] Discovered And Fixed Bug In vtkDecimatePolylineFilter In-Reply-To: <99659D14C00B47A1846B5D8F57A38477@donny> References: <99659D14C00B47A1846B5D8F57A38477@donny> Message-ID: On Sat, Dec 4, 2010 at 8:55 AM, Donny wrote: > Hello. I have discovered and fixed a bug in vtkDecimatePolylineFilter. The > bug occurs if you have a mixture of lines with 3 or more points and also > lines that are only 2 points. This sounds like a great patch for Gerrit (The following should be made into a wiki page named "how to contribute a patch" or similar - I've CCed Marcus who is the git expert and has been cleaning up the git/gerrit documentation) Create a Gerrit account as per: http://www.vtk.org/Wiki/ITK/Gerrit/Primer#Creating_a_Gerrit_account Once you've created an account, run the script: /Utilities/SetupForDevelopment.sh Then you can commit your change and push it to gerrit: git checkout -b YourPatchName git add YourFile git commit -m "ENH: 50 character description of your patch" git push gerrit HEAD:refs/for/master/YourPatchName Once you do this, you can add reviewers through the Gerrit interface. Once your code is reviewed, if you have write access you can push to the stage and then merge into master. If not, someone will do this for you. Good luck! David From lassi.paavolainen at jyu.fi Sat Dec 4 09:25:28 2010 From: lassi.paavolainen at jyu.fi (Lassi Paavolainen) Date: Sat, 4 Dec 2010 16:25:28 +0200 (EET) Subject: [vtkusers] wxPython+Cocoa+VTK? In-Reply-To: References: <31ddba771002280817j2260e6f4pda3516ce827ce319@mail.gmail.com> <31ddba771002281458m67b28360k6da8015bc36f6a37@mail.gmail.com> <31ddba771003010016x109ce667u92a65aa1b785ab4d@mail.gmail.com> <31ddba771003010747m3ed99505m82b2b810f6dfd436@mail.gmail.com> Message-ID: Hi Scott, Is your wxPython for Cocoa as well? I only found binaries for wxPython 2.9 for Cocoa in Python 2.7 from wxPython website. Did you get those somewhere else or built yourself? Sorry, can't really help on this one, but I'm also interested to get these working. My plan is to have Cocoa+wxPython+VTK+ITK in 64-bits. I've tried that combination in 32-bit and Carbon about a year ago without much of success. Cheers, Lassi On Fri, 3 Dec 2010, Scott Harris wrote: > Is this combination supposed to work? > > I've installed VTK 5.6.1 (64 bit, cocoa, wrap python) and wxPython 2.9.1.1 with the system Python 2.6.1 in OS X 10.6 and when I run: > > python wxVTKRenderWindow.py > > I get the renderer in a separate window from the wx.Frame. It fails with the following error and sometimes a seg fault. > > Warning: In /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.h, line 112 > vtkCocoaRenderWindow (0x10306da60): SetNextWindowInfo not implemented (WindowRemap not implemented). > > Warning: In /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.mm, line 944 > vtkCocoaRenderWindow (0x10306da60): Can't remap the window. > > Any ideas? > > Should I move to 32 bits, Carbon, and wxPython for Carbon? > > What I would really like is PyObjC+Cocoa+VTK, but I haven't been able to get that combination to work since OS X 10.4. > > Thanks, > -Scott > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -- Lassi Paavolainen, M.Sc Software Engineer, PhD Student in Computer Science BioImageXD (http://www.bioimagexd.net) University of Jyv?skyl? The Department of Biological and Environmental Science lassi.paavolainen at jyu.fi From scottrharris at gmail.com Sat Dec 4 16:30:38 2010 From: scottrharris at gmail.com (Scott Harris) Date: Sat, 4 Dec 2010 14:30:38 -0700 Subject: [vtkusers] wxPython+Cocoa+VTK? In-Reply-To: References: <31ddba771002280817j2260e6f4pda3516ce827ce319@mail.gmail.com> <31ddba771002281458m67b28360k6da8015bc36f6a37@mail.gmail.com> <31ddba771003010016x109ce667u92a65aa1b785ab4d@mail.gmail.com> <31ddba771003010747m3ed99505m82b2b810f6dfd436@mail.gmail.com> Message-ID: I compiled wxPython for Cocoa. The demos seem to work fine. -Scott On Sat, Dec 4, 2010 at 7:25 AM, Lassi Paavolainen wrote: > Hi Scott, > > Is your wxPython for Cocoa as well? I only found binaries for wxPython 2.9 > for Cocoa in Python 2.7 from wxPython website. Did you get those somewhere > else or built yourself? > > Sorry, can't really help on this one, but I'm also interested to get these > working. My plan is to have Cocoa+wxPython+VTK+ITK in 64-bits. I've tried > that combination in 32-bit and Carbon about a year ago without much of > success. > > Cheers, > Lassi > > On Fri, 3 Dec 2010, Scott Harris wrote: > >> Is this combination supposed to work? >> >> I've installed VTK 5.6.1 (64 bit, cocoa, wrap python) and wxPython 2.9.1.1 >> with the system Python 2.6.1 in OS X 10.6 and when I run: >> >> python wxVTKRenderWindow.py >> >> I get the renderer in a separate window from the wx.Frame. It fails with >> the following error and sometimes a seg fault. >> >> Warning: In >> /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.h, line >> 112 >> vtkCocoaRenderWindow (0x10306da60): SetNextWindowInfo not implemented >> (WindowRemap not implemented). >> >> Warning: In >> /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.mm, line >> 944 >> vtkCocoaRenderWindow (0x10306da60): Can't remap the window. >> >> Any ideas? >> >> Should I move to 32 bits, Carbon, and wxPython for Carbon? >> >> What I would really like is PyObjC+Cocoa+VTK, but I haven't been able to >> get that combination to work since OS X 10.4. >> >> Thanks, >> -Scott >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers >> > > -- > Lassi Paavolainen, M.Sc > Software Engineer, PhD Student in Computer Science > BioImageXD (http://www.bioimagexd.net) > University of Jyv?skyl? > The Department of Biological and Environmental Science > lassi.paavolainen at jyu.fi > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > From david.gobbi at gmail.com Sat Dec 4 17:10:25 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Sat, 4 Dec 2010 15:10:25 -0700 Subject: [vtkusers] wxPython+Cocoa+VTK? In-Reply-To: References: <31ddba771002280817j2260e6f4pda3516ce827ce319@mail.gmail.com> <31ddba771002281458m67b28360k6da8015bc36f6a37@mail.gmail.com> <31ddba771003010016x109ce667u92a65aa1b785ab4d@mail.gmail.com> <31ddba771003010747m3ed99505m82b2b810f6dfd436@mail.gmail.com> Message-ID: You can try using an older version of wxVTKRenderWindowPython.py that doesn't call "WindowRemap": http://vtk.org/gitweb?p=VTK.git;a=blob;f=Wrapping/Python/vtk/wx/wxVTKRenderWindow.py;hb=3eda1ca3 The WindowRemap() method has never been implemented for either the vtkCarbonRenderWindow or the vtkCocoaRenderWindow. David On Sat, Dec 4, 2010 at 2:30 PM, Scott Harris wrote: > I compiled wxPython for Cocoa. The demos seem to work fine. > -Scott > > On Sat, Dec 4, 2010 at 7:25 AM, Lassi Paavolainen > wrote: > > Hi Scott, > > > > Is your wxPython for Cocoa as well? I only found binaries for wxPython > 2.9 > > for Cocoa in Python 2.7 from wxPython website. Did you get those > somewhere > > else or built yourself? > > > > Sorry, can't really help on this one, but I'm also interested to get > these > > working. My plan is to have Cocoa+wxPython+VTK+ITK in 64-bits. I've tried > > that combination in 32-bit and Carbon about a year ago without much of > > success. > > > > Cheers, > > Lassi > > > > On Fri, 3 Dec 2010, Scott Harris wrote: > > > >> Is this combination supposed to work? > >> > >> I've installed VTK 5.6.1 (64 bit, cocoa, wrap python) and wxPython > 2.9.1.1 > >> with the system Python 2.6.1 in OS X 10.6 and when I run: > >> > >> python wxVTKRenderWindow.py > >> > >> I get the renderer in a separate window from the wx.Frame. It fails with > >> the following error and sometimes a seg fault. > >> > >> Warning: In > >> /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.h, > line > >> 112 > >> vtkCocoaRenderWindow (0x10306da60): SetNextWindowInfo not implemented > >> (WindowRemap not implemented). > >> > >> Warning: In > >> /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.mm, > line > >> 944 > >> vtkCocoaRenderWindow (0x10306da60): Can't remap the window. > >> > >> Any ideas? > >> > >> Should I move to 32 bits, Carbon, and wxPython for Carbon? > >> > >> What I would really like is PyObjC+Cocoa+VTK, but I haven't been able to > >> get that combination to work since OS X 10.4. > >> > >> Thanks, > >> -Scott > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sat Dec 4 17:19:49 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Sat, 4 Dec 2010 15:19:49 -0700 Subject: [vtkusers] wxPython+Cocoa+VTK? In-Reply-To: References: <31ddba771002280817j2260e6f4pda3516ce827ce319@mail.gmail.com> <31ddba771002281458m67b28360k6da8015bc36f6a37@mail.gmail.com> <31ddba771003010016x109ce667u92a65aa1b785ab4d@mail.gmail.com> <31ddba771003010747m3ed99505m82b2b810f6dfd436@mail.gmail.com> Message-ID: A small addition to my last email: the implementations for SetNextWindowInfo and WindowRemap in vtkWin32OpenGLRenderWindow.cxx are very simple. You should try copying them over to vtkCocoaRenderWindow.mm to see if they work there, too. David On Sat, Dec 4, 2010 at 3:10 PM, David Gobbi wrote: > You can try using an older version of wxVTKRenderWindowPython.py that > doesn't call "WindowRemap": > > http://vtk.org/gitweb?p=VTK.git;a=blob;f=Wrapping/Python/vtk/wx/wxVTKRenderWindow.py;hb=3eda1ca3 > > The WindowRemap() method has never been implemented for either the > vtkCarbonRenderWindow or the vtkCocoaRenderWindow. > > David > > > On Sat, Dec 4, 2010 at 2:30 PM, Scott Harris wrote: > >> I compiled wxPython for Cocoa. The demos seem to work fine. >> -Scott >> >> On Sat, Dec 4, 2010 at 7:25 AM, Lassi Paavolainen >> wrote: >> > Hi Scott, >> > >> > Is your wxPython for Cocoa as well? I only found binaries for wxPython >> 2.9 >> > for Cocoa in Python 2.7 from wxPython website. Did you get those >> somewhere >> > else or built yourself? >> > >> > Sorry, can't really help on this one, but I'm also interested to get >> these >> > working. My plan is to have Cocoa+wxPython+VTK+ITK in 64-bits. I've >> tried >> > that combination in 32-bit and Carbon about a year ago without much of >> > success. >> > >> > Cheers, >> > Lassi >> > >> > On Fri, 3 Dec 2010, Scott Harris wrote: >> > >> >> Is this combination supposed to work? >> >> >> >> I've installed VTK 5.6.1 (64 bit, cocoa, wrap python) and wxPython >> 2.9.1.1 >> >> with the system Python 2.6.1 in OS X 10.6 and when I run: >> >> >> >> python wxVTKRenderWindow.py >> >> >> >> I get the renderer in a separate window from the wx.Frame. It fails >> with >> >> the following error and sometimes a seg fault. >> >> >> >> Warning: In >> >> /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.h, >> line >> >> 112 >> >> vtkCocoaRenderWindow (0x10306da60): SetNextWindowInfo not implemented >> >> (WindowRemap not implemented). >> >> >> >> Warning: In >> >> /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.mm, >> line >> >> 944 >> >> vtkCocoaRenderWindow (0x10306da60): Can't remap the window. >> >> >> >> Any ideas? >> >> >> >> Should I move to 32 bits, Carbon, and wxPython for Carbon? >> >> >> >> What I would really like is PyObjC+Cocoa+VTK, but I haven't been able >> to >> >> get that combination to work since OS X 10.4. >> >> >> >> Thanks, >> >> -Scott >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From scottrharris at gmail.com Sat Dec 4 18:19:34 2010 From: scottrharris at gmail.com (Scott Harris) Date: Sat, 4 Dec 2010 16:19:34 -0700 Subject: [vtkusers] wxPython+Cocoa+VTK? In-Reply-To: References: <31ddba771002280817j2260e6f4pda3516ce827ce319@mail.gmail.com> <31ddba771002281458m67b28360k6da8015bc36f6a37@mail.gmail.com> <31ddba771003010016x109ce667u92a65aa1b785ab4d@mail.gmail.com> <31ddba771003010747m3ed99505m82b2b810f6dfd436@mail.gmail.com> Message-ID: <26DCED99-6F70-41D5-A3CC-09ADACA1BEFD@gmail.com> OK, I had to: 1. Hand code the values for WX_USE_GLCANVAS and WX_USE_X_CAPTURE. I need to go back and see why the try/except stuff was crashing. I was in a hurry for something to work. 2. Do some renaming (added "wx." all over) since "from wx import *" fails, but import wx works. I need to see understand why from wx import * fails for me, but that's a question for the wxGang. 3. Rename vtkpython to vtk. It seems to work, but the size of the cone and background are very small and only sit in the upper right hand corner of the window. Resizing the window makes everything snap together, so there's an initialization problem. Anyhow, I'll fix that size issue on initialization and just use this old, modified version. Is this a bug that should be fixed so that the current wxVTKRenderWindow stuff will work out of the box for OS X users? -Scott On Dec 4, 2010, at 3:10 PM, David Gobbi wrote: > You can try using an older version of wxVTKRenderWindowPython.py that doesn't call "WindowRemap": > http://vtk.org/gitweb?p=VTK.git;a=blob;f=Wrapping/Python/vtk/wx/wxVTKRenderWindow.py;hb=3eda1ca3 > > The WindowRemap() method has never been implemented for either the vtkCarbonRenderWindow or the vtkCocoaRenderWindow. > > David > > > On Sat, Dec 4, 2010 at 2:30 PM, Scott Harris wrote: > I compiled wxPython for Cocoa. The demos seem to work fine. > -Scott > > On Sat, Dec 4, 2010 at 7:25 AM, Lassi Paavolainen > wrote: > > Hi Scott, > > > > Is your wxPython for Cocoa as well? I only found binaries for wxPython 2.9 > > for Cocoa in Python 2.7 from wxPython website. Did you get those somewhere > > else or built yourself? > > > > Sorry, can't really help on this one, but I'm also interested to get these > > working. My plan is to have Cocoa+wxPython+VTK+ITK in 64-bits. I've tried > > that combination in 32-bit and Carbon about a year ago without much of > > success. > > > > Cheers, > > Lassi > > > > On Fri, 3 Dec 2010, Scott Harris wrote: > > > >> Is this combination supposed to work? > >> > >> I've installed VTK 5.6.1 (64 bit, cocoa, wrap python) and wxPython 2.9.1.1 > >> with the system Python 2.6.1 in OS X 10.6 and when I run: > >> > >> python wxVTKRenderWindow.py > >> > >> I get the renderer in a separate window from the wx.Frame. It fails with > >> the following error and sometimes a seg fault. > >> > >> Warning: In > >> /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.h, line > >> 112 > >> vtkCocoaRenderWindow (0x10306da60): SetNextWindowInfo not implemented > >> (WindowRemap not implemented). > >> > >> Warning: In > >> /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.mm, line > >> 944 > >> vtkCocoaRenderWindow (0x10306da60): Can't remap the window. > >> > >> Any ideas? > >> > >> Should I move to 32 bits, Carbon, and wxPython for Carbon? > >> > >> What I would really like is PyObjC+Cocoa+VTK, but I haven't been able to > >> get that combination to work since OS X 10.4. > >> > >> Thanks, > >> -Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sat Dec 4 19:22:03 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Sat, 4 Dec 2010 17:22:03 -0700 Subject: [vtkusers] wxPython+Cocoa+VTK? In-Reply-To: <26DCED99-6F70-41D5-A3CC-09ADACA1BEFD@gmail.com> References: <31ddba771002280817j2260e6f4pda3516ce827ce319@mail.gmail.com> <31ddba771002281458m67b28360k6da8015bc36f6a37@mail.gmail.com> <31ddba771003010016x109ce667u92a65aa1b785ab4d@mail.gmail.com> <31ddba771003010747m3ed99505m82b2b810f6dfd436@mail.gmail.com> <26DCED99-6F70-41D5-A3CC-09ADACA1BEFD@gmail.com> Message-ID: Hi Scott, It's good to hear that it is working. You should get in touch with the people who added the WindowRemap() calls to the code (just look through the git history for their emails). You might be able to work with them to create a fix that works for everyone. David On Sat, Dec 4, 2010 at 4:19 PM, Scott Harris wrote: > OK, I had to: > > 1. Hand code the values for WX_USE_GLCANVAS and WX_USE_X_CAPTURE. I need to > go back and see why the try/except stuff was crashing. I was in a hurry for > something to work. > > 2. Do some renaming (added "wx." all over) since "from wx import *" fails, > but import wx works. I need to see understand why from wx import * fails for > me, but that's a question for the wxGang. > > 3. Rename vtkpython to vtk. > > It seems to work, but the size of the cone and background are very small > and only sit in the upper right hand corner of the window. Resizing the > window makes everything snap together, so there's an initialization problem. > > Anyhow, I'll fix that size issue on initialization and just use this old, > modified version. > > Is this a bug that should be fixed so that the current wxVTKRenderWindow > stuff will work out of the box for OS X users? > > -Scott > > > > > On Dec 4, 2010, at 3:10 PM, David Gobbi wrote: > > You can try using an older version of wxVTKRenderWindowPython.py that > doesn't call "WindowRemap": > > http://vtk.org/gitweb?p=VTK.git;a=blob;f=Wrapping/Python/vtk/wx/wxVTKRenderWindow.py;hb=3eda1ca3 > > The WindowRemap() method has never been implemented for either the > vtkCarbonRenderWindow or the vtkCocoaRenderWindow. > > David > > > On Sat, Dec 4, 2010 at 2:30 PM, Scott Harris wrote: > >> I compiled wxPython for Cocoa. The demos seem to work fine. >> -Scott >> >> On Sat, Dec 4, 2010 at 7:25 AM, Lassi Paavolainen >> wrote: >> > Hi Scott, >> > >> > Is your wxPython for Cocoa as well? I only found binaries for wxPython >> 2.9 >> > for Cocoa in Python 2.7 from wxPython website. Did you get those >> somewhere >> > else or built yourself? >> > >> > Sorry, can't really help on this one, but I'm also interested to get >> these >> > working. My plan is to have Cocoa+wxPython+VTK+ITK in 64-bits. I've >> tried >> > that combination in 32-bit and Carbon about a year ago without much of >> > success. >> > >> > Cheers, >> > Lassi >> > >> > On Fri, 3 Dec 2010, Scott Harris wrote: >> > >> >> Is this combination supposed to work? >> >> >> >> I've installed VTK 5.6.1 (64 bit, cocoa, wrap python) and wxPython >> 2.9.1.1 >> >> with the system Python 2.6.1 in OS X 10.6 and when I run: >> >> >> >> python wxVTKRenderWindow.py >> >> >> >> I get the renderer in a separate window from the wx.Frame. It fails >> with >> >> the following error and sometimes a seg fault. >> >> >> >> Warning: In >> >> /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.h, >> line >> >> 112 >> >> vtkCocoaRenderWindow (0x10306da60): SetNextWindowInfo not implemented >> >> (WindowRemap not implemented). >> >> >> >> Warning: In >> >> /Users/scott/Documents/VTKStuff/VTK/Rendering/vtkCocoaRenderWindow.mm, >> line >> >> 944 >> >> vtkCocoaRenderWindow (0x10306da60): Can't remap the window. >> >> >> >> Any ideas? >> >> >> >> Should I move to 32 bits, Carbon, and wxPython for Carbon? >> >> >> >> What I would really like is PyObjC+Cocoa+VTK, but I haven't been able >> to >> >> get that combination to work since OS X 10.4. >> >> >> >> Thanks, >> >> -Scott >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From quantum.leaf at googlemail.com Sun Dec 5 05:28:02 2010 From: quantum.leaf at googlemail.com (Liam Kurmos) Date: Sun, 5 Dec 2010 10:28:02 +0000 Subject: [vtkusers] generating EndInteractionEvent In-Reply-To: References: Message-ID: > Does this trigger the event? > sliderWidget->GetRepresentation()->SetValue(value); > > If not you could probably do > sliderWidget->GetRepresentation()->SetValue(value); > sliderWidget->InvokeEvent(vtkCommand::EndInteractionEvent); > > David > Many thanks David, that solved my problem. it did require sliderWidget->InvokeEvent(vtkCommand::EndInteractionEvent); fyi cheers, Liam From jd379252 at gmail.com Sun Dec 5 10:07:00 2010 From: jd379252 at gmail.com (pof) Date: Sun, 05 Dec 2010 16:07:00 +0100 Subject: [vtkusers] bug 0009618 and UTF 8 text rendering fix question Message-ID: <4CFBAA94.8000303@gmail.com> Hi all: - the bug 0009618 (text shadow problem) is solved since september 2010 thanks to Roger Bramon fix. - the UTF 8 text rendering fix solves the accentuated character bug Just to know if these fixes will be available in the future vtk5.8 as they were not included in vtk5.6.1? Thanks JD From sistephan at gmail.com Sun Dec 5 10:12:08 2010 From: sistephan at gmail.com (Sam) Date: Sun, 5 Dec 2010 07:12:08 -0800 (PST) Subject: [vtkusers] VTK 3D Coordinate to ITK Coordinate Message-ID: <1291561928296-3292992.post@n5.nabble.com> Hello, I created a Surface (model) out of a 3D volumetric image using 3D Slicer. I am reading the surface using VTK. I want to take a given point from VTK and get the intensity value for that coordinate from the original ITK image. Do I need to do some type of transformation to go from VTK coordinate system to ITK coordinate system? Thanks, Sam -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-3D-Coordinate-to-ITK-Coordinate-tp3292992p3292992.html Sent from the VTK - Users mailing list archive at Nabble.com. From dave.partyka at kitware.com Sun Dec 5 10:14:36 2010 From: dave.partyka at kitware.com (Dave Partyka) Date: Sun, 5 Dec 2010 10:14:36 -0500 Subject: [vtkusers] bug 0009618 and UTF 8 text rendering fix question In-Reply-To: <4CFBAA94.8000303@gmail.com> References: <4CFBAA94.8000303@gmail.com> Message-ID: If these fixes were actually committed to master they will be included in vtk 5.8. If you know of fixes that aren't currently on master let us know. Thanks! On Sun, Dec 5, 2010 at 10:07 AM, pof wrote: > Hi all: > - the bug 0009618 (text shadow problem) is solved since september 2010 > thanks to Roger Bramon fix. > - the UTF 8 text rendering fix solves the accentuated character bug > Just to know if these fixes will be available in the future vtk5.8 as they > were not included in vtk5.6.1? > Thanks > JD > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jd379252 at gmail.com Sun Dec 5 10:22:42 2010 From: jd379252 at gmail.com (pof) Date: Sun, 05 Dec 2010 16:22:42 +0100 Subject: [vtkusers] bug 0009618 and UTF 8 text rendering fix question In-Reply-To: References: <4CFBAA94.8000303@gmail.com> Message-ID: <4CFBAE42.6080004@gmail.com> Actually, bug 0009618 has still an open status in Mantis, it should be closed now, but I do not know who can do this! Sorry if this question sounds a bit stupid, but how can I check if these fixes are on master? Le 05/12/2010 16:14, Dave Partyka a ?crit : > If these fixes were actually committed to master they will be included > in vtk 5.8. If you know of fixes that aren't currently on master let > us know. > > Thanks! > > On Sun, Dec 5, 2010 at 10:07 AM, pof > wrote: > > Hi all: > - the bug 0009618 (text shadow problem) is solved since september > 2010 thanks to Roger Bramon fix. > - the UTF 8 text rendering fix solves the accentuated character bug > Just to know if these fixes will be available in the future vtk5.8 > as they were not included in vtk5.6.1? > Thanks > JD > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ali.mahmoud.habib at gmail.com Sun Dec 5 14:31:06 2010 From: ali.mahmoud.habib at gmail.com (Ali Habib) Date: Sun, 5 Dec 2010 21:31:06 +0200 Subject: [vtkusers] create stl file with labeled parts Message-ID: Dear All, I have an ISO surface that I generated using marching cube and I want to save it as STL file after I divide it to 3 labelled surfaces for example I need to select the mandible to be part1, maxilla part2 neck part 3 any suggestion to do that please best regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Sun Dec 5 14:50:03 2010 From: daviddoria at gmail.com (David Doria) Date: Sun, 5 Dec 2010 14:50:03 -0500 Subject: [vtkusers] create stl file with labeled parts In-Reply-To: References: Message-ID: On Sun, Dec 5, 2010 at 2:31 PM, Ali Habib wrote: > Dear All, > I have an ISO surface that I generated using marching cube and I want to > save it as STL file after I divide it to 3?labelled?surfaces > for example I need to select the mandible to be part1,?maxilla?part2 neck > part 3 > > any suggestion to do that please > best regards You could label the three parts by adding an array to the point or cell data, something like this: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/MiscCellData I don't know how you intend to determine the three regions though. David From ali.mahmoud.habib at gmail.com Sun Dec 5 15:01:33 2010 From: ali.mahmoud.habib at gmail.com (Ali Habib) Date: Sun, 5 Dec 2010 22:01:33 +0200 Subject: [vtkusers] create stl file with labeled parts In-Reply-To: References: Message-ID: Dear David I use vtkboxwidget for selection and the vtkClipPolyData to get the selected points I will save the whole surface but I want to distinguish the parts using labels for further analysis in FE programs like ansys is their a way to near that Best regards On Sun, Dec 5, 2010 at 9:50 PM, David Doria wrote: > On Sun, Dec 5, 2010 at 2:31 PM, Ali Habib > wrote: > > Dear All, > > I have an ISO surface that I generated using marching cube and I want to > > save it as STL file after I divide it to 3 labelled surfaces > > for example I need to select the mandible to be part1, maxilla part2 neck > > part 3 > > > > any suggestion to do that please > > best regards > > You could label the three parts by adding an array to the point or > cell data, something like this: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/MiscCellData > > I don't know how you intend to determine the three regions though. > > David > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ali.mahmoud.habib at gmail.com Sun Dec 5 15:59:18 2010 From: ali.mahmoud.habib at gmail.com (Ali Habib) Date: Sun, 5 Dec 2010 22:59:18 +0200 Subject: [vtkusers] create stl file with labeled parts In-Reply-To: References: Message-ID: Dear Bll, no they are connected but in ANSYS we need to separate them logically by using labels any ideas best regards On Sun, Dec 5, 2010 at 10:57 PM, Bill Lorensen wrote: > If they are physically disconnected you can use > vtkPolyDataConnectivity to extract each isosurface. > > See: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColorDisconnectedRegions > > On Sun, Dec 5, 2010 at 2:31 PM, Ali Habib > wrote: > > Dear All, > > I have an ISO surface that I generated using marching cube and I want to > > save it as STL file after I divide it to 3 labelled surfaces > > for example I need to select the mandible to be part1, maxilla part2 neck > > part 3 > > > > any suggestion to do that please > > best regards > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Sun Dec 5 15:57:38 2010 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 5 Dec 2010 15:57:38 -0500 Subject: [vtkusers] create stl file with labeled parts In-Reply-To: References: Message-ID: If they are physically disconnected you can use vtkPolyDataConnectivity to extract each isosurface. See: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColorDisconnectedRegions On Sun, Dec 5, 2010 at 2:31 PM, Ali Habib wrote: > Dear All, > I have an ISO surface that I generated using marching cube and I want to > save it as STL file after I divide it to 3?labelled?surfaces > for example I need to select the mandible to be part1,?maxilla?part2 neck > part 3 > > any suggestion to do that please > best regards > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > From marcus.hanwell at kitware.com Sun Dec 5 16:13:38 2010 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Sun, 5 Dec 2010 16:13:38 -0500 Subject: [vtkusers] bug 0009618 and UTF 8 text rendering fix question In-Reply-To: <4CFBAE42.6080004@gmail.com> References: <4CFBAA94.8000303@gmail.com> <4CFBAE42.6080004@gmail.com> Message-ID: On Sun, Dec 5, 2010 at 10:22 AM, pof wrote: > Actually, > bug 0009618 has still an open status in Mantis, it should be closed now, but > I do not know who can do this! > Sorry if this question sounds a bit stupid, but how can I check if these > fixes are on master? I merged the changes into master for accented characters, I was not aware of this bug report at the time. I have assigned the bug to myself and marked it as resolved. I then realized that the drop shadow patch has not been merged, and so reopened the bug. I will try to make some time to check out the patch and get it merged if it looks good on all platforms. I am not as familiar with the drop shadow code, but am the one who has spent the most time working with FreeType classes in VTK recently. I would like to get this into the 5.8 release if it looks OK, and can confirm the accented characters patch is already in and will be in the next release. Marcus From marcus.hanwell at kitware.com Sun Dec 5 16:19:42 2010 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Sun, 5 Dec 2010 16:19:42 -0500 Subject: [vtkusers] Question on Viewports/vtkChartXY/SetGeometry in example TestMultipleChartRenderers.cxx In-Reply-To: <758150D667C235458DE231BB50B9A2B30AD021198F@de01ex07.GLOBAL.JHCN.NET> References: <758150D667C235458DE231BB50B9A2B30ACFDCA9B9@de01ex07.GLOBAL.JHCN.NET> <758150D667C235458DE231BB50B9A2B30ACFDCAF8B@de01ex07.GLOBAL.JHCN.NET> <758150D667C235458DE231BB50B9A2B30AD021198F@de01ex07.GLOBAL.JHCN.NET> Message-ID: Hi Daniel, I just merged a topic, and a new test, TestPlotMatrix, which shows a 2x2 matrix of charts with full mouse interaction. I still need to finish cleaning it up, but it should already allow most of what you need. You will need to get/update VTK master, you can run the test with a -I argument, so on Linux/Mac it would be (from your VTK build tree), ./bin/ChartsCxxTests TestPlotMatrix -I On Windows you may need to add a Release or Debug subdirectory in to get to the executable. Marcus 2010/12/1 Frese Daniel Dr. : > Hi Marcus, > > thanks again for your answer and the work you put into this. So I'll switch to the > git stuff. I guess if there is so much new stuff to come, I'll basically wait for the 5.8 > release and retest then again, using the git sources. > > Daniel > > > -----Urspr?ngliche Nachricht----- > Von: Marcus D. Hanwell [mailto:marcus.hanwell at kitware.com] > Gesendet: Mittwoch, 1. Dezember 2010 16:47 > An: Frese Daniel Dr. > Cc: vtkusers at vtk.org > Betreff: Re: [vtkusers] Question on Viewports/vtkChartXY/SetGeometry in example TestMultipleChartRenderers.cxx > > Hi Daniel, > > 2010/11/30 Frese Daniel Dr. : >> Hello Marcus, >> >> thank you for your fast answer. Such a feature (multiple graphs - maybe also images ? - >> in one scene) would be very useful. As I understand it now, this basically means that >> there are still some open issues in the 2D API, which you are working on. > > Multiple images is already possible, the charts have the issue that > they always grow to fill the scene. So there is some extra code that > needs to go in there to allow that behavior to be toggled. The charts > themselves have child items in the scene (the axes, plots etc), and so > make full use of the scene. >> >> We are looking here for some visualization kit for some very basic 3D stuff, but mainly >> to look at some XY charts and some matrix data - and for this your 2D API looks >> very nice ! So I try to figure out, whether it makes sense for our purposes >> to use VTK and the 2D API for this. Two questions on this : >> >> - Is there anywhere some kind of overview, which areas of this API are still work >> in progress, and which are already more stable ? That would help me (as a newbie) >> trying desperately to get some things running, while they simply don't work the >> expected way yet... > > I will see if I can put something together, this wiki page does not > yet exist. The VTK examples, and the tests in Charts/Testing/ give > many examples of what works, along with ParaView which uses the VTK > charts in its GUI (you can download binaries and see what it already > exposed). >> >> - I know this a difficult one, but what are the priorities on the 2D API stuff ? >> Is there some kind of target date as when things will kind of settle down ? >> Does it make sense for me, to check out sources regularly via git ? So far I use the >> 5.6.1 release. > > I think it would make sense to check out the source via git. I am > working on several new features, there is an article in the Source, > > http://www.kitware.com/products/html/NewChartAPIInVTK.html > > We have a new release (VTK 5.8), and I will be getting things ready > for that release. There are a few new chart types, along with the work > we are doing on Marks (Protovis like API in C++ over the 2D API/2D > scene). I monitor the mailing lists, but will see about making a high > level summary of this work. I will post to the list when I do so. > > There are a few topic branches I am getting ready to merge into VTK > master for things like 2D histograms (color maps), fixed size charts > (enabling multiple charts with interaction in one scene). > > Marcus > > > ------------------------------------------------------------------------------------------------------- > Registergericht: Traunstein / Registry Court: HRB 275 ? Sitz / Head Office: Traunreut > Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard > Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman), > Michael Grimm, Matthias Fauser, Sebastian Tondorf > > E-Mail Haftungsausschluss / E-Mail Disclaimer: http://www.heidenhain.de/disclaimer > > > From vitanovski at hotmail.com Mon Dec 6 04:33:14 2010 From: vitanovski at hotmail.com (Dime Vitanovski) Date: Mon, 6 Dec 2010 09:33:14 +0000 Subject: [vtkusers] ICP does not apply transformation on source data Message-ID: Hi VTK, I have some problems with ICP and I hope you can help me.I have two clouds of points: 1. source points => 638 3D Points 2. target points => 204 3D Points I used vtkIterativeClosestPointTransform to map the source points to the target points, everything work fines in terms of compilation and transformation ( i have printed the transfomration matrix)but I can not apply the computed transfomration on the source points. Here is the code, probably I am doing some very basic mistake: void ShapeAlignment::iterativeClosesPoint( const PointArray &mesh, const std::vector &sparseMesh, PointArray &mappedMesh ){ //MESH vtkPointsPtr vtkMesh; VTKConversion::convertSeC2VTK(mesh,vtkMesh); DebugRender::renderPoint(mesh,MString("mesh"),PointType(1,0,0),0); //vtkMesh is of type vtkPoints => 638 3D vtkPoints vtkSmartPointer vtkPolyDataMesh = vtkSmartPointer::New(); vtkPolyDataMesh->SetPoints(vtkMesh); vtkSmartPointer vertexMesh = vtkSmartPointer::New(); vertexMesh->SetInputConnection(vtkPolyDataMesh->GetProducerPort()); vertexMesh->Update(); //SPARSE MESH vtkPointsPtr vtkSparseMesh; VTKConversion::convertSeC2VTK(sparseMesh,vtkSparseMesh); DebugRender::renderPoint(vtkSparseMesh,MString("sparseMesh"),PointType(0,1,0),0); //vtkSparseMesh is of type vtkPoints => 204 3D points vtkSmartPointer vtkPolyDataSparseMesh = vtkSmartPointer::New(); vtkPolyDataSparseMesh->SetPoints(vtkSparseMesh); vtkSmartPointer vertexSparseMesh = vtkSmartPointer::New(); vertexSparseMesh->SetInputConnection(vtkPolyDataSparseMesh->GetProducerPort()); vertexSparseMesh->Update(); //setup ICP vtkSmartPointer icp = vtkSmartPointer::New(); icp->SetSource(vertexMesh->GetOutput()); icp->SetTarget(vertexSparseMesh->GetOutput()); icp->DebugOn(); icp->GetLandmarkTransform()->SetModeToRigidBody(); icp->SetMaximumNumberOfIterations(40); icp->SetMaximumNumberOfLandmarks(vertexSparseMesh->GetOutput()->GetNumberOfPoints()); icp->SetCheckMeanDistance(1); icp->SetMaximumMeanDistance(0.0000001); icp->Modified(); icp->Update(); vtkSmartPointer m = icp->GetMatrix(); std::cout << "The resulting matrix is: " << *m << std::endl; // Transform the source points by the ICP solution vtkSmartPointer icpTransformFilter = vtkSmartPointer::New(); icpTransformFilter->SetInput(vertexSparseMesh->GetOutput()); icpTransformFilter->SetTransform(icp); icpTransformFilter->Update(); //visualize transformed mesh DebugRender::renderPoint(vertexSparseMesh->GetOutput()->GetPoints(),MString("mesh"),PointType(0,0,1),0);} Can you please give me some feedback. Thanks a lot,padre -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Mon Dec 6 07:49:01 2010 From: daviddoria at gmail.com (David Doria) Date: Mon, 6 Dec 2010 07:49:01 -0500 Subject: [vtkusers] ICP does not apply transformation on source data In-Reply-To: References: Message-ID: > Can you please give me some feedback. > Thanks a lot, > padre I think you just need to change: //visualize transformed mesh DebugRender::renderPoint(vertexSparseMesh->GetOutput()->GetPoints(),MString("mesh"),PointType(0,0,1),0); to DebugRender::renderPoint(icpTransformFilter->GetOutput()->GetPoints(),MString("mesh"),PointType(0,0,1),0); The transform filter doesn't transform the data in place - it creates a new data set. David From hel.schumacher at fz-juelich.de Mon Dec 6 09:38:28 2010 From: hel.schumacher at fz-juelich.de (Dr. Helmut Schumacher) Date: Mon, 6 Dec 2010 15:38:28 +0100 Subject: [vtkusers] VTK; Qt and Java on Windows Message-ID: <003e01cb9553$3f118c90$bd34a5b0$@schumacher@fz-juelich.de> Hello, I have big problems running VTK on Windows with Qt AND Java. If I compile VTK with MinGW, I cannot use the Java wrapping. Cmake cannot configure VTK for Visual Studio with Qt. The message says, the problem is that the (precompiled) Qt was compiled with MinGW. Any ideas? Dr. Helmut Schumacher Forschungszentrum J?lich J?lich Supercompting Centre Leo-Brandt-Stra?e 52425 J?lich Tel.: +49-2461/61-2482 Fax: +49-2461/61-6656 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 5713 bytes Desc: not available URL: From jeff.baumes at kitware.com Mon Dec 6 09:47:28 2010 From: jeff.baumes at kitware.com (Jeff Baumes) Date: Mon, 6 Dec 2010 09:47:28 -0500 Subject: [vtkusers] VTK; Qt and Java on Windows In-Reply-To: <-903413786506876075@unknownmsgid> References: <-903413786506876075@unknownmsgid> Message-ID: On Mon, Dec 6, 2010 at 9:38 AM, Dr. Helmut Schumacher < hel.schumacher at fz-juelich.de> wrote: > Hello, > > I have big problems running VTK on Windows with Qt AND Java. > > If I compile VTK with MinGW, I cannot use the Java wrapping. > Cmake cannot configure VTK for Visual Studio with Qt. > The message says, the problem is that the (precompiled) Qt was compiled > with > MinGW. > > Any ideas? > I cannot speak to the issue of compiling Java wrapping with MinGW. To use Qt with Visual Studio, you'll need to either download the Visual Studio 2008 binaries if you have that version of VS, otherwise you need to compile Qt from source from the VS command prompt. Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: From frese at heidenhain.de Mon Dec 6 10:01:51 2010 From: frese at heidenhain.de (Frese Daniel Dr.) Date: Mon, 6 Dec 2010 16:01:51 +0100 Subject: [vtkusers] =?iso-8859-15?q?Question_on_Viewports/vtkChartXY/SetGe?= =?iso-8859-15?q?ometry_in__example_TestMultipleChartRenderers=2Ecxx?= In-Reply-To: References: <758150D667C235458DE231BB50B9A2B30ACFDCA9B9@de01ex07.GLOBAL.JHCN.NET> <758150D667C235458DE231BB50B9A2B30ACFDCAF8B@de01ex07.GLOBAL.JHCN.NET> <758150D667C235458DE231BB50B9A2B30AD021198F@de01ex07.GLOBAL.JHCN.NET> Message-ID: <758150D667C235458DE231BB50B9A2B30AD0BE1667@de01ex07.GLOBAL.JHCN.NET> Hi Marcus, I got your test file and the updated vtk source tree, and it looks really nice and works like charm. That was exactly what I was looking for, so thanks a lot. Daniel -----Urspr?ngliche Nachricht----- Von: Marcus D. Hanwell [mailto:marcus.hanwell at kitware.com] Gesendet: Sonntag, 5. Dezember 2010 22:20 An: Frese Daniel Dr. Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Question on Viewports/vtkChartXY/SetGeometry in example TestMultipleChartRenderers.cxx Hi Daniel, I just merged a topic, and a new test, TestPlotMatrix, which shows a 2x2 matrix of charts with full mouse interaction. I still need to finish cleaning it up, but it should already allow most of what you need. You will need to get/update VTK master, you can run the test with a -I argument, so on Linux/Mac it would be (from your VTK build tree), ./bin/ChartsCxxTests TestPlotMatrix -I On Windows you may need to add a Release or Debug subdirectory in to get to the executable. Marcus -------------- next part -------------- ------------------------------------------------------------------------------------------------------- Registergericht: Traunstein / Registry Court: HRB 275 ? Sitz / Head Office: Traunreut Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman), Michael Grimm, Matthias Fauser, Sebastian Tondorf E-Mail Haftungsausschluss / E-Mail Disclaimer: http://www.heidenhain.de/disclaimer From jonmorra at gmail.com Mon Dec 6 13:13:10 2010 From: jonmorra at gmail.com (Jonathan Morra) Date: Mon, 6 Dec 2010 10:13:10 -0800 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: I just got your class in my version of vtk and up and running in Java, and it's not working for me. I was wondering what I'm doing wrong, could you help me out? Thanks // We have to remove all the islands not connected to the center // and then fill the holes in the resulting mask vtkPoints seedPoints = new vtkPoints(); seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); vtkImageFloodFill fill = new vtkImageFloodFill(); fill.SetInput(binaryImage); fill.SetSeedPoints(seedPoints); fill.ThresholdByUpper(1); fill.Update(); binaryImage = fill.GetOutput(); On Fri, Dec 3, 2010 at 11:27 AM, Jonathan Morra wrote: > Fantastic, thanks for your help! > > > On Fri, Dec 3, 2010 at 11:13 AM, David Gobbi wrote: > >> Hi Jonathan, >> >> I put my flood-fill filter on github, and tested it to make sure it >> still works: >> http://github.com/dgobbi/VTK/tree/flood-fill/Imaging/ >> >> The interface is just like the vtkThresholdFilter, except that it >> has a method called SetSeedPoints() to allow you to set your >> seeds. For a binary image, call ThresholdByUpper(1) so that >> you can set seeds inside any non-zero islands that you want >> to keep in your output. >> >> I'll probably contribute this class to VTK after I have brought >> it up-to-date (it was originally written for VTK 4). >> >> David >> >> >> On Thu, Dec 2, 2010 at 3:39 PM, Jonathan Morra wrote: >> >>> Thanks, let me know where I can download it from. >>> >>> >>> On Thu, Dec 2, 2010 at 2:36 PM, David Gobbi wrote: >>> >>>> For Step 1, I have a VTK flood-fill class that do the job. I'll upload >>>> it to >>>> gerrit so that you can try it out. I don't think anything exists for >>>> your >>>> Step 2, though. >>>> >>>> David >>>> >>>> >>>> On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra wrote: >>>> >>>>> I have a binary vtkImageData class and I want to do 2 things with it, >>>>> and I don't know how. >>>>> >>>>> 1. I want to remove all islands from the image except one. I want to >>>>> identify the island not to be removed by a pixel location. I have seen >>>>> vtkImageIslandRemoval2D, and I don't think that'll work for me, because I do >>>>> not know anything about the island's size that I want to keep (it could be >>>>> big, small, or in the middle), all that I know is one point which >>>>> is guaranteed to be interior to one island, and that's the island I want to >>>>> keep. >>>>> >>>>> 2. I want to do hole filling on the output of step 1 and I don't know >>>>> how to do that. I saw vtkFillHolesFilter but that appears only to work on >>>>> poly data. I'd like something analogous to that for vtkImageData. >>>>> >>>>> If anyone knows how to do these things, I'd appreciate it. Also, if it >>>>> matters, I'm coding in Java. >>>>> >>>>> Thanks >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://www.vtk.org/mailman/listinfo/vtkusers >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Dec 6 13:19:57 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 6 Dec 2010 11:19:57 -0700 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: I think I made a mistake... I should have told you to use ThresholdByLower(1). Other than that, your code looks fine. David On Mon, Dec 6, 2010 at 11:13 AM, Jonathan Morra wrote: > I just got your class in my version of vtk and up and running in Java, and > it's not working for me. I was wondering what I'm doing wrong, could you > help me out? > > Thanks > > // We have to remove all the islands not connected to the > center > // and then fill the holes in the resulting mask > vtkPoints seedPoints = new vtkPoints(); > > seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); > vtkImageFloodFill fill = new vtkImageFloodFill(); > fill.SetInput(binaryImage); > fill.SetSeedPoints(seedPoints); > fill.ThresholdByUpper(1); > fill.Update(); > binaryImage = fill.GetOutput(); > > On Fri, Dec 3, 2010 at 11:27 AM, Jonathan Morra wrote: > >> Fantastic, thanks for your help! >> >> >> On Fri, Dec 3, 2010 at 11:13 AM, David Gobbi wrote: >> >>> Hi Jonathan, >>> >>> I put my flood-fill filter on github, and tested it to make sure it >>> still works: >>> http://github.com/dgobbi/VTK/tree/flood-fill/Imaging/ >>> >>> The interface is just like the vtkThresholdFilter, except that it >>> has a method called SetSeedPoints() to allow you to set your >>> seeds. For a binary image, call ThresholdByUpper(1) so that >>> you can set seeds inside any non-zero islands that you want >>> to keep in your output. >>> >>> I'll probably contribute this class to VTK after I have brought >>> it up-to-date (it was originally written for VTK 4). >>> >>> David >>> >>> >>> On Thu, Dec 2, 2010 at 3:39 PM, Jonathan Morra wrote: >>> >>>> Thanks, let me know where I can download it from. >>>> >>>> >>>> On Thu, Dec 2, 2010 at 2:36 PM, David Gobbi wrote: >>>> >>>>> For Step 1, I have a VTK flood-fill class that do the job. I'll upload >>>>> it to >>>>> gerrit so that you can try it out. I don't think anything exists for >>>>> your >>>>> Step 2, though. >>>>> >>>>> David >>>>> >>>>> >>>>> On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra wrote: >>>>> >>>>>> I have a binary vtkImageData class and I want to do 2 things with it, >>>>>> and I don't know how. >>>>>> >>>>>> 1. I want to remove all islands from the image except one. I want to >>>>>> identify the island not to be removed by a pixel location. I have seen >>>>>> vtkImageIslandRemoval2D, and I don't think that'll work for me, because I do >>>>>> not know anything about the island's size that I want to keep (it could be >>>>>> big, small, or in the middle), all that I know is one point which >>>>>> is guaranteed to be interior to one island, and that's the island I want to >>>>>> keep. >>>>>> >>>>>> 2. I want to do hole filling on the output of step 1 and I don't know >>>>>> how to do that. I saw vtkFillHolesFilter but that appears only to work on >>>>>> poly data. I'd like something analogous to that for vtkImageData. >>>>>> >>>>>> If anyone knows how to do these things, I'd appreciate it. Also, if >>>>>> it matters, I'm coding in Java. >>>>>> >>>>>> Thanks >>>>>> >>>>>> _______________________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>> >>>>>> Follow this link to subscribe/unsubscribe: >>>>>> http://www.vtk.org/mailman/listinfo/vtkusers >>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karthik.krishnan at kitware.com Mon Dec 6 13:34:01 2010 From: karthik.krishnan at kitware.com (Karthik Krishnan) Date: Tue, 7 Dec 2010 00:04:01 +0530 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: Or you could process the pipeline in ITK, if you are willing to incorporate another toolkit.. itk::ConnectedThresholdImageFilter -> VotingBinaryHoleFillingImageFilter (or its iterative version) On Mon, Dec 6, 2010 at 11:49 PM, David Gobbi wrote: > I think I made a mistake... I should have told you to use > ThresholdByLower(1). ?Other than that, your code looks fine. > ??David > > On Mon, Dec 6, 2010 at 11:13 AM, Jonathan Morra wrote: >> >> I just got your class in my version of vtk and up and running in Java, and >> it's not working for me. ?I was wondering what I'm doing wrong, could you >> help me out? >> Thanks >> ?? ? ? ? ? ?// We have to remove all the islands not connected to the >> center >> ?? ? ? ? ? ?// and then fill the holes in the resulting mask >> ?? ? ? ? ? ?vtkPoints seedPoints = new vtkPoints(); >> >> ?seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); >> ?? ? ? ? ? ?vtkImageFloodFill fill = new vtkImageFloodFill(); >> ?? ? ? ? ? ?fill.SetInput(binaryImage); >> ?? ? ? ? ? ?fill.SetSeedPoints(seedPoints); >> ?? ? ? ? ? ?fill.ThresholdByUpper(1); >> ?? ? ? ? ? ?fill.Update(); >> ?? ? ? ? ? ?binaryImage = fill.GetOutput(); >> On Fri, Dec 3, 2010 at 11:27 AM, Jonathan Morra >> wrote: >>> >>> Fantastic, thanks for your help! >>> >>> On Fri, Dec 3, 2010 at 11:13 AM, David Gobbi >>> wrote: >>>> >>>> Hi Jonathan, >>>> I put my flood-fill filter on github, and tested it to make sure it >>>> still works: >>>> http://github.com/dgobbi/VTK/tree/flood-fill/Imaging/ >>>> >>>> The interface is just like the vtkThresholdFilter, except that it >>>> has a method called SetSeedPoints() to allow you to set your >>>> seeds. ?For a binary image, call ThresholdByUpper(1) so that >>>> you can set seeds inside any non-zero islands that you want >>>> to keep in your output. >>>> I'll probably contribute this class to VTK after I have brought >>>> it up-to-date (it was originally written for VTK 4). >>>> ??David >>>> >>>> On Thu, Dec 2, 2010 at 3:39 PM, Jonathan Morra >>>> wrote: >>>>> >>>>> Thanks, let me know where I can download it from. >>>>> >>>>> On Thu, Dec 2, 2010 at 2:36 PM, David Gobbi >>>>> wrote: >>>>>> >>>>>> For Step 1, I have a VTK flood-fill class that do the job. ?I'll >>>>>> upload it to >>>>>> gerrit so that you can try it out. ?I don't think anything exists for >>>>>> your >>>>>> Step 2, though. >>>>>> ??David >>>>>> >>>>>> On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra >>>>>> wrote: >>>>>>> >>>>>>> I have a binary vtkImageData class and I want to do 2 things with it, >>>>>>> and I don't know how. >>>>>>> 1. ?I want to remove all islands from the image except one. ?I want >>>>>>> to identify the island not to be removed by a pixel location. ?I have seen >>>>>>> vtkImageIslandRemoval2D, and I don't think that'll work for me, because I do >>>>>>> not know anything about the island's size that I want to keep (it could be >>>>>>> big, small, or in the middle), all that I know is one point which >>>>>>> is?guaranteed?to be interior to one island, and that's the island I want to >>>>>>> keep. >>>>>>> 2. ?I want to do hole filling on the output of step 1 and I don't >>>>>>> know how to do that. ?I saw?vtkFillHolesFilter but that appears only to work >>>>>>> on poly data. ?I'd like something?analogous?to that for vtkImageData. >>>>>>> If anyone knows how to do these things, I'd appreciate it. ?Also, if >>>>>>> it matters, I'm coding in Java. >>>>>>> Thanks >>>>>>> _______________________________________________ >>>>>>> Powered by www.kitware.com >>>>>>> >>>>>>> Visit other Kitware open-source projects at >>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>> >>>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>>> >>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>> http://www.vtk.org/mailman/listinfo/vtkusers >>>>>>> >>>>>> >>>>> >>>> >>> >> > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > From jonmorra at gmail.com Mon Dec 6 14:38:21 2010 From: jonmorra at gmail.com (Jonathan Morra) Date: Mon, 6 Dec 2010 11:38:21 -0800 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: While, I'd love to use ITK, I haven't had luck getting ITK, VTK, and Java to play together, so I'd like to stick with VTK for now. David -- I'm still having issues with the filter. 1. The filter has to run in real time because this is called on a mouse move event. However, I know a bounding box outside of which all voxels are guaranteed to have a value of 0. Therefore I went ahead and used the SetFloodExtent method and set it to my known bounding box, is this OK? 2 I'm still seeing islands in the resulting binary mask, here is the latest version of what I'm doing, any ideas? vtkPoints seedPoints = new vtkPoints(); seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); vtkImageFloodFill fill = new vtkImageFloodFill(); fill.SetInput(binaryImage); fill.SetSeedPoints(seedPoints); fill.ThresholdByLower(1); fill.SetFloodExtent(bounds); fill.Update(); binaryImage = fill.GetOutput(); On Mon, Dec 6, 2010 at 10:34 AM, Karthik Krishnan < karthik.krishnan at kitware.com> wrote: > Or you could process the pipeline in ITK, if you are willing to > incorporate another toolkit.. > > itk::ConnectedThresholdImageFilter -> > VotingBinaryHoleFillingImageFilter (or its iterative version) > > > On Mon, Dec 6, 2010 at 11:49 PM, David Gobbi > wrote: > > I think I made a mistake... I should have told you to use > > ThresholdByLower(1). Other than that, your code looks fine. > > David > > > > On Mon, Dec 6, 2010 at 11:13 AM, Jonathan Morra > wrote: > >> > >> I just got your class in my version of vtk and up and running in Java, > and > >> it's not working for me. I was wondering what I'm doing wrong, could > you > >> help me out? > >> Thanks > >> // We have to remove all the islands not connected to the > >> center > >> // and then fill the holes in the resulting mask > >> vtkPoints seedPoints = new vtkPoints(); > >> > >> seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); > >> vtkImageFloodFill fill = new vtkImageFloodFill(); > >> fill.SetInput(binaryImage); > >> fill.SetSeedPoints(seedPoints); > >> fill.ThresholdByUpper(1); > >> fill.Update(); > >> binaryImage = fill.GetOutput(); > >> On Fri, Dec 3, 2010 at 11:27 AM, Jonathan Morra > >> wrote: > >>> > >>> Fantastic, thanks for your help! > >>> > >>> On Fri, Dec 3, 2010 at 11:13 AM, David Gobbi > >>> wrote: > >>>> > >>>> Hi Jonathan, > >>>> I put my flood-fill filter on github, and tested it to make sure it > >>>> still works: > >>>> http://github.com/dgobbi/VTK/tree/flood-fill/Imaging/ > >>>> > >>>> The interface is just like the vtkThresholdFilter, except that it > >>>> has a method called SetSeedPoints() to allow you to set your > >>>> seeds. For a binary image, call ThresholdByUpper(1) so that > >>>> you can set seeds inside any non-zero islands that you want > >>>> to keep in your output. > >>>> I'll probably contribute this class to VTK after I have brought > >>>> it up-to-date (it was originally written for VTK 4). > >>>> David > >>>> > >>>> On Thu, Dec 2, 2010 at 3:39 PM, Jonathan Morra > >>>> wrote: > >>>>> > >>>>> Thanks, let me know where I can download it from. > >>>>> > >>>>> On Thu, Dec 2, 2010 at 2:36 PM, David Gobbi > >>>>> wrote: > >>>>>> > >>>>>> For Step 1, I have a VTK flood-fill class that do the job. I'll > >>>>>> upload it to > >>>>>> gerrit so that you can try it out. I don't think anything exists > for > >>>>>> your > >>>>>> Step 2, though. > >>>>>> David > >>>>>> > >>>>>> On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra > >>>>>> wrote: > >>>>>>> > >>>>>>> I have a binary vtkImageData class and I want to do 2 things with > it, > >>>>>>> and I don't know how. > >>>>>>> 1. I want to remove all islands from the image except one. I want > >>>>>>> to identify the island not to be removed by a pixel location. I > have seen > >>>>>>> vtkImageIslandRemoval2D, and I don't think that'll work for me, > because I do > >>>>>>> not know anything about the island's size that I want to keep (it > could be > >>>>>>> big, small, or in the middle), all that I know is one point which > >>>>>>> is guaranteed to be interior to one island, and that's the island I > want to > >>>>>>> keep. > >>>>>>> 2. I want to do hole filling on the output of step 1 and I don't > >>>>>>> know how to do that. I saw vtkFillHolesFilter but that appears > only to work > >>>>>>> on poly data. I'd like something analogous to that for > vtkImageData. > >>>>>>> If anyone knows how to do these things, I'd appreciate it. Also, > if > >>>>>>> it matters, I'm coding in Java. > >>>>>>> Thanks > >>>>>>> _______________________________________________ > >>>>>>> Powered by www.kitware.com > >>>>>>> > >>>>>>> Visit other Kitware open-source projects at > >>>>>>> http://www.kitware.com/opensource/opensource.html > >>>>>>> > >>>>>>> Please keep messages on-topic and check the VTK FAQ at: > >>>>>>> http://www.vtk.org/Wiki/VTK_FAQ > >>>>>>> > >>>>>>> Follow this link to subscribe/unsubscribe: > >>>>>>> http://www.vtk.org/mailman/listinfo/vtkusers > >>>>>>> > >>>>>> > >>>>> > >>>> > >>> > >> > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://www.vtk.org/mailman/listinfo/vtkusers > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karthik.krishnan at kitware.com Mon Dec 6 14:48:57 2010 From: karthik.krishnan at kitware.com (Karthik Krishnan) Date: Tue, 7 Dec 2010 01:18:57 +0530 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: On Tue, Dec 7, 2010 at 1:08 AM, Jonathan Morra wrote: > While, I'd love to use ITK, I haven't had luck getting ITK, VTK, and Java to > play together, That is scary. When you get a chance, if you could post the build errors etc, it would be great. thanks -- karthik From aracha2010 at gmail.com Mon Dec 6 14:50:20 2010 From: aracha2010 at gmail.com (Rachel) Date: Mon, 6 Dec 2010 11:50:20 -0800 (PST) Subject: [vtkusers] 3D silhouette and 2D silhouette Message-ID: <1291665020250-3294609.post@n5.nabble.com> Hi All, I want to extract the boundary (silhouette) of 3D model (represented by mesh) then generate an image of the silhouette.her some examples: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExternalContour http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/Silhouette I have some questions 1. Does the points of the silhouette is set of points extracted from the mesh or just set of points that are independant of the points of the mesh. If the silhouette is respresented by set of points of the mesh , how do we generate them. 2. How do we know from the 2D image which pixel of the silhouette correspond to which points on 3D silhouette (or mesh) Many Thanks -- View this message in context: http://vtk.1045678.n5.nabble.com/3D-silhouette-and-2D-silhouette-tp3294609p3294609.html Sent from the VTK - Users mailing list archive at Nabble.com. From dave.partyka at kitware.com Mon Dec 6 14:51:57 2010 From: dave.partyka at kitware.com (Dave Partyka) Date: Mon, 6 Dec 2010 14:51:57 -0500 Subject: [vtkusers] ANN: ParaView 3.10 branch & VTK 5.8 branch In-Reply-To: References: Message-ID: Just a heads up. We will likely be branching tomorrow. Thank you, On Mon, Nov 29, 2010 at 1:30 PM, Dave Partyka wrote: > Hello all, > > We will be branching ParaView and VTK for their respective releases soon > (probably this week). This is a heads up that finished features, bug fixes, > etc., that are a part of these releases should be merged in the coming days. > Once the branches are created any further changes that need to be part of > the releases will need to be manually cherry-picked onto the release > branches. > > Also, If anyone is responsible for failing tests on the dashboards we would > strongly encourage you to please take a look at them. > > Thank you, > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Dec 6 15:11:23 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 6 Dec 2010 13:11:23 -0700 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: Hi Jonathan, If you are setting the FloodExtent to a size that is larger than the region that will be selected by the fill, then it shouldn't have any effect. As it says in the documentation, SetFloodExtent() is meant to restrict the flood fill to e.g. one slice of a 3D volume. This filter will not automatically remove islands, it just floods each connected region that contains a seed. For island removal, you would have to invert the threshold and then put a seed inside every island that you want to remove. I suspect that the thresholds are not set correctly. What is the data range of your image? Is it [0,1]? Or [0,255]? David On Mon, Dec 6, 2010 at 12:38 PM, Jonathan Morra wrote: > While, I'd love to use ITK, I haven't had luck getting ITK, VTK, and Java > to play together, so I'd like to stick with VTK for now. > > David -- I'm still having issues with the filter. > 1. The filter has to run in real time because this is called on a mouse > move event. However, I know a bounding box outside of which all voxels are > guaranteed to have a value of 0. Therefore I went ahead and used the > SetFloodExtent method and set it to my known bounding box, is this OK? > 2 I'm still seeing islands in the resulting binary mask, here is the > latest version of what I'm doing, any ideas? > > vtkPoints seedPoints = new vtkPoints(); > > seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); > vtkImageFloodFill fill = new vtkImageFloodFill(); > fill.SetInput(binaryImage); > fill.SetSeedPoints(seedPoints); > fill.ThresholdByLower(1); > fill.SetFloodExtent(bounds); > fill.Update(); > binaryImage = fill.GetOutput(); > > On Mon, Dec 6, 2010 at 10:34 AM, Karthik Krishnan < > karthik.krishnan at kitware.com> wrote: > >> Or you could process the pipeline in ITK, if you are willing to >> incorporate another toolkit.. >> >> itk::ConnectedThresholdImageFilter -> >> VotingBinaryHoleFillingImageFilter (or its iterative version) >> >> >> On Mon, Dec 6, 2010 at 11:49 PM, David Gobbi >> wrote: >> > I think I made a mistake... I should have told you to use >> > ThresholdByLower(1). Other than that, your code looks fine. >> > David >> > >> > On Mon, Dec 6, 2010 at 11:13 AM, Jonathan Morra >> wrote: >> >> >> >> I just got your class in my version of vtk and up and running in Java, >> and >> >> it's not working for me. I was wondering what I'm doing wrong, could >> you >> >> help me out? >> >> Thanks >> >> // We have to remove all the islands not connected to the >> >> center >> >> // and then fill the holes in the resulting mask >> >> vtkPoints seedPoints = new vtkPoints(); >> >> >> >> seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); >> >> vtkImageFloodFill fill = new vtkImageFloodFill(); >> >> fill.SetInput(binaryImage); >> >> fill.SetSeedPoints(seedPoints); >> >> fill.ThresholdByUpper(1); >> >> fill.Update(); >> >> binaryImage = fill.GetOutput(); >> >> On Fri, Dec 3, 2010 at 11:27 AM, Jonathan Morra >> >> wrote: >> >>> >> >>> Fantastic, thanks for your help! >> >>> >> >>> On Fri, Dec 3, 2010 at 11:13 AM, David Gobbi >> >>> wrote: >> >>>> >> >>>> Hi Jonathan, >> >>>> I put my flood-fill filter on github, and tested it to make sure it >> >>>> still works: >> >>>> http://github.com/dgobbi/VTK/tree/flood-fill/Imaging/ >> >>>> >> >>>> The interface is just like the vtkThresholdFilter, except that it >> >>>> has a method called SetSeedPoints() to allow you to set your >> >>>> seeds. For a binary image, call ThresholdByUpper(1) so that >> >>>> you can set seeds inside any non-zero islands that you want >> >>>> to keep in your output. >> >>>> I'll probably contribute this class to VTK after I have brought >> >>>> it up-to-date (it was originally written for VTK 4). >> >>>> David >> >>>> >> >>>> On Thu, Dec 2, 2010 at 3:39 PM, Jonathan Morra >> >>>> wrote: >> >>>>> >> >>>>> Thanks, let me know where I can download it from. >> >>>>> >> >>>>> On Thu, Dec 2, 2010 at 2:36 PM, David Gobbi >> >>>>> wrote: >> >>>>>> >> >>>>>> For Step 1, I have a VTK flood-fill class that do the job. I'll >> >>>>>> upload it to >> >>>>>> gerrit so that you can try it out. I don't think anything exists >> for >> >>>>>> your >> >>>>>> Step 2, though. >> >>>>>> David >> >>>>>> >> >>>>>> On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra > > >> >>>>>> wrote: >> >>>>>>> >> >>>>>>> I have a binary vtkImageData class and I want to do 2 things with >> it, >> >>>>>>> and I don't know how. >> >>>>>>> 1. I want to remove all islands from the image except one. I >> want >> >>>>>>> to identify the island not to be removed by a pixel location. I >> have seen >> >>>>>>> vtkImageIslandRemoval2D, and I don't think that'll work for me, >> because I do >> >>>>>>> not know anything about the island's size that I want to keep (it >> could be >> >>>>>>> big, small, or in the middle), all that I know is one point which >> >>>>>>> is guaranteed to be interior to one island, and that's the island >> I want to >> >>>>>>> keep. >> >>>>>>> 2. I want to do hole filling on the output of step 1 and I don't >> >>>>>>> know how to do that. I saw vtkFillHolesFilter but that appears >> only to work >> >>>>>>> on poly data. I'd like something analogous to that for >> vtkImageData. >> >>>>>>> If anyone knows how to do these things, I'd appreciate it. Also, >> if >> >>>>>>> it matters, I'm coding in Java. >> >>>>>>> Thanks >> >>>>>>> _______________________________________________ >> >>>>>>> Powered by www.kitware.com >> >>>>>>> >> >>>>>>> Visit other Kitware open-source projects at >> >>>>>>> http://www.kitware.com/opensource/opensource.html >> >>>>>>> >> >>>>>>> Please keep messages on-topic and check the VTK FAQ at: >> >>>>>>> http://www.vtk.org/Wiki/VTK_FAQ >> >>>>>>> >> >>>>>>> Follow this link to subscribe/unsubscribe: >> >>>>>>> http://www.vtk.org/mailman/listinfo/vtkusers >> >>>>>>> >> >>>>>> >> >>>>> >> >>>> >> >>> >> >> >> > >> > >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://www.vtk.org/mailman/listinfo/vtkusers >> > >> > >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dcthomp at sandia.gov Mon Dec 6 15:21:31 2010 From: dcthomp at sandia.gov (David Thompson) Date: Mon, 6 Dec 2010 12:21:31 -0800 Subject: [vtkusers] vtk.vtkExodusIIReader: information in GetOutput()? In-Reply-To: References: Message-ID: <36B5C9ED-29B9-4CAF-92A9-87D9FB262C72@sandia.gov> > ... when reading an ExodusII file with > reader = vtk.vtkExodusIIReader() > reader.Update() > out = reader.GetOutput() > 'out' would contain a whole lot of output the significance of which > I don't quite understant; Hi Nico, The old vtkExodusReader used to output a single unstructured grid. This made it difficult to handle the case when a variable was defined on some cells (in one element block) but not on others (in a different element block). It was also awkward to provide information about node sets and face sets. At the time, there was also no concept of pedigree and global ID arrays in vtkDataSetAttributes. This made writing Exodus datasets back out to a file after some manipulation difficult since much of the information in the original file could not be preserved. The vtkExodusModel and vtkModelMetadata classes were attempts to encapsulate some of that information for later access by a writer. The new vtkExodusIIReader outputs a multiblock dataset. Each multiblock dataset may have an arbitrary number of blocks, where each block is a arbitary dataset (an unstructured grid, an image, or even another multiblock dataset). The new reader outputs a multiblock dataset where each of the top-level blocks is itself a multiblock dataset holding unstructured grids of a single type (element blocks, face blocks, edge blocks, element sets, side sets, face sets, edge sets, node sets). When you "print out" you are seeing all of the internal variables associated with the one toplevel multiblock dataset and its children. This should print some more concise information about the blocks: ====================== *snip* ====================== for i in range( out.GetNumberOfBlocks() ): print out.GetMetaData( i ).Get( vtkCompositeDataSet.NAME() ) blk = out.GetBlock( i ) for j in range( blk.GetNumberOfBlocks() ): print ' ' + blk.GetMetaData( j ).Get( vtkCompositeDataSet.NAME() ) ====================== *snip* ====================== When the reader is told to read a block or set (only element blocks are read by default), then an unstructured grid will be inserted into the appropriate sub-block of the main reader's output. Hope this helps, David From jonmorra at gmail.com Mon Dec 6 16:09:07 2010 From: jonmorra at gmail.com (Jonathan Morra) Date: Mon, 6 Dec 2010 13:09:07 -0800 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: My data is all either 0 or 1. I'm not sure why I have to know seed points in the other islands. I don't know if I'm going to be able to get those points. Basically I want to keep the one island that has the mouse on it, that's how I know the one point I'm interested in. On Mon, Dec 6, 2010 at 12:11 PM, David Gobbi wrote: > Hi Jonathan, > > If you are setting the FloodExtent to a size that is larger than the region > that will be selected by the fill, then it shouldn't have any effect. As it > says in the documentation, SetFloodExtent() is meant to restrict the flood > fill to e.g. one slice of a 3D volume. > > This filter will not automatically remove islands, it just floods each > connected region that contains a seed. For island removal, you would have > to invert the threshold and then put a seed inside every island that you > want to remove. > > I suspect that the thresholds are not set correctly. What is the data > range of your image? Is it [0,1]? Or [0,255]? > > David > > > On Mon, Dec 6, 2010 at 12:38 PM, Jonathan Morra wrote: > >> While, I'd love to use ITK, I haven't had luck getting ITK, VTK, and Java >> to play together, so I'd like to stick with VTK for now. >> >> David -- I'm still having issues with the filter. >> 1. The filter has to run in real time because this is called on a mouse >> move event. However, I know a bounding box outside of which all voxels are >> guaranteed to have a value of 0. Therefore I went ahead and used the >> SetFloodExtent method and set it to my known bounding box, is this OK? >> 2 I'm still seeing islands in the resulting binary mask, here is the >> latest version of what I'm doing, any ideas? >> >> vtkPoints seedPoints = new vtkPoints(); >> >> seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); >> vtkImageFloodFill fill = new vtkImageFloodFill(); >> fill.SetInput(binaryImage); >> fill.SetSeedPoints(seedPoints); >> fill.ThresholdByLower(1); >> fill.SetFloodExtent(bounds); >> fill.Update(); >> binaryImage = fill.GetOutput(); >> >> On Mon, Dec 6, 2010 at 10:34 AM, Karthik Krishnan < >> karthik.krishnan at kitware.com> wrote: >> >>> Or you could process the pipeline in ITK, if you are willing to >>> incorporate another toolkit.. >>> >>> itk::ConnectedThresholdImageFilter -> >>> VotingBinaryHoleFillingImageFilter (or its iterative version) >>> >>> >>> On Mon, Dec 6, 2010 at 11:49 PM, David Gobbi >>> wrote: >>> > I think I made a mistake... I should have told you to use >>> > ThresholdByLower(1). Other than that, your code looks fine. >>> > David >>> > >>> > On Mon, Dec 6, 2010 at 11:13 AM, Jonathan Morra >>> wrote: >>> >> >>> >> I just got your class in my version of vtk and up and running in Java, >>> and >>> >> it's not working for me. I was wondering what I'm doing wrong, could >>> you >>> >> help me out? >>> >> Thanks >>> >> // We have to remove all the islands not connected to the >>> >> center >>> >> // and then fill the holes in the resulting mask >>> >> vtkPoints seedPoints = new vtkPoints(); >>> >> >>> >> seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); >>> >> vtkImageFloodFill fill = new vtkImageFloodFill(); >>> >> fill.SetInput(binaryImage); >>> >> fill.SetSeedPoints(seedPoints); >>> >> fill.ThresholdByUpper(1); >>> >> fill.Update(); >>> >> binaryImage = fill.GetOutput(); >>> >> On Fri, Dec 3, 2010 at 11:27 AM, Jonathan Morra >>> >> wrote: >>> >>> >>> >>> Fantastic, thanks for your help! >>> >>> >>> >>> On Fri, Dec 3, 2010 at 11:13 AM, David Gobbi >>> >>> wrote: >>> >>>> >>> >>>> Hi Jonathan, >>> >>>> I put my flood-fill filter on github, and tested it to make sure it >>> >>>> still works: >>> >>>> http://github.com/dgobbi/VTK/tree/flood-fill/Imaging/ >>> >>>> >>> >>>> The interface is just like the vtkThresholdFilter, except that it >>> >>>> has a method called SetSeedPoints() to allow you to set your >>> >>>> seeds. For a binary image, call ThresholdByUpper(1) so that >>> >>>> you can set seeds inside any non-zero islands that you want >>> >>>> to keep in your output. >>> >>>> I'll probably contribute this class to VTK after I have brought >>> >>>> it up-to-date (it was originally written for VTK 4). >>> >>>> David >>> >>>> >>> >>>> On Thu, Dec 2, 2010 at 3:39 PM, Jonathan Morra >>> >>>> wrote: >>> >>>>> >>> >>>>> Thanks, let me know where I can download it from. >>> >>>>> >>> >>>>> On Thu, Dec 2, 2010 at 2:36 PM, David Gobbi >> > >>> >>>>> wrote: >>> >>>>>> >>> >>>>>> For Step 1, I have a VTK flood-fill class that do the job. I'll >>> >>>>>> upload it to >>> >>>>>> gerrit so that you can try it out. I don't think anything exists >>> for >>> >>>>>> your >>> >>>>>> Step 2, though. >>> >>>>>> David >>> >>>>>> >>> >>>>>> On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra < >>> jonmorra at gmail.com> >>> >>>>>> wrote: >>> >>>>>>> >>> >>>>>>> I have a binary vtkImageData class and I want to do 2 things with >>> it, >>> >>>>>>> and I don't know how. >>> >>>>>>> 1. I want to remove all islands from the image except one. I >>> want >>> >>>>>>> to identify the island not to be removed by a pixel location. I >>> have seen >>> >>>>>>> vtkImageIslandRemoval2D, and I don't think that'll work for me, >>> because I do >>> >>>>>>> not know anything about the island's size that I want to keep (it >>> could be >>> >>>>>>> big, small, or in the middle), all that I know is one point which >>> >>>>>>> is guaranteed to be interior to one island, and that's the island >>> I want to >>> >>>>>>> keep. >>> >>>>>>> 2. I want to do hole filling on the output of step 1 and I don't >>> >>>>>>> know how to do that. I saw vtkFillHolesFilter but that appears >>> only to work >>> >>>>>>> on poly data. I'd like something analogous to that for >>> vtkImageData. >>> >>>>>>> If anyone knows how to do these things, I'd appreciate it. Also, >>> if >>> >>>>>>> it matters, I'm coding in Java. >>> >>>>>>> Thanks >>> >>>>>>> _______________________________________________ >>> >>>>>>> Powered by www.kitware.com >>> >>>>>>> >>> >>>>>>> Visit other Kitware open-source projects at >>> >>>>>>> http://www.kitware.com/opensource/opensource.html >>> >>>>>>> >>> >>>>>>> Please keep messages on-topic and check the VTK FAQ at: >>> >>>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>>>>>> >>> >>>>>>> Follow this link to subscribe/unsubscribe: >>> >>>>>>> http://www.vtk.org/mailman/listinfo/vtkusers >>> >>>>>>> >>> >>>>>> >>> >>>>> >>> >>>> >>> >>> >>> >> >>> > >>> > >>> > _______________________________________________ >>> > Powered by www.kitware.com >>> > >>> > Visit other Kitware open-source projects at >>> > http://www.kitware.com/opensource/opensource.html >>> > >>> > Please keep messages on-topic and check the VTK FAQ at: >>> > http://www.vtk.org/Wiki/VTK_FAQ >>> > >>> > Follow this link to subscribe/unsubscribe: >>> > http://www.vtk.org/mailman/listinfo/vtkusers >>> > >>> > >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Dec 6 16:26:22 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 6 Dec 2010 14:26:22 -0700 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: Hi Jonathan, In your original email you said that you need to select one island in your image (i.e. to keep only that island), and then fill the holes in that island. When I said "island removal" in my last email, I actually just meant fill the holes. I didn't mean to refer to the other islands. If your data is 0 and 1, then you should be able to select white with: ThresholdBetween(1,1) // only fill pixels that have a value of 1 SetOutValue(0) // set all other pixels black ThresholdBetween(0,0) // only fill pixels that have a value of 0 SetOutValue(1) // set all other pixels white David On Mon, Dec 6, 2010 at 2:09 PM, Jonathan Morra wrote: > My data is all either 0 or 1. I'm not sure why I have to know seed points > in the other islands. I don't know if I'm going to be able to get those > points. Basically I want to keep the one island that has the mouse on it, > that's how I know the one point I'm interested in. > > > On Mon, Dec 6, 2010 at 12:11 PM, David Gobbi wrote: > >> Hi Jonathan, >> >> If you are setting the FloodExtent to a size that is larger than the >> region that will be selected by the fill, then it shouldn't have any effect. >> As it says in the documentation, SetFloodExtent() is meant to restrict the >> flood fill to e.g. one slice of a 3D volume. >> >> This filter will not automatically remove islands, it just floods each >> connected region that contains a seed. For island removal, you would have >> to invert the threshold and then put a seed inside every island that you >> want to remove. >> >> I suspect that the thresholds are not set correctly. What is the data >> range of your image? Is it [0,1]? Or [0,255]? >> >> David >> >> >> On Mon, Dec 6, 2010 at 12:38 PM, Jonathan Morra wrote: >> >>> While, I'd love to use ITK, I haven't had luck getting ITK, VTK, and Java >>> to play together, so I'd like to stick with VTK for now. >>> >>> David -- I'm still having issues with the filter. >>> 1. The filter has to run in real time because this is called on a mouse >>> move event. However, I know a bounding box outside of which all voxels are >>> guaranteed to have a value of 0. Therefore I went ahead and used the >>> SetFloodExtent method and set it to my known bounding box, is this OK? >>> 2 I'm still seeing islands in the resulting binary mask, here is the >>> latest version of what I'm doing, any ideas? >>> >>> vtkPoints seedPoints = new vtkPoints(); >>> >>> seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); >>> vtkImageFloodFill fill = new vtkImageFloodFill(); >>> fill.SetInput(binaryImage); >>> fill.SetSeedPoints(seedPoints); >>> fill.ThresholdByLower(1); >>> fill.SetFloodExtent(bounds); >>> fill.Update(); >>> binaryImage = fill.GetOutput(); >>> >>> On Mon, Dec 6, 2010 at 10:34 AM, Karthik Krishnan < >>> karthik.krishnan at kitware.com> wrote: >>> >>>> Or you could process the pipeline in ITK, if you are willing to >>>> incorporate another toolkit.. >>>> >>>> itk::ConnectedThresholdImageFilter -> >>>> VotingBinaryHoleFillingImageFilter (or its iterative version) >>>> >>>> >>>> On Mon, Dec 6, 2010 at 11:49 PM, David Gobbi >>>> wrote: >>>> > I think I made a mistake... I should have told you to use >>>> > ThresholdByLower(1). Other than that, your code looks fine. >>>> > David >>>> > >>>> > On Mon, Dec 6, 2010 at 11:13 AM, Jonathan Morra >>>> wrote: >>>> >> >>>> >> I just got your class in my version of vtk and up and running in >>>> Java, and >>>> >> it's not working for me. I was wondering what I'm doing wrong, could >>>> you >>>> >> help me out? >>>> >> Thanks >>>> >> // We have to remove all the islands not connected to the >>>> >> center >>>> >> // and then fill the holes in the resulting mask >>>> >> vtkPoints seedPoints = new vtkPoints(); >>>> >> >>>> >> seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); >>>> >> vtkImageFloodFill fill = new vtkImageFloodFill(); >>>> >> fill.SetInput(binaryImage); >>>> >> fill.SetSeedPoints(seedPoints); >>>> >> fill.ThresholdByUpper(1); >>>> >> fill.Update(); >>>> >> binaryImage = fill.GetOutput(); >>>> >> On Fri, Dec 3, 2010 at 11:27 AM, Jonathan Morra >>>> >> wrote: >>>> >>> >>>> >>> Fantastic, thanks for your help! >>>> >>> >>>> >>> On Fri, Dec 3, 2010 at 11:13 AM, David Gobbi >>> > >>>> >>> wrote: >>>> >>>> >>>> >>>> Hi Jonathan, >>>> >>>> I put my flood-fill filter on github, and tested it to make sure it >>>> >>>> still works: >>>> >>>> http://github.com/dgobbi/VTK/tree/flood-fill/Imaging/ >>>> >>>> >>>> >>>> The interface is just like the vtkThresholdFilter, except that it >>>> >>>> has a method called SetSeedPoints() to allow you to set your >>>> >>>> seeds. For a binary image, call ThresholdByUpper(1) so that >>>> >>>> you can set seeds inside any non-zero islands that you want >>>> >>>> to keep in your output. >>>> >>>> I'll probably contribute this class to VTK after I have brought >>>> >>>> it up-to-date (it was originally written for VTK 4). >>>> >>>> David >>>> >>>> >>>> >>>> On Thu, Dec 2, 2010 at 3:39 PM, Jonathan Morra >>> > >>>> >>>> wrote: >>>> >>>>> >>>> >>>>> Thanks, let me know where I can download it from. >>>> >>>>> >>>> >>>>> On Thu, Dec 2, 2010 at 2:36 PM, David Gobbi < >>>> david.gobbi at gmail.com> >>>> >>>>> wrote: >>>> >>>>>> >>>> >>>>>> For Step 1, I have a VTK flood-fill class that do the job. I'll >>>> >>>>>> upload it to >>>> >>>>>> gerrit so that you can try it out. I don't think anything exists >>>> for >>>> >>>>>> your >>>> >>>>>> Step 2, though. >>>> >>>>>> David >>>> >>>>>> >>>> >>>>>> On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra < >>>> jonmorra at gmail.com> >>>> >>>>>> wrote: >>>> >>>>>>> >>>> >>>>>>> I have a binary vtkImageData class and I want to do 2 things >>>> with it, >>>> >>>>>>> and I don't know how. >>>> >>>>>>> 1. I want to remove all islands from the image except one. I >>>> want >>>> >>>>>>> to identify the island not to be removed by a pixel location. I >>>> have seen >>>> >>>>>>> vtkImageIslandRemoval2D, and I don't think that'll work for me, >>>> because I do >>>> >>>>>>> not know anything about the island's size that I want to keep >>>> (it could be >>>> >>>>>>> big, small, or in the middle), all that I know is one point >>>> which >>>> >>>>>>> is guaranteed to be interior to one island, and that's the >>>> island I want to >>>> >>>>>>> keep. >>>> >>>>>>> 2. I want to do hole filling on the output of step 1 and I >>>> don't >>>> >>>>>>> know how to do that. I saw vtkFillHolesFilter but that appears >>>> only to work >>>> >>>>>>> on poly data. I'd like something analogous to that for >>>> vtkImageData. >>>> >>>>>>> If anyone knows how to do these things, I'd appreciate it. >>>> Also, if >>>> >>>>>>> it matters, I'm coding in Java. >>>> >>>>>>> Thanks >>>> >>>>>>> _______________________________________________ >>>> >>>>>>> Powered by www.kitware.com >>>> >>>>>>> >>>> >>>>>>> Visit other Kitware open-source projects at >>>> >>>>>>> http://www.kitware.com/opensource/opensource.html >>>> >>>>>>> >>>> >>>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>> >>>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>>>>> >>>> >>>>>>> Follow this link to subscribe/unsubscribe: >>>> >>>>>>> http://www.vtk.org/mailman/listinfo/vtkusers >>>> >>>>>>> >>>> >>>>>> >>>> >>>>> >>>> >>>> >>>> >>> >>>> >> >>>> > >>>> > >>>> > _______________________________________________ >>>> > Powered by www.kitware.com >>>> > >>>> > Visit other Kitware open-source projects at >>>> > http://www.kitware.com/opensource/opensource.html >>>> > >>>> > Please keep messages on-topic and check the VTK FAQ at: >>>> > http://www.vtk.org/Wiki/VTK_FAQ >>>> > >>>> > Follow this link to subscribe/unsubscribe: >>>> > http://www.vtk.org/mailman/listinfo/vtkusers >>>> > >>>> > >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonmorra at gmail.com Mon Dec 6 16:29:41 2010 From: jonmorra at gmail.com (Jonathan Morra) Date: Mon, 6 Dec 2010 13:29:41 -0800 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: Thanks, the first suggestion worked exactly like I expected and the speed is totally fine. Thanks again. On Mon, Dec 6, 2010 at 1:26 PM, David Gobbi wrote: > Hi Jonathan, > > In your original email you said that you need to select one island in your > image (i.e. to keep only that island), and then fill the holes in that > island. When I said "island removal" in my last email, I actually just > meant fill the holes. I didn't mean to refer to the other islands. > > If your data is 0 and 1, then you should be able to select white with: > > ThresholdBetween(1,1) // only fill pixels that have a value of 1 > SetOutValue(0) // set all other pixels black > > ThresholdBetween(0,0) // only fill pixels that have a value of 0 > SetOutValue(1) // set all other pixels white > > David > > > On Mon, Dec 6, 2010 at 2:09 PM, Jonathan Morra wrote: > >> My data is all either 0 or 1. I'm not sure why I have to know seed points >> in the other islands. I don't know if I'm going to be able to get those >> points. Basically I want to keep the one island that has the mouse on it, >> that's how I know the one point I'm interested in. >> >> >> On Mon, Dec 6, 2010 at 12:11 PM, David Gobbi wrote: >> >>> Hi Jonathan, >>> >>> If you are setting the FloodExtent to a size that is larger than the >>> region that will be selected by the fill, then it shouldn't have any effect. >>> As it says in the documentation, SetFloodExtent() is meant to restrict the >>> flood fill to e.g. one slice of a 3D volume. >>> >>> This filter will not automatically remove islands, it just floods each >>> connected region that contains a seed. For island removal, you would have >>> to invert the threshold and then put a seed inside every island that you >>> want to remove. >>> >>> I suspect that the thresholds are not set correctly. What is the data >>> range of your image? Is it [0,1]? Or [0,255]? >>> >>> David >>> >>> >>> On Mon, Dec 6, 2010 at 12:38 PM, Jonathan Morra wrote: >>> >>>> While, I'd love to use ITK, I haven't had luck getting ITK, VTK, and >>>> Java to play together, so I'd like to stick with VTK for now. >>>> >>>> David -- I'm still having issues with the filter. >>>> 1. The filter has to run in real time because this is called on a >>>> mouse move event. However, I know a bounding box outside of which all >>>> voxels are guaranteed to have a value of 0. Therefore I went ahead and used >>>> the SetFloodExtent method and set it to my known bounding box, is this OK? >>>> 2 I'm still seeing islands in the resulting binary mask, here is the >>>> latest version of what I'm doing, any ideas? >>>> >>>> vtkPoints seedPoints = new vtkPoints(); >>>> >>>> seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); >>>> vtkImageFloodFill fill = new vtkImageFloodFill(); >>>> fill.SetInput(binaryImage); >>>> fill.SetSeedPoints(seedPoints); >>>> fill.ThresholdByLower(1); >>>> fill.SetFloodExtent(bounds); >>>> fill.Update(); >>>> binaryImage = fill.GetOutput(); >>>> >>>> On Mon, Dec 6, 2010 at 10:34 AM, Karthik Krishnan < >>>> karthik.krishnan at kitware.com> wrote: >>>> >>>>> Or you could process the pipeline in ITK, if you are willing to >>>>> incorporate another toolkit.. >>>>> >>>>> itk::ConnectedThresholdImageFilter -> >>>>> VotingBinaryHoleFillingImageFilter (or its iterative version) >>>>> >>>>> >>>>> On Mon, Dec 6, 2010 at 11:49 PM, David Gobbi >>>>> wrote: >>>>> > I think I made a mistake... I should have told you to use >>>>> > ThresholdByLower(1). Other than that, your code looks fine. >>>>> > David >>>>> > >>>>> > On Mon, Dec 6, 2010 at 11:13 AM, Jonathan Morra >>>>> wrote: >>>>> >> >>>>> >> I just got your class in my version of vtk and up and running in >>>>> Java, and >>>>> >> it's not working for me. I was wondering what I'm doing wrong, >>>>> could you >>>>> >> help me out? >>>>> >> Thanks >>>>> >> // We have to remove all the islands not connected to >>>>> the >>>>> >> center >>>>> >> // and then fill the holes in the resulting mask >>>>> >> vtkPoints seedPoints = new vtkPoints(); >>>>> >> >>>>> >> seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); >>>>> >> vtkImageFloodFill fill = new vtkImageFloodFill(); >>>>> >> fill.SetInput(binaryImage); >>>>> >> fill.SetSeedPoints(seedPoints); >>>>> >> fill.ThresholdByUpper(1); >>>>> >> fill.Update(); >>>>> >> binaryImage = fill.GetOutput(); >>>>> >> On Fri, Dec 3, 2010 at 11:27 AM, Jonathan Morra >>>> > >>>>> >> wrote: >>>>> >>> >>>>> >>> Fantastic, thanks for your help! >>>>> >>> >>>>> >>> On Fri, Dec 3, 2010 at 11:13 AM, David Gobbi < >>>>> david.gobbi at gmail.com> >>>>> >>> wrote: >>>>> >>>> >>>>> >>>> Hi Jonathan, >>>>> >>>> I put my flood-fill filter on github, and tested it to make sure >>>>> it >>>>> >>>> still works: >>>>> >>>> http://github.com/dgobbi/VTK/tree/flood-fill/Imaging/ >>>>> >>>> >>>>> >>>> The interface is just like the vtkThresholdFilter, except that it >>>>> >>>> has a method called SetSeedPoints() to allow you to set your >>>>> >>>> seeds. For a binary image, call ThresholdByUpper(1) so that >>>>> >>>> you can set seeds inside any non-zero islands that you want >>>>> >>>> to keep in your output. >>>>> >>>> I'll probably contribute this class to VTK after I have brought >>>>> >>>> it up-to-date (it was originally written for VTK 4). >>>>> >>>> David >>>>> >>>> >>>>> >>>> On Thu, Dec 2, 2010 at 3:39 PM, Jonathan Morra < >>>>> jonmorra at gmail.com> >>>>> >>>> wrote: >>>>> >>>>> >>>>> >>>>> Thanks, let me know where I can download it from. >>>>> >>>>> >>>>> >>>>> On Thu, Dec 2, 2010 at 2:36 PM, David Gobbi < >>>>> david.gobbi at gmail.com> >>>>> >>>>> wrote: >>>>> >>>>>> >>>>> >>>>>> For Step 1, I have a VTK flood-fill class that do the job. I'll >>>>> >>>>>> upload it to >>>>> >>>>>> gerrit so that you can try it out. I don't think anything >>>>> exists for >>>>> >>>>>> your >>>>> >>>>>> Step 2, though. >>>>> >>>>>> David >>>>> >>>>>> >>>>> >>>>>> On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra < >>>>> jonmorra at gmail.com> >>>>> >>>>>> wrote: >>>>> >>>>>>> >>>>> >>>>>>> I have a binary vtkImageData class and I want to do 2 things >>>>> with it, >>>>> >>>>>>> and I don't know how. >>>>> >>>>>>> 1. I want to remove all islands from the image except one. I >>>>> want >>>>> >>>>>>> to identify the island not to be removed by a pixel location. >>>>> I have seen >>>>> >>>>>>> vtkImageIslandRemoval2D, and I don't think that'll work for me, >>>>> because I do >>>>> >>>>>>> not know anything about the island's size that I want to keep >>>>> (it could be >>>>> >>>>>>> big, small, or in the middle), all that I know is one point >>>>> which >>>>> >>>>>>> is guaranteed to be interior to one island, and that's the >>>>> island I want to >>>>> >>>>>>> keep. >>>>> >>>>>>> 2. I want to do hole filling on the output of step 1 and I >>>>> don't >>>>> >>>>>>> know how to do that. I saw vtkFillHolesFilter but that appears >>>>> only to work >>>>> >>>>>>> on poly data. I'd like something analogous to that for >>>>> vtkImageData. >>>>> >>>>>>> If anyone knows how to do these things, I'd appreciate it. >>>>> Also, if >>>>> >>>>>>> it matters, I'm coding in Java. >>>>> >>>>>>> Thanks >>>>> >>>>>>> _______________________________________________ >>>>> >>>>>>> Powered by www.kitware.com >>>>> >>>>>>> >>>>> >>>>>>> Visit other Kitware open-source projects at >>>>> >>>>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>>>> >>>>> >>>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> >>>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>>>> >>>>> >>>>>>> Follow this link to subscribe/unsubscribe: >>>>> >>>>>>> http://www.vtk.org/mailman/listinfo/vtkusers >>>>> >>>>>>> >>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>>>> >>> >>>>> >> >>>>> > >>>>> > >>>>> > _______________________________________________ >>>>> > Powered by www.kitware.com >>>>> > >>>>> > Visit other Kitware open-source projects at >>>>> > http://www.kitware.com/opensource/opensource.html >>>>> > >>>>> > Please keep messages on-topic and check the VTK FAQ at: >>>>> > http://www.vtk.org/Wiki/VTK_FAQ >>>>> > >>>>> > Follow this link to subscribe/unsubscribe: >>>>> > http://www.vtk.org/mailman/listinfo/vtkusers >>>>> > >>>>> > >>>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aracha2010 at gmail.com Mon Dec 6 16:41:31 2010 From: aracha2010 at gmail.com (Rachel) Date: Mon, 6 Dec 2010 13:41:31 -0800 (PST) Subject: [vtkusers] 3D silhouette and 2D silhouette In-Reply-To: <1291665020250-3294609.post@n5.nabble.com> References: <1291665020250-3294609.post@n5.nabble.com> Message-ID: <1291671691867-3294881.post@n5.nabble.com> What i could understand is that the silhouette is extracted from 2D image... My problem is to extract the boundary in 3D and generate 2D image of the silhouette. Also i need to go back from image to 3D data. Or at least i should know which pixel corresponds to which vertex in the mesh .. Please help me Many thanks -- View this message in context: http://vtk.1045678.n5.nabble.com/3D-silhouette-and-2D-silhouette-tp3294609p3294881.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Mon Dec 6 16:45:00 2010 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 6 Dec 2010 14:45:00 -0700 Subject: [vtkusers] image island removal and hole filling In-Reply-To: References: Message-ID: Good to hear. I will probably contribute this class to VTK after I have cleaned it up a bit. David On Mon, Dec 6, 2010 at 2:29 PM, Jonathan Morra wrote: > Thanks, the first suggestion worked exactly like I expected and the speed > is totally fine. > > Thanks again. > > > On Mon, Dec 6, 2010 at 1:26 PM, David Gobbi wrote: > >> Hi Jonathan, >> >> In your original email you said that you need to select one island in your >> image (i.e. to keep only that island), and then fill the holes in that >> island. When I said "island removal" in my last email, I actually just >> meant fill the holes. I didn't mean to refer to the other islands. >> >> If your data is 0 and 1, then you should be able to select white with: >> >> ThresholdBetween(1,1) // only fill pixels that have a value of 1 >> SetOutValue(0) // set all other pixels black >> >> ThresholdBetween(0,0) // only fill pixels that have a value of 0 >> SetOutValue(1) // set all other pixels white >> >> David >> >> >> On Mon, Dec 6, 2010 at 2:09 PM, Jonathan Morra wrote: >> >>> My data is all either 0 or 1. I'm not sure why I have to know seed >>> points in the other islands. I don't know if I'm going to be able to get >>> those points. Basically I want to keep the one island that has the mouse on >>> it, that's how I know the one point I'm interested in. >>> >>> >>> On Mon, Dec 6, 2010 at 12:11 PM, David Gobbi wrote: >>> >>>> Hi Jonathan, >>>> >>>> If you are setting the FloodExtent to a size that is larger than the >>>> region that will be selected by the fill, then it shouldn't have any effect. >>>> As it says in the documentation, SetFloodExtent() is meant to restrict the >>>> flood fill to e.g. one slice of a 3D volume. >>>> >>>> This filter will not automatically remove islands, it just floods each >>>> connected region that contains a seed. For island removal, you would have >>>> to invert the threshold and then put a seed inside every island that you >>>> want to remove. >>>> >>>> I suspect that the thresholds are not set correctly. What is the data >>>> range of your image? Is it [0,1]? Or [0,255]? >>>> >>>> David >>>> >>>> >>>> On Mon, Dec 6, 2010 at 12:38 PM, Jonathan Morra wrote: >>>> >>>>> While, I'd love to use ITK, I haven't had luck getting ITK, VTK, and >>>>> Java to play together, so I'd like to stick with VTK for now. >>>>> >>>>> David -- I'm still having issues with the filter. >>>>> 1. The filter has to run in real time because this is called on a >>>>> mouse move event. However, I know a bounding box outside of which all >>>>> voxels are guaranteed to have a value of 0. Therefore I went ahead and used >>>>> the SetFloodExtent method and set it to my known bounding box, is this OK? >>>>> 2 I'm still seeing islands in the resulting binary mask, here is the >>>>> latest version of what I'm doing, any ideas? >>>>> >>>>> vtkPoints seedPoints = new vtkPoints(); >>>>> >>>>> seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); >>>>> vtkImageFloodFill fill = new vtkImageFloodFill(); >>>>> fill.SetInput(binaryImage); >>>>> fill.SetSeedPoints(seedPoints); >>>>> fill.ThresholdByLower(1); >>>>> fill.SetFloodExtent(bounds); >>>>> fill.Update(); >>>>> binaryImage = fill.GetOutput(); >>>>> >>>>> On Mon, Dec 6, 2010 at 10:34 AM, Karthik Krishnan < >>>>> karthik.krishnan at kitware.com> wrote: >>>>> >>>>>> Or you could process the pipeline in ITK, if you are willing to >>>>>> incorporate another toolkit.. >>>>>> >>>>>> itk::ConnectedThresholdImageFilter -> >>>>>> VotingBinaryHoleFillingImageFilter (or its iterative version) >>>>>> >>>>>> >>>>>> On Mon, Dec 6, 2010 at 11:49 PM, David Gobbi >>>>>> wrote: >>>>>> > I think I made a mistake... I should have told you to use >>>>>> > ThresholdByLower(1). Other than that, your code looks fine. >>>>>> > David >>>>>> > >>>>>> > On Mon, Dec 6, 2010 at 11:13 AM, Jonathan Morra >>>>>> wrote: >>>>>> >> >>>>>> >> I just got your class in my version of vtk and up and running in >>>>>> Java, and >>>>>> >> it's not working for me. I was wondering what I'm doing wrong, >>>>>> could you >>>>>> >> help me out? >>>>>> >> Thanks >>>>>> >> // We have to remove all the islands not connected to >>>>>> the >>>>>> >> center >>>>>> >> // and then fill the holes in the resulting mask >>>>>> >> vtkPoints seedPoints = new vtkPoints(); >>>>>> >> >>>>>> >> seedPoints.InsertNextPoint(panel.getPicker().GetPickPosition()); >>>>>> >> vtkImageFloodFill fill = new vtkImageFloodFill(); >>>>>> >> fill.SetInput(binaryImage); >>>>>> >> fill.SetSeedPoints(seedPoints); >>>>>> >> fill.ThresholdByUpper(1); >>>>>> >> fill.Update(); >>>>>> >> binaryImage = fill.GetOutput(); >>>>>> >> On Fri, Dec 3, 2010 at 11:27 AM, Jonathan Morra < >>>>>> jonmorra at gmail.com> >>>>>> >> wrote: >>>>>> >>> >>>>>> >>> Fantastic, thanks for your help! >>>>>> >>> >>>>>> >>> On Fri, Dec 3, 2010 at 11:13 AM, David Gobbi < >>>>>> david.gobbi at gmail.com> >>>>>> >>> wrote: >>>>>> >>>> >>>>>> >>>> Hi Jonathan, >>>>>> >>>> I put my flood-fill filter on github, and tested it to make sure >>>>>> it >>>>>> >>>> still works: >>>>>> >>>> http://github.com/dgobbi/VTK/tree/flood-fill/Imaging/ >>>>>> >>>> >>>>>> >>>> The interface is just like the vtkThresholdFilter, except that it >>>>>> >>>> has a method called SetSeedPoints() to allow you to set your >>>>>> >>>> seeds. For a binary image, call ThresholdByUpper(1) so that >>>>>> >>>> you can set seeds inside any non-zero islands that you want >>>>>> >>>> to keep in your output. >>>>>> >>>> I'll probably contribute this class to VTK after I have brought >>>>>> >>>> it up-to-date (it was originally written for VTK 4). >>>>>> >>>> David >>>>>> >>>> >>>>>> >>>> On Thu, Dec 2, 2010 at 3:39 PM, Jonathan Morra < >>>>>> jonmorra at gmail.com> >>>>>> >>>> wrote: >>>>>> >>>>> >>>>>> >>>>> Thanks, let me know where I can download it from. >>>>>> >>>>> >>>>>> >>>>> On Thu, Dec 2, 2010 at 2:36 PM, David Gobbi < >>>>>> david.gobbi at gmail.com> >>>>>> >>>>> wrote: >>>>>> >>>>>> >>>>>> >>>>>> For Step 1, I have a VTK flood-fill class that do the job. >>>>>> I'll >>>>>> >>>>>> upload it to >>>>>> >>>>>> gerrit so that you can try it out. I don't think anything >>>>>> exists for >>>>>> >>>>>> your >>>>>> >>>>>> Step 2, though. >>>>>> >>>>>> David >>>>>> >>>>>> >>>>>> >>>>>> On Thu, Dec 2, 2010 at 3:14 PM, Jonathan Morra < >>>>>> jonmorra at gmail.com> >>>>>> >>>>>> wrote: >>>>>> >>>>>>> >>>>>> >>>>>>> I have a binary vtkImageData class and I want to do 2 things >>>>>> with it, >>>>>> >>>>>>> and I don't know how. >>>>>> >>>>>>> 1. I want to remove all islands from the image except one. I >>>>>> want >>>>>> >>>>>>> to identify the island not to be removed by a pixel location. >>>>>> I have seen >>>>>> >>>>>>> vtkImageIslandRemoval2D, and I don't think that'll work for >>>>>> me, because I do >>>>>> >>>>>>> not know anything about the island's size that I want to keep >>>>>> (it could be >>>>>> >>>>>>> big, small, or in the middle), all that I know is one point >>>>>> which >>>>>> >>>>>>> is guaranteed to be interior to one island, and that's the >>>>>> island I want to >>>>>> >>>>>>> keep. >>>>>> >>>>>>> 2. I want to do hole filling on the output of step 1 and I >>>>>> don't >>>>>> >>>>>>> know how to do that. I saw vtkFillHolesFilter but that >>>>>> appears only to work >>>>>> >>>>>>> on poly data. I'd like something analogous to that for >>>>>> vtkImageData. >>>>>> >>>>>>> If anyone knows how to do these things, I'd appreciate it. >>>>>> Also, if >>>>>> >>>>>>> it matters, I'm coding in Java. >>>>>> >>>>>>> Thanks >>>>>> >>>>>>> _______________________________________________ >>>>>> >>>>>>> Powered by www.kitware.com >>>>>> >>>>>>> >>>>>> >>>>>>> Visit other Kitware open-source projects at >>>>>> >>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>>> >>>>>> >>>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>> >>>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>> >>>>>>> >>>>>> >>>>>>> Follow this link to subscribe/unsubscribe: >>>>>> >>>>>>> http://www.vtk.org/mailman/listinfo/vtkusers >>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>>> >>>> >>>>>> >>> >>>>>> >> >>>>>> > >>>>>> > >>>>>> > _______________________________________________ >>>>>> > Powered by www.kitware.com >>>>>> > >>>>>> > Visit other Kitware open-source projects at >>>>>> > http://www.kitware.com/opensource/opensource.html >>>>>> > >>>>>> > Please keep messages on-topic and check the VTK FAQ at: >>>>>> > http://www.vtk.org/Wiki/VTK_FAQ >>>>>> > >>>>>> > Follow this link to subscribe/unsubscribe: >>>>>> > http://www.vtk.org/mailman/listinfo/vtkusers >>>>>> > >>>>>> > >>>>>> >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nico.schloemer at gmail.com Mon Dec 6 19:06:49 2010 From: nico.schloemer at gmail.com (=?ISO-8859-1?Q?Nico_Schl=F6mer?=) Date: Tue, 7 Dec 2010 01:06:49 +0100 Subject: [vtkusers] vtk.vtkExodusIIReader: information in GetOutput()? In-Reply-To: <36B5C9ED-29B9-4CAF-92A9-87D9FB262C72@sandia.gov> References: <36B5C9ED-29B9-4CAF-92A9-87D9FB262C72@sandia.gov> Message-ID: Thanks David for the info! I tried the snippet your provided and got ============ *snip* ============ Element Blocks block_5 Face Blocks Edge Blocks Element Sets Side Sets Face Sets Edge Sets Node Set ============ *snap* ============ I guess that tells me I got one element block, and that'd be it. I guess Exodus is minimalistic in the sense that it contains exactly what was put into the file once, and even though there are egdes in the mesh naturally, they are not stored in the file. Fair enough. I think I'll play around with trying to read a file, manipulate, and write it out again. Do you happen to know if it's possible to iterate over the edges and/or faces of a vtkUnstructuredGrid? Cheers! Nico That reminds me: On Mon, Dec 6, 2010 at 9:21 PM, David Thompson wrote: >> ... when reading an ExodusII file with >> ?reader = vtk.vtkExodusIIReader() >> ?reader.Update() >> ?out = reader.GetOutput() >> 'out' would contain a whole lot of output the significance of which I >> don't quite understant; > > Hi Nico, > > The old vtkExodusReader used to output a single unstructured grid. This made > it difficult to handle the case when a variable was defined on some cells > (in one element block) but not on others (in a different element block). It > was also awkward to provide information about node sets and face sets. At > the time, there was also no concept of pedigree and global ID arrays in > vtkDataSetAttributes. This made writing Exodus datasets back out to a file > after some manipulation difficult since much of the information in the > original file could not be preserved. The vtkExodusModel and > vtkModelMetadata classes were attempts to encapsulate some of that > information for later access by a writer. > > The new vtkExodusIIReader outputs a multiblock dataset. Each multiblock > dataset may have an arbitrary number of blocks, where each block is a > arbitary dataset (an unstructured grid, an image, or even another multiblock > dataset). The new reader outputs a multiblock dataset where each of the > top-level blocks is itself a multiblock dataset holding unstructured grids > of a single type (element blocks, face blocks, edge blocks, element sets, > side sets, face sets, edge sets, node sets). When you "print out" you are > seeing all of the internal variables associated with the one toplevel > multiblock dataset and its children. > > This should print some more concise information about the blocks: > ====================== *snip* ====================== > for i in range( out.GetNumberOfBlocks() ): > ?print out.GetMetaData( i ).Get( vtkCompositeDataSet.NAME() ) > ?blk = out.GetBlock( i ) > ?for j in range( blk.GetNumberOfBlocks() ): > ? ?print ' ?' + blk.GetMetaData( j ).Get( vtkCompositeDataSet.NAME() ) > > ====================== *snip* ====================== > When the reader is told to read a block or set (only element blocks are read > by default), then an unstructured grid will be inserted into the appropriate > sub-block of the main reader's output. > > ? ? ? ?Hope this helps, > ? ? ? ?David > > > > From dcthomp at sandia.gov Mon Dec 6 20:43:22 2010 From: dcthomp at sandia.gov (David Thompson) Date: Mon, 6 Dec 2010 17:43:22 -0800 Subject: [vtkusers] vtk.vtkExodusIIReader: information in GetOutput()? In-Reply-To: References: <36B5C9ED-29B9-4CAF-92A9-87D9FB262C72@sandia.gov> Message-ID: > ... I tried the snippet your provided and got > > ============ *snip* ============ > Element Blocks > block_5 > ... > ============ *snap* ============ > > I guess that tells me I got one element block, and that'd be it. I > guess Exodus is minimalistic in the sense that it contains exactly > what was put into the file once, and even though there are egdes in > the mesh naturally, they are not stored in the file. True. > Do you happen to know if it's possible to iterate over the edges > and/or faces of a vtkUnstructuredGrid? You can use vtkExtractEdges to get a vtkPolyData that contains all the edges of the input vtkUnstructuredGrid. Reading the source for its RequestData() method illustrates how to iterate over all the edges yourself if you don't want to use the filter. David From ambarc at gmail.com Mon Dec 6 21:09:16 2010 From: ambarc at gmail.com (Ambar C) Date: Mon, 6 Dec 2010 18:09:16 -0800 Subject: [vtkusers] vtkPolyDataAlgorithm Input setting problem? Message-ID: Hello, I have the code: vtkSmartPointer algo = vtkSmartPointer::New(); algo->SetInput(baseMesh); where baseMesh is the output of a transform filter (which has been checked). This line causes me to get the output vtkPolyDataAlgorithm (02EA1DC8): Definition of Execute() method should be in subclass and you should really use the ExecuteData(vtkInformation *request,...) signature instead I'm not quite sure what to do with this, and think that the problem lies with the way I'm setting my input. Any suggestions? From daviddoria at gmail.com Mon Dec 6 22:07:35 2010 From: daviddoria at gmail.com (David Doria) Date: Mon, 6 Dec 2010 22:07:35 -0500 Subject: [vtkusers] vtkPolyDataAlgorithm Input setting problem? In-Reply-To: References: Message-ID: On Mon, Dec 6, 2010 at 9:09 PM, Ambar C wrote: > Hello, > > I have the code: > > vtkSmartPointer algo = > vtkSmartPointer::New(); > algo->SetInput(baseMesh); > > where baseMesh is the output of a transform filter (which has been checked). > > This line causes me to get the output > > vtkPolyDataAlgorithm (02EA1DC8): Definition of Execute() method should > be in subclass and you should really use the > ExecuteData(vtkInformation *request,...) signature instead > > I'm not quite sure what to do with this, and think that the problem > lies with the way I'm setting my input. Any suggestions? You cannot instantiate vtkPolyDataAlgorithm, it is abstract. What is it you are trying to do? You need to use an appropriate subclass. You can see all of the subclasses here: http://www.vtk.org/doc/nightly/html/hierarchy.html (search for vtkPolyDataAlgorithm on the page) David From ambarc at gmail.com Mon Dec 6 22:13:54 2010 From: ambarc at gmail.com (Ambar C) Date: Mon, 6 Dec 2010 19:13:54 -0800 Subject: [vtkusers] vtkPolyDataAlgorithm Input setting problem? In-Reply-To: References: Message-ID: Hi, I'm just looking for a method to encapsulate some vtkPolyData so that I can satisfy someone else's function prototype. I didn't realise vtkPolyDataAlgorithm was abstract. What would be the best envelope for this? Best, Ambar On Mon, Dec 6, 2010 at 7:07 PM, David Doria wrote: > On Mon, Dec 6, 2010 at 9:09 PM, Ambar C wrote: >> Hello, >> >> I have the code: >> >> vtkSmartPointer algo = >> vtkSmartPointer::New(); >> algo->SetInput(baseMesh); >> >> where baseMesh is the output of a transform filter (which has been checked). >> >> This line causes me to get the output >> >> vtkPolyDataAlgorithm (02EA1DC8): Definition of Execute() method should >> be in subclass and you should really use the >> ExecuteData(vtkInformation *request,...) signature instead >> >> I'm not quite sure what to do with this, and think that the problem >> lies with the way I'm setting my input. Any suggestions? > > You cannot instantiate vtkPolyDataAlgorithm, it is abstract. What is > it you are trying to do? You need to use an appropriate subclass. You > can see all of the subclasses here: > http://www.vtk.org/doc/nightly/html/hierarchy.html (search for > vtkPolyDataAlgorithm on the page) > > David > From daviddoria at gmail.com Mon Dec 6 22:19:17 2010 From: daviddoria at gmail.com (David Doria) Date: Mon, 6 Dec 2010 22:19:17 -0500 Subject: [vtkusers] vtkPolyDataAlgorithm Input setting problem? In-Reply-To: References: Message-ID: On Mon, Dec 6, 2010 at 10:13 PM, Ambar C wrote: > Hi, I'm just looking for a method to encapsulate some vtkPolyData so > that I can satisfy someone else's function prototype. I didn't realise > vtkPolyDataAlgorithm was abstract. What would be the best envelope for > this? What is their prototype? David From daviddoria at gmail.com Mon Dec 6 22:25:15 2010 From: daviddoria at gmail.com (David Doria) Date: Mon, 6 Dec 2010 22:25:15 -0500 Subject: [vtkusers] vtkPolyDataAlgorithm Input setting problem? In-Reply-To: References: Message-ID: On Mon, Dec 6, 2010 at 10:21 PM, Ambar C wrote: > displayOnlyData(vtkPolyDataAlgorithm object, int xSize, int ySize); That doesn't really make sense. It should just accept a vtkPolyData if it wants an 'object'. I mean I suppose you could pass it a subclass of vtkPolyDataAlgorithm and then call GetOutput() on it inside displayOnlyData, but that seems horribly convoluted. If I am understanding correctly and you still want to do that, you could set your vtkPolyData as the input to a vtkTransformPolyDataFilter with default values as the output will be the input unmodified. David From ambarc at gmail.com Mon Dec 6 22:26:53 2010 From: ambarc at gmail.com (Ambar C) Date: Mon, 6 Dec 2010 19:26:53 -0800 Subject: [vtkusers] vtkPolyDataAlgorithm Input setting problem? In-Reply-To: References: Message-ID: Yeah - that's what the function does, not sure why though. I'll try the vtkTransformPolyDataFilter, thanks! On Mon, Dec 6, 2010 at 7:25 PM, David Doria wrote: > On Mon, Dec 6, 2010 at 10:21 PM, Ambar C wrote: >> displayOnlyData(vtkPolyDataAlgorithm object, int xSize, int ySize); > > That doesn't really make sense. It should just accept a vtkPolyData if > it wants an 'object'. I mean I suppose you could pass it a subclass of > vtkPolyDataAlgorithm and then call GetOutput() on it inside > displayOnlyData, but that seems horribly convoluted. > > If I am understanding correctly and you still want to do that, you > could set your vtkPolyData as the input to a > vtkTransformPolyDataFilter with default values as the output will be > the input unmodified. > > David > From sistephan at gmail.com Mon Dec 6 22:52:55 2010 From: sistephan at gmail.com (Sam) Date: Mon, 6 Dec 2010 19:52:55 -0800 (PST) Subject: [vtkusers] XOR of 2 Polydata Message-ID: <1291693975186-3295249.post@n5.nabble.com> Hello, I need to load two polydata objects and then take their XOR and save the result as another polydata object (vtk file). Is there a way to do this? I need to be able to intersect them and remove the intersected part. Thanks Sam -- View this message in context: http://vtk.1045678.n5.nabble.com/XOR-of-2-Polydata-tp3295249p3295249.html Sent from the VTK - Users mailing list archive at Nabble.com. From ambarc at gmail.com Mon Dec 6 23:02:38 2010 From: ambarc at gmail.com (Ambar C) Date: Mon, 6 Dec 2010 20:02:38 -0800 Subject: [vtkusers] Match Connectivity Message-ID: Hello, I have two meshes with the same number of vertices - I'm trying to go through the first mesh and change the connectivity (vtkCellArray) of the second so that they have the same connectivity in terms of which cell ids are matched. Currently, I'm attempting: denseCells->SetCells(baseCellCount, baseCells->GetData()); where denseCells is the vtkCellArray of the mesh whose connectivity I want to change to match that of baseCells' mesh. Any suggestions? Cheers, Ambar From nclemeur at gmail.com Mon Dec 6 23:04:36 2010 From: nclemeur at gmail.com (nclemeur) Date: Mon, 6 Dec 2010 20:04:36 -0800 (PST) Subject: [vtkusers] Question on Viewports/vtkChartXY/SetGeometry in example TestMultipleChartRenderers.cxx In-Reply-To: References: <758150D667C235458DE231BB50B9A2B30ACFDCA9B9@de01ex07.GLOBAL.JHCN.NET> <758150D667C235458DE231BB50B9A2B30ACFDCAF8B@de01ex07.GLOBAL.JHCN.NET> <758150D667C235458DE231BB50B9A2B30AD021198F@de01ex07.GLOBAL.JHCN.NET> Message-ID: <1291694676254-3295269.post@n5.nabble.com> Marcus D. Hanwell-2 wrote: > > Hi Daniel, > > I just merged a topic, and a new test, TestPlotMatrix, which shows a > Hello Marcus, I did play a little bit with the sample and it is looking quite good. I might have found one small glitch: when you zoom on a chart using the right mouse button, and then you "move" (I am not really sure about the term) using the left button, it seems that the grid lines are displayed outside the chart area. I have included a snapshot that display the problem, but I am not really sure how that will be handled by nabble. If you can see the snapshot, just have a look at the chart at top-left. The grid line for the "0" value is outside the chart area. http://vtk.1045678.n5.nabble.com/file/n3295269/plotmatrix.png As a small note, it took me quite a while to get this chart build as it seems that you need to define VTK_DATA_ROOT to get it build. I don't believe it requires it... I'll continue to play with these in the near feature. Thanks a lot for your work on this. Cheers Nicolas 2x2 matrix of charts with full mouse interaction. I still need to finish cleaning it up, but it should already allow most of what you need. You will need to get/update VTK master, you can run the test with a -I argument, so on Linux/Mac it would be (from your VTK build tree), ./bin/ChartsCxxTests TestPlotMatrix -I On Windows you may need to add a Release or Debug subdirectory in to get to the executable. Marcus 2010/12/1 Frese Daniel Dr. : > Hi Marcus, > > thanks again for your answer and the work you put into this. So I'll > switch to the > git stuff. I guess if there is so much new stuff to come, I'll basically > wait for the 5.8 > release and retest then again, using the git sources. > > Daniel > > > -----Urspr?ngliche Nachricht----- > Von: Marcus D. Hanwell [mailto:marcus.hanwell at kitware.com] > Gesendet: Mittwoch, 1. Dezember 2010 16:47 > An: Frese Daniel Dr. > Cc: vtkusers at vtk.org > Betreff: Re: [vtkusers] Question on Viewports/vtkChartXY/SetGeometry in > example TestMultipleChartRenderers.cxx > > Hi Daniel, > > 2010/11/30 Frese Daniel Dr. : >> Hello Marcus, >> >> thank you for your fast answer. Such a feature (multiple graphs - maybe >> also images ? - >> in one scene) would be very useful. As I understand it now, this >> basically means that >> there are still some open issues in the 2D API, which you are working on. > > Multiple images is already possible, the charts have the issue that > they always grow to fill the scene. So there is some extra code that > needs to go in there to allow that behavior to be toggled. The charts > themselves have child items in the scene (the axes, plots etc), and so > make full use of the scene. >> >> We are looking here for some visualization kit for some very basic 3D >> stuff, but mainly >> to look at some XY charts and some matrix data - and for this your 2D API >> looks >> very nice ! So I try to figure out, whether it makes sense for our >> purposes >> to use VTK and the 2D API for this. Two questions on this : >> >> - Is there anywhere some kind of overview, which areas of this API are >> still work >> in progress, and which are already more stable ? That would help me (as a >> newbie) >> trying desperately to get some things running, while they simply don't >> work the >> expected way yet... > > I will see if I can put something together, this wiki page does not > yet exist. The VTK examples, and the tests in Charts/Testing/ give > many examples of what works, along with ParaView which uses the VTK > charts in its GUI (you can download binaries and see what it already > exposed). >> >> - I know this a difficult one, but what are the priorities on the 2D API >> stuff ? >> Is there some kind of target date as when things will kind of settle down >> ? >> Does it make sense for me, to check out sources regularly via git ? So >> far I use the >> 5.6.1 release. > > I think it would make sense to check out the source via git. I am > working on several new features, there is an article in the Source, > > http://www.kitware.com/products/html/NewChartAPIInVTK.html > > We have a new release (VTK 5.8), and I will be getting things ready > for that release. There are a few new chart types, along with the work > we are doing on Marks (Protovis like API in C++ over the 2D API/2D > scene). I monitor the mailing lists, but will see about making a high > level summary of this work. I will post to the list when I do so. > > There are a few topic branches I am getting ready to merge into VTK > master for things like 2D histograms (color maps), fixed size charts > (enabling multiple charts with interaction in one scene). > > Marcus > > > ------------------------------------------------------------------------------------------------------- > Registergericht: Traunstein / Registry Court: HRB 275 ? Sitz / Head > Office: Traunreut > Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard > Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / > Chairman), > Michael Grimm, Matthias Fauser, Sebastian Tondorf > > E-Mail Haftungsausschluss / E-Mail Disclaimer: > http://www.heidenhain.de/disclaimer > > > _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers -- View this message in context: http://vtk.1045678.n5.nabble.com/Question-on-Viewports-vtkChartXY-SetGeometry-in-example-TestMultipleChartRenderers-cxx-tp3284622p3295269.html Sent from the VTK - Users mailing list archive at Nabble.com. From frese at heidenhain.de Tue Dec 7 03:35:56 2010 From: frese at heidenhain.de (Frese Daniel Dr.) Date: Tue, 7 Dec 2010 09:35:56 +0100 Subject: [vtkusers] Positioning titles within vtkAxis Message-ID: <758150D667C235458DE231BB50B9A2B30AD0BE1983@de01ex07.GLOBAL.JHCN.NET> Hi all, I have a problem positioning an axis title relative to its vtkAxis object. Basically, if I draw a horizontal X-axis, the assigned title is written such that it overlapps with the tick labels. Reading through the docs, I got the impression that I should be able to introduce a vertical offset between the drawn axis and the titel by using either a call to Xaxis->GetTitleProperties()->SetLineOffset(offset_in_pixel) or by Xaxis->GetTitleProperties()->SetLineSpacing(scale_factor). But neither call seems to have any effect. Moving from 5.6.1 to the latest vtk git source tree I noticed that the chart stuff seems to have improved greatly (most functions a joy to use !), but it still seems to be a work in progress. So am doing something stupid and do I miss something here or is this feature just not implemented yet ? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part --------------

------------------------------------------------------------------------------------------------------
Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut
Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard
Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman),
Michael Grimm, Matthias Fauser, Sebastian Tondorf

E-Mail Haftungsausschluss / E-Mail Disclaimer


From emonson at cs.duke.edu  Tue Dec  7 07:53:54 2010
From: emonson at cs.duke.edu (Eric E. Monson)
Date: Tue, 7 Dec 2010 07:53:54 -0500
Subject: [vtkusers] Positioning titles within vtkAxis
In-Reply-To: <758150D667C235458DE231BB50B9A2B30AD0BE1983@de01ex07.GLOBAL.JHCN.NET>
References: <758150D667C235458DE231BB50B9A2B30AD0BE1983@de01ex07.GLOBAL.JHCN.NET>
Message-ID: <1EF31637-776B-40E6-BFD1-05E0141E4AA4@cs.duke.edu>

Hey Daniel,

It does seem like SetLineOffset should do something like what you want, but I think they way the label text is applied with VerticalJustification probably nullifies any line offset setting. Line spacing shouldn't matter for a single line of text.

So, the adjustments you want are just not implemented. Marcus, the developer, has worked hard to get the labels right, though, so if you have a use case where the labels are running into the axis ticks maybe you should describe the situation and send a screen shot ? it may be something that needs fixing. 

You're right that the charts are still under development, but some of the core functionality has settled down, and as you said, the current implementation is better than the 5.6.1 version.

-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Dec 7, 2010, at 3:35 AM, Frese Daniel Dr. wrote:

> Hi all,
>  
> I have a problem positioning an axis title relative to its vtkAxis object.
> Basically, if I draw a horizontal  X-axis, the assigned title is written such that it overlapps with the
> tick labels. Reading through the docs, I got the impression that I should be able to introduce a
> vertical offset between the drawn axis and the titel by using either a call to
> Xaxis->GetTitleProperties()->SetLineOffset(offset_in_pixel)
> or by 
> Xaxis->GetTitleProperties()->SetLineSpacing(scale_factor).
> But neither call seems to have any effect.
> Moving from 5.6.1 to the latest vtk git source tree I noticed that the chart stuff seems to have
> improved greatly (most functions a joy to use !), but it still seems to be a work in progress.
> So am doing something stupid and do I miss something here or is this feature just not
> implemented yet ?
>  
> Daniel
>  
> 

> ------------------------------------------------------------------------------------------------------
> Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut
> Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard
> Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman),
> Michael Grimm, Matthias Fauser, Sebastian Tondorf

> E-Mail Haftungsausschluss / E-Mail Disclaimer

> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From daviddoria at gmail.com  Tue Dec  7 07:56:39 2010
From: daviddoria at gmail.com (David Doria)
Date: Tue, 7 Dec 2010 07:56:39 -0500
Subject: [vtkusers] Match Connectivity
In-Reply-To: 
References: 
Message-ID: 

On Mon, Dec 6, 2010 at 11:02 PM, Ambar C  wrote:
> Hello,
>
> I have two meshes with the same number of vertices - I'm trying to go
> through the first mesh and change the connectivity (vtkCellArray) of
> the second so that they have the same connectivity in terms of which
> cell ids are matched. Currently, I'm attempting:
>
> denseCells->SetCells(baseCellCount, baseCells->GetData());
>
> where denseCells is the vtkCellArray of the mesh whose connectivity I
> want to change to match that of baseCells' mesh. Any suggestions?
>
> Cheers,
> Ambar

What is the type of denseCells? Typically the cells are all of the
same type (polys, for example), so you could use

polydata1->SetPolys(polydata2->GetPolys());

David


From emonson at cs.duke.edu  Tue Dec  7 07:59:45 2010
From: emonson at cs.duke.edu (Eric E. Monson)
Date: Tue, 7 Dec 2010 07:59:45 -0500
Subject: [vtkusers] XOR of 2 Polydata
In-Reply-To: <1291693975186-3295249.post@n5.nabble.com>
References: <1291693975186-3295249.post@n5.nabble.com>
Message-ID: <1CEC817B-99A9-462D-9024-591F86FE5919@cs.duke.edu>

Hello Sam,

I haven't used this myself, but the place people seem to go for boolean operations on VTK surfaces is this VTK Journal article:

http://www.insight-journal.org/browse/publication/726

Good luck,
-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Dec 6, 2010, at 10:52 PM, Sam wrote:

> 
> Hello,
> 
> I need to load two polydata objects and then take their XOR and save the
> result as another polydata object (vtk file).  Is there a way to do this?  I
> need to be able to intersect them and remove the intersected part. 
> 
> Thanks
> Sam
> -- 
> View this message in context: http://vtk.1045678.n5.nabble.com/XOR-of-2-Polydata-tp3295249p3295249.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



From frese at heidenhain.de  Tue Dec  7 08:29:50 2010
From: frese at heidenhain.de (Frese Daniel Dr.)
Date: Tue, 7 Dec 2010 14:29:50 +0100
Subject: [vtkusers] Positioning titles within vtkAxis
In-Reply-To: <1EF31637-776B-40E6-BFD1-05E0141E4AA4@cs.duke.edu>
References: <758150D667C235458DE231BB50B9A2B30AD0BE1983@de01ex07.GLOBAL.JHCN.NET>
	<1EF31637-776B-40E6-BFD1-05E0141E4AA4@cs.duke.edu>
Message-ID: <758150D667C235458DE231BB50B9A2B30AD0BE1DA8@de01ex07.GLOBAL.JHCN.NET>

Hello Eric, Marcus,

before I explain my problem once more I just want to add that I find the charts functionality already quite useful.
As I said I just updated my vtk stuff and I can imagine it must have been quite some work to get to this point.

I appended a screenshot illustrating the problem. Since I don't know how this appears on the mail list I just describe briefly.
I have a scene with a vtkImageItem to show some 2D matrix data. Around the image I have axes (vtkAxis objects) with
appropriate ticks, tick labels and axes titles. The problem is that the axes titles overlap with the tick labels. E.g. for the
case of the X axis , the title should be lower such that it does not touch the labels, but there does not seem to
be a way to do that as of now.

A possible low level solution would be a way to specify some vertical (horizontal axis case) or some horizontal (vertical axis case) offset
for the position of the titles (in pixel or font size units).
In principle of course the vtkAxis object could calculate such an offset by itself, since it has access to both
the labels' and the titles' text properties.

What do you think ?
Daniel

Von: Eric E. Monson [mailto:emonson at cs.duke.edu]
Gesendet: Dienstag, 7. Dezember 2010 13:54
An: Frese Daniel Dr.
Cc: vtkusers at vtk.org
Betreff: Re: [vtkusers] Positioning titles within vtkAxis

Hey Daniel,

It does seem like SetLineOffset should do something like what you want, but I think they way the label text is applied with VerticalJustification probably nullifies any line offset setting. Line spacing shouldn't matter for a single line of text.

So, the adjustments you want are just not implemented. Marcus, the developer, has worked hard to get the labels right, though, so if you have a use case where the labels are running into the axis ticks maybe you should describe the situation and send a screen shot - it may be something that needs fixing.

You're right that the charts are still under development, but some of the core functionality has settled down, and as you said, the current implementation is better than the 5.6.1 version.

-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group



On Dec 7, 2010, at 3:35 AM, Frese Daniel Dr. wrote:


Hi all,

I have a problem positioning an axis title relative to its vtkAxis object.
Basically, if I draw a horizontal  X-axis, the assigned title is written such that it overlapps with the
tick labels. Reading through the docs, I got the impression that I should be able to introduce a
vertical offset between the drawn axis and the titel by using either a call to
Xaxis->GetTitleProperties()->SetLineOffset(offset_in_pixel)
or by
Xaxis->GetTitleProperties()->SetLineSpacing(scale_factor).
But neither call seems to have any effect.
Moving from 5.6.1 to the latest vtk git source tree I noticed that the chart stuff seems to have
improved greatly (most functions a joy to use !), but it still seems to be a work in progress.
So am doing something stupid and do I miss something here or is this feature just not
implemented yet ?

Daniel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot.jpg
Type: image/jpeg
Size: 28070 bytes
Desc: screenshot.jpg
URL: 
-------------- next part --------------

------------------------------------------------------------------------------------------------------
Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut
Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard
Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman),
Michael Grimm, Matthias Fauser, Sebastian Tondorf

E-Mail Haftungsausschluss / E-Mail Disclaimer


From emonson at cs.duke.edu  Tue Dec  7 10:13:12 2010
From: emonson at cs.duke.edu (Eric E. Monson)
Date: Tue, 7 Dec 2010 10:13:12 -0500
Subject: [vtkusers] Positioning titles within vtkAxis
In-Reply-To: <758150D667C235458DE231BB50B9A2B30AD0BE1DA8@de01ex07.GLOBAL.JHCN.NET>
References: <758150D667C235458DE231BB50B9A2B30AD0BE1983@de01ex07.GLOBAL.JHCN.NET>
	<1EF31637-776B-40E6-BFD1-05E0141E4AA4@cs.duke.edu>
	<758150D667C235458DE231BB50B9A2B30AD0BE1DA8@de01ex07.GLOBAL.JHCN.NET>
Message-ID: <19688F91-1AD1-4231-8CE4-E68E3AEF1B46@cs.duke.edu>

Hey Daniel,

Yes, this shouldn't be happening. Would you be able to send the section of your code that generates this chart? I'm curious how you're implementing the combination of ImageItem and axes. Maybe there is another way of accomplishing the same thing that wouldn't cause the overlap, or it might at least help us diagnose why the label placement routine isn't dealing with your case correctly.

Also, just to be clear, was this generated with the current development (git) version, or with 5.6.1?

Thanks,
-Eric


On Dec 7, 2010, at 8:29 AM, Frese Daniel Dr. wrote:

> Hello Eric, Marcus,
>  
> before I explain my problem once more I just want to add that I find the charts functionality already quite useful.
> As I said I just updated my vtk stuff and I can imagine it must have been quite some work to get to this point.
>  
> I appended a screenshot illustrating the problem. Since I don?t know how this appears on the mail list I just describe briefly.
> I have a scene with a vtkImageItem to show some 2D matrix data. Around the image I have axes (vtkAxis objects) with
> appropriate ticks, tick labels and axes titles. The problem is that the axes titles overlap with the tick labels. E.g. for the
> case of the X axis , the title should be lower such that it does not touch the labels, but there does not seem to
> be a way to do that as of now.
>  
> A possible low level solution would be a way to specify some vertical (horizontal axis case) or some horizontal (vertical axis case) offset
> for the position of the titles (in pixel or font size units).
> In principle of course the vtkAxis object could calculate such an offset by itself, since it has access to both
> the labels? and the titles? text properties.
>  
> What do you think ?
> Daniel
>  
> Von: Eric E. Monson [mailto:emonson at cs.duke.edu] 
> Gesendet: Dienstag, 7. Dezember 2010 13:54
> An: Frese Daniel Dr.
> Cc: vtkusers at vtk.org
> Betreff: Re: [vtkusers] Positioning titles within vtkAxis
>  
> Hey Daniel,
>  
> It does seem like SetLineOffset should do something like what you want, but I think they way the label text is applied with VerticalJustification probably nullifies any line offset setting. Line spacing shouldn't matter for a single line of text.
>  
> So, the adjustments you want are just not implemented. Marcus, the developer, has worked hard to get the labels right, though, so if you have a use case where the labels are running into the axis ticks maybe you should describe the situation and send a screen shot ? it may be something that needs fixing. 
>  
> You're right that the charts are still under development, but some of the core functionality has settled down, and as you said, the current implementation is better than the 5.6.1 version.
>  
> -Eric
>  
> ------------------------------------------------------
> Eric E Monson
> Duke Visualization Technology Group
> 
>  
>  
> On Dec 7, 2010, at 3:35 AM, Frese Daniel Dr. wrote:
> 
> 
> Hi all,
>  
> I have a problem positioning an axis title relative to its vtkAxis object.
> Basically, if I draw a horizontal  X-axis, the assigned title is written such that it overlapps with the
> tick labels. Reading through the docs, I got the impression that I should be able to introduce a
> vertical offset between the drawn axis and the titel by using either a call to
> Xaxis->GetTitleProperties()->SetLineOffset(offset_in_pixel)
> or by 
> Xaxis->GetTitleProperties()->SetLineSpacing(scale_factor).
> But neither call seems to have any effect.
> Moving from 5.6.1 to the latest vtk git source tree I noticed that the chart stuff seems to have
> improved greatly (most functions a joy to use !), but it still seems to be a work in progress.
> So am doing something stupid and do I miss something here or is this feature just not
> implemented yet ?
>  
> Daniel
>  
> 

> ------------------------------------------------------------------------------------------------------
> Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut
> Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard
> Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman),
> Michael Grimm, Matthias Fauser, Sebastian Tondorf

> E-Mail Haftungsausschluss / E-Mail Disclaimer


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From frese at heidenhain.de  Tue Dec  7 10:46:30 2010
From: frese at heidenhain.de (Frese Daniel Dr.)
Date: Tue, 7 Dec 2010 16:46:30 +0100
Subject: [vtkusers] Positioning titles within vtkAxis
In-Reply-To: <19688F91-1AD1-4231-8CE4-E68E3AEF1B46@cs.duke.edu>
References: <758150D667C235458DE231BB50B9A2B30AD0BE1983@de01ex07.GLOBAL.JHCN.NET>
	<1EF31637-776B-40E6-BFD1-05E0141E4AA4@cs.duke.edu>
	<758150D667C235458DE231BB50B9A2B30AD0BE1DA8@de01ex07.GLOBAL.JHCN.NET>
	<19688F91-1AD1-4231-8CE4-E68E3AEF1B46@cs.duke.edu>
Message-ID: <758150D667C235458DE231BB50B9A2B30AD1026E25@de01ex07.GLOBAL.JHCN.NET>

Hi Eric,

here it is, or at least the relevant part.
I'm sorry it's a bit lengthy, even though I omitted some stuff around. I did this
in the Visual Studio and created a WinForms control (which by the way worked nicely),
so "this" points to an instance of the form in order to get the dimensions of the output window.
The double locdata array and the dimensions of the image etc. are stored in private elements of the
WinForm control.

This is basically my first effort with these routines in order to try out things,
so I wouldn't be surprised if things can be done in a better way. I put the axes
in a different scene in order to work around some strange things when using vtk 5.6.1,
but now I am using the latest git stuff (or nearly, I downloaded yesterday afternoon)
and there is no need any more for any workarounds (vtk & life has become better :)).
Placing the axes into the view's scene does not change their behavior however (I tested).

Thank you very much for your interest in this !
Daniel


      void vtk2dDataControl::VTKRender() {
            double *minmax;                          // min and max within the data
            int nColors = 1000;                      // number of colors
            double colorposition[2];           // holds the position of the colorbar
            int windowsizeX;                   // X window size - to be supplied externally
            int windowsizeY;                   // Y window size - to be supplied externally
            int imageextent[6];                      // extent of the imgage
            int barwidth = 120;                      // FIXME, X space for colorbar
            int labelnum;                            // number of labels - a helper var
            int upperborder = 20;              // border space between upper image edge and window edge
            int rightborder = 40;              // space between image and colorbar
            int i;


            // calculate the effective width of the window, that can be used for the display
            windowsizeX = this->Width;
            windowsizeY = this->Height;
            effectiveSizeX = windowsizeX  - imageposition[0] - barwidth - rightborder;
            effectiveSizeY = windowsizeY  - imageposition[1] - upperborder;

            // import the data into the vtkimagedata structure
            VTK_CREATE(vtkImageImport, import);
            import->SetImportVoidPointer(localdata);
            import->SetDataScalarTypeToDouble();
            import->SetWholeExtent(0,locdimX-1,0,locdimY-1,0,0);
            import->SetDataExtent(0,locdimX-1,0,locdimY-1,0,0);
            import->Update(); // call update for getting the right minmax values below...
            minmax = import->GetOutput()->GetScalarRange();

            // resample the image in order to fit into the given window geometry
            VTK_CREATE(vtkImageResample, resample);
            resample->SetInputConnection(import->GetOutputPort());
            resample->SetDimensionality(2);
            resample->SetAxisMagnificationFactor(0, ((double) effectiveSizeX) / locdimX);
            resample->SetAxisMagnificationFactor(1, ((double) effectiveSizeY) / locdimY);

            // add a colorbar
            VTK_CREATE(vtkLookupTable, lookupTable);
            VTK_CREATE(vtkScalarBarActor, colorbar);
            lookupTable->SetNumberOfColors(nColors);
            lookupTable->SetTableRange(minmax);
            //lookupTable->SetSaturationRange(0, 1);
            //lookupTable->SetHueRange(0, 1);
            lookupTable->SetRampToLinear();
            lookupTable->Build();

            // Filter to convert the grey image into an RGB output
            VTK_CREATE(vtkImageMapToColors, rgb);
            rgb->SetInputConnection(resample->GetOutputPort());
            rgb->SetLookupTable(lookupTable);
            rgb->SetOutputFormatToRGBA();
            rgb->Update();

            // Set up a 2D context view - this is the basic 2D API structure
            if (view != NULL) view->Delete();
            view = vtkContextView::New();
            view->GetRenderWindow()->SetSize(windowsizeX, windowsizeY);

            // register the image into the view and position it
            VTK_CREATE(vtkImageItem, item);
            view->GetScene()->AddItem(item);
            item->SetImage(vtkImageData::SafeDownCast(rgb->GetOutput()));
            item->GetImage()->GetExtent(imageextent);
            item->SetPosition(imageposition[0], imageposition[1]);

            // create a new scene for axes and colorbar; also create actor for axes
            VTK_CREATE(vtkContextScene, axesscene);
            VTK_CREATE(vtkContextActor, axesactor);

            // Starting from here there is mainly stuff for the axes...
            // X Axis
            VTK_CREATE(vtkAxis, Xaxis);
            Xaxis->SetBehavior(1); // rescalable
            // now define location of axis by giving two points
            Xaxis->SetPoint1(imageposition[0], imageposition[1]);
            Xaxis->SetPoint2((int) imageextent[1]-imageextent[0] + imageposition[0], imageposition[1]);
            Xaxis->SetPosition(vtkAxis::BOTTOM);     // this is an axis at the bottom
            Xaxis->SetTitle(XAxisName->c_str());     // title of axis
            Xaxis->GetPen()->SetWidth(2);            // lines are 2 pixel wide
            Xaxis->SetMinimum(locXmin);                    // set Xmin and ...
            Xaxis->SetMaximum(locXmax);                    // ... Xmax for later autoscale()
            Xaxis->SetPrecision(2);                        // two figures after period
            Xaxis->SetNotation(2);                         // "mixed" (i.e. standard or scientific)
            Xaxis->AutoScale();                                  // perform autoscale for ticks
            Xaxis->Update();                               // do it !
            Xaxis->SetMinimum(locXmin);                    // got to reste min/max values afetr autoscale
            Xaxis->SetMaximum(locXmax);
            Xaxis->GetGridPen()->SetColor(0,0,0,1); // write in black
            Xaxis->SetLabelsVisible(true);                 // show it all...
            Xaxis->SetVisible(true);
            //Xaxis->GetTitleProperties()->SetLineOffset(10);
            Xaxis->Update();                               // do it !
            axesscene->AddItem(Xaxis);                     // add to scene

            // Y Axis
            // everything completely analogous to X Axis - so no need for comments here
            VTK_CREATE(vtkAxis, Yaxis);
            Yaxis->SetBehavior(1);
            Yaxis->SetPoint1(imageposition[0], imageposition[1]);
            Yaxis->SetPoint2(imageposition[0], (int) imageextent[3]-imageextent[2] + imageposition[1]);
            Yaxis->SetPosition(vtkAxis::LEFT);
            Yaxis->SetTitle(YAxisName->c_str());
            Yaxis->GetPen()->SetWidth(2);
            Yaxis->SetMinimum(locYmin);
            Yaxis->SetMaximum(locYmax);
            Yaxis->AutoScale();
            Yaxis->Update();
            Yaxis->SetMinimum(locYmin);
            Yaxis->SetMaximum(locYmax);
            Yaxis->GetGridPen()->SetColor(0,0,0,1);
            Yaxis->GetTitleProperties()->SetOrientation(90.0);
            Yaxis->SetLabelsVisible(true);
            Yaxis->SetVisible(true);
            Yaxis->Update();
            axesscene->AddItem(Yaxis);

            // prepare axes on top and on right w/o labels (just ticks)
            labelnum = Xaxis->GetTickPositions()->GetDataSize();
            VTK_CREATE(vtkStringArray, Xemptylabels);
            Xemptylabels->SetNumberOfValues(labelnum);
            for (i=0; iSetValue(i, "");
            }
            labelnum = Yaxis->GetTickPositions()->GetDataSize();
            VTK_CREATE(vtkStringArray, Yemptylabels);
            Yemptylabels->SetNumberOfValues(labelnum);
            for (i=0; iSetValue(i, "");
            }

            // create axis on top of image
            VTK_CREATE(vtkAxis, XaxisUpper);
            XaxisUpper->SetBehavior(1);
            XaxisUpper->SetPoint1(imageposition[0], imageposition[1] + (int) (imageextent[3]-imageextent[2]));
            XaxisUpper->SetPoint2((int) imageextent[1]-imageextent[0] + imageposition[0], imageposition[1] + (int) (imageextent[3]-imageextent[2]));
            XaxisUpper->SetPosition(vtkAxis::TOP);
            XaxisUpper->GetPen()->SetWidth(2);
            XaxisUpper->SetMinimum(locXmin);
            XaxisUpper->SetMaximum(locXmax);
            // want to have same number of ticks as X axis ...
            XaxisUpper->SetNumberOfTicks(Xaxis->GetTickPositions()->GetDataSize());
            XaxisUpper->GetGridPen()->SetColor(0,0,0,1);
            // ... and same positions of ticks as X axis ...
            XaxisUpper->SetTickPositions(Xaxis->GetTickPositions());
            // .. but no labels this time.
            XaxisUpper->SetTickLabels(Xemptylabels);
            XaxisUpper->SetVisible(true);
            XaxisUpper->Update();
            axesscene->AddItem(XaxisUpper);

            // create axis on the right of top image - analogous to XaxisUpper above
            VTK_CREATE(vtkAxis, YaxisRight);
            YaxisRight->SetBehavior(1);
            YaxisRight->SetPoint1(imageposition[0] + (int) imageextent[1]-imageextent[0], imageposition[1]);
            YaxisRight->SetPoint2(imageposition[0] + (int) imageextent[1]-imageextent[0], (int) imageextent[3]-imageextent[2] + imageposition[1]);
            YaxisRight->SetPosition(vtkAxis::RIGHT);
            YaxisRight->GetPen()->SetWidth(2);
            YaxisRight->SetMinimum(locYmin);
            YaxisRight->SetMaximum(locYmax);
            YaxisRight->SetNumberOfTicks(Yaxis->GetTickPositions()->GetDataSize());
            YaxisRight->GetGridPen()->SetColor(0,0,0,1);
            YaxisRight->SetTickPositions(Yaxis->GetTickPositions());
            YaxisRight->SetTickLabels(Yemptylabels);
            YaxisRight->SetVisible(true);
            YaxisRight->Update();
            axesscene->AddItem(YaxisRight);

            // now format and position colorbar
            colorbar->SetLookupTable(lookupTable);
            colorposition[0] = 1.0 - (1.0* barwidth)/windowsizeX;
            colorposition[1] = (1.0* imageposition[1])/windowsizeY;
            colorbar->SetWidth(0.5);
            colorbar->SetHeight(1.0 - 2* colorposition[1]);
            colorbar->SetPosition(colorposition);
            colorbar->SetLabelFormat("%1.2E");
            colorbar->PickableOff();
            colorbar->SetMaximumWidthInPixels(barwidth);
            colorbar->VisibilityOn();
            colorbar->GetLabelTextProperty()->SetShadow(0);
            colorbar->GetLabelTextProperty()->SetColor(0,0,0);

            // register the axescene to the axesactor, which and point to the renderer
            axesactor->SetScene(axesscene);
            view->GetRenderer()->AddActor(axesactor);

            // register the colorbar as an actor
            view->GetRenderer()->AddActor(colorbar);

            RenderWindow = view->GetRenderWindow();
            RenderWindow->SetWindowId((HWND)Handle.ToInt64());

            // set Interactor Style to RubberBand
            VTK_CREATE(vtkInteractorStyleRubberBand2D, RubberBandStyle);
            RubberBandStyle->SetRenderOnMouseMove(false);
            VTK_CREATE(vtkCallbackCommand, SelectionChangedCallback);
            SelectionChangedCallback->SetCallback(SelectionChangedCallbackFunction);
            RubberBandStyle->AddObserver(vtkCommand::SelectionChangedEvent,SelectionChangedCallback);
            RenderWindow->SetInteractor(WinInteractor);
            RenderWindow->SetDoubleBuffer(1);
            WinInteractor->SetInteractorStyle(RubberBandStyle);
            WinInteractor->Initialize();
      }

Von: Eric E. Monson [mailto:emonson at cs.duke.edu]
Gesendet: Dienstag, 7. Dezember 2010 16:13
An: Frese Daniel Dr.
Cc: Marcus D. Hanwell; vtkusers at vtk.org
Betreff: Re: AW: [vtkusers] Positioning titles within vtkAxis

Hey Daniel,

Yes, this shouldn't be happening. Would you be able to send the section of your code that generates this chart? I'm curious how you're implementing the combination of ImageItem and axes. Maybe there is another way of accomplishing the same thing that wouldn't cause the overlap, or it might at least help us diagnose why the label placement routine isn't dealing with your case correctly.

Also, just to be clear, was this generated with the current development (git) version, or with 5.6.1?

Thanks,
-Eric


On Dec 7, 2010, at 8:29 AM, Frese Daniel Dr. wrote:


Hello Eric, Marcus,

before I explain my problem once more I just want to add that I find the charts functionality already quite useful.
As I said I just updated my vtk stuff and I can imagine it must have been quite some work to get to this point.

I appended a screenshot illustrating the problem. Since I don't know how this appears on the mail list I just describe briefly.
I have a scene with a vtkImageItem to show some 2D matrix data. Around the image I have axes (vtkAxis objects) with
appropriate ticks, tick labels and axes titles. The problem is that the axes titles overlap with the tick labels. E.g. for the
case of the X axis , the title should be lower such that it does not touch the labels, but there does not seem to
be a way to do that as of now.

A possible low level solution would be a way to specify some vertical (horizontal axis case) or some horizontal (vertical axis case) offset
for the position of the titles (in pixel or font size units).
In principle of course the vtkAxis object could calculate such an offset by itself, since it has access to both
the labels' and the titles' text properties.

What do you think ?
Daniel

Von: Eric E. Monson [mailto:emonson at cs.duke.edu]
Gesendet: Dienstag, 7. Dezember 2010 13:54
An: Frese Daniel Dr.
Cc: vtkusers at vtk.org
Betreff: Re: [vtkusers] Positioning titles within vtkAxis

Hey Daniel,

It does seem like SetLineOffset should do something like what you want, but I think they way the label text is applied with VerticalJustification probably nullifies any line offset setting. Line spacing shouldn't matter for a single line of text.

So, the adjustments you want are just not implemented. Marcus, the developer, has worked hard to get the labels right, though, so if you have a use case where the labels are running into the axis ticks maybe you should describe the situation and send a screen shot - it may be something that needs fixing.

You're right that the charts are still under development, but some of the core functionality has settled down, and as you said, the current implementation is better than the 5.6.1 version.

-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group




On Dec 7, 2010, at 3:35 AM, Frese Daniel Dr. wrote:



Hi all,

I have a problem positioning an axis title relative to its vtkAxis object.
Basically, if I draw a horizontal  X-axis, the assigned title is written such that it overlapps with the
tick labels. Reading through the docs, I got the impression that I should be able to introduce a
vertical offset between the drawn axis and the titel by using either a call to
Xaxis->GetTitleProperties()->SetLineOffset(offset_in_pixel)
or by
Xaxis->GetTitleProperties()->SetLineSpacing(scale_factor).
But neither call seems to have any effect.
Moving from 5.6.1 to the latest vtk git source tree I noticed that the chart stuff seems to have
improved greatly (most functions a joy to use !), but it still seems to be a work in progress.
So am doing something stupid and do I miss something here or is this feature just not
implemented yet ?

Daniel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------

------------------------------------------------------------------------------------------------------
Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut
Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard
Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman),
Michael Grimm, Matthias Fauser, Sebastian Tondorf

E-Mail Haftungsausschluss / E-Mail Disclaimer


From emonson at cs.duke.edu  Tue Dec  7 13:05:44 2010
From: emonson at cs.duke.edu (Eric E. Monson)
Date: Tue, 7 Dec 2010 13:05:44 -0500
Subject: [vtkusers] Positioning titles within vtkAxis
In-Reply-To: <758150D667C235458DE231BB50B9A2B30AD1026E25@de01ex07.GLOBAL.JHCN.NET>
References: <758150D667C235458DE231BB50B9A2B30AD0BE1983@de01ex07.GLOBAL.JHCN.NET>
	<1EF31637-776B-40E6-BFD1-05E0141E4AA4@cs.duke.edu>
	<758150D667C235458DE231BB50B9A2B30AD0BE1DA8@de01ex07.GLOBAL.JHCN.NET>
	<19688F91-1AD1-4231-8CE4-E68E3AEF1B46@cs.duke.edu>
	<758150D667C235458DE231BB50B9A2B30AD1026E25@de01ex07.GLOBAL.JHCN.NET>
Message-ID: <91FBF48B-DB54-4474-9FCB-A821117CEFD2@cs.duke.edu>

Hey Daniel,

There seems to be something wrong with the painting for vtkAxis when used by itself in a scene. I'm not sure why we don't see this behavior when these axes are used within the charts. Hopefully Marcus will be able to take a look. You can see the problem even in the attached simple Python script.

One thing I noticed that maybe Marcus can comment on: Things like vtkChartXY do an Update on themselves before Paint. If in this script you don't call Update explicitly on the axis objects they paint the axis line and title, but not the ticks and their labels. Maybe it would be good to add and Update call at the beginning of vtkAxis::Paint?

Daniel, something you might want to consider instead of the method you're using now is a trick others are using for vtkScalarsToColorsItem and its subclasses: they make a subclass of vtkPlot which has a vtkImageData as a private Texture variable, and then paints the texture within the plot's bounds. This way they can instantiate a vtkChartXY and use AddPlot() to add what is basically an image painter, and then vtkChartXY takes care of the axes internally. Just an idea that I've seen the developers using.

Anyway, hopefully Marcus or someone else will be able to take a look at this sometime soon, but I know he's very busy right now.

Talk to you later,
-Eric

# =======
import vtk

view = vtk.vtkContextView()
view.GetRenderWindow().SetSize(400, 300)

axis1 = vtk.vtkAxis()
axis1.SetPoint1(75,75)
axis1.SetPoint2(75,225)
axis1.SetPosition(vtk.vtkAxis.LEFT)
axis1.SetTitle('YAxis')
axis1.Update()
view.GetScene().AddItem(axis1)

axis2 = vtk.vtkAxis()
axis2.SetPoint1(75,75)
axis2.SetPoint2(325,75)
axis2.SetPosition(vtk.vtkAxis.BOTTOM)
axis2.SetTitle('XAxis')
axis2.Update()
view.GetScene().AddItem(axis2)

view.Render()
view.GetInteractor().Start()
# =======


On Dec 7, 2010, at 10:46 AM, Frese Daniel Dr. wrote:

> Hi Eric,
>  
> here it is, or at least the relevant part.
> I?m sorry it?s a bit lengthy, even though I omitted some stuff around. I did this
> in the Visual Studio and created a WinForms control (which by the way worked nicely),
> so ?this? points to an instance of the form in order to get the dimensions of the output window.
> The double locdata array and the dimensions of the image etc. are stored in private elements of the
> WinForm control.
>  
> This is basically my first effort with these routines in order to try out things,
> so I wouldn?t be surprised if things can be done in a better way. I put the axes
> in a different scene in order to work around some strange things when using vtk 5.6.1,
> but now I am using the latest git stuff (or nearly, I downloaded yesterday afternoon)
> and there is no need any more for any workarounds (vtk & life has become better J).
> Placing the axes into the view?s scene does not change their behavior however (I tested).
>  
> Thank you very much for your interest in this !
> Daniel
>  
>  
>       void vtk2dDataControl::VTKRender() {
>             double *minmax;                          // min and max within the data
>             int nColors = 1000;                      // number of colors
>             double colorposition[2];           // holds the position of the colorbar
>             int windowsizeX;                   // X window size - to be supplied externally
>             int windowsizeY;                   // Y window size - to be supplied externally
>             int imageextent[6];                      // extent of the imgage
>             int barwidth = 120;                      // FIXME, X space for colorbar
>             int labelnum;                            // number of labels - a helper var
>             int upperborder = 20;              // border space between upper image edge and window edge
>             int rightborder = 40;              // space between image and colorbar
>             int i;
>  
>  
>             // calculate the effective width of the window, that can be used for the display
>             windowsizeX = this->Width;
>             windowsizeY = this->Height;
>             effectiveSizeX = windowsizeX  - imageposition[0] - barwidth - rightborder;
>             effectiveSizeY = windowsizeY  - imageposition[1] - upperborder;
>            
>             // import the data into the vtkimagedata structure
>             VTK_CREATE(vtkImageImport, import);
>             import->SetImportVoidPointer(localdata);
>             import->SetDataScalarTypeToDouble();
>             import->SetWholeExtent(0,locdimX-1,0,locdimY-1,0,0);
>             import->SetDataExtent(0,locdimX-1,0,locdimY-1,0,0);
>             import->Update(); // call update for getting the right minmax values below...
>             minmax = import->GetOutput()->GetScalarRange();
>  
>             // resample the image in order to fit into the given window geometry
>             VTK_CREATE(vtkImageResample, resample);
>             resample->SetInputConnection(import->GetOutputPort());
>             resample->SetDimensionality(2);
>             resample->SetAxisMagnificationFactor(0, ((double) effectiveSizeX) / locdimX);
>             resample->SetAxisMagnificationFactor(1, ((double) effectiveSizeY) / locdimY);
>  
>             // add a colorbar
>             VTK_CREATE(vtkLookupTable, lookupTable);
>             VTK_CREATE(vtkScalarBarActor, colorbar);
>             lookupTable->SetNumberOfColors(nColors);
>             lookupTable->SetTableRange(minmax);
>             //lookupTable->SetSaturationRange(0, 1);
>             //lookupTable->SetHueRange(0, 1);
>             lookupTable->SetRampToLinear();
>             lookupTable->Build();
>  
>             // Filter to convert the grey image into an RGB output
>             VTK_CREATE(vtkImageMapToColors, rgb);
>             rgb->SetInputConnection(resample->GetOutputPort());
>             rgb->SetLookupTable(lookupTable);
>             rgb->SetOutputFormatToRGBA();
>             rgb->Update();
>  
>             // Set up a 2D context view - this is the basic 2D API structure
>             if (view != NULL) view->Delete();
>             view = vtkContextView::New();
>             view->GetRenderWindow()->SetSize(windowsizeX, windowsizeY); 
>  
>             // register the image into the view and position it
>             VTK_CREATE(vtkImageItem, item); 
>             view->GetScene()->AddItem(item);
>             item->SetImage(vtkImageData::SafeDownCast(rgb->GetOutput()));
>             item->GetImage()->GetExtent(imageextent);
>             item->SetPosition(imageposition[0], imageposition[1]);
>  
>             // create a new scene for axes and colorbar; also create actor for axes
>             VTK_CREATE(vtkContextScene, axesscene);
>             VTK_CREATE(vtkContextActor, axesactor);
>  
>             // Starting from here there is mainly stuff for the axes...
>             // X Axis
>             VTK_CREATE(vtkAxis, Xaxis);
>             Xaxis->SetBehavior(1); // rescalable
>             // now define location of axis by giving two points
>             Xaxis->SetPoint1(imageposition[0], imageposition[1]);
>             Xaxis->SetPoint2((int) imageextent[1]-imageextent[0] + imageposition[0], imageposition[1]);
>             Xaxis->SetPosition(vtkAxis::BOTTOM);     // this is an axis at the bottom
>             Xaxis->SetTitle(XAxisName->c_str());     // title of axis
>             Xaxis->GetPen()->SetWidth(2);            // lines are 2 pixel wide
>             Xaxis->SetMinimum(locXmin);                    // set Xmin and ...
>             Xaxis->SetMaximum(locXmax);                    // ... Xmax for later autoscale()
>             Xaxis->SetPrecision(2);                        // two figures after period
>             Xaxis->SetNotation(2);                         // "mixed" (i.e. standard or scientific)
>             Xaxis->AutoScale();                                  // perform autoscale for ticks
>             Xaxis->Update();                               // do it !
>             Xaxis->SetMinimum(locXmin);                    // got to reste min/max values afetr autoscale
>             Xaxis->SetMaximum(locXmax);
>             Xaxis->GetGridPen()->SetColor(0,0,0,1); // write in black
>             Xaxis->SetLabelsVisible(true);                 // show it all...
>             Xaxis->SetVisible(true);
>             //Xaxis->GetTitleProperties()->SetLineOffset(10);
>             Xaxis->Update();                               // do it !
>             axesscene->AddItem(Xaxis);                     // add to scene
>  
>             // Y Axis
>             // everything completely analogous to X Axis - so no need for comments here
>             VTK_CREATE(vtkAxis, Yaxis);
>             Yaxis->SetBehavior(1);
>             Yaxis->SetPoint1(imageposition[0], imageposition[1]);
>             Yaxis->SetPoint2(imageposition[0], (int) imageextent[3]-imageextent[2] + imageposition[1]);
>             Yaxis->SetPosition(vtkAxis::LEFT);
>             Yaxis->SetTitle(YAxisName->c_str());
>             Yaxis->GetPen()->SetWidth(2);
>             Yaxis->SetMinimum(locYmin);
>             Yaxis->SetMaximum(locYmax);
>             Yaxis->AutoScale();
>             Yaxis->Update();
>             Yaxis->SetMinimum(locYmin);
>             Yaxis->SetMaximum(locYmax);
>             Yaxis->GetGridPen()->SetColor(0,0,0,1);
>             Yaxis->GetTitleProperties()->SetOrientation(90.0);
>             Yaxis->SetLabelsVisible(true);
>             Yaxis->SetVisible(true);
>             Yaxis->Update();
>             axesscene->AddItem(Yaxis);
>  
>             // prepare axes on top and on right w/o labels (just ticks)
>             labelnum = Xaxis->GetTickPositions()->GetDataSize();
>             VTK_CREATE(vtkStringArray, Xemptylabels);
>             Xemptylabels->SetNumberOfValues(labelnum);
>             for (i=0; i                   Xemptylabels->SetValue(i, "");
>             }
>             labelnum = Yaxis->GetTickPositions()->GetDataSize();
>             VTK_CREATE(vtkStringArray, Yemptylabels);
>             Yemptylabels->SetNumberOfValues(labelnum);
>             for (i=0; i                   Yemptylabels->SetValue(i, "");
>             }
>  
>             // create axis on top of image
>             VTK_CREATE(vtkAxis, XaxisUpper);
>             XaxisUpper->SetBehavior(1);
>             XaxisUpper->SetPoint1(imageposition[0], imageposition[1] + (int) (imageextent[3]-imageextent[2]));
>             XaxisUpper->SetPoint2((int) imageextent[1]-imageextent[0] + imageposition[0], imageposition[1] + (int) (imageextent[3]-imageextent[2]));
>             XaxisUpper->SetPosition(vtkAxis::TOP);
>             XaxisUpper->GetPen()->SetWidth(2);
>             XaxisUpper->SetMinimum(locXmin);
>             XaxisUpper->SetMaximum(locXmax);
>             // want to have same number of ticks as X axis ...
>             XaxisUpper->SetNumberOfTicks(Xaxis->GetTickPositions()->GetDataSize());
>             XaxisUpper->GetGridPen()->SetColor(0,0,0,1);
>             // ... and same positions of ticks as X axis ...
>             XaxisUpper->SetTickPositions(Xaxis->GetTickPositions());
>             // .. but no labels this time.
>             XaxisUpper->SetTickLabels(Xemptylabels);
>             XaxisUpper->SetVisible(true);
>             XaxisUpper->Update();
>             axesscene->AddItem(XaxisUpper);
>  
>             // create axis on the right of top image - analogous to XaxisUpper above
>             VTK_CREATE(vtkAxis, YaxisRight);
>             YaxisRight->SetBehavior(1);
>             YaxisRight->SetPoint1(imageposition[0] + (int) imageextent[1]-imageextent[0], imageposition[1]);
>             YaxisRight->SetPoint2(imageposition[0] + (int) imageextent[1]-imageextent[0], (int) imageextent[3]-imageextent[2] + imageposition[1]);
>             YaxisRight->SetPosition(vtkAxis::RIGHT);
>             YaxisRight->GetPen()->SetWidth(2);
>             YaxisRight->SetMinimum(locYmin);
>             YaxisRight->SetMaximum(locYmax);
>             YaxisRight->SetNumberOfTicks(Yaxis->GetTickPositions()->GetDataSize());
>             YaxisRight->GetGridPen()->SetColor(0,0,0,1);
>             YaxisRight->SetTickPositions(Yaxis->GetTickPositions());
>             YaxisRight->SetTickLabels(Yemptylabels);
>             YaxisRight->SetVisible(true);
>             YaxisRight->Update();
>             axesscene->AddItem(YaxisRight);
>  
>             // now format and position colorbar
>             colorbar->SetLookupTable(lookupTable);
>             colorposition[0] = 1.0 - (1.0* barwidth)/windowsizeX;
>             colorposition[1] = (1.0* imageposition[1])/windowsizeY;
>             colorbar->SetWidth(0.5);
>             colorbar->SetHeight(1.0 - 2* colorposition[1]);
>             colorbar->SetPosition(colorposition);
>             colorbar->SetLabelFormat("%1.2E");
>             colorbar->PickableOff();
>             colorbar->SetMaximumWidthInPixels(barwidth);
>             colorbar->VisibilityOn();
>             colorbar->GetLabelTextProperty()->SetShadow(0);
>             colorbar->GetLabelTextProperty()->SetColor(0,0,0);
>  
>             // register the axescene to the axesactor, which and point to the renderer
>             axesactor->SetScene(axesscene);
>             view->GetRenderer()->AddActor(axesactor);
>  
>             // register the colorbar as an actor
>             view->GetRenderer()->AddActor(colorbar);
>  
>             RenderWindow = view->GetRenderWindow();
>             RenderWindow->SetWindowId((HWND)Handle.ToInt64());
>  
>             // set Interactor Style to RubberBand
>             VTK_CREATE(vtkInteractorStyleRubberBand2D, RubberBandStyle);
>             RubberBandStyle->SetRenderOnMouseMove(false);
>             VTK_CREATE(vtkCallbackCommand, SelectionChangedCallback);
>             SelectionChangedCallback->SetCallback(SelectionChangedCallbackFunction);
>             RubberBandStyle->AddObserver(vtkCommand::SelectionChangedEvent,SelectionChangedCallback);
>             RenderWindow->SetInteractor(WinInteractor);
>             RenderWindow->SetDoubleBuffer(1);
>             WinInteractor->SetInteractorStyle(RubberBandStyle);
>             WinInteractor->Initialize();
>       }
>  
> Von: Eric E. Monson [mailto:emonson at cs.duke.edu] 
> Gesendet: Dienstag, 7. Dezember 2010 16:13
> An: Frese Daniel Dr.
> Cc: Marcus D. Hanwell; vtkusers at vtk.org
> Betreff: Re: AW: [vtkusers] Positioning titles within vtkAxis
>  
> Hey Daniel,
>  
> Yes, this shouldn't be happening. Would you be able to send the section of your code that generates this chart? I'm curious how you're implementing the combination of ImageItem and axes. Maybe there is another way of accomplishing the same thing that wouldn't cause the overlap, or it might at least help us diagnose why the label placement routine isn't dealing with your case correctly.
>  
> Also, just to be clear, was this generated with the current development (git) version, or with 5.6.1?
>  
> Thanks,
> -Eric
>  
>  
> On Dec 7, 2010, at 8:29 AM, Frese Daniel Dr. wrote:
> 
> 
> Hello Eric, Marcus,
>  
> before I explain my problem once more I just want to add that I find the charts functionality already quite useful.
> As I said I just updated my vtk stuff and I can imagine it must have been quite some work to get to this point.
>  
> I appended a screenshot illustrating the problem. Since I don?t know how this appears on the mail list I just describe briefly.
> I have a scene with a vtkImageItem to show some 2D matrix data. Around the image I have axes (vtkAxis objects) with
> appropriate ticks, tick labels and axes titles. The problem is that the axes titles overlap with the tick labels. E.g. for the
> case of the X axis , the title should be lower such that it does not touch the labels, but there does not seem to
> be a way to do that as of now.
>  
> A possible low level solution would be a way to specify some vertical (horizontal axis case) or some horizontal (vertical axis case) offset
> for the position of the titles (in pixel or font size units).
> In principle of course the vtkAxis object could calculate such an offset by itself, since it has access to both
> the labels? and the titles? text properties.
>  
> What do you think ?
> Daniel
>  
> Von: Eric E. Monson [mailto:emonson at cs.duke.edu] 
> Gesendet: Dienstag, 7. Dezember 2010 13:54
> An: Frese Daniel Dr.
> Cc: vtkusers at vtk.org
> Betreff: Re: [vtkusers] Positioning titles within vtkAxis
>  
> Hey Daniel,
>  
> It does seem like SetLineOffset should do something like what you want, but I think they way the label text is applied with VerticalJustification probably nullifies any line offset setting. Line spacing shouldn't matter for a single line of text.
>  
> So, the adjustments you want are just not implemented. Marcus, the developer, has worked hard to get the labels right, though, so if you have a use case where the labels are running into the axis ticks maybe you should describe the situation and send a screen shot ? it may be something that needs fixing. 
>  
> You're right that the charts are still under development, but some of the core functionality has settled down, and as you said, the current implementation is better than the 5.6.1 version.
>  
> -Eric
>  
> ------------------------------------------------------
> Eric E Monson
> Duke Visualization Technology Group
> 
> 
>  
>  
> On Dec 7, 2010, at 3:35 AM, Frese Daniel Dr. wrote:
> 
> 
> 
> Hi all,
>  
> I have a problem positioning an axis title relative to its vtkAxis object.
> Basically, if I draw a horizontal  X-axis, the assigned title is written such that it overlapps with the
> tick labels. Reading through the docs, I got the impression that I should be able to introduce a
> vertical offset between the drawn axis and the titel by using either a call to
> Xaxis->GetTitleProperties()->SetLineOffset(offset_in_pixel)
> or by 
> Xaxis->GetTitleProperties()->SetLineSpacing(scale_factor).
> But neither call seems to have any effect.
> Moving from 5.6.1 to the latest vtk git source tree I noticed that the chart stuff seems to have
> improved greatly (most functions a joy to use !), but it still seems to be a work in progress.
> So am doing something stupid and do I miss something here or is this feature just not
> implemented yet ?
>  
> Daniel
>  
> 

> ------------------------------------------------------------------------------------------------------
> Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut
> Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard
> Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman),
> Michael Grimm, Matthias Fauser, Sebastian Tondorf

> E-Mail Haftungsausschluss / E-Mail Disclaimer


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AxisLabelOverlap.png
Type: image/png
Size: 16550 bytes
Desc: not available
URL: 

From analisifunzionale at gmail.com  Tue Dec  7 13:07:40 2010
From: analisifunzionale at gmail.com (analisifunzionale)
Date: Tue, 7 Dec 2010 19:07:40 +0100
Subject: [vtkusers] [newbie] How to save an array on file
Message-ID: 

Hi everybody,

I'm trying to save an array on disk.

I'm using vtkArrayWrite to save a vtkLongArray in this way:
    ---
    vtkArrayWriter::Write(myArray ,"array_file_name.xml");
    ---

The compiler give me this error:

    ---
    error: no matching function for call to
?vtkArrayWriter::Write(vtkSmartPointer&, vtkStdString&)?
    note: candidates are: bool vtkArrayWriter::Write(const vtkStdString&, bool)
    note:                 static bool vtkArrayWriter::Write(vtkArray*,
const vtkStdString&, bool)
    note:                 bool vtkArrayWriter::Write(std::ostream&, bool)
    note:                 static bool vtkArrayWriter::Write(vtkArray*,
std::ostream&, bool)
    ---

To solve I tried with SafeDownCast in this way:

   ---
  vtkArrayWriter::Write(vtkArray::SafeDownCast( myArray ),array_file_name);
  ---

And now I compile but the saved file is empty.

Any hint? Is there a better way to an array on disk?

Thank you,

,af

-- 
Happy hacking!


From daviddoria at gmail.com  Tue Dec  7 13:31:10 2010
From: daviddoria at gmail.com (David Doria)
Date: Tue, 7 Dec 2010 13:31:10 -0500
Subject: [vtkusers] [newbie] How to save an array on file
In-Reply-To: 
References: 
Message-ID: 

On Tue, Dec 7, 2010 at 1:07 PM, analisifunzionale
 wrote:
> Hi everybody,
>
> I'm trying to save an array on disk.
>
> I'm using vtkArrayWrite to save a vtkLongArray in this way:
> ? ?---
> ? ?vtkArrayWriter::Write(myArray ,"array_file_name.xml");
> ? ?---
>
> The compiler give me this error:
>
> ? ?---
> ? ?error: no matching function for call to
> ?vtkArrayWriter::Write(vtkSmartPointer&, vtkStdString&)?
> ? ?note: candidates are: bool vtkArrayWriter::Write(const vtkStdString&, bool)
> ? ?note: ? ? ? ? ? ? ? ? static bool vtkArrayWriter::Write(vtkArray*,
> const vtkStdString&, bool)

You can only write a vtkDenseArray (or vtkSparseArray) with that writer:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ArrayWriter

As for the best way to write a "normal" array (vtkLongArray, for
example), I'll defer to someone else.

David


From sean at rogue-research.com  Tue Dec  7 13:42:54 2010
From: sean at rogue-research.com (Sean McBride)
Date: Tue, 7 Dec 2010 13:42:54 -0500
Subject: [vtkusers] bug 0009618 and UTF 8 text rendering fix question
Message-ID: <20101207184254.169257625@mail.rogue-research.com>

On Sun, 5 Dec 2010 16:13:38 -0500, Marcus D. Hanwell said:

>On Sun, Dec 5, 2010 at 10:22 AM, pof  wrote:
>> Actually,
>> bug 0009618 has still an open status in Mantis, it should be closed
now, but
>> I do not know who can do this!
>> Sorry if this question sounds a bit stupid, but how can I check if these
>> fixes are on master?
>
>I merged the changes into master for accented characters, I was not
>aware of this bug report at the time. I have assigned the bug to
>myself and marked it as resolved. I then realized that the drop shadow
>patch has not been merged, and so reopened the bug. I will try to make
>some time to check out the patch and get it merged if it looks good on
>all platforms.
>
>I am not as familiar with the drop shadow code, but am the one who has
>spent the most time working with FreeType classes in VTK recently. I
>would like to get this into the 5.8 release if it looks OK, and can
>confirm the accented characters patch is already in and will be in the
>next release.

Marcus,

Just to clarify, what encoding should be given to vtkTextActor::SetInput
()?  Last I tried, it seemed to expect ISO-8859-1.  Certainly a step up
from ASCII!  Is the long term plan for it to accept UTF8?

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montr?al, Qu?bec, Canada




From david.gobbi at gmail.com  Tue Dec  7 15:13:56 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Tue, 7 Dec 2010 13:13:56 -0700
Subject: [vtkusers] bug 0009618 and UTF 8 text rendering fix question
In-Reply-To: <20101207184254.169257625@mail.rogue-research.com>
References: <20101207184254.169257625@mail.rogue-research.com>
Message-ID: 

On Tue, Dec 7, 2010 at 11:42 AM, Sean McBride wrote:

>
> Marcus,
>
> Just to clarify, what encoding should be given to vtkTextActor::SetInput
> ()?  Last I tried, it seemed to expect ISO-8859-1.  Certainly a step up
> from ASCII!  Is the long term plan for it to accept UTF8?
>

I think it is best if VTK strings use the system default encoding, rather
than utf-8.  For unicode there is always vtkUnicodeString.  More classes
should be adapted to take vtkUnicodeString as input (but only, of course,
if they are internally capable of using/rendering unicode).

But I'm flexible.  Really, I'm just pushing for VTK's string handling to be
more similar to Python's.  ;)

  David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From marcus.hanwell at kitware.com  Tue Dec  7 15:27:03 2010
From: marcus.hanwell at kitware.com (Marcus D. Hanwell)
Date: Tue, 7 Dec 2010 15:27:03 -0500
Subject: [vtkusers] bug 0009618 and UTF 8 text rendering fix question
In-Reply-To: 
References: <20101207184254.169257625@mail.rogue-research.com>
	
Message-ID: 

On Tue, Dec 7, 2010 at 3:13 PM, David Gobbi  wrote:
> On Tue, Dec 7, 2010 at 11:42 AM, Sean McBride 
> wrote:
>>
>> Marcus,
>>
>> Just to clarify, what encoding should be given to vtkTextActor::SetInput
>> ()? ?Last I tried, it seemed to expect ISO-8859-1. ?Certainly a step up
>> from ASCII! ?Is the long term plan for it to accept UTF8?
>
> I think it is best if VTK strings use the system default encoding, rather
> than utf-8. ?For unicode there is always vtkUnicodeString. ?More classes
> should be adapted to take vtkUnicodeString as input (but only, of course,
> if they are internally capable of using/rendering unicode).
>
> But I'm flexible. ?Really, I'm just pushing for VTK's string handling to be
> more similar to Python's. ?;)
>
I am not too concerned about aligning with Python's string handling,
but agree with David - I think we should be adjusting existing classes
to deal with and take vtkUnicodeString, which can take UTF8 strings
for construction. It would probably be simplest to interpret all const
char* and vtkStdString as UTF8 when it came to rendering, as minimal
code/API changes would be required.

If you look at vtkContext2D and friends, where I have been prototyping
the UTF8 string handling and Unicode rendering, I have used
vtkUnicodeString as the function argument. There is vtkFreeTypeTools
that can take a unicode string, and render it accordingly, or the more
traditional string and render it as has been done for many years.

I certainly welcome people's thoughts on this. Working through the
relevant classes, and adding vtkUnicodeString API to them where and
when they can really render Unicode seems like a reasonable approach
to me.

Marcus


From marcus.hanwell at kitware.com  Tue Dec  7 15:30:55 2010
From: marcus.hanwell at kitware.com (Marcus D. Hanwell)
Date: Tue, 7 Dec 2010 15:30:55 -0500
Subject: [vtkusers] Positioning titles within vtkAxis
In-Reply-To: <91FBF48B-DB54-4474-9FCB-A821117CEFD2@cs.duke.edu>
References: <758150D667C235458DE231BB50B9A2B30AD0BE1983@de01ex07.GLOBAL.JHCN.NET>
	<1EF31637-776B-40E6-BFD1-05E0141E4AA4@cs.duke.edu>
	<758150D667C235458DE231BB50B9A2B30AD0BE1DA8@de01ex07.GLOBAL.JHCN.NET>
	<19688F91-1AD1-4231-8CE4-E68E3AEF1B46@cs.duke.edu>
	<758150D667C235458DE231BB50B9A2B30AD1026E25@de01ex07.GLOBAL.JHCN.NET>
	<91FBF48B-DB54-4474-9FCB-A821117CEFD2@cs.duke.edu>
Message-ID: 

Hi,

I will take a look at this, but the vtkAxis has not been used much outside
of charts. Calling Update should help, after making all changes. There is a
new 2D histogram class I am actively developing that does most of what you
have done there. You seem to construct actors that are not required in the
code. I will see if I can take a better look at this later when I have more
time, I am actively fixing bugs right now in preparation for the VTK and
ParaView branches.

It is great to see more people experimenting with these classes, I will get
an updated guide to the 2D world in VTK once I have a little time. I think
the axis updates need a little refactoring as I have found it to be a little
too fragile - so this is something I am looking at.

Marcus

On Tue, Dec 7, 2010 at 1:05 PM, Eric E. Monson  wrote:

> Hey Daniel,
>
> There seems to be something wrong with the painting for vtkAxis when used
> by itself in a scene. I'm not sure why we don't see this behavior when these
> axes are used within the charts. Hopefully Marcus will be able to take a
> look. You can see the problem even in the attached simple Python script.
>
> One thing I noticed that maybe Marcus can comment on: Things like
> vtkChartXY do an Update on themselves before Paint. If in this script you
> don't call Update explicitly on the axis objects they paint the axis line
> and title, but not the ticks and their labels. Maybe it would be good to add
> and Update call at the beginning of vtkAxis::Paint?
>
> Daniel, something you might want to consider instead of the method you're
> using now is a trick others are using for vtkScalarsToColorsItem and its
> subclasses: they make a subclass of vtkPlot which has a vtkImageData as a
> private Texture variable, and then paints the texture within the plot's
> bounds. This way they can instantiate a vtkChartXY and use AddPlot() to add
> what is basically an image painter, and then vtkChartXY takes care of the
> axes internally. Just an idea that I've seen the developers using.
>
> Anyway, hopefully Marcus or someone else will be able to take a look at
> this sometime soon, but I know he's very busy right now.
>
> Talk to you later,
> -Eric
>
> # =======
> import vtk
>
> view = vtk.vtkContextView()
> view.GetRenderWindow().SetSize(400, 300)
>
> axis1 = vtk.vtkAxis()
> axis1.SetPoint1(75,75)
> axis1.SetPoint2(75,225)
> axis1.SetPosition(vtk.vtkAxis.LEFT)
> axis1.SetTitle('YAxis')
> axis1.Update()
> view.GetScene().AddItem(axis1)
>
> axis2 = vtk.vtkAxis()
> axis2.SetPoint1(75,75)
> axis2.SetPoint2(325,75)
> axis2.SetPosition(vtk.vtkAxis.BOTTOM)
> axis2.SetTitle('XAxis')
> axis2.Update()
> view.GetScene().AddItem(axis2)
>
> view.Render()
> view.GetInteractor().Start()
> # =======
>
> On Dec 7, 2010, at 10:46 AM, Frese Daniel Dr. wrote:
>
> Hi Eric,
>
> here it is, or at least the relevant part.
> I?m sorry it?s a bit lengthy, even though I omitted some stuff around. I
> did this
> in the Visual Studio and created a WinForms control (which by the way
> worked nicely),
> so ?this? points to an instance of the form in order to get the dimensions
> of the output window.
> The double locdata array and the dimensions of the image etc. are stored in
> private elements of the
> WinForm control.
>
> This is basically my first effort with these routines in order to try out
> things,
> so I wouldn?t be surprised if things can be done in a better way. I put the
> axes
> in a different scene in order to work around some strange things when using
> vtk 5.6.1,
> but now I am using the latest git stuff (or nearly, I downloaded yesterday
> afternoon)
> and there is no need any more for any workarounds (vtk & life has become
> better J).
> Placing the axes into the view?s scene does not change their behavior
> however (I tested).
>
> Thank you very much for your interest in this !
> Daniel
>
>
>       void vtk2dDataControl::VTKRender() {
>             double *minmax;                          // min and max within
> the data
>             int nColors = 1000;                      // number of colors
>             double colorposition[2];           // holds the position of
> the colorbar
>             int windowsizeX;                   // X window size - to be
> supplied externally
>             int windowsizeY;                   // Y window size - to be
> supplied externally
>             int imageextent[6];                      // extent of the
> imgage
>             int barwidth = 120;                      // FIXME, X space for
> colorbar
>             int labelnum;                            // number of labels -
> a helper var
>             int upperborder = 20;              // border space between
> upper image edge and window edge
>             int rightborder = 40;              // space between image and
> colorbar
>             int i;
>
>
>             // calculate the effective width of the window, that can be
> used for the display
>             windowsizeX = this->Width;
>             windowsizeY = this->Height;
>             effectiveSizeX = windowsizeX  - imageposition[0] - barwidth -
> rightborder;
>             effectiveSizeY = windowsizeY  - imageposition[1] - upperborder;
>
>             // import the data into the vtkimagedata structure
>             VTK_CREATE(vtkImageImport, import);
>             import->SetImportVoidPointer(localdata);
>             import->SetDataScalarTypeToDouble();
>             import->SetWholeExtent(0,locdimX-1,0,locdimY-1,0,0);
>             import->SetDataExtent(0,locdimX-1,0,locdimY-1,0,0);
>             import->Update(); // call update for getting the right minmax
> values below...
>             minmax = import->GetOutput()->GetScalarRange();
>
>             // resample the image in order to fit into the given window
> geometry
>             VTK_CREATE(vtkImageResample, resample);
>             resample->SetInputConnection(import->GetOutputPort());
>             resample->SetDimensionality(2);
>             resample->SetAxisMagnificationFactor(0, ((double)
> effectiveSizeX) / locdimX);
>             resample->SetAxisMagnificationFactor(1, ((double)
> effectiveSizeY) / locdimY);
>
>             // add a colorbar
>             VTK_CREATE(vtkLookupTable, lookupTable);
>             VTK_CREATE(vtkScalarBarActor, colorbar);
>             lookupTable->SetNumberOfColors(nColors);
>             lookupTable->SetTableRange(minmax);
>             //lookupTable->SetSaturationRange(0, 1);
>             //lookupTable->SetHueRange(0, 1);
>             lookupTable->SetRampToLinear();
>             lookupTable->Build();
>
>             // Filter to convert the grey image into an RGB output
>             VTK_CREATE(vtkImageMapToColors, rgb);
>             rgb->SetInputConnection(resample->GetOutputPort());
>             rgb->SetLookupTable(lookupTable);
>             rgb->SetOutputFormatToRGBA();
>             rgb->Update();
>
>             // Set up a 2D context view - this is the basic 2D API
> structure
>             if (view != NULL) view->Delete();
>             view = vtkContextView::New();
>             view->GetRenderWindow()->SetSize(windowsizeX, windowsizeY);
>
>             // register the image into the view and position it
>             VTK_CREATE(vtkImageItem, item);
>             view->GetScene()->AddItem(item);
>             item->SetImage(vtkImageData::SafeDownCast(rgb->GetOutput()));
>             item->GetImage()->GetExtent(imageextent);
>             item->SetPosition(imageposition[0], imageposition[1]);
>
>             // create a new scene for axes and colorbar; also create actor
> for axes
>             VTK_CREATE(vtkContextScene, axesscene);
>             VTK_CREATE(vtkContextActor, axesactor);
>
>             // Starting from here there is mainly stuff for the axes...
>             // X Axis
>             VTK_CREATE(vtkAxis, Xaxis);
>             Xaxis->SetBehavior(1); // rescalable
>             // now define location of axis by giving two points
>             Xaxis->SetPoint1(imageposition[0], imageposition[1]);
>             Xaxis->SetPoint2((int) imageextent[1]-imageextent[0] +
> imageposition[0], imageposition[1]);
>             Xaxis->SetPosition(vtkAxis::BOTTOM);     // this is an axis at
> the bottom
>             Xaxis->SetTitle(XAxisName->c_str());     // title of axis
>             Xaxis->GetPen()->SetWidth(2);            // lines are 2 pixel
> wide
>             Xaxis->SetMinimum(locXmin);                    // set Xmin and
> ...
>             Xaxis->SetMaximum(locXmax);                    // ... Xmax for
> later autoscale()
>             Xaxis->SetPrecision(2);                        // two figures
> after period
>             Xaxis->SetNotation(2);                         // "mixed"
> (i.e. standard or scientific)
>             Xaxis->AutoScale();                                  //
> perform autoscale for ticks
>             Xaxis->Update();                               // do it !
>             Xaxis->SetMinimum(locXmin);                    // got to reste
> min/max values afetr autoscale
>             Xaxis->SetMaximum(locXmax);
>             Xaxis->GetGridPen()->SetColor(0,0,0,1); // write in black
>             Xaxis->SetLabelsVisible(true);                 // show it
> all...
>             Xaxis->SetVisible(true);
>             //Xaxis->GetTitleProperties()->SetLineOffset(10);
>             Xaxis->Update();                               // do it !
>             axesscene->AddItem(Xaxis);                     // add to scene
>
>             // Y Axis
>             // everything completely analogous to X Axis - so no need for
> comments here
>             VTK_CREATE(vtkAxis, Yaxis);
>             Yaxis->SetBehavior(1);
>             Yaxis->SetPoint1(imageposition[0], imageposition[1]);
>             Yaxis->SetPoint2(imageposition[0], (int)
> imageextent[3]-imageextent[2] + imageposition[1]);
>             Yaxis->SetPosition(vtkAxis::LEFT);
>             Yaxis->SetTitle(YAxisName->c_str());
>             Yaxis->GetPen()->SetWidth(2);
>             Yaxis->SetMinimum(locYmin);
>             Yaxis->SetMaximum(locYmax);
>             Yaxis->AutoScale();
>             Yaxis->Update();
>             Yaxis->SetMinimum(locYmin);
>             Yaxis->SetMaximum(locYmax);
>             Yaxis->GetGridPen()->SetColor(0,0,0,1);
>             Yaxis->GetTitleProperties()->SetOrientation(90.0);
>             Yaxis->SetLabelsVisible(true);
>             Yaxis->SetVisible(true);
>             Yaxis->Update();
>             axesscene->AddItem(Yaxis);
>
>             // prepare axes on top and on right w/o labels (just ticks)
>             labelnum = Xaxis->GetTickPositions()->GetDataSize();
>             VTK_CREATE(vtkStringArray, Xemptylabels);
>             Xemptylabels->SetNumberOfValues(labelnum);
>             for (i=0; i                   Xemptylabels->SetValue(i, "");
>             }
>             labelnum = Yaxis->GetTickPositions()->GetDataSize();
>             VTK_CREATE(vtkStringArray, Yemptylabels);
>             Yemptylabels->SetNumberOfValues(labelnum);
>             for (i=0; i                   Yemptylabels->SetValue(i, "");
>             }
>
>             // create axis on top of image
>             VTK_CREATE(vtkAxis, XaxisUpper);
>             XaxisUpper->SetBehavior(1);
>             XaxisUpper->SetPoint1(imageposition[0], imageposition[1] + (
> int) (imageextent[3]-imageextent[2]));
>             XaxisUpper->SetPoint2((int) imageextent[1]-imageextent[0] +
> imageposition[0], imageposition[1] + (int)
> (imageextent[3]-imageextent[2]));
>             XaxisUpper->SetPosition(vtkAxis::TOP);
>             XaxisUpper->GetPen()->SetWidth(2);
>             XaxisUpper->SetMinimum(locXmin);
>             XaxisUpper->SetMaximum(locXmax);
>             // want to have same number of ticks as X axis ...
>
> XaxisUpper->SetNumberOfTicks(Xaxis->GetTickPositions()->GetDataSize());
>             XaxisUpper->GetGridPen()->SetColor(0,0,0,1);
>             // ... and same positions of ticks as X axis ...
>             XaxisUpper->SetTickPositions(Xaxis->GetTickPositions());
>             // .. but no labels this time.
>             XaxisUpper->SetTickLabels(Xemptylabels);
>             XaxisUpper->SetVisible(true);
>             XaxisUpper->Update();
>             axesscene->AddItem(XaxisUpper);
>
>             // create axis on the right of top image - analogous to
> XaxisUpper above
>             VTK_CREATE(vtkAxis, YaxisRight);
>             YaxisRight->SetBehavior(1);
>             YaxisRight->SetPoint1(imageposition[0] + (int)
> imageextent[1]-imageextent[0], imageposition[1]);
>             YaxisRight->SetPoint2(imageposition[0] + (int)
> imageextent[1]-imageextent[0], (int) imageextent[3]-imageextent[2] +
> imageposition[1]);
>             YaxisRight->SetPosition(vtkAxis::RIGHT);
>             YaxisRight->GetPen()->SetWidth(2);
>             YaxisRight->SetMinimum(locYmin);
>             YaxisRight->SetMaximum(locYmax);
>
> YaxisRight->SetNumberOfTicks(Yaxis->GetTickPositions()->GetDataSize());
>             YaxisRight->GetGridPen()->SetColor(0,0,0,1);
>             YaxisRight->SetTickPositions(Yaxis->GetTickPositions());
>             YaxisRight->SetTickLabels(Yemptylabels);
>             YaxisRight->SetVisible(true);
>             YaxisRight->Update();
>             axesscene->AddItem(YaxisRight);
>
>             // now format and position colorbar
>             colorbar->SetLookupTable(lookupTable);
>             colorposition[0] = 1.0 - (1.0* barwidth)/windowsizeX;
>             colorposition[1] = (1.0* imageposition[1])/windowsizeY;
>             colorbar->SetWidth(0.5);
>             colorbar->SetHeight(1.0 - 2* colorposition[1]);
>             colorbar->SetPosition(colorposition);
>             colorbar->SetLabelFormat("%1.2E");
>             colorbar->PickableOff();
>             colorbar->SetMaximumWidthInPixels(barwidth);
>             colorbar->VisibilityOn();
>             colorbar->GetLabelTextProperty()->SetShadow(0);
>             colorbar->GetLabelTextProperty()->SetColor(0,0,0);
>
>             // register the axescene to the axesactor, which and point to
> the renderer
>             axesactor->SetScene(axesscene);
>             view->GetRenderer()->AddActor(axesactor);
>
>             // register the colorbar as an actor
>             view->GetRenderer()->AddActor(colorbar);
>
>             RenderWindow = view->GetRenderWindow();
>             RenderWindow->SetWindowId((HWND)Handle.ToInt64());
>
>             // set Interactor Style to RubberBand
>             VTK_CREATE(vtkInteractorStyleRubberBand2D, RubberBandStyle);
>             RubberBandStyle->SetRenderOnMouseMove(false);
>             VTK_CREATE(vtkCallbackCommand, SelectionChangedCallback);
>
> SelectionChangedCallback->SetCallback(SelectionChangedCallbackFunction);
>
> RubberBandStyle->AddObserver(vtkCommand::SelectionChangedEvent,SelectionChangedCallback);
>             RenderWindow->SetInteractor(WinInteractor);
>             RenderWindow->SetDoubleBuffer(1);
>             WinInteractor->SetInteractorStyle(RubberBandStyle);
>             WinInteractor->Initialize();
>       }
>
> *Von:* Eric E. Monson [mailto:emonson at cs.duke.edu]
> *Gesendet:* Dienstag, 7. Dezember 2010 16:13
> *An:* Frese Daniel Dr.
> *Cc:* Marcus D. Hanwell; vtkusers at vtk.org
> *Betreff:* Re: AW: [vtkusers] Positioning titles within vtkAxis
>
> Hey Daniel,
>
> Yes, this shouldn't be happening. Would you be able to send the section of
> your code that generates this chart? I'm curious how you're implementing the
> combination of ImageItem and axes. Maybe there is another way of
> accomplishing the same thing that wouldn't cause the overlap, or it might at
> least help us diagnose why the label placement routine isn't dealing with
> your case correctly.
>
> Also, just to be clear, was this generated with the current development
> (git) version, or with 5.6.1?
>
> Thanks,
> -Eric
>
>
> On Dec 7, 2010, at 8:29 AM, Frese Daniel Dr. wrote:
>
>
> Hello Eric, Marcus,
>
> before I explain my problem once more I just want to add that I find the
> charts functionality already quite useful.
> As I said I just updated my vtk stuff and I can imagine it must have been
> quite some work to get to this point.
>
> I appended a screenshot illustrating the problem. Since I don?t know how
> this appears on the mail list I just describe briefly.
> I have a scene with a vtkImageItem to show some 2D matrix data. Around the
> image I have axes (vtkAxis objects) with
> appropriate ticks, tick labels and axes titles. The problem is that the
> axes titles overlap with the tick labels. E.g. for the
> case of the X axis , the title should be lower such that it does not touch
> the labels, but there does not seem to
> be a way to do that as of now.
>
> A possible low level solution would be a way to specify some vertical
> (horizontal axis case) or some horizontal (vertical axis case) offset
> for the position of the titles (in pixel or font size units).
> In principle of course the vtkAxis object could calculate such an offset by
> itself, since it has access to both
> the labels? and the titles? text properties.
>
> What do you think ?
> Daniel
>
> *Von:* Eric E. Monson [mailto:emonson at cs.duke.edu]
> *Gesendet:* Dienstag, 7. Dezember 2010 13:54
> *An:* Frese Daniel Dr.
> *Cc:* vtkusers at vtk.org
> *Betreff:* Re: [vtkusers] Positioning titles within vtkAxis
>
> Hey Daniel,
>
> It does seem like SetLineOffset should do something like what you want, but
> I think they way the label text is applied with VerticalJustification
> probably nullifies any line offset setting. Line spacing shouldn't matter
> for a single line of text.
>
> So, the adjustments you want are just not implemented. Marcus, the
> developer, has worked hard to get the labels right, though, so if you have a
> use case where the labels are running into the axis ticks maybe you should
> describe the situation and send a screen shot ? it may be something that
> needs fixing.
>
> You're right that the charts are still under development, but some of the
> core functionality has settled down, and as you said, the current
> implementation is better than the 5.6.1 version.
>
> -Eric
>
> ------------------------------------------------------
> Eric E Monson
> Duke Visualization Technology Group
>
>
>
>
> On Dec 7, 2010, at 3:35 AM, Frese Daniel Dr. wrote:
>
>
>
> Hi all,
>
> I have a problem positioning an axis title relative to its vtkAxis object.
> Basically, if I draw a horizontal  X-axis, the assigned title is written
> such that it overlapps with the
> tick labels. Reading through the docs, I got the impression that I should
> be able to introduce a
> vertical offset between the drawn axis and the titel by using either a call
> to
> Xaxis->GetTitleProperties()->SetLineOffset(offset_in_pixel)
> or by
> Xaxis->GetTitleProperties()->SetLineSpacing(scale_factor).
> But neither call seems to have any effect.
> Moving from 5.6.1 to the latest vtk git source tree I noticed that the
> chart stuff seems to have
> improved greatly (most functions a joy to use !), but it still seems to be
> a work in progress.
> So am doing something stupid and do I miss something here or is this
> feature just not
> implemented yet ?
>
> Daniel
>
> 

> ------------------------------------------------------------------------------------------------------ >
> Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: > Traunreut
> Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard >
> Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / > Chairman),
> Michael Grimm, Matthias Fauser, Sebastian Tondorf

> E-Mail > Haftungsausschluss / E-Mail Disclaimer

>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 16550 bytes
Desc: not available
URL: 

From rodrigo.geof at gmail.com  Tue Dec  7 16:14:24 2010
From: rodrigo.geof at gmail.com (rodrigo)
Date: Tue, 7 Dec 2010 13:14:24 -0800 (PST)
Subject: [vtkusers] Rubber band zoom and pick on 2d image
Message-ID: <1291756464748-3296495.post@n5.nabble.com>


Hello, I'm new to vtk, what I want to do is to zoom on a 2D image using a
Rubber band box, and to have my mouse coordinates showed up.

I tried to modify one of the wiki examples, but I couldn't make the mouse
coordinates be showed up and have the rubber band  at the same time. Besides
that, I have no idea on how to make the rubber band zoom my image. I really
want to use the coordinates grabbed by the rubber box to zoom the image.

Here is my code:

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

// The mouse motion callback, to pick the image and recover pixel values
class vtkImageInteractionCallback1 : public vtkCommand
{
public:

	static vtkImageInteractionCallback1 *New() 
	{
		return new vtkImageInteractionCallback1; 
	}

	vtkImageInteractionCallback1() 
	{
		this->Viewer = 0;
		this->Picker = 0;
		this->Annotation = 0;
		this->PointData = vtkPointData::New();
	}

	~vtkImageInteractionCallback1()
	{
		this->Viewer = 0;
		this->Picker = 0;
		this->Annotation = 0;
		this->PointData->Delete();
	}

	void SetPicker(vtkPropPicker *picker) 
	{
		this->Picker = picker; 
	}

	void SetAnnotation(vtkCornerAnnotation *annotation) 
	{
		this->Annotation = annotation; 
	}

	void SetViewer(vtkImageViewer2 *viewer) 
	{
		this->Viewer = viewer; 
	}

	virtual void Execute(vtkObject *, unsigned long vtkNotUsed(event), void *)
	{
		//this->Viewer;
		vtkRenderWindowInteractor *interactor =
			this->Viewer->GetRenderWindow()->GetInteractor();
		vtkRenderer* renderer = this->Viewer->GetRenderer();
		vtkImageActor* actor = this->Viewer->GetImageActor();
		vtkImageData* image = this->Viewer->GetInput();
		vtkInteractorStyle *style = vtkInteractorStyle::SafeDownCast(
				interactor->GetInteractorStyle());

		image->Update();

		// Pick at the mouse location provided by the interactor
		this->Picker->Pick( interactor->GetEventPosition()[0],
				    interactor->GetEventPosition()[1],
				    0.0, renderer );

		// There could be other props assigned to this picker, so 
		// make sure we picked the image actor
		vtkAssemblyPath* path = this->Picker->GetPath();
		bool validPick = false;

		if( path )
		{
			vtkCollectionSimpleIterator sit;
			path->InitTraversal( sit );
			vtkAssemblyNode *node;
			for( int i = 0; i < path->GetNumberOfItems() && !validPick; ++i )
			{
				node = path->GetNextNode( sit );
				if( actor == vtkImageActor::SafeDownCast( node->GetViewProp() ) )
				{
					validPick = true;
				}
			}
		}

		if( !validPick )
		{
			this->Annotation->SetText( 0, "Off Image" );
			interactor->Render();
			// Pass the event further on
			style->OnMouseMove();
			return;
		}

		// Get the world coordinates of the pick
		double pos[3];
		this->Picker->GetPickPosition( pos );
		// Fixes some numerical problems with the picking
		double *bounds = actor->GetDisplayBounds();
		int axis = this->Viewer->GetSliceOrientation();
		pos[axis] = bounds[2*axis];

		vtkPointData* pd = image->GetPointData();
		if( !pd )
		{
			return;
		}

		this->PointData->InterpolateAllocate( pd, 1, 1 );

		// Use tolerance as a function of size of source data
		double tol2 = image->GetLength();
		tol2 = tol2 ? tol2*tol2 / 1000.0 : 0.001;

		// Find the cell that contains pos
		int subId;
		double pcoords[3], weights[8];
		vtkCell* cell = image->FindAndGetCell(
				pos, NULL, -1, tol2, subId, pcoords, weights );
		if( cell )
		{
			// Interpolate the point data
			this->PointData->InterpolatePoint( pd, 0, cell->PointIds, weights );
			int components =
				this->PointData->GetScalars()->GetNumberOfComponents();
			double* tuple = this->PointData->GetScalars()->GetTuple( 0 );

			std::string message = "Location: ( ";
			message += vtkVariant( pos[0] ).ToString();
			message += ", ";
			message += vtkVariant( pos[1] ).ToString();
			message += ", ";
			message += vtkVariant( pos[2] ).ToString();
			message += " )\nValue: ( ";

			for( int c = 0; c < components; ++c )
			{
				message += vtkVariant( tuple[ c ] ).ToString();
				if( c != components - 1 ) 
				{
					message += ", ";
				}
			}
			message += " )";
			this->Annotation->SetText( 0, message.c_str() );
			interactor->Render();
			style->OnMouseMove();
		}
	}

private:

	// Pointer to the viewer
	vtkImageViewer2 *Viewer;

	// Pointer to the picker
	vtkPropPicker *Picker;

	// Pointer to the annotation
	vtkCornerAnnotation *Annotation;

	// Interpolator
	vtkPointData* PointData;
};

 
void SelectionChangedCallbackFunction ( vtkObject* vtkNotUsed(caller), 
					long unsigned int vtkNotUsed(eventId), void* vtkNotUsed(clientData),
void* callData )
{
	std::cout << "SelectionChanged callback" << std::endl;

	unsigned int* rect = reinterpret_cast ( callData );
	unsigned int pos1X = rect[0];
	unsigned int pos1Y = rect[1];
	unsigned int pos2X = rect[2];
	unsigned int pos2Y = rect[3];

	std::cout << "Start x: " << pos1X << " Start y: " << pos1Y 
		<< " End x: " << pos2X << " End y: " << pos2Y << std::endl;
}

int main ( int argc, char* argv[] )
{
	//Verify input arguments
	if ( argc != 2 )
	{
		std::cout << "Usage: " << argv[0] 
			<< " Filename(jpeg)" << std::endl;
		return EXIT_FAILURE;
	}

	//Parse input argument
	std::string inputFilename = argv[1];

	//Read the image
	vtkSmartPointer jpegReader =
		vtkSmartPointer::New();
	if( !jpegReader->CanReadFile( inputFilename.c_str() ) )
	{
		std::cout << argv[0] << ": Error reading file "
			<< inputFilename << endl << "Exiting..." << endl;
		return EXIT_FAILURE;
	}
	jpegReader->SetFileName ( inputFilename.c_str() );

	// Picker to pick pixels
	vtkSmartPointer propPicker =
		vtkSmartPointer::New();
	propPicker->PickFromListOn();

	// Give the picker a prop to pick
	vtkSmartPointer imageViewer =
		vtkSmartPointer::New();
	propPicker->AddPickList( imageViewer->GetImageActor() );

	// Visualize
	vtkSmartPointer renderWindowInteractor =
		vtkSmartPointer::New();
	imageViewer->SetInputConnection( jpegReader->GetOutputPort() );
	imageViewer->SetupInteractor( renderWindowInteractor );
	imageViewer->SetSize( 600, 600 );

	vtkRenderer* renderer = imageViewer->GetRenderer();
	renderer->ResetCamera();
	renderer->GradientBackgroundOn();
	renderer->SetBackground(0,0,0);
	renderer->SetBackground2(1,1,1);

	// Annotate the image with window/level and mouse over pixel information
	vtkSmartPointer cornerAnnotation =
		vtkSmartPointer::New();
	cornerAnnotation->SetLinearFontScaleFactor( 2 );
	cornerAnnotation->SetNonlinearFontScaleFactor( 1 );
	cornerAnnotation->SetMaximumFontSize( 20 );
	cornerAnnotation->SetText( 0, "Off Image" );
	cornerAnnotation->SetText( 3, "\n" );
	cornerAnnotation->GetTextProperty()->SetColor( 1,0,0);

	imageViewer->GetRenderer()->AddViewProp( cornerAnnotation );

	// Callback listens to MouseMoveEvents invoked by the interactor's style
	vtkSmartPointer callback =
		vtkSmartPointer::New();
	callback->SetViewer( imageViewer );
	callback->SetAnnotation( cornerAnnotation );
	callback->SetPicker( propPicker );

	// InteractorStyleImage allows for the following controls:
	// 1) middle mouse + move = camera pan
	// 2) left mouse + move = window/level
	// 3) right mouse + move = camera zoom
	// 4) middle mouse wheel scroll = zoom
	// 5) 'r' = reset window/level
	// 6) shift + 'r' = reset camera
	vtkInteractorStyleImage* imageStyle = imageViewer->GetInteractorStyle();
	imageStyle->AddObserver( vtkCommand::MouseMoveEvent, callback );
	
	vtkSmartPointer selectionChangedCallback = 
		vtkSmartPointer::New();
	selectionChangedCallback->SetCallback ( SelectionChangedCallbackFunction );

	vtkSmartPointer style = 
		vtkSmartPointer::New();
	style->AddObserver ( vtkCommand::SelectionChangedEvent,
selectionChangedCallback );
	renderWindowInteractor->SetInteractorStyle( style );

	renderWindowInteractor->Initialize();
	renderWindowInteractor->Start();

	return EXIT_SUCCESS;
}

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Rubber-band-zoom-and-pick-on-2d-image-tp3296495p3296495.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From sean at rogue-research.com  Tue Dec  7 16:35:49 2010
From: sean at rogue-research.com (Sean McBride)
Date: Tue, 7 Dec 2010 16:35:49 -0500
Subject: [vtkusers] bug 0009618 and UTF 8 text rendering fix question
In-Reply-To: 
References: <20101207184254.169257625@mail.rogue-research.com>
	
	
Message-ID: <20101207213549.2041125906@mail.rogue-research.com>

On Tue, 7 Dec 2010 15:27:03 -0500, Marcus D. Hanwell said:

>>> Just to clarify, what encoding should be given to vtkTextActor::SetInput
>>> ()? ?Last I tried, it seemed to expect ISO-8859-1. ?Certainly a step up
>>> from ASCII! ?Is the long term plan for it to accept UTF8?
>>
>> I think it is best if VTK strings use the system default encoding, rather
>> than utf-8. ?For unicode there is always vtkUnicodeString. ?More classes
>> should be adapted to take vtkUnicodeString as input (but only, of course,
>> if they are internally capable of using/rendering unicode).
>>
>> But I'm flexible. ?Really, I'm just pushing for VTK's string handling to be
>> more similar to Python's. ?;)
>>
>I am not too concerned about aligning with Python's string handling,
>but agree with David - I think we should be adjusting existing classes
>to deal with and take vtkUnicodeString, which can take UTF8 strings
>for construction.

Agreed.

>It would probably be simplest to interpret all const
>char* and vtkStdString as UTF8 when it came to rendering, as minimal
>code/API changes would be required.

I agree here too, but such a change would appear to break binary
compatibility.  Today's vtkTextActor::SetInput() expects ISO-8859-1 (at
least on my system), if we change it to expect UTF8 we break existing
clients of VTK.

In any case, API that take char* should document which encoding they
expect.  Consider the tiny attached patch.

>If you look at vtkContext2D and friends, where I have been prototyping
>the UTF8 string handling and Unicode rendering, I have used
>vtkUnicodeString as the function argument.

Sounds great.

>I certainly welcome people's thoughts on this. Working through the
>relevant classes, and adding vtkUnicodeString API to them where and
>when they can really render Unicode seems like a reasonable approach
>to me.

vtkTextActor appears to be in need of vtkUnicodeString support...

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montr?al, Qu?bec, Canada
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 821 bytes
Desc: not available
URL: 

From sistephan at gmail.com  Tue Dec  7 21:48:11 2010
From: sistephan at gmail.com (Sam)
Date: Tue, 7 Dec 2010 18:48:11 -0800 (PST)
Subject: [vtkusers] XOR of 2 Polydata
In-Reply-To: <1CEC817B-99A9-462D-9024-591F86FE5919@cs.duke.edu>
References: <1291693975186-3295249.post@n5.nabble.com>
	<1CEC817B-99A9-462D-9024-591F86FE5919@cs.duke.edu>
Message-ID: <1291776491624-3296857.post@n5.nabble.com>


Thanks Eric.  I read through the article.  However, I need to use the
existing VTK classes only because I'm using the C# version of VTK.  

Does anyone have ideas on how to approach this?  

For example,

Given a Polydata, I have translated it in the X direction.  Now I want to
intersect the translated polydata object with the original and get all the
points that are NOT in the intersect.  
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/XOR-of-2-Polydata-tp3295249p3296857.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From oka at bpe.es.osaka-u.ac.jp  Wed Dec  8 00:51:22 2010
From: oka at bpe.es.osaka-u.ac.jp (oka)
Date: Wed, 08 Dec 2010 14:51:22 +0900
Subject: [vtkusers] cell picking
Message-ID: <20101208144251.2516.F353B791@bpe.es.osaka-u.ac.jp>

Dear VTK users,

When using example of cellPicking 
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Picking/CellPicking
I want to erase highlight when I pick again the same cell once
selected. Is it possible ?
I met cases  GetCellID value change to "0" if double clicked.
Is it correct ?
Normally GetCellID is ID number of selected cell id, I know.

Best regards,

Oka
-- 
oka 



From KRuvva at robodoc.com  Wed Dec  8 02:21:35 2010
From: KRuvva at robodoc.com (Rao Ruvva)
Date: Tue, 7 Dec 2010 23:21:35 -0800
Subject: [vtkusers] DICOM reader
Message-ID: 

What is the best way to read DICOM CT data that has non-uniform slice spacing along Z. Need to preserve the z spacing while storing and viewing. I have CT scan data for femoral bone where proximal femur (femoral head) and distal femur (near knee joint) were scanned and the shaft was ignored to avoid radiation exposure.  vtkDICOMImageReader does not maintain the slice z locations. I want preserve the slices z locations when I render them. Any ideas?

Thanks
Rao

From yxp233 at postech.ac.kr  Wed Dec  8 05:23:46 2010
From: yxp233 at postech.ac.kr (Xiaopeng Yang)
Date: Wed, 8 Dec 2010 19:23:46 +0900
Subject: [vtkusers] Image registration between CT and MRI
In-Reply-To: 
References: 
Message-ID: <00d001cb96c1$ff26f9b0$fd74ed10$@ac.kr>

Hello,

 

Is it possible for image registration between CT and MRI data sets? If so,
how to make it?

 

Thanks,

Xiaopeng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From ali.mahmoud.habib at gmail.com  Wed Dec  8 05:28:07 2010
From: ali.mahmoud.habib at gmail.com (Ali Habib)
Date: Wed, 8 Dec 2010 12:28:07 +0200
Subject: [vtkusers] STL with parts inside
Message-ID: 

Hi all,

when I save the vtkpolydata to stl file , the vtkstwriter save it as one
part , what if I want to dived it to many parts how can I do that please

best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From aracha2010 at gmail.com  Wed Dec  8 06:34:31 2010
From: aracha2010 at gmail.com (Rachel)
Date: Wed, 8 Dec 2010 03:34:31 -0800 (PST)
Subject: [vtkusers] 3D surface to 2D silhouette---
In-Reply-To: <20091204150819.85510@gmx.net>
References: <20091204124630.82890@gmx.net> <20091204150819.85510@gmx.net>
Message-ID: <1291808071554-3297216.post@n5.nabble.com>


Hi,
is there any way to go back from 2D silhouette to 3D ?
i need to know 3D point that corresponds to each pixel .

Thank you 



-- 
View this message in context: http://vtk.1045678.n5.nabble.com/3D-surface-to-2D-silhouette-tp1227388p3297216.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From aracha2010 at gmail.com  Wed Dec  8 06:34:32 2010
From: aracha2010 at gmail.com (Rachel)
Date: Wed, 8 Dec 2010 03:34:32 -0800 (PST)
Subject: [vtkusers] 3D surface to 2D silhouette---
In-Reply-To: <20091204150819.85510@gmx.net>
References: <20091204124630.82890@gmx.net> <20091204150819.85510@gmx.net>
Message-ID: <1291808072395-3297217.post@n5.nabble.com>


Hi,
is there any way to go back from 2D silhouette to 3D ?
i need to know 3D point that corresponds to each pixel .

Thank you 



-- 
View this message in context: http://vtk.1045678.n5.nabble.com/3D-surface-to-2D-silhouette-tp1227388p3297217.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From frese at heidenhain.de  Wed Dec  8 06:48:20 2010
From: frese at heidenhain.de (Frese Daniel Dr.)
Date: Wed, 8 Dec 2010 12:48:20 +0100
Subject: [vtkusers] Positioning titles within vtkAxis
In-Reply-To: <91FBF48B-DB54-4474-9FCB-A821117CEFD2@cs.duke.edu>
References: <758150D667C235458DE231BB50B9A2B30AD0BE1983@de01ex07.GLOBAL.JHCN.NET>
	<1EF31637-776B-40E6-BFD1-05E0141E4AA4@cs.duke.edu>
	<758150D667C235458DE231BB50B9A2B30AD0BE1DA8@de01ex07.GLOBAL.JHCN.NET>
	<19688F91-1AD1-4231-8CE4-E68E3AEF1B46@cs.duke.edu>
	<758150D667C235458DE231BB50B9A2B30AD1026E25@de01ex07.GLOBAL.JHCN.NET>
	<91FBF48B-DB54-4474-9FCB-A821117CEFD2@cs.duke.edu>
Message-ID: <758150D667C235458DE231BB50B9A2B30AD102732A@de01ex07.GLOBAL.JHCN.NET>

Hi Eric,

thanks for pointing me to vtkScalarsToColorsItem. This looks like a much more natural solution
than stitching everything together, as I did. I tried it and it works - thanks to Marcus's last addition
to the vtkChartXY (vtkChartsXY::SetAutoSize I am even able to control the size of the chart for e.g.
reserving some space for a separate colorbar. And in this case the axes titles are placed correctly.

I do have however one problem remaining. Obviously the chart takes some space for its axes labels,
ticks and titles, so the displayed image actually takes less space than I assign to the whole chart via SetSize().
Further, the space for the image could change in dependence of the axes labels, so the mapping from
pixel coordinates to plot coordinates is not always the same, but has offsets depending on
e.g. the label font size, length of number notation etc.
But I would like to know (and control) the exact  position of the displayed image in pixels:
First it makes data analysis using the rubber band interactor easier, since as far as I understand I get the
coordinates of the drawn rectangles in pixels coordinates, but not in plot coordinates (as I understand,
this can not be different, as the interactor is tied to the render window, not to the chart).
Second (less important) in my application it just looks better if the position of the axes does change
from shot to shot (arguably this is a matter personal preferences...)

So is there a way to find out the space for the axes labels/ticks/titles for a given chart ? I tried to read out
the "Point1" of the axes, but unfortunately this seems to be given in local coordinates and not in
respect to the overall scene. Methods like MapTo/FromParent/Scene sound like they should do the
trick (the doc is not exactly extensive on those...), but they did not return me anything usable. Also I tried to find
the place where this is calculated in the source, but failed miserably. If you (or anybody else) could give
me some hints on this, that would be really great.

Daniel



Von: Eric E. Monson [mailto:emonson at cs.duke.edu]
Gesendet: Dienstag, 7. Dezember 2010 19:06
An: Frese Daniel Dr.
Cc: Marcus D. Hanwell; vtkusers at vtk.org
Betreff: Re: AW: AW: [vtkusers] Positioning titles within vtkAxis

Hey Daniel,

There seems to be something wrong with the painting for vtkAxis when used by itself in a scene. I'm not sure why we don't see this behavior when these axes are used within the charts. Hopefully Marcus will be able to take a look. You can see the problem even in the attached simple Python script.

One thing I noticed that maybe Marcus can comment on: Things like vtkChartXY do an Update on themselves before Paint. If in this script you don't call Update explicitly on the axis objects they paint the axis line and title, but not the ticks and their labels. Maybe it would be good to add and Update call at the beginning of vtkAxis::Paint?

Daniel, something you might want to consider instead of the method you're using now is a trick others are using for vtkScalarsToColorsItem and its subclasses: they make a subclass of vtkPlot which has a vtkImageData as a private Texture variable, and then paints the texture within the plot's bounds. This way they can instantiate a vtkChartXY and use AddPlot() to add what is basically an image painter, and then vtkChartXY takes care of the axes internally. Just an idea that I've seen the developers using.

Anyway, hopefully Marcus or someone else will be able to take a look at this sometime soon, but I know he's very busy right now.

Talk to you later,
-Eric

# =======
import vtk

view = vtk.vtkContextView()
view.GetRenderWindow().SetSize(400, 300)

axis1 = vtk.vtkAxis()
axis1.SetPoint1(75,75)
axis1.SetPoint2(75,225)
axis1.SetPosition(vtk.vtkAxis.LEFT)
axis1.SetTitle('YAxis')
axis1.Update()
view.GetScene().AddItem(axis1)

axis2 = vtk.vtkAxis()
axis2.SetPoint1(75,75)
axis2.SetPoint2(325,75)
axis2.SetPosition(vtk.vtkAxis.BOTTOM)
axis2.SetTitle('XAxis')
axis2.Update()
view.GetScene().AddItem(axis2)

view.Render()
view.GetInteractor().Start()
# =======

[cid:image001.png at 01CB96CB.2DB6BFF0]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 16550 bytes
Desc: image001.png
URL: 
-------------- next part --------------

------------------------------------------------------------------------------------------------------
Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut
Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard
Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman),
Michael Grimm, Matthias Fauser, Sebastian Tondorf

E-Mail Haftungsausschluss / E-Mail Disclaimer


From dave.partyka at kitware.com  Wed Dec  8 07:35:09 2010
From: dave.partyka at kitware.com (Dave Partyka)
Date: Wed, 8 Dec 2010 07:35:09 -0500
Subject: [vtkusers] Re : [Paraview] ANN: ParaView 3.10 branch & VTK 5.8
	branch
In-Reply-To: <173780.84309.qm@web26108.mail.ukl.yahoo.com>
References: 
	
	<173780.84309.qm@web26108.mail.ukl.yahoo.com>
Message-ID: 

The master branch of the git repo should have this fix. When we branch for
the release (which will happen in the next few days) the current contents of
master (building as version 3.9) will become 3.10.

On Wed, Dec 8, 2010 at 2:36 AM, R M  wrote:

> Hello,
>
> Where can we get the 3.10 version ? I need to have the Cell  Data to Point
> Data that crashs on the 3.9.0 win 32.
> it seems to be fixed in the 3.10 version ->
> http://www.paraview.org/Bug/view.php?id=11520
>
> Thank you.
>
> ------------------------------
> *De :* Dave Partyka 
> *? :* ParaView ; ParaView Developers <
> paraview-developers at paraview.org>; vtk ; VTK Developers
> 
> *Envoy? le :* Lun 6 d?cembre 2010, 20h 51min 57s
> *Objet :* Re: [Paraview] ANN: ParaView 3.10 branch & VTK 5.8 branch
>
> Just a heads up. We will likely be branching tomorrow.
>
> Thank you,
>
> On Mon, Nov 29, 2010 at 1:30 PM, Dave Partyka wrote:
>
>> Hello all,
>>
>> We will be branching ParaView and VTK for their respective releases soon
>> (probably this week). This is a heads up that finished features, bug fixes,
>> etc., that are a part of these releases should be merged in the coming days.
>>  Once the branches are created any further changes that need to be part of
>> the releases will need to be manually cherry-picked onto the release
>> branches.
>>
>> Also, If anyone is responsible for failing tests on the dashboards we
>> would strongly encourage you to please take a look at them.
>>
>> Thank you,
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From nclemeur at gmail.com  Wed Dec  8 07:38:39 2010
From: nclemeur at gmail.com (nclemeur)
Date: Wed, 8 Dec 2010 04:38:39 -0800 (PST)
Subject: [vtkusers] vtkChartXY picking
Message-ID: <1291811919653-3297279.post@n5.nabble.com>


Hello,

I am quite novice with vtk and I would like some advice on how to implement
picking in a vtkChartXY.

For example I would like to select a plot when clicking on it and then
hightlight it in a similar way as it is done when selecting a rectangular
window. This would provides me with a way to popup a menu  (I am using
wxWidgets) when the user then right click on the curve to customise the
curve color,...

Ideally I would like to do something similar with the axes so that I can
popup  a menu to change the ranges, and so on...

For the time being I am looking at the vtk side of it. I'll investigate the
integration with wxWidgets later on.

I have already tried a few things like implementing my own InteractorStyle
(based on vtkInteractorStyleRubberBand2D), attached SelectionChanged
observers on the plots... Without a lot of success.

Any hints on that would be great.

Cheers

Nicolas
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp3297279p3297279.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From dimitar.ivanov at musala.com  Wed Dec  8 08:03:52 2010
From: dimitar.ivanov at musala.com (dstivanov)
Date: Wed, 8 Dec 2010 05:03:52 -0800 (PST)
Subject: [vtkusers] vtkChartXY picking
In-Reply-To: <1291811919653-3297279.post@n5.nabble.com>
References: <1291811919653-3297279.post@n5.nabble.com>
Message-ID: <1291813432427-3297305.post@n5.nabble.com>


Hi Nicolas,

I offer you to use vtkPropPicker. The idea of all the picker classes is to
give you different vtkObject(prop, area, cell, volume, world point
coordinates) according to the 2D coordinates on the screen(on the rendering
window to be more precise). You can see the hierarchy of the
vtkAbstractPicker to get familiar with the different types of pickers. 

I think that if you use the proper picker you can take the element, situated
under the mouse pointer 2D coordinates(you will understand what I mean when
you read the documentation of the pickers) and after that manipulate it as
you wish. 

Greetings,
Mitko
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp3297279p3297305.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From prakeshofficial at gmail.com  Wed Dec  8 08:20:02 2010
From: prakeshofficial at gmail.com (rakesh patil)
Date: Wed, 8 Dec 2010 18:50:02 +0530
Subject: [vtkusers] How to avoid VTK warning window?
Message-ID: 

Hello,

While displaying vectors sometimes, a vtk window pops up with a warning. Is
there any way to avoid or disable this popping up of vkt warning window..??

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From daviddoria at gmail.com  Wed Dec  8 08:59:38 2010
From: daviddoria at gmail.com (David Doria)
Date: Wed, 8 Dec 2010 08:59:38 -0500
Subject: [vtkusers] How to avoid VTK warning window?
In-Reply-To: 
References: 
Message-ID: 

On Wed, Dec 8, 2010 at 8:20 AM, rakesh patil  wrote:
> Hello,
>
> While displaying vectors sometimes, a vtk window pops up with a warning. Is
> there any way to avoid or disable this popping up of vkt warning window..??
>
> Thanks

What does the warning say?

David


From david.gobbi at gmail.com  Wed Dec  8 09:00:51 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Wed, 8 Dec 2010 07:00:51 -0700
Subject: [vtkusers] How to avoid VTK warning window?
In-Reply-To: 
References: 
Message-ID: 

Hi Rakesh,

You can replace VTK's default output window with one that writes the errors
to a file:

vtkOutputWindow *w = vtkFileOutputWindow::New();
w->SetFileName("vtk_errors.txt")
vtkOutputWindow::SetInstance(w);
w->Delete(); // now SetInstance owns the reference

  David


On Wed, Dec 8, 2010 at 6:20 AM, rakesh patil wrote:

> Hello,
>
> While displaying vectors sometimes, a vtk window pops up with a warning. Is
> there any way to avoid or disable this popping up of vkt warning window..??
>
> Thanks
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From aracha2010 at gmail.com  Wed Dec  8 09:35:07 2010
From: aracha2010 at gmail.com (Rachel)
Date: Wed, 8 Dec 2010 06:35:07 -0800 (PST)
Subject: [vtkusers] Coordinate conversions (World-Display)
In-Reply-To: 
References: <564BD474-1FC0-427D-A0F9-1A757C9973AD@bwh.harvard.edu>
	
	
Message-ID: <1291818907537-3297433.post@n5.nabble.com>


Hello, 
I think this is similar what i m looking for but i don"t know how to apply
these functions. My problem is as follow:
i transformed 3D contour into image. And i need to go back to 3D. Indeed i
need to to know each pixel correspond to which points in 3D contour.
Any suggestion ?
Please i need your help, it is urgent.

Many Thanks  
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Coordinate-conversions-World-Display-tp2808312p3297433.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From emonson at cs.duke.edu  Wed Dec  8 09:51:18 2010
From: emonson at cs.duke.edu (Eric E. Monson)
Date: Wed, 8 Dec 2010 09:51:18 -0500
Subject: [vtkusers] vtkChartXY picking
In-Reply-To: <1291811919653-3297279.post@n5.nabble.com>
References: <1291811919653-3297279.post@n5.nabble.com>
Message-ID: <26188332-E371-4CEE-B032-EA857A9D77C7@cs.duke.edu>

Hey Nicolas,

I'm not quite sure how to solve your problem, but I wanted to let you know that the 2D API classes (which includes the Charts like vtkChartXY) do not use the standard VTK interactors for their event handling, so that's why your tests with changing interactor style didn't work. The 2D API is based on items placed in a scene, and each of those items handles its own drawing and mouse events. The lines and marks on the plots, though, are just drawn with OpenGL, and are not items themselves that handle events. 

I'm not an expert in this, but to do what you want with the way the Charts and 2D API are implemented right now you might need to go into the classes themselves and add in custom events that fire when things like axes are hit. I'm not sure about things like line colors. There is already code in the charts that is used for tooltips that finds the closest points to the mouse, so that may be useful.

Sorry I couldn't be more direct help,
-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Dec 8, 2010, at 7:38 AM, nclemeur wrote:

> 
> Hello,
> 
> I am quite novice with vtk and I would like some advice on how to implement
> picking in a vtkChartXY.
> 
> For example I would like to select a plot when clicking on it and then
> hightlight it in a similar way as it is done when selecting a rectangular
> window. This would provides me with a way to popup a menu  (I am using
> wxWidgets) when the user then right click on the curve to customise the
> curve color,...
> 
> Ideally I would like to do something similar with the axes so that I can
> popup  a menu to change the ranges, and so on...
> 
> For the time being I am looking at the vtk side of it. I'll investigate the
> integration with wxWidgets later on.
> 
> I have already tried a few things like implementing my own InteractorStyle
> (based on vtkInteractorStyleRubberBand2D), attached SelectionChanged
> observers on the plots... Without a lot of success.
> 
> Any hints on that would be great.
> 
> Cheers
> 
> Nicolas
> -- 
> View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp3297279p3297279.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



From ecappeau at phenix-systems.com  Mon Dec  6 11:12:51 2010
From: ecappeau at phenix-systems.com (Eddy Cappeau)
Date: Mon, 06 Dec 2010 17:12:51 +0100
Subject: [vtkusers] ImageToPolyData example
Message-ID: <4CFD0B83.5010104@phenix-systems.com>

Hi !

Does anybody managed to run the ImageToPolyData example ?
I've tried to run It but it crash here :

imageToPolyDataFilter->Update();

Beside that, imageToPolyDataFilter seems unused.

-- 
Eddy


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From daviddoria at gmail.com  Wed Dec  8 10:42:04 2010
From: daviddoria at gmail.com (David Doria)
Date: Wed, 8 Dec 2010 10:42:04 -0500
Subject: [vtkusers] ImageToPolyData example
In-Reply-To: <4CFD0B83.5010104@phenix-systems.com>
References: <4CFD0B83.5010104@phenix-systems.com>
Message-ID: 

On Mon, Dec 6, 2010 at 11:12 AM, Eddy Cappeau
 wrote:
> Hi !
>
> Does anybody managed to run the ImageToPolyData example ?
> I've tried to run It but it crash here :
>
> imageToPolyDataFilter->Update();
>
> Beside that, imageToPolyDataFilter seems unused.
>
> --
> Eddy

Is this what you were looking at?

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageToPolyDataFilter

David


From darshanpai at gmail.com  Wed Dec  8 12:48:11 2010
From: darshanpai at gmail.com (Darshan Pai)
Date: Wed, 8 Dec 2010 12:48:11 -0500
Subject: [vtkusers] Image registration between CT and MRI
In-Reply-To: <00d001cb96c1$ff26f9b0$fd74ed10$@ac.kr>
References: 
	<00d001cb96c1$ff26f9b0$fd74ed10$@ac.kr>
Message-ID: 

You can go through the Insight examples on mutual Information registration .


On Wed, Dec 8, 2010 at 5:23 AM, Xiaopeng Yang  wrote:

>  Hello,
>
>
>
> Is it possible for image registration between CT and MRI data sets? If so,
> how to make it?
>
>
>
> Thanks,
>
> Xiaopeng
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From aracha2010 at gmail.com  Wed Dec  8 15:22:42 2010
From: aracha2010 at gmail.com (Rachel)
Date: Wed, 8 Dec 2010 12:22:42 -0800 (PST)
Subject: [vtkusers] coordinate transformation between polydata and image
	data
In-Reply-To: 
References: <887B391A-2B68-4D6F-9EEA-1C7BF6A8716F@u.washington.edu>
	
Message-ID: <1291839762279-3297909.post@n5.nabble.com>


How to compute spacing? i have 3D object and i save it as 2D image (.png) for
each  pixel, i want to compute the corresponding x, y , z in 3D space.
Many thanks
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/coordinate-transformation-between-polydata-and-image-data-tp3216899p3297909.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From daviddoria at gmail.com  Wed Dec  8 16:09:06 2010
From: daviddoria at gmail.com (David Doria)
Date: Wed, 8 Dec 2010 16:09:06 -0500
Subject: [vtkusers] coordinate transformation between polydata and image
	data
In-Reply-To: <1291839762279-3297909.post@n5.nabble.com>
References: <887B391A-2B68-4D6F-9EEA-1C7BF6A8716F@u.washington.edu>
	
	<1291839762279-3297909.post@n5.nabble.com>
Message-ID: 

imageData->FindPoint(x,y,z) will give you the index (vtkTypeId) of the
pixel/point in the ImageData that (x,y,z) is closest to.

I wrote a patch a while ago to convert from this linear index back to
(i,j,k) image coordinates, but I forgot to add reviewers!
http://review.source.kitware.com/#change,466 Hopefully you can look
for this soon.

David


From Martin_Klamm at gmx.de  Wed Dec  8 20:47:50 2010
From: Martin_Klamm at gmx.de (BountyHuntA)
Date: Wed, 8 Dec 2010 17:47:50 -0800 (PST)
Subject: [vtkusers] Read DICOM memory stream to use in VTK
Message-ID: <1291859270217-3298355.post@n5.nabble.com>


Hello.

I develop a DICOM rendering with VTK in connection with a JAVA Web-Service.
The user send some DICOM images to the Web-Service and JNA passes a pointer
to the DICOM files in the RAM from the JAVA side to C++-VTK.
I have now the problem that GDCM can only read real files from HDD
(setFileNames etc.).
Is there a opportunity to read in a char* or istream/ ostream/ stringstream
containing the DICOM informations with GDCM?

Thank you
Martin
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Read-DICOM-memory-stream-to-use-in-VTK-tp3298355p3298355.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From mmroden at gmail.com  Wed Dec  8 22:21:20 2010
From: mmroden at gmail.com (Mark Roden)
Date: Wed, 8 Dec 2010 19:21:20 -0800
Subject: [vtkusers] vtk 5.6.1 on a mac wrapped in Java
In-Reply-To: 
References: 
	
	
	
	
	
	
Message-ID: 

So, any idea on how to fix this issue?  Getting

ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/vtk-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx,
line 802
vtkStreamingDemandDrivenPipeline (0x133f80aa0): Input for connection
index 0 on input port index 0 for algorithm
vtkImageChangeInformation(0x133f7fcc0) is NULL, but a vtkImageData is
required.

right after trying to run a vtkChangeImageInformation pipeline.

I tried this also using the straight vtk DICOM reader (rather than the
gdcm reader), and it gives the same error, but at a different point in
the app.  Basically, anything that's pipeline-based appears to be
thinking that the inputs haven't been set, which is pretty much all of
the vtk stuff I have in there.

Thanks for any help,
Mark

On Thu, Dec 2, 2010 at 11:32 AM, Sebastien Jourdain
 wrote:
> the Unix makefile is fine.
> To setup release you just need to write Release in the CMake config
> for the build type (CMAKE_BUILD_TYPE).
> You can switch also the optimisation to -02 instead of -03 in the
> ..._FLAGS_RELEASE options.
>
> But I doubt that it could come from that.
>
> Seb
>
>
> On Thu, Dec 2, 2010 at 1:49 PM, Mark Roden  wrote:
>> Maybe the problem is the build method I'm using for the libraries.
>>
>> I'm building both gdcm and vtk using Unix makefiles on the mac, since
>> the xcode stuff isn't working.
>>
>> How can I make sure that I'm building release versions on both
>> machines? ?There's a suggestion here:
>> http://comments.gmane.org/gmane.comp.lib.mitk.user/1052
>>
>> that this bug could be due to compilation problems.
>>
>> Specifically, I'd like for 64 bit release versions to be made. ?On
>> XCode, that's a dropdown selection, but typing 'make release' results
>> in 'don't know how to build release, stop', and I'm not sure what
>> 'make all' is doing.
>>
>> Thanks,
>> Mark
>>
>> On Thu, Dec 2, 2010 at 7:00 AM, Mark Roden  wrote:
>>> The java code works fine on windows, it's the same code, shared via
>>> git on the different machines
>>>
>>> I'm not trying to inherit. ?vtkImageChangeInformation is exposed by
>>> the vtk java wrapping, but the vtlImageData I'm passing in isn't
>>> working.
>>>
>>> This code works in java on windows. ?It doesn't on mac. ?I use the
>>> same libraries underneath, or at least, the same versions of gdcm and
>>> vtk are built and used.
>>>
>>> On Thu, Dec 2, 2010 at 6:53 AM, Sebastien Jourdain
>>>  wrote:
>>>> I was talking about your Java code that was using VTK, not VTK itself.
>>>>
>>>> Moreover, I think that you can not inherit from VTK classes in Java...
>>>>
>>>> Seb
>>>>
>>>> On Thu, Dec 2, 2010 at 9:17 AM, Mark Roden  wrote:
>>>>> Hi Sebastien,
>>>>>
>>>>> I can't use the windows binary on the mac-- the vtk underpinnings are
>>>>> still C++, which means that it's compiled into a dll on windows, which
>>>>> means (as far as I know, and as my experiments confirm), it doesn't
>>>>> work on a mac. ?I have to recompile vtk for the mac directly. ?The
>>>>> java wrappings (the jar) should be identical, though. ?Just to be
>>>>> safe, I'm using the mac-generated jars now.
>>>>>
>>>>> I am sure that the filenames have no spaces or special strings. ?If
>>>>> you look at the line
>>>>>
>>>>> ? ? String theString2 = sortedFT.get(i)
>>>>>
>>>>> I can stop there with the debugger and see the contents of the string,
>>>>> and it's clean.
>>>>>
>>>>> For what it's worth, Fred Fred asked about this error message a year
>>>>> ago, and he got no response:
>>>>> http://public.kitware.com/pipermail/vtkusers/2009-October/102935.html
>>>>> I don't know if he was in the same situation as me, though.
>>>>>
>>>>> Thanks,
>>>>> Mark
>>>>>
>>>>> On Thu, Dec 2, 2010 at 5:02 AM, Sebastien Jourdain
>>>>>  wrote:
>>>>>> Hi Mark,
>>>>>>
>>>>>> did you try your windows (Java) binary on your mac to see if you get
>>>>>> the same behavior ?
>>>>>> Are you sure that on your mac, the filename provided to the reader are
>>>>>> correct ? (no space or special string ?)
>>>>>>
>>>>>> Seb
>>>>>>
>>>>>> On Thu, Dec 2, 2010 at 12:01 AM, Mark Roden  wrote:
>>>>>>> Hi all,
>>>>>>>
>>>>>>> So I managed to get vtk 5.6.1 to work on a mac with java wrappings on
>>>>>>> (10.6.5) and with gdcm.
>>>>>>>
>>>>>>> The following code is producing errors that I don't see on windows:
>>>>>>>
>>>>>>> ? ? ? ? ? ? ? IPPSorter sorter = new IPPSorter();
>>>>>>> ? ? ? ? ? ? ? ?sorter.SetComputeZSpacing(true);
>>>>>>> ? ? ? ? ? ? ? ?sorter.SetZSpacingTolerance(0.000001);
>>>>>>> ? ? ? ? ? ? ? ?Boolean sorted = sorter.Sort(theSeriesFiles);
>>>>>>> ? ? ? ? ? ? ? ?//sorter.Sort(ft);
>>>>>>>
>>>>>>> ? ? ? ? ? ? ? ?//have to make a vtk string array
>>>>>>> ? ? ? ? ? ? ? ?FilenamesType sortedFT = sorter.GetFilenames();
>>>>>>> ? ? ? ? ? ? ? ?long theSize = sortedFT.size();
>>>>>>> ? ? ? ? ? ? ? ?vtkStringArray sa = new vtkStringArray();
>>>>>>> ? ? ? ? ? ? ? ?for (int j = 0; j < theSize; j++) {
>>>>>>> ? ? ? ? ? ? ? ? ? ?String theString2 = sortedFT.get(j);
>>>>>>> ? ? ? ? ? ? ? ? ? ?sa.InsertNextValue(sortedFT.get(j));
>>>>>>> ? ? ? ? ? ? ? ?}
>>>>>>> ? ? ? ? ? ? ? ?gdcmReader.SetFileNames(sa);
>>>>>>>
>>>>>>> ? ? ? ? ? ? ? ?gdcmReader.Update();
>>>>>>>
>>>>>>> ? ? ? ? ? ? ? ?imageData = gdcmReader.GetOutput();
>>>>>>>
>>>>>>> ? ? ? ? ? ? ? ?//make sure that we're getting spacing and orientation info
>>>>>>> ? ? ? ? ? ? ? ?double[] spacing = imageData.GetSpacing();
>>>>>>> ? ? ? ? ? ? ? ?spacing[2] = sorter.GetZSpacing();
>>>>>>> ? ? ? ? ? ? ? ?imageData.SetSpacing(spacing);
>>>>>>> ? ? ? ? ? ? ? ?double[] origin = imageData.GetOrigin();
>>>>>>> ? ? ? ? ? ? ? ?double[] bounds = imageData.GetBounds();
>>>>>>> ? ? ? ? ? ? ? ?double[] extraOrigin = {0,0,0};//because vtk will only
>>>>>>> flip about 0,0,0
>>>>>>>
>>>>>>> ? ? ? ? ? ? ? ?vtkImageChangeInformation imageSpacingChange = new
>>>>>>> vtkImageChangeInformation();
>>>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetInput(imageData);
>>>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputSpacing(spacing[0],
>>>>>>> spacing[1], spacing[2]);
>>>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputOrigin(extraOrigin);
>>>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.Update();
>>>>>>>
>>>>>>> Once the last line is hit, the following error is reported in netbeans:
>>>>>>>
>>>>>>> ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/VTK-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx,
>>>>>>> line 802
>>>>>>> vtkStreamingDemandDrivenPipeline (0x135884c10): Input for connection
>>>>>>> index 0 on input port index 0 for algorithm
>>>>>>> vtkImageChangeInformation(0x1358853c0) is NULL, but a vtkImageData is
>>>>>>> required.
>>>>>>>
>>>>>>> This code works perfectly well in Windows, and the spacing, origin,
>>>>>>> and bounds arrays all match the values in windows when loading the
>>>>>>> same series there. ?So, I know that the gdcm side of things is
>>>>>>> working, at least to the point that those arrays are being reported
>>>>>>> correctly.
>>>>>>>
>>>>>>> Because the pipeline is breaking there, nothing else is working. ?What
>>>>>>> can I do to fix it?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Mark
>>>>>>> _______________________________________________
>>>>>>> Powered by www.kitware.com
>>>>>>>
>>>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>>>>>
>>>>>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>>>>>
>>>>>>> Follow this link to subscribe/unsubscribe:
>>>>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>


From mmroden at gmail.com  Wed Dec  8 23:32:23 2010
From: mmroden at gmail.com (Mark Roden)
Date: Wed, 8 Dec 2010 20:32:23 -0800
Subject: [vtkusers] vtkGDCMImageReader
Message-ID: 

Hi Rao,

You might want to try the vtkGDCMImageReader class.  This class is
part of the gdcm project.

You'll need to download GDCM from sourceforge, and then build it using
cmake with the option to use vtk checked.  I don't know your level of
using vtk, but I'd assume it's on the level of code, which would mean
building via cmake.  gdcm on top of vtk is fairly straightforward,
although you will need to use the IPP sorter class to sort your images
by z position.

This wiki entry should help:
http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Using_GDCM_API#Automatic_ordering_of_slices_for_vtkGDCMImageReader.SetFileNames

Good luck!
Mark


From mmroden at gmail.com  Wed Dec  8 23:45:12 2010
From: mmroden at gmail.com (Mark Roden)
Date: Wed, 8 Dec 2010 20:45:12 -0800
Subject: [vtkusers] vtk 5.6.1 on a mac wrapped in Java
In-Reply-To: 
References: 
	
	
	
	
	
	
	
Message-ID: 

I think I've made a bit more progress here.

How are libraries supposed to be used on the mac?

On windows, libraries are always looked for in the system PATH,
starting with the local directory with the java file is run (at least,
that's my understanding, and what appears to happen with this app on
Windows).

On the mac, where should these libraries sit?  Do they have to be
'installed' (as in 'make; make install') in order for the java program
to run?  When I call System.loadlibrary("vtkgdcmJava"), will it look
in the local path for the libraries?  Because I'm trying to mimic the
windows paradigm of putting all the libraries in the same place as the
jar, but given the large number of links produced here, that might not
be the right paradigm on the Mac or other unix flavors.

Thanks,
Mark

On Wed, Dec 8, 2010 at 7:21 PM, Mark Roden  wrote:
> So, any idea on how to fix this issue? ?Getting
>
> ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/vtk-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx,
> line 802
> vtkStreamingDemandDrivenPipeline (0x133f80aa0): Input for connection
> index 0 on input port index 0 for algorithm
> vtkImageChangeInformation(0x133f7fcc0) is NULL, but a vtkImageData is
> required.
>
> right after trying to run a vtkChangeImageInformation pipeline.
>
> I tried this also using the straight vtk DICOM reader (rather than the
> gdcm reader), and it gives the same error, but at a different point in
> the app. ?Basically, anything that's pipeline-based appears to be
> thinking that the inputs haven't been set, which is pretty much all of
> the vtk stuff I have in there.
>
> Thanks for any help,
> Mark
>
> On Thu, Dec 2, 2010 at 11:32 AM, Sebastien Jourdain
>  wrote:
>> the Unix makefile is fine.
>> To setup release you just need to write Release in the CMake config
>> for the build type (CMAKE_BUILD_TYPE).
>> You can switch also the optimisation to -02 instead of -03 in the
>> ..._FLAGS_RELEASE options.
>>
>> But I doubt that it could come from that.
>>
>> Seb
>>
>>
>> On Thu, Dec 2, 2010 at 1:49 PM, Mark Roden  wrote:
>>> Maybe the problem is the build method I'm using for the libraries.
>>>
>>> I'm building both gdcm and vtk using Unix makefiles on the mac, since
>>> the xcode stuff isn't working.
>>>
>>> How can I make sure that I'm building release versions on both
>>> machines? ?There's a suggestion here:
>>> http://comments.gmane.org/gmane.comp.lib.mitk.user/1052
>>>
>>> that this bug could be due to compilation problems.
>>>
>>> Specifically, I'd like for 64 bit release versions to be made. ?On
>>> XCode, that's a dropdown selection, but typing 'make release' results
>>> in 'don't know how to build release, stop', and I'm not sure what
>>> 'make all' is doing.
>>>
>>> Thanks,
>>> Mark
>>>
>>> On Thu, Dec 2, 2010 at 7:00 AM, Mark Roden  wrote:
>>>> The java code works fine on windows, it's the same code, shared via
>>>> git on the different machines
>>>>
>>>> I'm not trying to inherit. ?vtkImageChangeInformation is exposed by
>>>> the vtk java wrapping, but the vtlImageData I'm passing in isn't
>>>> working.
>>>>
>>>> This code works in java on windows. ?It doesn't on mac. ?I use the
>>>> same libraries underneath, or at least, the same versions of gdcm and
>>>> vtk are built and used.
>>>>
>>>> On Thu, Dec 2, 2010 at 6:53 AM, Sebastien Jourdain
>>>>  wrote:
>>>>> I was talking about your Java code that was using VTK, not VTK itself.
>>>>>
>>>>> Moreover, I think that you can not inherit from VTK classes in Java...
>>>>>
>>>>> Seb
>>>>>
>>>>> On Thu, Dec 2, 2010 at 9:17 AM, Mark Roden  wrote:
>>>>>> Hi Sebastien,
>>>>>>
>>>>>> I can't use the windows binary on the mac-- the vtk underpinnings are
>>>>>> still C++, which means that it's compiled into a dll on windows, which
>>>>>> means (as far as I know, and as my experiments confirm), it doesn't
>>>>>> work on a mac. ?I have to recompile vtk for the mac directly. ?The
>>>>>> java wrappings (the jar) should be identical, though. ?Just to be
>>>>>> safe, I'm using the mac-generated jars now.
>>>>>>
>>>>>> I am sure that the filenames have no spaces or special strings. ?If
>>>>>> you look at the line
>>>>>>
>>>>>> ? ? String theString2 = sortedFT.get(i)
>>>>>>
>>>>>> I can stop there with the debugger and see the contents of the string,
>>>>>> and it's clean.
>>>>>>
>>>>>> For what it's worth, Fred Fred asked about this error message a year
>>>>>> ago, and he got no response:
>>>>>> http://public.kitware.com/pipermail/vtkusers/2009-October/102935.html
>>>>>> I don't know if he was in the same situation as me, though.
>>>>>>
>>>>>> Thanks,
>>>>>> Mark
>>>>>>
>>>>>> On Thu, Dec 2, 2010 at 5:02 AM, Sebastien Jourdain
>>>>>>  wrote:
>>>>>>> Hi Mark,
>>>>>>>
>>>>>>> did you try your windows (Java) binary on your mac to see if you get
>>>>>>> the same behavior ?
>>>>>>> Are you sure that on your mac, the filename provided to the reader are
>>>>>>> correct ? (no space or special string ?)
>>>>>>>
>>>>>>> Seb
>>>>>>>
>>>>>>> On Thu, Dec 2, 2010 at 12:01 AM, Mark Roden  wrote:
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> So I managed to get vtk 5.6.1 to work on a mac with java wrappings on
>>>>>>>> (10.6.5) and with gdcm.
>>>>>>>>
>>>>>>>> The following code is producing errors that I don't see on windows:
>>>>>>>>
>>>>>>>> ? ? ? ? ? ? ? IPPSorter sorter = new IPPSorter();
>>>>>>>> ? ? ? ? ? ? ? ?sorter.SetComputeZSpacing(true);
>>>>>>>> ? ? ? ? ? ? ? ?sorter.SetZSpacingTolerance(0.000001);
>>>>>>>> ? ? ? ? ? ? ? ?Boolean sorted = sorter.Sort(theSeriesFiles);
>>>>>>>> ? ? ? ? ? ? ? ?//sorter.Sort(ft);
>>>>>>>>
>>>>>>>> ? ? ? ? ? ? ? ?//have to make a vtk string array
>>>>>>>> ? ? ? ? ? ? ? ?FilenamesType sortedFT = sorter.GetFilenames();
>>>>>>>> ? ? ? ? ? ? ? ?long theSize = sortedFT.size();
>>>>>>>> ? ? ? ? ? ? ? ?vtkStringArray sa = new vtkStringArray();
>>>>>>>> ? ? ? ? ? ? ? ?for (int j = 0; j < theSize; j++) {
>>>>>>>> ? ? ? ? ? ? ? ? ? ?String theString2 = sortedFT.get(j);
>>>>>>>> ? ? ? ? ? ? ? ? ? ?sa.InsertNextValue(sortedFT.get(j));
>>>>>>>> ? ? ? ? ? ? ? ?}
>>>>>>>> ? ? ? ? ? ? ? ?gdcmReader.SetFileNames(sa);
>>>>>>>>
>>>>>>>> ? ? ? ? ? ? ? ?gdcmReader.Update();
>>>>>>>>
>>>>>>>> ? ? ? ? ? ? ? ?imageData = gdcmReader.GetOutput();
>>>>>>>>
>>>>>>>> ? ? ? ? ? ? ? ?//make sure that we're getting spacing and orientation info
>>>>>>>> ? ? ? ? ? ? ? ?double[] spacing = imageData.GetSpacing();
>>>>>>>> ? ? ? ? ? ? ? ?spacing[2] = sorter.GetZSpacing();
>>>>>>>> ? ? ? ? ? ? ? ?imageData.SetSpacing(spacing);
>>>>>>>> ? ? ? ? ? ? ? ?double[] origin = imageData.GetOrigin();
>>>>>>>> ? ? ? ? ? ? ? ?double[] bounds = imageData.GetBounds();
>>>>>>>> ? ? ? ? ? ? ? ?double[] extraOrigin = {0,0,0};//because vtk will only
>>>>>>>> flip about 0,0,0
>>>>>>>>
>>>>>>>> ? ? ? ? ? ? ? ?vtkImageChangeInformation imageSpacingChange = new
>>>>>>>> vtkImageChangeInformation();
>>>>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetInput(imageData);
>>>>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputSpacing(spacing[0],
>>>>>>>> spacing[1], spacing[2]);
>>>>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.SetOutputOrigin(extraOrigin);
>>>>>>>> ? ? ? ? ? ? ? ?imageSpacingChange.Update();
>>>>>>>>
>>>>>>>> Once the last line is hit, the following error is reported in netbeans:
>>>>>>>>
>>>>>>>> ERROR: In /Users/mmroden/Documents/src/vtk-5.6.1/VTK-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx,
>>>>>>>> line 802
>>>>>>>> vtkStreamingDemandDrivenPipeline (0x135884c10): Input for connection
>>>>>>>> index 0 on input port index 0 for algorithm
>>>>>>>> vtkImageChangeInformation(0x1358853c0) is NULL, but a vtkImageData is
>>>>>>>> required.
>>>>>>>>
>>>>>>>> This code works perfectly well in Windows, and the spacing, origin,
>>>>>>>> and bounds arrays all match the values in windows when loading the
>>>>>>>> same series there. ?So, I know that the gdcm side of things is
>>>>>>>> working, at least to the point that those arrays are being reported
>>>>>>>> correctly.
>>>>>>>>
>>>>>>>> Because the pipeline is breaking there, nothing else is working. ?What
>>>>>>>> can I do to fix it?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Mark
>>>>>>>> _______________________________________________
>>>>>>>> Powered by www.kitware.com
>>>>>>>>
>>>>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>>>>>>
>>>>>>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>>>>>>
>>>>>>>> Follow this link to subscribe/unsubscribe:
>>>>>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>


From bill.lorensen at gmail.com  Thu Dec  9 00:18:32 2010
From: bill.lorensen at gmail.com (Bill Lorensen)
Date: Thu, 9 Dec 2010 00:18:32 -0500
Subject: [vtkusers] ImageToPolyData example
In-Reply-To: <4CFD0B83.5010104@phenix-systems.com>
References: <4CFD0B83.5010104@phenix-systems.com>
Message-ID: 

Download it again. It had a few problems.

On Mon, Dec 6, 2010 at 11:12 AM, Eddy Cappeau
 wrote:
> Hi !
>
> Does anybody managed to run the ImageToPolyData example ?
> I've tried to run It but it crash here :
>
> imageToPolyDataFilter->Update();
>
> Beside that, imageToPolyDataFilter seems unused.
>
> --
> Eddy
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


From david.gobbi at gmail.com  Thu Dec  9 00:15:56 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Wed, 8 Dec 2010 22:15:56 -0700
Subject: [vtkusers] vtk 5.6.1 on a mac wrapped in Java
In-Reply-To: 
References: 
	
	
	
	
	
	
	
	
Message-ID: 

Hi Mark,

On the mac, libraries are looked for in the DYLD_LIBRARY_PATH as well as in
several default locations.  When debugging library issues, it is usually
easiest to figure things out by running your program from the terminal and
manually setting DYLD_LIBRARY_PATH.

After starting the terminal, type:
export DYLD_LIBRARY_PATH=/your/library/directory/

Then run the program from the terminal.  If you google "java" and
"DYLD_LIBRARY_PATH" you will probably come up with some useful java-specific
library info.  Note that DYLD_LIBRARY_PATH is only meant to be a
quick-and-dirty way to get things to work, it isn't something you would use
when you are actually distributing an application.

The basic Windows paradigm of putting everything in the same directory
doesn't work on the Mac.  Instead the mac uses "bundles" which are a
mac-specific directory structure, and the mac also uses something called the
"loader_path" which can be built-in to an executable to tell it where to
find its libraries.

  David


On Wed, Dec 8, 2010 at 9:45 PM, Mark Roden  wrote:

> I think I've made a bit more progress here.
>
> How are libraries supposed to be used on the mac?
>
> On windows, libraries are always looked for in the system PATH,
> starting with the local directory with the java file is run (at least,
> that's my understanding, and what appears to happen with this app on
> Windows).
>
> On the mac, where should these libraries sit?  Do they have to be
> 'installed' (as in 'make; make install') in order for the java program
> to run?  When I call System.loadlibrary("vtkgdcmJava"), will it look
> in the local path for the libraries?  Because I'm trying to mimic the
> windows paradigm of putting all the libraries in the same place as the
> jar, but given the large number of links produced here, that might not
> be the right paradigm on the Mac or other unix flavors.
>
> Thanks,
> Mark
>
> On Wed, Dec 8, 2010 at 7:21 PM, Mark Roden  wrote:
> > So, any idea on how to fix this issue?  Getting
> >
> > ERROR: In
> /Users/mmroden/Documents/src/vtk-5.6.1/vtk-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx,
> > line 802
> > vtkStreamingDemandDrivenPipeline (0x133f80aa0): Input for connection
> > index 0 on input port index 0 for algorithm
> > vtkImageChangeInformation(0x133f7fcc0) is NULL, but a vtkImageData is
> > required.
> >
> > right after trying to run a vtkChangeImageInformation pipeline.
> >
> > I tried this also using the straight vtk DICOM reader (rather than the
> > gdcm reader), and it gives the same error, but at a different point in
> > the app.  Basically, anything that's pipeline-based appears to be
> > thinking that the inputs haven't been set, which is pretty much all of
> > the vtk stuff I have in there.
> >
> > Thanks for any help,
> > Mark
> >
> > On Thu, Dec 2, 2010 at 11:32 AM, Sebastien Jourdain
> >  wrote:
> >> the Unix makefile is fine.
> >> To setup release you just need to write Release in the CMake config
> >> for the build type (CMAKE_BUILD_TYPE).
> >> You can switch also the optimisation to -02 instead of -03 in the
> >> ..._FLAGS_RELEASE options.
> >>
> >> But I doubt that it could come from that.
> >>
> >> Seb
> >>
> >>
> >> On Thu, Dec 2, 2010 at 1:49 PM, Mark Roden  wrote:
> >>> Maybe the problem is the build method I'm using for the libraries.
> >>>
> >>> I'm building both gdcm and vtk using Unix makefiles on the mac, since
> >>> the xcode stuff isn't working.
> >>>
> >>> How can I make sure that I'm building release versions on both
> >>> machines?  There's a suggestion here:
> >>> http://comments.gmane.org/gmane.comp.lib.mitk.user/1052
> >>>
> >>> that this bug could be due to compilation problems.
> >>>
> >>> Specifically, I'd like for 64 bit release versions to be made.  On
> >>> XCode, that's a dropdown selection, but typing 'make release' results
> >>> in 'don't know how to build release, stop', and I'm not sure what
> >>> 'make all' is doing.
> >>>
> >>> Thanks,
> >>> Mark
> >>>
> >>> On Thu, Dec 2, 2010 at 7:00 AM, Mark Roden  wrote:
> >>>> The java code works fine on windows, it's the same code, shared via
> >>>> git on the different machines
> >>>>
> >>>> I'm not trying to inherit.  vtkImageChangeInformation is exposed by
> >>>> the vtk java wrapping, but the vtlImageData I'm passing in isn't
> >>>> working.
> >>>>
> >>>> This code works in java on windows.  It doesn't on mac.  I use the
> >>>> same libraries underneath, or at least, the same versions of gdcm and
> >>>> vtk are built and used.
> >>>>
> >>>> On Thu, Dec 2, 2010 at 6:53 AM, Sebastien Jourdain
> >>>>  wrote:
> >>>>> I was talking about your Java code that was using VTK, not VTK
> itself.
> >>>>>
> >>>>> Moreover, I think that you can not inherit from VTK classes in
> Java...
> >>>>>
> >>>>> Seb
> >>>>>
> >>>>> On Thu, Dec 2, 2010 at 9:17 AM, Mark Roden 
> wrote:
> >>>>>> Hi Sebastien,
> >>>>>>
> >>>>>> I can't use the windows binary on the mac-- the vtk underpinnings
> are
> >>>>>> still C++, which means that it's compiled into a dll on windows,
> which
> >>>>>> means (as far as I know, and as my experiments confirm), it doesn't
> >>>>>> work on a mac.  I have to recompile vtk for the mac directly.  The
> >>>>>> java wrappings (the jar) should be identical, though.  Just to be
> >>>>>> safe, I'm using the mac-generated jars now.
> >>>>>>
> >>>>>> I am sure that the filenames have no spaces or special strings.  If
> >>>>>> you look at the line
> >>>>>>
> >>>>>>     String theString2 = sortedFT.get(i)
> >>>>>>
> >>>>>> I can stop there with the debugger and see the contents of the
> string,
> >>>>>> and it's clean.
> >>>>>>
> >>>>>> For what it's worth, Fred Fred asked about this error message a year
> >>>>>> ago, and he got no response:
> >>>>>>
> http://public.kitware.com/pipermail/vtkusers/2009-October/102935.html
> >>>>>> I don't know if he was in the same situation as me, though.
> >>>>>>
> >>>>>> Thanks,
> >>>>>> Mark
> >>>>>>
> >>>>>> On Thu, Dec 2, 2010 at 5:02 AM, Sebastien Jourdain
> >>>>>>  wrote:
> >>>>>>> Hi Mark,
> >>>>>>>
> >>>>>>> did you try your windows (Java) binary on your mac to see if you
> get
> >>>>>>> the same behavior ?
> >>>>>>> Are you sure that on your mac, the filename provided to the reader
> are
> >>>>>>> correct ? (no space or special string ?)
> >>>>>>>
> >>>>>>> Seb
> >>>>>>>
> >>>>>>> On Thu, Dec 2, 2010 at 12:01 AM, Mark Roden 
> wrote:
> >>>>>>>> Hi all,
> >>>>>>>>
> >>>>>>>> So I managed to get vtk 5.6.1 to work on a mac with java wrappings
> on
> >>>>>>>> (10.6.5) and with gdcm.
> >>>>>>>>
> >>>>>>>> The following code is producing errors that I don't see on
> windows:
> >>>>>>>>
> >>>>>>>>               IPPSorter sorter = new IPPSorter();
> >>>>>>>>                sorter.SetComputeZSpacing(true);
> >>>>>>>>                sorter.SetZSpacingTolerance(0.000001);
> >>>>>>>>                Boolean sorted = sorter.Sort(theSeriesFiles);
> >>>>>>>>                //sorter.Sort(ft);
> >>>>>>>>
> >>>>>>>>                //have to make a vtk string array
> >>>>>>>>                FilenamesType sortedFT = sorter.GetFilenames();
> >>>>>>>>                long theSize = sortedFT.size();
> >>>>>>>>                vtkStringArray sa = new vtkStringArray();
> >>>>>>>>                for (int j = 0; j < theSize; j++) {
> >>>>>>>>                    String theString2 = sortedFT.get(j);
> >>>>>>>>                    sa.InsertNextValue(sortedFT.get(j));
> >>>>>>>>                }
> >>>>>>>>                gdcmReader.SetFileNames(sa);
> >>>>>>>>
> >>>>>>>>                gdcmReader.Update();
> >>>>>>>>
> >>>>>>>>                imageData = gdcmReader.GetOutput();
> >>>>>>>>
> >>>>>>>>                //make sure that we're getting spacing and
> orientation info
> >>>>>>>>                double[] spacing = imageData.GetSpacing();
> >>>>>>>>                spacing[2] = sorter.GetZSpacing();
> >>>>>>>>                imageData.SetSpacing(spacing);
> >>>>>>>>                double[] origin = imageData.GetOrigin();
> >>>>>>>>                double[] bounds = imageData.GetBounds();
> >>>>>>>>                double[] extraOrigin = {0,0,0};//because vtk will
> only
> >>>>>>>> flip about 0,0,0
> >>>>>>>>
> >>>>>>>>                vtkImageChangeInformation imageSpacingChange = new
> >>>>>>>> vtkImageChangeInformation();
> >>>>>>>>                imageSpacingChange.SetInput(imageData);
> >>>>>>>>                imageSpacingChange.SetOutputSpacing(spacing[0],
> >>>>>>>> spacing[1], spacing[2]);
> >>>>>>>>                imageSpacingChange.SetOutputOrigin(extraOrigin);
> >>>>>>>>                imageSpacingChange.Update();
> >>>>>>>>
> >>>>>>>> Once the last line is hit, the following error is reported in
> netbeans:
> >>>>>>>>
> >>>>>>>> ERROR: In
> /Users/mmroden/Documents/src/vtk-5.6.1/VTK-5.6.1/Filtering/vtkDemandDrivenPipeline.cxx,
> >>>>>>>> line 802
> >>>>>>>> vtkStreamingDemandDrivenPipeline (0x135884c10): Input for
> connection
> >>>>>>>> index 0 on input port index 0 for algorithm
> >>>>>>>> vtkImageChangeInformation(0x1358853c0) is NULL, but a vtkImageData
> is
> >>>>>>>> required.
> >>>>>>>>
> >>>>>>>> This code works perfectly well in Windows, and the spacing,
> origin,
> >>>>>>>> and bounds arrays all match the values in windows when loading the
> >>>>>>>> same series there.  So, I know that the gdcm side of things is
> >>>>>>>> working, at least to the point that those arrays are being
> reported
> >>>>>>>> correctly.
> >>>>>>>>
> >>>>>>>> Because the pipeline is breaking there, nothing else is working.
>  What
> >>>>>>>> can I do to fix it?
> >>>>>>>>
> >>>>>>>> Thanks,
> >>>>>>>> Mark
> >>>>>>>> _______________________________________________
> >>>>>>>> Powered by www.kitware.com
> >>>>>>>>
> >>>>>>>> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> >>>>>>>>
> >>>>>>>> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> >>>>>>>>
> >>>>>>>> Follow this link to subscribe/unsubscribe:
> >>>>>>>> http://www.vtk.org/mailman/listinfo/vtkusers
> >>>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>>
> >>
> >
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From nclemeur at gmail.com  Thu Dec  9 01:38:55 2010
From: nclemeur at gmail.com (nclemeur)
Date: Wed, 8 Dec 2010 22:38:55 -0800 (PST)
Subject: [vtkusers] vtkChartXY picking
In-Reply-To: <26188332-E371-4CEE-B032-EA857A9D77C7@cs.duke.edu>
References: <1291811919653-3297279.post@n5.nabble.com>
	<26188332-E371-4CEE-B032-EA857A9D77C7@cs.duke.edu>
Message-ID: <1291876735599-3298505.post@n5.nabble.com>



Eric E. Monson wrote:
> 
> I'm not quite sure how to solve your problem, but I wanted to let you know
> that the 2D API classes (which includes the Charts like vtkChartXY) do not
> use the standard VTK interactors for their event handling, so that's why
> your tests with changing interactor style didn't work. 
> 

Does that mean I should not try to use the vtkPropPicker as suggested above?


Eric E. Monson wrote:
> 
> I'm not an expert in this, but to do what you want with the way the Charts
> and 2D API are implemented right now you might need to go into the classes
> themselves and add in custom events that fire when things like axes are
> hit. I'm not sure about things like line colors. There is already code in
> the charts that is used for tooltips that finds the closest points to the
> mouse, so that may be useful.
> 

Thanks that really usefull to know. I might start by trying to subclass the
vtkXYChart class and see if I can generate custom event. I'll give it a go
soon and will report any success...



-- 
View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp3297279p3298505.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From ecappeau at phenix-systems.com  Thu Dec  9 03:31:02 2010
From: ecappeau at phenix-systems.com (Eddy Cappeau)
Date: Thu, 09 Dec 2010 09:31:02 +0100
Subject: [vtkusers] ImageToPolyData example
In-Reply-To: 
References: <4CFD0B83.5010104@phenix-systems.com>
	
Message-ID: <4D0093C6.3030906@phenix-systems.com>

Thank you, It work fine know.

Le 09/12/2010 06:18, Bill Lorensen a ?crit :
> Download it again. It had a few problems.
>
> On Mon, Dec 6, 2010 at 11:12 AM, Eddy Cappeau
>   wrote:
>> Hi !
>>
>> Does anybody managed to run the ImageToPolyData example ?
>> I've tried to run It but it crash here :
>>
>> imageToPolyDataFilter->Update();
>>
>> Beside that, imageToPolyDataFilter seems unused.
>>
>> --
>> Eddy
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>

-- 
Eddy



-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From h0ppel at web.de  Thu Dec  9 06:32:10 2010
From: h0ppel at web.de (h0ppel)
Date: Thu, 9 Dec 2010 03:32:10 -0800 (PST)
Subject: [vtkusers] show single plane form implicitplanewidget
Message-ID: <1291894330955-3298765.post@n5.nabble.com>


hi,

I made a implicitplanewidget with ja cutting funtion.
Now I only want to display the plane with the cutline. Not in the 3d box but
in 2d. So you can see the plane with the cut frontal 

thanks
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/show-single-plane-form-implicitplanewidget-tp3298765p3298765.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From aracha2010 at gmail.com  Thu Dec  9 07:43:17 2010
From: aracha2010 at gmail.com (Rachel)
Date: Thu, 9 Dec 2010 04:43:17 -0800 (PST)
Subject: [vtkusers] coordinate transformation between polydata and image
	data
In-Reply-To: 
References: <887B391A-2B68-4D6F-9EEA-1C7BF6A8716F@u.washington.edu>
	
	<1291839762279-3297909.post@n5.nabble.com>
	
Message-ID: <1291898597713-3298831.post@n5.nabble.com>


Thank very much David. 
I will try your solution. 

Merci :)

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/coordinate-transformation-between-polydata-and-image-data-tp3216899p3298831.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From nclemeur at gmail.com  Thu Dec  9 07:46:09 2010
From: nclemeur at gmail.com (nclemeur)
Date: Thu, 9 Dec 2010 04:46:09 -0800 (PST)
Subject: [vtkusers] vtkChartXY picking
In-Reply-To: <1291876735599-3298505.post@n5.nabble.com>
References: <1291811919653-3297279.post@n5.nabble.com>
	<26188332-E371-4CEE-B032-EA857A9D77C7@cs.duke.edu>
	<1291876735599-3298505.post@n5.nabble.com>
Message-ID: <1291898769680-3298834.post@n5.nabble.com>



nclemeur wrote:
> 
> ... I might start by trying to subclass the vtkXYChart class
> 

I have tried this approach but it seems that it would be usefull for me to
have access to a method similar to

int vtkChartXY::LocatePlot(const vtkContextMouseEvent &mouse)

it would simply return the index of the first visible plot found under the
mouse. 

This method would be really similar to the existing 

vtkChartXY::LocatePointInPlots(const vtkContextMouseEvent &mouse)

As a more general feature, maybe it would suffices to have a method to get
the "world" coordinate from the mouse coordinate. I could then use the
method GetNearestPoint on every plot to find the plot that has been clicked
on.  It looks like all te code necessary for that method is already
implemented in vtkChartXY::LocatePointInPlots. Is there any chance to have
this available?






-- 
View this message in context: http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp3297279p3298834.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From mmroden at gmail.com  Thu Dec  9 13:21:49 2010
From: mmroden at gmail.com (Mark Roden)
Date: Thu, 9 Dec 2010 10:21:49 -0800
Subject: [vtkusers] vtkGDCMImageReader
In-Reply-To: 
References: 
	
Message-ID: 

Hi Rao,

The best thing for a linux system is probably to build via cmake.

Mark

On Thu, Dec 9, 2010 at 9:57 AM, Rao Ruvva  wrote:
> Mark,
>
> Thanks for your response. I'll install GDCM and try.
>
> I was looking at Sourceforge for GDCM for Linux and found installation files for 64 bit systems. But I am on 32 bit system. Any ideas, from where I get the GDCM source for 32 bit Linux system?
>
> Thank you
> Rao
>
> ________________________________________
> From: Mark Roden [mmroden at gmail.com]
> Sent: Wednesday, December 08, 2010 8:32 PM
> To: Rao Ruvva
> Cc: VTK
> Subject: vtkGDCMImageReader
>
> Hi Rao,
>
> You might want to try the vtkGDCMImageReader class. ?This class is
> part of the gdcm project.
>
> You'll need to download GDCM from sourceforge, and then build it using
> cmake with the option to use vtk checked. ?I don't know your level of
> using vtk, but I'd assume it's on the level of code, which would mean
> building via cmake. ?gdcm on top of vtk is fairly straightforward,
> although you will need to use the IPP sorter class to sort your images
> by z position.
>
> This wiki entry should help:
> http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Using_GDCM_API#Automatic_ordering_of_slices_for_vtkGDCMImageReader.SetFileNames
>
> Good luck!
> Mark
>


From webmaster at insightsoftwareconsortium.org  Thu Dec  9 13:58:23 2010
From: webmaster at insightsoftwareconsortium.org (Insight Journal)
Date: Thu, 9 Dec 2010 13:58:23 -0500
Subject: [vtkusers] The Insight Journal-New Submission
Message-ID: <201012091858.oB9IwMGQ016306@insight-journal.org>

Hello,
A new submission has been added to the Insight Journal.

Title: Variance Image Filter
Author(s):Tamburo R.
Abstract: 
This paper describes an intensity image filter for computing the variance of pixel values contained within a neighborhood centered at each input pixel. The output image contains the calculated variance at each input pixel location. This paper is accompanied with source code for the filter and test, test images and parameters, and expected output images.  

Download and Review the paper at: http://www.insight-journal.org/browse/publication/779

Generated by the Insight Journal
You are receiving this email because you asked to be informed by the Insight Journal for new submissions.
                    
To change your email preference go to http://www.insight-journal.org .


From jli023 at cs.auckland.ac.nz  Thu Dec  9 22:53:33 2010
From: jli023 at cs.auckland.ac.nz (Jing Li)
Date: Fri, 10 Dec 2010 16:53:33 +1300
Subject: [vtkusers] How to get min oriented bounding box of a set of points
Message-ID: <000001cb981d$d0c86a60$72593f20$@auckland.ac.nz>

Hi there, 

 

I use vtkOBBTree's method ComputeOBB to compute the orientated bounding box
for a set of points. The size[3] returned by it is relative sizes for
comparison.  

 

Do you know how to get the min bounding box's size for the set of points?

 

Thanks, 

 

Jing

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From mathieu.malaterre at gmail.com  Fri Dec 10 03:25:40 2010
From: mathieu.malaterre at gmail.com (Mathieu Malaterre)
Date: Fri, 10 Dec 2010 09:25:40 +0100
Subject: [vtkusers] Read DICOM memory stream to use in VTK
In-Reply-To: <1291859270217-3298355.post@n5.nabble.com>
References: <1291859270217-3298355.post@n5.nabble.com>
Message-ID: 

On Thu, Dec 9, 2010 at 2:47 AM, BountyHuntA  wrote:
>
> Hello.
>
> I develop a DICOM rendering with VTK in connection with a JAVA Web-Service.
> The user send some DICOM images to the Web-Service and JNA passes a pointer
> to the DICOM files in the RAM from the JAVA side to C++-VTK.
> I have now the problem that GDCM can only read real files from HDD
> (setFileNames etc.).

This is incorrect. GDCM offer an API to read from a std::istream&.

http://gdcm.sourceforge.net/html/classgdcm_1_1Reader.html#a2fdbf80e6dedc1f3a127a68d6ab11341

gdcm::Reader::SetStream

The vtkGDCMImageReader however only offer a filename API.


HTH
-- 
Mathieu


From mathieu.malaterre at gmail.com  Fri Dec 10 06:13:13 2010
From: mathieu.malaterre at gmail.com (Mathieu Malaterre)
Date: Fri, 10 Dec 2010 12:13:13 +0100
Subject: [vtkusers] vtkGDCMImageReader
In-Reply-To: 
References: 
	
	
Message-ID: 

On debian/ubuntu/fedora you can do:

apt-get install libvtkgdcm-dev

yum install libvtkgdcm-dev

HTH

On Thu, Dec 9, 2010 at 7:21 PM, Mark Roden  wrote:
> Hi Rao,
>
> The best thing for a linux system is probably to build via cmake.
>
> Mark
>
> On Thu, Dec 9, 2010 at 9:57 AM, Rao Ruvva  wrote:
>> Mark,
>>
>> Thanks for your response. I'll install GDCM and try.
>>
>> I was looking at Sourceforge for GDCM for Linux and found installation files for 64 bit systems. But I am on 32 bit system. Any ideas, from where I get the GDCM source for 32 bit Linux system?
>>
>> Thank you
>> Rao
>>
>> ________________________________________
>> From: Mark Roden [mmroden at gmail.com]
>> Sent: Wednesday, December 08, 2010 8:32 PM
>> To: Rao Ruvva
>> Cc: VTK
>> Subject: vtkGDCMImageReader
>>
>> Hi Rao,
>>
>> You might want to try the vtkGDCMImageReader class. ?This class is
>> part of the gdcm project.
>>
>> You'll need to download GDCM from sourceforge, and then build it using
>> cmake with the option to use vtk checked. ?I don't know your level of
>> using vtk, but I'd assume it's on the level of code, which would mean
>> building via cmake. ?gdcm on top of vtk is fairly straightforward,
>> although you will need to use the IPP sorter class to sort your images
>> by z position.
>>
>> This wiki entry should help:
>> http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Using_GDCM_API#Automatic_ordering_of_slices_for_vtkGDCMImageReader.SetFileNames
>>
>> Good luck!
>> Mark
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
Mathieu


From stefan.mauerberger at mnet-online.de  Fri Dec 10 06:19:23 2010
From: stefan.mauerberger at mnet-online.de (Stefan Mauerberger)
Date: Fri, 10 Dec 2010 12:19:23 +0100
Subject: [vtkusers] projecting an RGB image on a sphere (python binding)
Message-ID: <1291979963.15644.28.camel@como.geophysik.uni-muenchen.de>


Hi everyone,

I'm a new VTK user. A few days ago I discovered the python bindings of
VTK. I use it to get my data into VTK format. And I use ParaView for
visualization. I'm exited and so far nearly everything works quite well.

Now I want to project an image (2D RGB array) on a sphere. The 'vector
components' should be shown at any point in RGB color space. The
projection works but the coloring of the points does not work. (see
attached sample code)

It would be wonderful if you could help me!

Regards

Stefan

PS: Is there a way to improve the performance. Going through all the
indexes is very slow. The array passed as a whole would be much faster.

> import numpy as np
> import vtk 
> 
> # dummy random RGB image 
> def im(lat,lon):
>     im = np.random.random_integers( 0, 254, 3)
>     im = im.astype('int8')
>     return im.tolist()
> 
> # parameters of the sphere
> Lat = np.linspace( 0.2, 2.1, 200 ).tolist()
> Lon = np.linspace( 1.1, 3.2, 200 ).tolist()
> r   = 1.
> 
> # create VTK points and array
> points = vtk.vtkPoints()
> array  = vtk.vtkTypeInt8Array()
> array.SetNumberOfComponents( 3 )
> for nlat, lat  in enumerate( Lat ):
>     for nlon, lon in enumerate( Lon ):
>         # transform to carthesien coord.
>         x = r * np.sin( lat ) * np.cos( lon )
>         y = r * np.sin( lat ) * np.sin( lon )
>         z = r * np.cos( lat ) 
>         points.InsertNextPoint( ( x, y, z ) )
>         # get RGB random values 
>         R, G, B = im( nlat, nlon)
>         array.InsertNextTuple3( R, G, B )
> 
> # generate VTK structured grid
> sgrid = vtk.vtkStructuredGrid()
> sgrid.SetDimensions( 1, len( Lon ), len( Lat ) ) 
> sgrid.SetPoints( points )
> sgrid.GetPointData().AddArray( array )
> 
> # write to file 
> writer = vtk.vtkStructuredGridWriter()
> writer.SetInput( sgrid )
> writer.SetFileName( 'file.vtk' )
> writer.SetFileTypeToBinary()
> writer.Write()



From luis.ibanez at kitware.com  Fri Dec 10 07:23:54 2010
From: luis.ibanez at kitware.com (Luis Ibanez)
Date: Fri, 10 Dec 2010 07:23:54 -0500
Subject: [vtkusers] [Insight-users] Image registration between CT and MRI
In-Reply-To: <00d001cb96c1$ff26f9b0$fd74ed10$@ac.kr>
References: 
	<00d001cb96c1$ff26f9b0$fd74ed10$@ac.kr>
Message-ID: 

Hi Xiaopeng,

You may want to look at:

ITK/Examples/Registration/ImageRegistration8.cxx

for an illustration on how to rigidly register two 3D images.

and to

ITK/Examples/Registration/ImageRegistration4.cxx

for an illustration on how to use Mattes Mutual Information.

>From those two examples, you can create one that
uses Mattes Mutual Information in a rigid 3D registration.

The Image Registration chapter of the Software Guide
will also be helpful.

       http://www.itk.org/ItkSoftwareGuide.pdf

Please note that the examples above are described
in the text of the software guide.

Regards,


      Luis


------------------------------------------------
On Wed, Dec 8, 2010 at 5:23 AM, Xiaopeng Yang  wrote:
> Hello,
>
>
>
> Is it possible for image registration between CT and MRI data sets? If so,
> how to make it?
>
>
>
> Thanks,
>
> Xiaopeng
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


From Martin_Klamm at gmx.de  Fri Dec 10 08:22:15 2010
From: Martin_Klamm at gmx.de (BountyHuntA)
Date: Fri, 10 Dec 2010 05:22:15 -0800 (PST)
Subject: [vtkusers] Read DICOM memory stream to use in VTK
In-Reply-To: 
References: <1291859270217-3298355.post@n5.nabble.com>
	
Message-ID: <1291987335899-3300278.post@n5.nabble.com>


Hello.

Thats right. I edited my post after I've created so obviously you didn't got
my changes.

I know that there is the setStream-function in gdcm::Reader but I don't know
how to use this reader or maybe the gdcm::File with VTK...
Somehow I need sth. like vtkAlgorithmOutput like from
vtkGDCMImageReader::getOutputPort() or vtkImageData but this is of course
not supported by the gdcm::Reader.

Do you know a solution?

Martin
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Read-DICOM-memory-stream-to-use-in-VTK-tp3298355p3300278.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From hongyi at renci.org  Fri Dec 10 10:37:47 2010
From: hongyi at renci.org (Hong Yi)
Date: Fri, 10 Dec 2010 15:37:47 +0000
Subject: [vtkusers] Link error when building VTK with boost support in
 Visual Studio 2010
Message-ID: <3269F716AE5D424ABC02847989CA18CF1E43C255@exch-mbx1.ad.renci.org>

Hello,

I am trying to build VTK with boost support in Visual Studio 2010. I generated VTK solution/projects successfully using CMake, but when I build VTK solution in VS 2010, I got the following link error:

fatal error LNK1104: cannot open file 'libboost_serialization-vc100-mt-gd-1_44.lib'

I installed boost C++ library (version 1.44) using installer provided by BoostPro Computing. I selected all multi-threaded build variants when installing boost.

I cannot find any useful suggestions by googling to solve this link error and hope to get some advice from the list.

Thanks,

Hong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From jeff.baumes at kitware.com  Fri Dec 10 11:19:57 2010
From: jeff.baumes at kitware.com (Jeff Baumes)
Date: Fri, 10 Dec 2010 11:19:57 -0500
Subject: [vtkusers] Link error when building VTK with boost support in
 Visual Studio 2010
In-Reply-To: <3269F716AE5D424ABC02847989CA18CF1E43C255@exch-mbx1.ad.renci.org>
References: <3269F716AE5D424ABC02847989CA18CF1E43C255@exch-mbx1.ad.renci.org>
Message-ID: 

Did you turn on VTK_USE_PARALLEL_BGL for processing graphs in parallel? That
is the only reason it should be looking for the serialization library. If
you turn off that flag it should be fine (in case you turned it on
accidentally).

Jeff

On Fri, Dec 10, 2010 at 10:37 AM, Hong Yi  wrote:

> Hello,
>
>
>
> I am trying to build VTK with boost support in Visual Studio 2010. I
> generated VTK solution/projects successfully using CMake, but when I build
> VTK solution in VS 2010, I got the following link error:
>
>
>
> fatal error LNK1104: cannot open file
> 'libboost_serialization-vc100-mt-gd-1_44.lib'
>
>
>
> I installed boost C++ library (version 1.44) using installerprovided by BoostPro
> Computing . I selected all multi-threaded build
> variants when installing boost.
>
>
>
> I cannot find any useful suggestions by googling to solve this link error
> and hope to get some advice from the list.
>
>
>
> Thanks,
>
>
>
> Hong
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From mike.jackson at bluequartz.net  Fri Dec 10 11:51:39 2010
From: mike.jackson at bluequartz.net (Michael Jackson)
Date: Fri, 10 Dec 2010 11:51:39 -0500
Subject: [vtkusers] Link error when building VTK with boost support in
	Visual Studio 2010
In-Reply-To: <3269F716AE5D424ABC02847989CA18CF1E43C255@exch-mbx1.ad.renci.org>
References: <3269F716AE5D424ABC02847989CA18CF1E43C255@exch-mbx1.ad.renci.org>
Message-ID: <249E9B80-5F30-4447-BB21-B145C869917E@bluequartz.net>

you have an actual library named libboost_serialization-vc100-mt- 
gd-1_44.lib anywhere in the Boost Pro installation?
___________________________________________________________
Mike Jackson                      www.bluequartz.net
Principal Software Engineer       mike.jackson at bluequartz.net
BlueQuartz Software               Dayton, Ohio



On Dec 10, 2010, at 10:37 AM, Hong Yi wrote:

> Hello,
>
> I am trying to build VTK with boost support in Visual Studio 2010. I  
> generated VTK solution/projects successfully using CMake, but when I  
> build VTK solution in VS 2010, I got the following link error:
>
> fatal error LNK1104: cannot open file 'libboost_serialization-vc100- 
> mt-gd-1_44.lib'
>
> I installed boost C++ library (version 1.44) using installer  
> provided by BoostPro Computing. I selected all multi-threaded build  
> variants when installing boost.
>
> I cannot find any useful suggestions by googling to solve this link  
> error and hope to get some advice from the list.
>
> Thanks,
>
> Hong
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



From lisa.avila at kitware.com  Fri Dec 10 11:50:12 2010
From: lisa.avila at kitware.com (Lisa Avila)
Date: Fri, 10 Dec 2010 11:50:12 -0500
Subject: [vtkusers] ANN: Books available on amazon.co.uk
Message-ID: 

Great news for everyone in Europe who would like to purchase the VTK User's
Guide or Mastering CMake - we now have these two titles available on
amazon.co.uk (thanks to our new
officein Lyon, France).
You can get the VTK User's Guide
herefor?69.00
and
Mastering CMake
herefor
?49.00. You can always find these links on our web site under
www.kitware.com - use the menu to navigate to Products -> Books, then select
the book you'd like to order. The amazon.com and amazon.co.uk links are both
listed on the Ordering Information tab. Ordering from amazon.co.uk should
result in significantly lower shipping costs for our European customers. We
do plan to offer more of our titles on more Amazon sites in the EU in this
coming year.

Lisa



-----------------------
Lisa S. Avila
Vice President
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065 USA
518-371-3971 x103
lisa.avila at kitware.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From hongyi at renci.org  Fri Dec 10 12:08:58 2010
From: hongyi at renci.org (Hong Yi)
Date: Fri, 10 Dec 2010 17:08:58 +0000
Subject: [vtkusers] Link error when building VTK with boost support in
 Visual Studio 2010
In-Reply-To: 
References: <3269F716AE5D424ABC02847989CA18CF1E43C255@exch-mbx1.ad.renci.org>
	
Message-ID: <3269F716AE5D424ABC02847989CA18CF1E43C2D2@exch-mbx1.ad.renci.org>

I did not find VTK_USE_PARALLEL_BGL flag, only find VTK_USE_PARALLEL flag which is turned off. Two relevant flags, VTK_USE_BOOST and VTK_USE_TEXT_ANALYSIS flags, are turned on with VTK_USE_PARALLEL flag off. I am using CMake 2.8.3 and VTK 5.6. Is there an exact flag called VTK_USE_PARALLEL_BGL? I checked a couple of times but could not find it, for some reason...

Many thanks for the info,

Hong

From: Jeff Baumes [mailto:jeff.baumes at kitware.com]
Sent: Friday, December 10, 2010 11:20 AM
To: Hong Yi
Cc: VTK Users
Subject: Re: [vtkusers] Link error when building VTK with boost support in Visual Studio 2010

Did you turn on VTK_USE_PARALLEL_BGL for processing graphs in parallel? That is the only reason it should be looking for the serialization library. If you turn off that flag it should be fine (in case you turned it on accidentally).

Jeff
On Fri, Dec 10, 2010 at 10:37 AM, Hong Yi > wrote:
Hello,

I am trying to build VTK with boost support in Visual Studio 2010. I generated VTK solution/projects successfully using CMake, but when I build VTK solution in VS 2010, I got the following link error:

fatal error LNK1104: cannot open file 'libboost_serialization-vc100-mt-gd-1_44.lib'

I installed boost C++ library (version 1.44) using installer provided by BoostPro Computing. I selected all multi-threaded build variants when installing boost.

I cannot find any useful suggestions by googling to solve this link error and hope to get some advice from the list.

Thanks,

Hong

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From jeff.baumes at kitware.com  Fri Dec 10 13:00:04 2010
From: jeff.baumes at kitware.com (Jeff Baumes)
Date: Fri, 10 Dec 2010 13:00:04 -0500
Subject: [vtkusers] Link error when building VTK with boost support in
 Visual Studio 2010
In-Reply-To: <3269F716AE5D424ABC02847989CA18CF1E43C2D2@exch-mbx1.ad.renci.org>
References: <3269F716AE5D424ABC02847989CA18CF1E43C255@exch-mbx1.ad.renci.org>
	
	<3269F716AE5D424ABC02847989CA18CF1E43C2D2@exch-mbx1.ad.renci.org>
Message-ID: 

The flag is only available if you turn on certain other flags, so it sounds
like it is not on. What library is being linked when you get this error?

Jeff

On Fri, Dec 10, 2010 at 12:08 PM, Hong Yi  wrote:

> I did not find VTK_USE_PARALLEL_BGL flag, only find VTK_USE_PARALLEL flag
> which is turned off. Two relevant flags, VTK_USE_BOOST and
> VTK_USE_TEXT_ANALYSIS flags, are turned on with VTK_USE_PARALLEL flag off. I
> am using CMake 2.8.3 and VTK 5.6. Is there an exact flag called
> VTK_USE_PARALLEL_BGL? I checked a couple of times but could not find it, for
> some reason?
>
>
>
> Many thanks for the info,
>
>
>
> Hong
>
>
>
> *From:* Jeff Baumes [mailto:jeff.baumes at kitware.com]
> *Sent:* Friday, December 10, 2010 11:20 AM
> *To:* Hong Yi
> *Cc:* VTK Users
> *Subject:* Re: [vtkusers] Link error when building VTK with boost support
> in Visual Studio 2010
>
>
>
> Did you turn on VTK_USE_PARALLEL_BGL for processing graphs in parallel?
> That is the only reason it should be looking for the serialization library.
> If you turn off that flag it should be fine (in case you turned it on
> accidentally).
>
>
>
> Jeff
>
> On Fri, Dec 10, 2010 at 10:37 AM, Hong Yi  wrote:
>
> Hello,
>
>
>
> I am trying to build VTK with boost support in Visual Studio 2010. I
> generated VTK solution/projects successfully using CMake, but when I build
> VTK solution in VS 2010, I got the following link error:
>
>
>
> fatal error LNK1104: cannot open file
> 'libboost_serialization-vc100-mt-gd-1_44.lib'
>
>
>
> I installed boost C++ library (version 1.44) using installerprovided by BoostPro
> Computing . I selected all multi-threaded build
> variants when installing boost.
>
>
>
> I cannot find any useful suggestions by googling to solve this link error
> and hope to get some advice from the list.
>
>
>
> Thanks,
>
>
>
> Hong
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From mmroden at gmail.com  Fri Dec 10 14:27:36 2010
From: mmroden at gmail.com (Mark Roden)
Date: Fri, 10 Dec 2010 11:27:36 -0800
Subject: [vtkusers] problem with vtkImageOpenClose3D
Message-ID: 

Hi all,

I'm having a problem with vtkImageOpenClose3D.  It seems that no
matter what the radius I give to the filter, it's only closing by a
single pixel.

Here's my method (java, vtk v 5.6)

    private void ErodeDilateBinary(vtkImageData inBinaryImage){
        vtkImageOpenClose3D theOpenClose = new vtkImageOpenClose3D();
        //theOpenClose.SetOpenValue(0);
        theOpenClose.SetCloseValue(100);

        int theRadius = (int)(((radii[0] > radii[1]? radii[0] :
radii[1]) * 0.25) + 0.5);
        if (theRadius < 1) theRadius = 1;

        int[] erodeDilateKernel = new int[3];
        switch (panel.getOrientation()) {
            case OrthoPanel.ORIENTATION_XY:
                erodeDilateKernel[0] = theRadius;
                erodeDilateKernel[1] = theRadius;
                erodeDilateKernel[2] = 1;
            break;
            case OrthoPanel.ORIENTATION_XZ:
                erodeDilateKernel[0] = theRadius;
                erodeDilateKernel[1] = 1;
                erodeDilateKernel[2] = theRadius;
            break;
            case OrthoPanel.ORIENTATION_YZ:
                erodeDilateKernel[0] = 1;
                erodeDilateKernel[1] = theRadius;
                erodeDilateKernel[2] = theRadius;
            break;
        }
        theOpenClose.SetKernelSize(erodeDilateKernel[0],
erodeDilateKernel[1], erodeDilateKernel[2]);
        theOpenClose.SetInput(inBinaryImage);
        theOpenClose.Update();
        inBinaryImage = theOpenClose.GetOutput();

    }
theRadius, in this case, is 11, and orientation is XY.

I'm trying to remove small (no larger than four or five pixels) holes
from a binary mask.  The single pixel holes are removed, but the
larger holes remain.  I would think that with a radius of 11, anything
smaller than 8 or so pixels (given topology, of course...) would be
erased.  Is there something I'm missing here?  Once a hole is filled,
it shouldn't be able to come back, right?

Thanks for any help,
Mark


From aracha2010 at gmail.com  Fri Dec 10 14:41:31 2010
From: aracha2010 at gmail.com (Rachel)
Date: Fri, 10 Dec 2010 11:41:31 -0800 (PST)
Subject: [vtkusers] VTK/Examples/Cxx/ImageData/IterateImageData
Message-ID: <1292010091961-3300844.post@n5.nabble.com>


Hi all,
i m looking for how to get pixel value in a image (it is black and white)
and replace it with new value and save image.
 i tried to use the following example:
VTK/Examples/Cxx/ImageData/IterateImageData

the pixels values are set to 2.0. and then the code displays  0 instead 2.0

any one know where is the mistake ?

Many thanks


-- 
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-Examples-Cxx-ImageData-IterateImageData-tp3300844p3300844.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From daviddoria at gmail.com  Fri Dec 10 14:48:50 2010
From: daviddoria at gmail.com (David Doria)
Date: Fri, 10 Dec 2010 14:48:50 -0500
Subject: [vtkusers] VTK/Examples/Cxx/ImageData/IterateImageData
In-Reply-To: <1292010091961-3300844.post@n5.nabble.com>
References: <1292010091961-3300844.post@n5.nabble.com>
Message-ID: 

On Fri, Dec 10, 2010 at 2:41 PM, Rachel  wrote:
>
> Hi all,
> i m looking for how to get pixel value in a image (it is black and white)
> and replace it with new value and save image.
> ?i tried to use the following example:
> VTK/Examples/Cxx/ImageData/IterateImageData
>
> the pixels values are set to 2.0. and then the code displays ?0 instead 2.0
>
> any one know where is the mistake ?
>
> Many thanks


Are you running that code without modifying it? The output for me is:

Starting:
Dims:  x: 2 y: 3 z: 1
Number of points: 6
Number of cells: 2
2 2
2 2
2 2

David


From luca.pamparana at gmail.com  Fri Dec 10 19:04:34 2010
From: luca.pamparana at gmail.com (Luca Pamparana)
Date: Sat, 11 Dec 2010 00:04:34 +0000
Subject: [vtkusers] VTK demo
Message-ID: 

Hello everyone,

I want to demo VTK to my company CEO next week and one of the example
that is sure to catch his eye is some volume/isosurface rendering
(medical data would be good) and if there is some fancy CAD dataset
available that could be visualized using VTK, that would be great.

It does not really need to be something particular, just anything that
would look good on the screen :)

I was wondering if there are some datasets (maybe 2 or 3) and some
associated VTK code available that would demonstrate some of the
volume rendering, isosurface rendering, texturing/color map
capabilities of VTK. If anyone can point me to such examples that
would be really appreciated. I can take the code and integrate it with
my demo app.

Thanks,

Luca


From webmaster at insightsoftwareconsortium.org  Sat Dec 11 09:14:58 2010
From: webmaster at insightsoftwareconsortium.org (Insight Journal)
Date: Sat, 11 Dec 2010 09:14:58 -0500
Subject: [vtkusers] The Insight Journal-New Submission
Message-ID: <201012111414.oBBEEwvR020830@insight-journal.org>

Hello,
A new submission has been added to the Insight Journal.

Title: RGB Image Color Space Transformations
Author(s):Tamburo R.
Abstract: 
This paper describes a set of pixel accessors that transform RGB pixel values to a different color space.  Accessors for the HSI, XYZ, Yuv, YUV, HSV, Lab, Luv, HSL, CMY, and CMYK color spaces are provided here. This paper is accompanied with source code for the pixel accessors and test, test images and parameters, and expected output images. 

Download and Review the paper at: http://www.insight-journal.org/browse/publication/780

Generated by the Insight Journal
You are receiving this email because you asked to be informed by the Insight Journal for new submissions.
                    
To change your email preference go to http://www.insight-journal.org .


From nico.schloemer at gmail.com  Sat Dec 11 14:10:10 2010
From: nico.schloemer at gmail.com (=?ISO-8859-1?Q?Nico_Schl=F6mer?=)
Date: Sat, 11 Dec 2010 20:10:10 +0100
Subject: [vtkusers] vtkPExodusIIWriter?
Message-ID: 

Hi all,

I notice that with VTK, it's possible to read parallel ExodusII files
via "vtkPExodusIIReader"
.
Curiously, however, I didn't find the corresponding vtkPExodusIIWriter
class.

Is it possible to write parallel Exodus files with VTK at all then,
using the regular vtkExodusIIWriter classes?

Cheers,
Nico


From nico.schloemer at gmail.com  Sat Dec 11 14:12:40 2010
From: nico.schloemer at gmail.com (=?ISO-8859-1?Q?Nico_Schl=F6mer?=)
Date: Sat, 11 Dec 2010 20:12:40 +0100
Subject: [vtkusers] vtk.vtkExodusIIReader: information in GetOutput()?
In-Reply-To: 
References: 
	<36B5C9ED-29B9-4CAF-92A9-87D9FB262C72@sandia.gov>
	
	
Message-ID: 

> Reading the source for its RequestData()
> method illustrates how to iterate over all the edges yourself if you don't
> want to use the filter.

The filter? I'm not familiar with this concept (though it seems to
appear within VTK a lot).
If that something that help in iterating over the edges, I'd be more
than happy to use it of course! Are there examples?

--Nico



On Tue, Dec 7, 2010 at 2:43 AM, David Thompson  wrote:
>> ... I tried the snippet your provided and got
>>
>> ============ *snip* ============
>> Element Blocks
>> ?block_5
>> ...
>> ============ *snap* ============
>>
>> I guess that tells me I got one element block, and that'd be it. I
>> guess Exodus is minimalistic in the sense that it contains exactly
>> what was put into the file once, and even though there are egdes in
>> the mesh naturally, they are not stored in the file.
>
> True.
>
>> Do you happen to know if it's possible to iterate over the edges
>> and/or faces of a vtkUnstructuredGrid?
>
> You can use vtkExtractEdges to get a vtkPolyData that contains all the edges
> of the input vtkUnstructuredGrid. Reading the source for its RequestData()
> method illustrates how to iterate over all the edges yourself if you don't
> want to use the filter.
>
> ? ? ? ?David
>
>
>


From nico.schloemer at gmail.com  Sat Dec 11 16:25:48 2010
From: nico.schloemer at gmail.com (=?ISO-8859-1?Q?Nico_Schl=F6mer?=)
Date: Sat, 11 Dec 2010 22:25:48 +0100
Subject: [vtkusers] vtk.vtkExodusIIReader: information in GetOutput()?
In-Reply-To: <36B5C9ED-29B9-4CAF-92A9-87D9FB262C72@sandia.gov>
References: 
	<36B5C9ED-29B9-4CAF-92A9-87D9FB262C72@sandia.gov>
Message-ID: 

Alright, so this

================= *snip* =================
    out = reader.GetOutput()
    for i in range( out.GetNumberOfBlocks() ):
        blk = out.GetBlock( i )
        for j in range( blk.GetNumberOfBlocks() ):
            sub_block = blk.GetBlock( j )
            if sub_block.IsA( "vtkUnstructuredGrid" ):
                vtk_mesh.append( sub_block )
================= *snap* =================

gives me all vtkUnstructuredGrid in the vtkExodusIIReader output. Nice!

However, there's more data in the Exodus file I'd like to retrieve,
for example a data array for point data. In the ExodusII file, the
values are declared as "vals_nod_var1=..." and "name_nod_var =
"x0_R",  "x0_Z" ;", but those are certainly not contained in the block
hierarchy above.

Is there a switch of some sort that needs to be set prior to reading
the data maybe?

--Nico





On Mon, Dec 6, 2010 at 9:21 PM, David Thompson  wrote:
>> ... when reading an ExodusII file with
>> ?reader = vtk.vtkExodusIIReader()
>> ?reader.Update()
>> ?out = reader.GetOutput()
>> 'out' would contain a whole lot of output the significance of which I
>> don't quite understant;
>
> Hi Nico,
>
> The old vtkExodusReader used to output a single unstructured grid. This made
> it difficult to handle the case when a variable was defined on some cells
> (in one element block) but not on others (in a different element block). It
> was also awkward to provide information about node sets and face sets. At
> the time, there was also no concept of pedigree and global ID arrays in
> vtkDataSetAttributes. This made writing Exodus datasets back out to a file
> after some manipulation difficult since much of the information in the
> original file could not be preserved. The vtkExodusModel and
> vtkModelMetadata classes were attempts to encapsulate some of that
> information for later access by a writer.
>
> The new vtkExodusIIReader outputs a multiblock dataset. Each multiblock
> dataset may have an arbitrary number of blocks, where each block is a
> arbitary dataset (an unstructured grid, an image, or even another multiblock
> dataset). The new reader outputs a multiblock dataset where each of the
> top-level blocks is itself a multiblock dataset holding unstructured grids
> of a single type (element blocks, face blocks, edge blocks, element sets,
> side sets, face sets, edge sets, node sets). When you "print out" you are
> seeing all of the internal variables associated with the one toplevel
> multiblock dataset and its children.
>
> This should print some more concise information about the blocks:
> ====================== *snip* ======================
> for i in range( out.GetNumberOfBlocks() ):
> ?print out.GetMetaData( i ).Get( vtkCompositeDataSet.NAME() )
> ?blk = out.GetBlock( i )
> ?for j in range( blk.GetNumberOfBlocks() ):
> ? ?print ' ?' + blk.GetMetaData( j ).Get( vtkCompositeDataSet.NAME() )
>
> ====================== *snip* ======================
> When the reader is told to read a block or set (only element blocks are read
> by default), then an unstructured grid will be inserted into the appropriate
> sub-block of the main reader's output.
>
> ? ? ? ?Hope this helps,
> ? ? ? ?David
>
>
>
>


From dcthomp at sandia.gov  Sat Dec 11 21:02:15 2010
From: dcthomp at sandia.gov (Thompson, David C)
Date: Sat, 11 Dec 2010 19:02:15 -0700
Subject: [vtkusers] vtk.vtkExodusIIReader: information in GetOutput()?
In-Reply-To: 
References: 
	<36B5C9ED-29B9-4CAF-92A9-87D9FB262C72@sandia.gov>
	
	,
	
Message-ID: <1C9079C90336A64BBF5612428BC98E1F3AB2F0E107@ES04SNLNT.srn.sandia.gov>

Hi Nico,

>> Reading the source for its RequestData()
>> method illustrates how to iterate over all the edges yourself if you don't
>> want to use the filter.
> The filter? I'm not familiar with this concept (though it seems to appear within VTK a lot).

In VTK, most of the C++ classes either serve mainly as
+ storage (anything inheriting vtkDataObject)
+ algorithms that take storage as input or produce storage as output or both.
The second set are known as filters, because most take an input dataset
and filter the data in some way to produce an output. For example,
the vtkGeometryFilter takes a mesh as input and produces polygonal
output describing some kind of boundary of the mesh (its bounding points,
edges, or faces).

> If that something that help in iterating over the edges, I'd be more
> than happy to use it of course! Are there examples?

I was suggesting that you look at the C++ source code:
http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkExtractEdges.cxx;h=901e9f968d4510ec4c50a39621dd6dc6e68cbfd5;hb=HEAD
for the vtkExtractEdges class (lines 50--209 in the version above) since I don't
know of any other examples of how to traverse the edges of a mesh. Most of
the C++ methods also exist in the Python wrappings, so you should
be able to translate it into Python if need be.

    David

On Tue, Dec 7, 2010 at 2:43 AM, David Thompson  wrote:
>> ... I tried the snippet your provided and got
>>
>> ============ *snip* ============
>> Element Blocks
>>  block_5
>> ...
>> ============ *snap* ============
>>
>> I guess that tells me I got one element block, and that'd be it. I
>> guess Exodus is minimalistic in the sense that it contains exactly
>> what was put into the file once, and even though there are egdes in
>> the mesh naturally, they are not stored in the file.
>
> True.
>
>> Do you happen to know if it's possible to iterate over the edges
>> and/or faces of a vtkUnstructuredGrid?
>
> You can use vtkExtractEdges to get a vtkPolyData that contains all the edges
> of the input vtkUnstructuredGrid. Reading the source for its RequestData()
> method illustrates how to iterate over all the edges yourself if you don't
> want to use the filter.
>
>        David
>
>
>




From dcthomp at sandia.gov  Sat Dec 11 21:30:27 2010
From: dcthomp at sandia.gov (Thompson, David C)
Date: Sat, 11 Dec 2010 19:30:27 -0700
Subject: [vtkusers] vtk.vtkExodusIIReader: information in GetOutput()?
In-Reply-To: 
References: 
	<36B5C9ED-29B9-4CAF-92A9-87D9FB262C72@sandia.gov>,
	
Message-ID: <1C9079C90336A64BBF5612428BC98E1F3AB2F0E108@ES04SNLNT.srn.sandia.gov>

Hi Nico,

> Alright, so this
> ...
> gives me all vtkUnstructuredGrid in the vtkExodusIIReader output. Nice!
> However, there's more data in the Exodus file I'd like to retrieve,
> for example a data array for point data. In the ExodusII file, the
> values are declared as "vals_nod_var1=..." and "name_nod_var =
> "x0_R",  "x0_Z" ;", but those are certainly not contained in the block
> hierarchy above.

Each unstructured grid that is output may have point and cell
arrays (I forget whether they are read by default or whether you
must call SetObjectArrayStatus() to tell the reader you want them
loaded). For the point variables "x0_R" and "x0_Z" in your example
above, you would call

  rdr = vtkExodusIIReader()
  rdr.SetFileName( 'foo.exo' ) # or whatever
  rdr.UpdateInformation() # this tells the reader to fetch metadata from the file
  # Iterate over all the point arrays:
  for i in range( rdr.GetNumberOfObjectArrays( rdr.NODAL ) ):
    nname = rdr.GetObjectArrayName( rdr.NODAL, i )
    print 'Array %d is "%s"' % (i,nname)
    # if an array name matches, tell the reader we want to load it:
    if nname == 'x0' or nname == 'x0_':
      # 0 means "don't load", 1 means "load" the i-th nodal array
      rdr.SetObjectArrayStatus( rdr.NODAL, i, 1 )
  rdr.Update()
  out = rdr.GetOutput()
  # Assuming you have an element block, its point data will have
  # the x0 array.
  elem_blks = out.GetBlock( 0 )
  elem_blk0 = elem_blks.GetBlock( 0 )
  x0 = elem_blk0.GetPointData().GetArray( 'x0' )

Note that because "_R" and "_Z" imply cylindrical coordinates, the two scalars
in the exodus file will be combined into a 2-component vector by the reader and
the result will be named either "x0" or "x0_" (I forget whether the trailing underscore
is omitted or not).

Because Exodus defines a single, global set of nodes for all element/face/edge
blocks, any nodal variables you request will be present on every output block.
However, because the cells in a block don't necessarily reference every point,
the point coordinates and point data for each block are subsets of the global
arrays. For instance, if you have 10 points defined in a mesh but the first
element block contains a single quadrilateral (4 points), there will only be 4
values in the 'x0' array attached to that element block's unstructured grid.

    David


On Mon, Dec 6, 2010 at 9:21 PM, David Thompson  wrote:
>> ... when reading an ExodusII file with
>>  reader = vtk.vtkExodusIIReader()
>>  reader.Update()
>>  out = reader.GetOutput()
>> 'out' would contain a whole lot of output the significance of which I
>> don't quite understant;
>
> Hi Nico,
>
> The old vtkExodusReader used to output a single unstructured grid. This made
> it difficult to handle the case when a variable was defined on some cells
> (in one element block) but not on others (in a different element block). It
> was also awkward to provide information about node sets and face sets. At
> the time, there was also no concept of pedigree and global ID arrays in
> vtkDataSetAttributes. This made writing Exodus datasets back out to a file
> after some manipulation difficult since much of the information in the
> original file could not be preserved. The vtkExodusModel and
> vtkModelMetadata classes were attempts to encapsulate some of that
> information for later access by a writer.
>
> The new vtkExodusIIReader outputs a multiblock dataset. Each multiblock
> dataset may have an arbitrary number of blocks, where each block is a
> arbitary dataset (an unstructured grid, an image, or even another multiblock
> dataset). The new reader outputs a multiblock dataset where each of the
> top-level blocks is itself a multiblock dataset holding unstructured grids
> of a single type (element blocks, face blocks, edge blocks, element sets,
> side sets, face sets, edge sets, node sets). When you "print out" you are
> seeing all of the internal variables associated with the one toplevel
> multiblock dataset and its children.
>
> This should print some more concise information about the blocks:
> ====================== *snip* ======================
> for i in range( out.GetNumberOfBlocks() ):
>  print out.GetMetaData( i ).Get( vtkCompositeDataSet.NAME() )
>  blk = out.GetBlock( i )
>  for j in range( blk.GetNumberOfBlocks() ):
>    print '  ' + blk.GetMetaData( j ).Get( vtkCompositeDataSet.NAME() )
>
> ====================== *snip* ======================
> When the reader is told to read a block or set (only element blocks are read
> by default), then an unstructured grid will be inserted into the appropriate
> sub-block of the main reader's output.
>
>        Hope this helps,
>        David
>
>
>
>




From dcthomp at sandia.gov  Sat Dec 11 21:30:42 2010
From: dcthomp at sandia.gov (Thompson, David C)
Date: Sat, 11 Dec 2010 19:30:42 -0700
Subject: [vtkusers] vtkPExodusIIWriter?
In-Reply-To: 
References: 
Message-ID: <1C9079C90336A64BBF5612428BC98E1F3AB2F0E109@ES04SNLNT.srn.sandia.gov>

Hi Nico,

I didn't write the vtkExodusIIWriter, so I don't know about how/whether it works in parallel.

    David
________________________________________
From: vtkusers-bounces at vtk.org [vtkusers-bounces at vtk.org] On Behalf Of Nico Schl?mer [nico.schloemer at gmail.com]
Sent: Saturday, December 11, 2010 11:10
To: vtkusers
Subject: [vtkusers] vtkPExodusIIWriter?

Hi all,

I notice that with VTK, it's possible to read parallel ExodusII files
via "vtkPExodusIIReader"
.
Curiously, however, I didn't find the corresponding vtkPExodusIIWriter
class.

Is it possible to write parallel Exodus files with VTK at all then,
using the regular vtkExodusIIWriter classes?

Cheers,
Nico
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers




From paulojamorim at gmail.com  Sat Dec 11 21:41:02 2010
From: paulojamorim at gmail.com (Paulo Henrique Junqueira Amorim)
Date: Sun, 12 Dec 2010 00:41:02 -0200
Subject: [vtkusers] Triangle Geometry and Vertices
Message-ID: 

Hi,

I'm trying to write this example (
http://www.vtk.org/Wiki/VTK/Tutorials/TriangleGeometryVertices ) in python
language.

When you open the VTK rendering window occurs Segmentation fault.

I tried to open the file (.vtp) in the Paraview, when click on Apply, the
Paraview closes.

Regards,
Paulo


*The code:
*
from vtk import *

X = [1.0, 0.0, 0.0]
Y = [0.0, 0.0, 1.0]
Z = [0.0, 0.0, 0.0]

points = vtkPoints()
vertices = vtkCellArray()

ids = vtkIdList()
ids.SetNumberOfIds(3)

for i in xrange(3):
    ids.SetId(i, i)
    points.InsertNextPoint(X[i],Y[i],Z[i])
    vertices.InsertNextCell(ids)

writer = vtkXMLPolyDataWriter()
writer.SetFileName ( ".//TriangleVerts.vtp")
writer.SetInput(polydata)
writer.Write()

polydata = vtkPolyData()
polydata.SetPoints(points)
polydata.SetVerts(vertices)
polydata.Update()

mapper = vtkPolyDataMapper()
mapper.SetInput(polydata)

actor = vtkActor()
actor.SetMapper(mapper)

ren = vtkRenderer()
ren.AddActor(actor)

renWin = vtkRenderWindow()
renWin.AddRenderer( ren )

iren = vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)

renWin.Render()


*VTP File Content:*




  
    
      
      
      
      
      
        
      
      
        
        
      
      
        
        
      
      
        
        
      
      
        
        
      
    
  
  

_AQAAAACAAAAkAAAAEAAAAA==eJxjYGiwZ8AJIHIAHX4Bfw==AQAAAACAAAAwAAAAGQAAAA==eJxjYICAFXqXL8XXM8ABIwMqgPEBffcDXA==AQAAAACAAAAYAAAAEAAAAA==eJxjYoAAFijNBqUBALgADQ==AAAAAACAAAAAAAAAAAAAAACAAAAAAAAAAAAAAACAAAAAAAAAAAAAAACAAAAAAAAAAAAAAACAAAAAAAAAAAAAAACAAAAAAAAA
  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From hongyi at renci.org  Sat Dec 11 22:52:27 2010
From: hongyi at renci.org (Hong Yi)
Date: Sun, 12 Dec 2010 03:52:27 +0000
Subject: [vtkusers] Link error when building VTK with boost support in
 Visual Studio 2010
In-Reply-To: 
References: <3269F716AE5D424ABC02847989CA18CF1E43C255@exch-mbx1.ad.renci.org>
	
	<3269F716AE5D424ABC02847989CA18CF1E43C2D2@exch-mbx1.ad.renci.org>
	
Message-ID: <3269F716AE5D424ABC02847989CA18CF1E43C7AA@exch-mbx1.ad.renci.org>

Thanks, Jeff.

I don't get this error (i.e., fatal error LNK1104: cannot open file 'libboost_serialization-vc100-mt-gd-1_44.lib') any more after I turned off Windows 7 Account Access Control and rebuilt everything, so this error was caused by windows 7 Account Access Control. However, I got the following 3 linking errors:

8>BoostArrayLogWeighting.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class vtkBoostLogWeighting * __cdecl vtkBoostLogWeighting::New(void)" (__imp_?New at vtkBoostLogWeighting@@SAPAV1 at XZ) referenced in function "public: static class vtkSmartPointer __cdecl vtkSmartPointer::New(void)" (?New@?$vtkSmartPointer at VvtkBoostLogWeighting@@@@SA?AV1 at XZ)
8>BoostArrayRandomSparseArraySource.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class vtkBoostRandomSparseArraySource * __cdecl vtkBoostRandomSparseArraySource::New(void)" (__imp_?New at vtkBoostRandomSparseArraySource@@SAPAV1 at XZ) referenced in function "public: static class vtkSmartPointer __cdecl vtkSmartPointer::New(void)" (?New@?$vtkSmartPointer at VvtkBoostRandomSparseArraySource@@@@SA?AV1 at XZ)
8>BoostArrayRandomSparseArraySource.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall vtkBoostRandomSparseArraySource::SetExtents(class vtkArrayExtents const &)" (__imp_?SetExtents at vtkBoostRandomSparseArraySource@@QAEXABVvtkArrayExtents@@@Z) referenced in function "int __cdecl BoostArrayRandomSparseArraySource(int,char * * const)" (?BoostArrayRandomSparseArraySource@@YAHHQAPAD at Z)
8>C:\Users\hongyi.HONGYI-W510\VTK-CMake\bin\RelWithDebInfo\InfovisBoostArrayCxxTests.exe : fatal error LNK1120: 3 unresolved externals

Any suggestions on what additional libs I should include in the link property setup to make above three symbols resolved?

Another not-directly-related question: I have written a simple example using VTK and QT and it only works with release configuration with VTK built and installed with release configuration also. When I run the example with debug configuration, I got an error message "this application has failed to start because the application configuration is incorrect. Review the manifest file for possible errors." I am new to VTK and read from the web that VTK should be installed with release configuration since the debug configuration does not work well, is that a true statement? I am currently using visual studio 2010 to build VTK 5.6 version. If I want my VTK+QT example to work with debug configuration, is there anything special I should do and be aware of? Thanks for any suggestions and guidelines on this.

Hong


From: Jeff Baumes [mailto:jeff.baumes at kitware.com]
Sent: Friday, December 10, 2010 1:00 PM
To: Hong Yi
Cc: VTK Users
Subject: Re: [vtkusers] Link error when building VTK with boost support in Visual Studio 2010

The flag is only available if you turn on certain other flags, so it sounds like it is not on. What library is being linked when you get this error?

Jeff
On Fri, Dec 10, 2010 at 12:08 PM, Hong Yi > wrote:
I did not find VTK_USE_PARALLEL_BGL flag, only find VTK_USE_PARALLEL flag which is turned off. Two relevant flags, VTK_USE_BOOST and VTK_USE_TEXT_ANALYSIS flags, are turned on with VTK_USE_PARALLEL flag off. I am using CMake 2.8.3 and VTK 5.6. Is there an exact flag called VTK_USE_PARALLEL_BGL? I checked a couple of times but could not find it, for some reason...

Many thanks for the info,

Hong

From: Jeff Baumes [mailto:jeff.baumes at kitware.com]
Sent: Friday, December 10, 2010 11:20 AM
To: Hong Yi
Cc: VTK Users
Subject: Re: [vtkusers] Link error when building VTK with boost support in Visual Studio 2010

Did you turn on VTK_USE_PARALLEL_BGL for processing graphs in parallel? That is the only reason it should be looking for the serialization library. If you turn off that flag it should be fine (in case you turned it on accidentally).

Jeff
On Fri, Dec 10, 2010 at 10:37 AM, Hong Yi > wrote:
Hello,

I am trying to build VTK with boost support in Visual Studio 2010. I generated VTK solution/projects successfully using CMake, but when I build VTK solution in VS 2010, I got the following link error:

fatal error LNK1104: cannot open file 'libboost_serialization-vc100-mt-gd-1_44.lib'

I installed boost C++ library (version 1.44) using installer provided by BoostPro Computing. I selected all multi-threaded build variants when installing boost.

I cannot find any useful suggestions by googling to solve this link error and hope to get some advice from the list.

Thanks,

Hong

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From jimcp at cox.net  Sun Dec 12 08:39:35 2010
From: jimcp at cox.net (Jim Peterson)
Date: Sun, 12 Dec 2010 08:39:35 -0500
Subject: [vtkusers] Triangle Geometry and Vertices
In-Reply-To: 
References: 
Message-ID: <4D04D097.2080205@cox.net>

Paulo,
I am no Python expert, but if I understand the sequence of events, you 
should create the polydata object before writing the file.

Hope that helps,
Jim

Paulo Henrique Junqueira Amorim wrote:
> Hi,
>
> I'm trying to write this example ( 
> http://www.vtk.org/Wiki/VTK/Tutorials/TriangleGeometryVertices ) in 
> python language.
>
> When you open the VTK rendering window occurs Segmentation fault.
>
> I tried to open the file (.vtp) in the Paraview, when click on Apply, 
> the Paraview closes.
>
> Regards,
> Paulo
>
>
> *The code:
> *
> from vtk import *
>
> X = [1.0, 0.0, 0.0]
> Y = [0.0, 0.0, 1.0]
> Z = [0.0, 0.0, 0.0]
>  
> points = vtkPoints()
> vertices = vtkCellArray()
>
> ids = vtkIdList()
> ids.SetNumberOfIds(3)
>
> for i in xrange(3):
>     ids.SetId(i, i)
>     points.InsertNextPoint(X[i],Y[i],Z[i])
>     vertices.InsertNextCell(ids)
>    
> writer = vtkXMLPolyDataWriter()
> writer.SetFileName ( ".//TriangleVerts.vtp")
> writer.SetInput(polydata)
> writer.Write()
>
> polydata = vtkPolyData()
> polydata.SetPoints(points)
> polydata.SetVerts(vertices)
> polydata.Update()
>
> mapper = vtkPolyDataMapper()
> mapper.SetInput(polydata)
>
> actor = vtkActor()
> actor.SetMapper(mapper)
>  
> ren = vtkRenderer()
> ren.AddActor(actor)
>
> renWin = vtkRenderWindow()
> renWin.AddRenderer( ren )
>
> iren = vtkRenderWindowInteractor()
> iren.SetRenderWindow(renWin)
>
> renWin.Render()
>
>
> *VTP File Content:*
>
>
> 
>  compressor="vtkZLibDataCompressor">
>   
>      NumberOfVerts="3"                    
> NumberOfLines="0"                    
> NumberOfStrips="0"                    
> NumberOfPolys="0"                   >
>       
>       
>       
>       
>       
>          format="appended" RangeMin="0"                    
> RangeMax="1"                    offset="0"                   />
>       
>       
>          RangeMin=""                     RangeMax=""                     
> offset="48"                  />
>          RangeMin=""                     RangeMax=""                     
> offset="108"                 />
>       
>       
>          RangeMin=""                     RangeMax=""                     
> offset="156"                 />
>          RangeMin=""                     RangeMax=""                     
> offset="172"                 />
>       
>       
>          RangeMin=""                     RangeMax=""                     
> offset="188"                 />
>          RangeMin=""                     RangeMax=""                     
> offset="204"                 />
>       
>       
>          RangeMin=""                     RangeMax=""                     
> offset="220"                 />
>          RangeMin=""                     RangeMax=""                     
> offset="236"                 />
>       
>     
>   
>   
>    
> _AQAAAACAAAAkAAAAEAAAAA==eJxjYGiwZ8AJIHIAHX4Bfw==AQAAAACAAAAwAAAAGQAAAA==eJxjYICAFXqXL8XXM8ABIwMqgPEBffcDXA==AQAAAACAAAAYAAAAEAAAAA==eJxjYoAAFijNBqUBALgADQ==AAAAAACAAAAAAAAAAAAAAACAAAAAAAAAAAAAAACAAAAAAAAAAAAAAACAAAAAAAAAAAAAAACAAAAAAAAAAAAAAACAAAAAAAAA
>   
> 
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   



From david.gobbi at gmail.com  Sun Dec 12 10:43:36 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Sun, 12 Dec 2010 08:43:36 -0700
Subject: [vtkusers] Triangle Geometry and Vertices
In-Reply-To: <4D04D097.2080205@cox.net>
References: 
	<4D04D097.2080205@cox.net>
Message-ID: 

On Sun, Dec 12, 2010 at 6:39 AM, Jim Peterson  wrote:

> Paulo,
> I am no Python expert, but if I understand the sequence of events, you
> should create the polydata object before writing the file.
>
> Hope that helps,
> Jim


What Jim said.  Also, the id list is never filled in.  The following code is
wrong:

ids = vtkIdList()
ids.SetNumberOfIds(3)

for i in xrange(3):
    ids.SetId(i, i)
    points.InsertNextPoint(X[i],Y[i],Z[i])
    vertices.InsertNextCell(ids)

To fix it, you have two choices.  You can have all three verts in the same
cell:

ids = vtkIdList()
ids.SetNumberOfIds(3)

for i in xrange(3):
    ids.SetId(i, i)
    points.InsertNextPoint(X[i],Y[i],Z[i])

vertices.InsertNextCell(ids)

Or you can have each vert in its own cell:

ids = vtkIdList()
ids.SetNumberOfIds(1)

for i in xrange(3):
    ids.SetId(0, i)
    points.InsertNextPoint(X[i],Y[i],Z[i])
    vertices.InsertNextCell(ids)

In the "for" loop, you were calling vertices.InsertNextCell(ids)
when "ids" still had some unititialized values, since the three
ids values were not filled in until the third loop iteration.

  - David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From david.gobbi at gmail.com  Sun Dec 12 11:04:58 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Sun, 12 Dec 2010 09:04:58 -0700
Subject: [vtkusers] Triangle Geometry and Vertices
In-Reply-To: 
References: 
	<4D04D097.2080205@cox.net>
	
Message-ID: 

I'm going to throw in a little addition.? You say "triangle verts" so
I'm guessing
you want your cells to be triangles, not verts.? If that is the case,
the code you
really need is as follows:

 ids = vtkIdList()
 ids.SetNumberOfIds(3)

 for i in xrange(3):
     ids.SetId(i, i)
     points.InsertNextPoint(X[i],Y[i],Z[i])

 vertices.InsertNextCell(ids) # call for every cell, not for every point

 polydata = vtkPolyData()
 polydata.SetPoints(points)
 polydata.SetPolys(vertices)  # use SetPolys for triangles
 polydata.Update()

The above code will create a polydata that has one triangle.

  David


On Sun, Dec 12, 2010 at 8:43 AM, David Gobbi  wrote:
>
> On Sun, Dec 12, 2010 at 6:39 AM, Jim Peterson  wrote:
>>
>> Paulo,
>> I am no Python expert, but if I understand the sequence of events, you should create the polydata object before writing the file.
>>
>> Hope that helps,
>> Jim
>
> What Jim said.? Also, the id list is never filled in.? The following code is wrong:
>
> ids = vtkIdList()
> ids.SetNumberOfIds(3)
>
> for i in xrange(3):
> ??? ids.SetId(i, i)
> ??? points.InsertNextPoint(X[i],Y[i],Z[i])
> ??? vertices.InsertNextCell(ids)
>
> To fix it, you have two choices.? You can have all three verts in the same cell:
>
> ids = vtkIdList()
> ids.SetNumberOfIds(3)
>
> for i in xrange(3):
> ??? ids.SetId(i, i)
> ??? points.InsertNextPoint(X[i],Y[i],Z[i])
>
> vertices.InsertNextCell(ids)
> Or you can have each vert in its own cell:
>
> ids = vtkIdList()
> ids.SetNumberOfIds(1)
>
> for i in xrange(3):
> ??? ids.SetId(0, i)
> ??? points.InsertNextPoint(X[i],Y[i],Z[i])
> ??? vertices.InsertNextCell(ids)
>
> In the "for" loop, you were calling vertices.InsertNextCell(ids)
> when "ids" still had some unititialized values, since the three
> ids values were not filled in until the third loop iteration.
>
> ? - David


From nico.schloemer at gmail.com  Sun Dec 12 11:11:36 2010
From: nico.schloemer at gmail.com (=?ISO-8859-1?Q?Nico_Schl=F6mer?=)
Date: Sun, 12 Dec 2010 17:11:36 +0100
Subject: [vtkusers] vtk.vtkExodusIIReader: information in GetOutput()?
In-Reply-To: <1C9079C90336A64BBF5612428BC98E1F3AB2F0E108@ES04SNLNT.srn.sandia.gov>
References: 
	<36B5C9ED-29B9-4CAF-92A9-87D9FB262C72@sandia.gov>
	
	<1C9079C90336A64BBF5612428BC98E1F3AB2F0E108@ES04SNLNT.srn.sandia.gov>
Message-ID: 

Hi,

I was able to get it all together with

    reader.UpdateInformation()
    for k in xrange( reader.GetNumberOfPointResultArrays() ):
        arr_name = reader.GetPointResultArrayName( k )
        reader.SetPointResultArrayStatus( arr_name, 1 )

Then, after Update() has been called, the vtkUnstructuredGrid will
magically containt the array. Great!

> Note that because "_R" and "_Z" imply cylindrical coordinates, the two scalars
> in the exodus file will be combined into a 2-component vector by the reader and
> the result will be named either "x0" or "x0_" (I forget whether the trailing underscore
> is omitted or not).

Cylindrical coordinates, alright? Well, I got the data in there by
providing a complex valued array, but I guess that doesn't really
matter. The underscore is preserved by the way, so I'll just go ahead
and cut it off.

Thanks for the help!
--Nico



On Sun, Dec 12, 2010 at 3:30 AM, Thompson, David C  wrote:
> Hi Nico,
>
>> Alright, so this
>> ...
>> gives me all vtkUnstructuredGrid in the vtkExodusIIReader output. Nice!
>> However, there's more data in the Exodus file I'd like to retrieve,
>> for example a data array for point data. In the ExodusII file, the
>> values are declared as "vals_nod_var1=..." and "name_nod_var =
>> "x0_R", ?"x0_Z" ;", but those are certainly not contained in the block
>> hierarchy above.
>
> Each unstructured grid that is output may have point and cell
> arrays (I forget whether they are read by default or whether you
> must call SetObjectArrayStatus() to tell the reader you want them
> loaded). For the point variables "x0_R" and "x0_Z" in your example
> above, you would call
>
> ?rdr = vtkExodusIIReader()
> ?rdr.SetFileName( 'foo.exo' ) # or whatever
> ?rdr.UpdateInformation() # this tells the reader to fetch metadata from the file
> ?# Iterate over all the point arrays:
> ?for i in range( rdr.GetNumberOfObjectArrays( rdr.NODAL ) ):
> ? ?nname = rdr.GetObjectArrayName( rdr.NODAL, i )
> ? ?print 'Array %d is "%s"' % (i,nname)
> ? ?# if an array name matches, tell the reader we want to load it:
> ? ?if nname == 'x0' or nname == 'x0_':
> ? ? ?# 0 means "don't load", 1 means "load" the i-th nodal array
> ? ? ?rdr.SetObjectArrayStatus( rdr.NODAL, i, 1 )
> ?rdr.Update()
> ?out = rdr.GetOutput()
> ?# Assuming you have an element block, its point data will have
> ?# the x0 array.
> ?elem_blks = out.GetBlock( 0 )
> ?elem_blk0 = elem_blks.GetBlock( 0 )
> ?x0 = elem_blk0.GetPointData().GetArray( 'x0' )
>
> Note that because "_R" and "_Z" imply cylindrical coordinates, the two scalars
> in the exodus file will be combined into a 2-component vector by the reader and
> the result will be named either "x0" or "x0_" (I forget whether the trailing underscore
> is omitted or not).
>
> Because Exodus defines a single, global set of nodes for all element/face/edge
> blocks, any nodal variables you request will be present on every output block.
> However, because the cells in a block don't necessarily reference every point,
> the point coordinates and point data for each block are subsets of the global
> arrays. For instance, if you have 10 points defined in a mesh but the first
> element block contains a single quadrilateral (4 points), there will only be 4
> values in the 'x0' array attached to that element block's unstructured grid.
>
> ? ?David
>
>
> On Mon, Dec 6, 2010 at 9:21 PM, David Thompson  wrote:
>>> ... when reading an ExodusII file with
>>> ?reader = vtk.vtkExodusIIReader()
>>> ?reader.Update()
>>> ?out = reader.GetOutput()
>>> 'out' would contain a whole lot of output the significance of which I
>>> don't quite understant;
>>
>> Hi Nico,
>>
>> The old vtkExodusReader used to output a single unstructured grid. This made
>> it difficult to handle the case when a variable was defined on some cells
>> (in one element block) but not on others (in a different element block). It
>> was also awkward to provide information about node sets and face sets. At
>> the time, there was also no concept of pedigree and global ID arrays in
>> vtkDataSetAttributes. This made writing Exodus datasets back out to a file
>> after some manipulation difficult since much of the information in the
>> original file could not be preserved. The vtkExodusModel and
>> vtkModelMetadata classes were attempts to encapsulate some of that
>> information for later access by a writer.
>>
>> The new vtkExodusIIReader outputs a multiblock dataset. Each multiblock
>> dataset may have an arbitrary number of blocks, where each block is a
>> arbitary dataset (an unstructured grid, an image, or even another multiblock
>> dataset). The new reader outputs a multiblock dataset where each of the
>> top-level blocks is itself a multiblock dataset holding unstructured grids
>> of a single type (element blocks, face blocks, edge blocks, element sets,
>> side sets, face sets, edge sets, node sets). When you "print out" you are
>> seeing all of the internal variables associated with the one toplevel
>> multiblock dataset and its children.
>>
>> This should print some more concise information about the blocks:
>> ====================== *snip* ======================
>> for i in range( out.GetNumberOfBlocks() ):
>> ?print out.GetMetaData( i ).Get( vtkCompositeDataSet.NAME() )
>> ?blk = out.GetBlock( i )
>> ?for j in range( blk.GetNumberOfBlocks() ):
>> ? ?print ' ?' + blk.GetMetaData( j ).Get( vtkCompositeDataSet.NAME() )
>>
>> ====================== *snip* ======================
>> When the reader is told to read a block or set (only element blocks are read
>> by default), then an unstructured grid will be inserted into the appropriate
>> sub-block of the main reader's output.
>>
>> ? ? ? ?Hope this helps,
>> ? ? ? ?David
>>
>>
>>
>>
>
>
>


From donniebrasco912 at gmail.com  Sun Dec 12 15:21:44 2010
From: donniebrasco912 at gmail.com (Mehdi Ben Larbi)
Date: Sun, 12 Dec 2010 21:21:44 +0100
Subject: [vtkusers] Problem with viewing vtkReebGraph
Message-ID: 

Hello,

I'm new to VTK,i'm working on a 3D indexing project for my research so i
need to use Reeb's graph.
I have been trying to view vtkReebGraph since 2 days now,i have he correct
data but i'm not able to display it.
I'm developing on Java and this is my code,the view part copied form this
one http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraph i
just translated it to Java  :

vtkPolyDataToReebGraphFilter surfaceReebGraphFilter = new
> vtkPolyDataToReebGraphFilter();
>


>         surfaceReebGraphFilter.SetInput(reader.GetOutput());
>
>         surfaceReebGraphFilter.Update();
>
>         vtkReebGraph surfaceReebGraph = surfaceReebGraphFilter.GetOutput();
>
>         System.out.println(surfaceReebGraph.Print());
>
>
>          vtkGraphLayoutView graphLayoutView =new  vtkGraphLayoutView ();
>
>          vtkGraphLayout layout =     new   vtkGraphLayout ();
>          vtkSimple2DLayoutStrategy strategy = new
> vtkSimple2DLayoutStrategy ();
>          layout.SetInput(surfaceReebGraph);
>          layout.SetLayoutStrategy(strategy);
> ......
>


The Graph is correctly printed but i have this weird error : Exception in
thread "main" java.lang.UnsatisfiedLinkError:
vtk.vtkGraphLayoutView.VTKInit()J

The PATH is correctly set so i don't know where it may come from.
Can you please help me ? I'm desperate.
Maybe another method to display ReebGraph without using the graphLayoutView
?

Thanks a lot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From paulojamorim at gmail.com  Sun Dec 12 15:58:54 2010
From: paulojamorim at gmail.com (Paulo Henrique Junqueira Amorim)
Date: Sun, 12 Dec 2010 18:58:54 -0200
Subject: [vtkusers] Triangle Geometry and Vertices
In-Reply-To: 
References: 
	<4D04D097.2080205@cox.net>
	
	
Message-ID: 

Thank's David and Jim.

Generate a triangle is really what I wanted.

By the same token, there is some way from a vtkPolyData, generate a mesh of
triangles more regular?

I would like to improve the mesh for use in finite elements.

Ragards,
Paulo



On 12 December 2010 14:04, David Gobbi  wrote:

> I'm going to throw in a little addition.  You say "triangle verts" so
> I'm guessing
> you want your cells to be triangles, not verts.  If that is the case,
> the code you
> really need is as follows:
>
>  ids = vtkIdList()
>  ids.SetNumberOfIds(3)
>
>  for i in xrange(3):
>     ids.SetId(i, i)
>     points.InsertNextPoint(X[i],Y[i],Z[i])
>
>  vertices.InsertNextCell(ids) # call for every cell, not for every point
>
>  polydata = vtkPolyData()
>  polydata.SetPoints(points)
>  polydata.SetPolys(vertices)  # use SetPolys for triangles
>  polydata.Update()
>
> The above code will create a polydata that has one triangle.
>
>  David
>
>
> On Sun, Dec 12, 2010 at 8:43 AM, David Gobbi 
> wrote:
> >
> > On Sun, Dec 12, 2010 at 6:39 AM, Jim Peterson  wrote:
> >>
> >> Paulo,
> >> I am no Python expert, but if I understand the sequence of events, you
> should create the polydata object before writing the file.
> >>
> >> Hope that helps,
> >> Jim
> >
> > What Jim said.  Also, the id list is never filled in.  The following code
> is wrong:
> >
> > ids = vtkIdList()
> > ids.SetNumberOfIds(3)
> >
> > for i in xrange(3):
> >     ids.SetId(i, i)
> >     points.InsertNextPoint(X[i],Y[i],Z[i])
> >     vertices.InsertNextCell(ids)
> >
> > To fix it, you have two choices.  You can have all three verts in the
> same cell:
> >
> > ids = vtkIdList()
> > ids.SetNumberOfIds(3)
> >
> > for i in xrange(3):
> >     ids.SetId(i, i)
> >     points.InsertNextPoint(X[i],Y[i],Z[i])
> >
> > vertices.InsertNextCell(ids)
> > Or you can have each vert in its own cell:
> >
> > ids = vtkIdList()
> > ids.SetNumberOfIds(1)
> >
> > for i in xrange(3):
> >     ids.SetId(0, i)
> >     points.InsertNextPoint(X[i],Y[i],Z[i])
> >     vertices.InsertNextCell(ids)
> >
> > In the "for" loop, you were calling vertices.InsertNextCell(ids)
> > when "ids" still had some unititialized values, since the three
> > ids values were not filled in until the third loop iteration.
> >
> >   - David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From jimcp at cox.net  Sun Dec 12 16:10:15 2010
From: jimcp at cox.net (Jim Peterson)
Date: Sun, 12 Dec 2010 16:10:15 -0500
Subject: [vtkusers] Problem with viewing vtkReebGraph
In-Reply-To: 
References: 
Message-ID: <4D053A37.3050801@cox.net>

Mehdi,
The unsatisfied link error would mean you have not loaded the 
vtkViewsJava library in order to have access to the native vtk functions 
for the vtkGraphLayout class.

I hope that helps,
Jim

Mehdi Ben Larbi wrote:
> Hello,
>
> I'm new to VTK,i'm working on a 3D indexing project for my research so 
> i need to use Reeb's graph.
> I have been trying to view vtkReebGraph since 2 days now,i have he 
> correct data but i'm not able to display it.
> I'm developing on Java and this is my code,the view part copied form 
> this one 
> http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraph i 
> just translated it to Java  :
>
>     vtkPolyDataToReebGraphFilter surfaceReebGraphFilter = new
>     vtkPolyDataToReebGraphFilter();
>
>  
>
>             surfaceReebGraphFilter.SetInput(reader.GetOutput());
>
>             surfaceReebGraphFilter.Update();
>
>             vtkReebGraph surfaceReebGraph =
>     surfaceReebGraphFilter.GetOutput();
>            
>             System.out.println(surfaceReebGraph.Print());
>            
>            
>              vtkGraphLayoutView graphLayoutView =new 
>     vtkGraphLayoutView ();
>              
>              vtkGraphLayout layout =     new   vtkGraphLayout ();
>              vtkSimple2DLayoutStrategy strategy = new 
>     vtkSimple2DLayoutStrategy ();
>              layout.SetInput(surfaceReebGraph);
>              layout.SetLayoutStrategy(strategy);
>     ......
>
>
>
> The Graph is correctly printed but i have this weird error : Exception 
> in thread "main" java.lang.UnsatisfiedLinkError: 
> vtk.vtkGraphLayoutView.VTKInit()J
>
> The PATH is correctly set so i don't know where it may come from.
> Can you please help me ? I'm desperate.
> Maybe another method to display ReebGraph without using the 
> graphLayoutView ?
>
> Thanks a lot.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   



From david.gobbi at gmail.com  Sun Dec 12 16:17:11 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Sun, 12 Dec 2010 14:17:11 -0700
Subject: [vtkusers] Triangle Geometry and Vertices
In-Reply-To: 
References: 
	<4D04D097.2080205@cox.net>
	
	
	
Message-ID: 

Hi Paulo,

You can use vtkMeshQuality to compute the quality of a mesh, but I don't
think there is anything in VTK for improving the quality of a mesh.
 Hopefully someone will tell me that I'm wrong about this...

  David


On Sun, Dec 12, 2010 at 1:58 PM, Paulo Henrique Junqueira Amorim <
paulojamorim at gmail.com> wrote:
> Thank's David and Jim.
>
> Generate a triangle is really what I wanted.
>
> By the same token, there is some way from a vtkPolyData, generate a mesh
of
> triangles more regular?
>
> I would like to improve the mesh for use in finite elements.
>
> Ragards,
> Paulo
>
>
>
> On 12 December 2010 14:04, David Gobbi  wrote:
>>
>> I'm going to throw in a little addition.  You say "triangle verts" so
>> I'm guessing
>> you want your cells to be triangles, not verts.  If that is the case,
>> the code you
>> really need is as follows:
>>
>>  ids = vtkIdList()
>>  ids.SetNumberOfIds(3)
>>
>>  for i in xrange(3):
>>     ids.SetId(i, i)
>>     points.InsertNextPoint(X[i],Y[i],Z[i])
>>
>>  vertices.InsertNextCell(ids) # call for every cell, not for every point
>>
>>  polydata = vtkPolyData()
>>  polydata.SetPoints(points)
>>  polydata.SetPolys(vertices)  # use SetPolys for triangles
>>  polydata.Update()
>>
>> The above code will create a polydata that has one triangle.
>>
>>  David
>>
>>
>> On Sun, Dec 12, 2010 at 8:43 AM, David Gobbi 
>> wrote:
>> >
>> > On Sun, Dec 12, 2010 at 6:39 AM, Jim Peterson  wrote:
>> >>
>> >> Paulo,
>> >> I am no Python expert, but if I understand the sequence of events, you
>> >> should create the polydata object before writing the file.
>> >>
>> >> Hope that helps,
>> >> Jim
>> >
>> > What Jim said.  Also, the id list is never filled in.  The following
>> > code is wrong:
>> >
>> > ids = vtkIdList()
>> > ids.SetNumberOfIds(3)
>> >
>> > for i in xrange(3):
>> >     ids.SetId(i, i)
>> >     points.InsertNextPoint(X[i],Y[i],Z[i])
>> >     vertices.InsertNextCell(ids)
>> >
>> > To fix it, you have two choices.  You can have all three verts in the
>> > same cell:
>> >
>> > ids = vtkIdList()
>> > ids.SetNumberOfIds(3)
>> >
>> > for i in xrange(3):
>> >     ids.SetId(i, i)
>> >     points.InsertNextPoint(X[i],Y[i],Z[i])
>> >
>> > vertices.InsertNextCell(ids)
>> > Or you can have each vert in its own cell:
>> >
>> > ids = vtkIdList()
>> > ids.SetNumberOfIds(1)
>> >
>> > for i in xrange(3):
>> >     ids.SetId(0, i)
>> >     points.InsertNextPoint(X[i],Y[i],Z[i])
>> >     vertices.InsertNextCell(ids)
>> >
>> > In the "for" loop, you were calling vertices.InsertNextCell(ids)
>> > when "ids" still had some unititialized values, since the three
>> > ids values were not filled in until the third loop iteration.
>> >
>> >   - David
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From daviddoria at gmail.com  Sun Dec 12 17:28:45 2010
From: daviddoria at gmail.com (David Doria)
Date: Sun, 12 Dec 2010 17:28:45 -0500
Subject: [vtkusers] Problem with viewing vtkReebGraph
In-Reply-To: <4D053A37.3050801@cox.net>
References: 
	<4D053A37.3050801@cox.net>
Message-ID: 

>> Hello,
>>
>> I'm new to VTK,i'm working on a 3D indexing project for my research so i
>> need to use Reeb's graph.
>> I have been trying to view vtkReebGraph since 2 days now,i have he correct
>> data but i'm not able to display it.
>> I'm developing on Java and this is my code,the view part copied form this
>> one http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraph i
>> just translated it to Java ?:

Mehdi,

If you could add the example that you translated here:
http://www.vtk.org/Wiki/VTK/Examples/Java#Graphs

that would be great!

David


From nico.schloemer at gmail.com  Sun Dec 12 19:56:31 2010
From: nico.schloemer at gmail.com (=?ISO-8859-1?Q?Nico_Schl=F6mer?=)
Date: Mon, 13 Dec 2010 01:56:31 +0100
Subject: [vtkusers] vtk.vtkExodusIIReader: information in GetOutput()?
In-Reply-To: 
References: 
	<36B5C9ED-29B9-4CAF-92A9-87D9FB262C72@sandia.gov>
	
	<1C9079C90336A64BBF5612428BC98E1F3AB2F0E108@ES04SNLNT.srn.sandia.gov>
	
Message-ID: 

I've written and alternative implementation for the Exodus
reader/writer using vtkExodusReader (as opposed to the
vtkExodusIIReader) and found that things work out much more easily.

It's basically enough to

    reader.ExodusModelMetadataOn()

to get information on all the time steps, for example. With the
vtkExodusIIReader (where there is no ModelMetadata), I could get the
same to work only with a loop over [0:GetNumberOfTimeSteps()], then
SetTimeStep(k) and subsequently retrieve a vtkUnstructuredGrid for
each step with the corresponding point data.

The only thing I need to do now is to figure out how to extract the
individual time step arrays from the vtkUnstructuredGrid, work on
them, and inject them back to be written to a file.

Cheers,
Nico



On Sun, Dec 12, 2010 at 5:11 PM, Nico Schl?mer  wrote:
> Hi,
>
> I was able to get it all together with
>
> ? ?reader.UpdateInformation()
> ? ?for k in xrange( reader.GetNumberOfPointResultArrays() ):
> ? ? ? ?arr_name = reader.GetPointResultArrayName( k )
> ? ? ? ?reader.SetPointResultArrayStatus( arr_name, 1 )
>
> Then, after Update() has been called, the vtkUnstructuredGrid will
> magically containt the array. Great!
>
>> Note that because "_R" and "_Z" imply cylindrical coordinates, the two scalars
>> in the exodus file will be combined into a 2-component vector by the reader and
>> the result will be named either "x0" or "x0_" (I forget whether the trailing underscore
>> is omitted or not).
>
> Cylindrical coordinates, alright? Well, I got the data in there by
> providing a complex valued array, but I guess that doesn't really
> matter. The underscore is preserved by the way, so I'll just go ahead
> and cut it off.
>
> Thanks for the help!
> --Nico
>
>
>
> On Sun, Dec 12, 2010 at 3:30 AM, Thompson, David C  wrote:
>> Hi Nico,
>>
>>> Alright, so this
>>> ...
>>> gives me all vtkUnstructuredGrid in the vtkExodusIIReader output. Nice!
>>> However, there's more data in the Exodus file I'd like to retrieve,
>>> for example a data array for point data. In the ExodusII file, the
>>> values are declared as "vals_nod_var1=..." and "name_nod_var =
>>> "x0_R", ?"x0_Z" ;", but those are certainly not contained in the block
>>> hierarchy above.
>>
>> Each unstructured grid that is output may have point and cell
>> arrays (I forget whether they are read by default or whether you
>> must call SetObjectArrayStatus() to tell the reader you want them
>> loaded). For the point variables "x0_R" and "x0_Z" in your example
>> above, you would call
>>
>> ?rdr = vtkExodusIIReader()
>> ?rdr.SetFileName( 'foo.exo' ) # or whatever
>> ?rdr.UpdateInformation() # this tells the reader to fetch metadata from the file
>> ?# Iterate over all the point arrays:
>> ?for i in range( rdr.GetNumberOfObjectArrays( rdr.NODAL ) ):
>> ? ?nname = rdr.GetObjectArrayName( rdr.NODAL, i )
>> ? ?print 'Array %d is "%s"' % (i,nname)
>> ? ?# if an array name matches, tell the reader we want to load it:
>> ? ?if nname == 'x0' or nname == 'x0_':
>> ? ? ?# 0 means "don't load", 1 means "load" the i-th nodal array
>> ? ? ?rdr.SetObjectArrayStatus( rdr.NODAL, i, 1 )
>> ?rdr.Update()
>> ?out = rdr.GetOutput()
>> ?# Assuming you have an element block, its point data will have
>> ?# the x0 array.
>> ?elem_blks = out.GetBlock( 0 )
>> ?elem_blk0 = elem_blks.GetBlock( 0 )
>> ?x0 = elem_blk0.GetPointData().GetArray( 'x0' )
>>
>> Note that because "_R" and "_Z" imply cylindrical coordinates, the two scalars
>> in the exodus file will be combined into a 2-component vector by the reader and
>> the result will be named either "x0" or "x0_" (I forget whether the trailing underscore
>> is omitted or not).
>>
>> Because Exodus defines a single, global set of nodes for all element/face/edge
>> blocks, any nodal variables you request will be present on every output block.
>> However, because the cells in a block don't necessarily reference every point,
>> the point coordinates and point data for each block are subsets of the global
>> arrays. For instance, if you have 10 points defined in a mesh but the first
>> element block contains a single quadrilateral (4 points), there will only be 4
>> values in the 'x0' array attached to that element block's unstructured grid.
>>
>> ? ?David
>>
>>
>> On Mon, Dec 6, 2010 at 9:21 PM, David Thompson  wrote:
>>>> ... when reading an ExodusII file with
>>>> ?reader = vtk.vtkExodusIIReader()
>>>> ?reader.Update()
>>>> ?out = reader.GetOutput()
>>>> 'out' would contain a whole lot of output the significance of which I
>>>> don't quite understant;
>>>
>>> Hi Nico,
>>>
>>> The old vtkExodusReader used to output a single unstructured grid. This made
>>> it difficult to handle the case when a variable was defined on some cells
>>> (in one element block) but not on others (in a different element block). It
>>> was also awkward to provide information about node sets and face sets. At
>>> the time, there was also no concept of pedigree and global ID arrays in
>>> vtkDataSetAttributes. This made writing Exodus datasets back out to a file
>>> after some manipulation difficult since much of the information in the
>>> original file could not be preserved. The vtkExodusModel and
>>> vtkModelMetadata classes were attempts to encapsulate some of that
>>> information for later access by a writer.
>>>
>>> The new vtkExodusIIReader outputs a multiblock dataset. Each multiblock
>>> dataset may have an arbitrary number of blocks, where each block is a
>>> arbitary dataset (an unstructured grid, an image, or even another multiblock
>>> dataset). The new reader outputs a multiblock dataset where each of the
>>> top-level blocks is itself a multiblock dataset holding unstructured grids
>>> of a single type (element blocks, face blocks, edge blocks, element sets,
>>> side sets, face sets, edge sets, node sets). When you "print out" you are
>>> seeing all of the internal variables associated with the one toplevel
>>> multiblock dataset and its children.
>>>
>>> This should print some more concise information about the blocks:
>>> ====================== *snip* ======================
>>> for i in range( out.GetNumberOfBlocks() ):
>>> ?print out.GetMetaData( i ).Get( vtkCompositeDataSet.NAME() )
>>> ?blk = out.GetBlock( i )
>>> ?for j in range( blk.GetNumberOfBlocks() ):
>>> ? ?print ' ?' + blk.GetMetaData( j ).Get( vtkCompositeDataSet.NAME() )
>>>
>>> ====================== *snip* ======================
>>> When the reader is told to read a block or set (only element blocks are read
>>> by default), then an unstructured grid will be inserted into the appropriate
>>> sub-block of the main reader's output.
>>>
>>> ? ? ? ?Hope this helps,
>>> ? ? ? ?David
>>>
>>>
>>>
>>>
>>
>>
>>
>


From nico.schloemer at gmail.com  Sun Dec 12 19:59:56 2010
From: nico.schloemer at gmail.com (=?ISO-8859-1?Q?Nico_Schl=F6mer?=)
Date: Mon, 13 Dec 2010 01:59:56 +0100
Subject: [vtkusers] vtkPExodusIIWriter?
In-Reply-To: <1C9079C90336A64BBF5612428BC98E1F3AB2F0E109@ES04SNLNT.srn.sandia.gov>
References: 
	<1C9079C90336A64BBF5612428BC98E1F3AB2F0E109@ES04SNLNT.srn.sandia.gov>
Message-ID: 

I just came across the sentence

"However if this writer is part of a parallel application (hence
writing out a distributed Exodus file), then we need at the very least
a list of all the block IDs that appear in the file. And we need the
element array of block IDs for the input unstructured grid."

in the vtkExodusIIWriter documentation, so I guess it *does* support
parallel writes, just that the data has to be fitted for it somehow.
Is there a newbie howto for parallel data structures in VTK?

--Nico



On Sun, Dec 12, 2010 at 3:30 AM, Thompson, David C  wrote:
> Hi Nico,
>
> I didn't write the vtkExodusIIWriter, so I don't know about how/whether it works in parallel.
>
> ? ?David
> ________________________________________
> From: vtkusers-bounces at vtk.org [vtkusers-bounces at vtk.org] On Behalf Of Nico Schl?mer [nico.schloemer at gmail.com]
> Sent: Saturday, December 11, 2010 11:10
> To: vtkusers
> Subject: [vtkusers] vtkPExodusIIWriter?
>
> Hi all,
>
> I notice that with VTK, it's possible to read parallel ExodusII files
> via "vtkPExodusIIReader"
> .
> Curiously, however, I didn't find the corresponding vtkPExodusIIWriter
> class.
>
> Is it possible to write parallel Exodus files with VTK at all then,
> using the regular vtkExodusIIWriter classes?
>
> Cheers,
> Nico
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>


From yxp233 at postech.ac.kr  Sun Dec 12 21:10:11 2010
From: yxp233 at postech.ac.kr (Xiaopeng Yang)
Date: Mon, 13 Dec 2010 11:10:11 +0900
Subject: [vtkusers] DICOM information
In-Reply-To: 
References: <4CFF65C4.8050401@gmail.com>		<006f01cb98d2$c28066a0$478133e0$@ac.kr>
	
Message-ID: <00b901cb9a6a$e467cd50$ad3767f0$@ac.kr>

Hello everyone,

I'm trying to get patient name, age, and sex from a series of CT images. But
I have no idea how to do this. I am using ITK GDCMImageIO to load the
dataset, then connecting ITK to VTK, and then using VTK Imageviewer2 to
visualize the dataset.

Based on the algorithms I used, how can I get patient information?

Thank you for your help.

Best,
Xiaopeng







From luis.ibanez at kitware.com  Sun Dec 12 21:32:23 2010
From: luis.ibanez at kitware.com (Luis Ibanez)
Date: Sun, 12 Dec 2010 21:32:23 -0500
Subject: [vtkusers] [Insight-users] DICOM information
In-Reply-To: <00b901cb9a6a$e467cd50$ad3767f0$@ac.kr>
References: <4CFF65C4.8050401@gmail.com>
	
	<006f01cb98d2$c28066a0$478133e0$@ac.kr>
	
	<00b901cb9a6a$e467cd50$ad3767f0$@ac.kr>
Message-ID: 

Hi Xiaopeng,

Please look at the example

      ITK/Examples/IO/DicomImageReadPrintTags.cxx

The tags that you need are listed here:

http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/DICOM.html

0010,0010 	PatientName
0010,0040 	PatientSex
0010,1010 	PatientAge

In the Example above,
the lines of code 300 to 333 show you
how to get the patient name.

You can get the other values by using the
DICOM tags for Sex and Age.



    Regards


          Luis


------------------------------------------------------
On Sun, Dec 12, 2010 at 9:10 PM, Xiaopeng Yang  wrote:
> Hello everyone,
>
> I'm trying to get patient name, age, and sex from a series of CT images. But
> I have no idea how to do this. I am using ITK GDCMImageIO to load the
> dataset, then connecting ITK to VTK, and then using VTK Imageviewer2 to
> visualize the dataset.
>
> Based on the algorithms I used, how can I get patient information?
>
> Thank you for your help.
>
> Best,
> Xiaopeng
>
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


From yxp233 at postech.ac.kr  Mon Dec 13 00:33:17 2010
From: yxp233 at postech.ac.kr (Xiaopeng Yang)
Date: Mon, 13 Dec 2010 14:33:17 +0900
Subject: [vtkusers] [Insight-users] DICOM information
In-Reply-To: 
References: <4CFF65C4.8050401@gmail.com>		<006f01cb98d2$c28066a0$478133e0$@ac.kr>		<00b901cb9a6a$e467cd50$ad3767f0$@ac.kr>
	
Message-ID: <00c301cb9a87$3f18bf40$bd4a3dc0$@ac.kr>

Hi Luis,

Thanks very much. It works! May I ask you another question please? Do you know some fast hole filling algorithm for binary image? 

Best regards,

Xiaopeng

-----????-----
???: Luis Ibanez [mailto:luis.ibanez at kitware.com] 
????: 2010? 12? 13? ??? ?? 11:32
???: Xiaopeng Yang
??: insight-users at itk.org; vtkusers at vtk.org
??: Re: [Insight-users] DICOM information

Hi Xiaopeng,

Please look at the example

      ITK/Examples/IO/DicomImageReadPrintTags.cxx

The tags that you need are listed here:

http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/DICOM.html

0010,0010 	PatientName
0010,0040 	PatientSex
0010,1010 	PatientAge

In the Example above,
the lines of code 300 to 333 show you
how to get the patient name.

You can get the other values by using the
DICOM tags for Sex and Age.



    Regards


          Luis


------------------------------------------------------
On Sun, Dec 12, 2010 at 9:10 PM, Xiaopeng Yang  wrote:
> Hello everyone,
>
> I'm trying to get patient name, age, and sex from a series of CT images. But
> I have no idea how to do this. I am using ITK GDCMImageIO to load the
> dataset, then connecting ITK to VTK, and then using VTK Imageviewer2 to
> visualize the dataset.
>
> Based on the algorithms I used, how can I get patient information?
>
> Thank you for your help.
>
> Best,
> Xiaopeng
>
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>











From rogerbramon at gmail.com  Mon Dec 13 04:43:14 2010
From: rogerbramon at gmail.com (Roger Bramon Feixas)
Date: Mon, 13 Dec 2010 10:43:14 +0100
Subject: [vtkusers] bug 0009618 and UTF 8 text rendering fix question
In-Reply-To: <20101207213549.2041125906@mail.rogue-research.com>
References: <20101207184254.169257625@mail.rogue-research.com>
	
	
	<20101207213549.2041125906@mail.rogue-research.com>
Message-ID: 

Hi,

Sean, at my system vtkTextActor::SetInput() also expects ISO-8859-1. I'm
using Qt and I have to call QString::toLatin1() to be able to use accents in
VTK.

Marcus, let me know if you has any questions about the patch which tries to
solve the drop shadow rendering problem.

Thanks for your attention,

Roger


On Tue, Dec 7, 2010 at 10:35 PM, Sean McBride wrote:

> On Tue, 7 Dec 2010 15:27:03 -0500, Marcus D. Hanwell said:
>
> >>> Just to clarify, what encoding should be given to
> vtkTextActor::SetInput
> >>> ()?  Last I tried, it seemed to expect ISO-8859-1.  Certainly a step up
> >>> from ASCII!  Is the long term plan for it to accept UTF8?
> >>
> >> I think it is best if VTK strings use the system default encoding,
> rather
> >> than utf-8.  For unicode there is always vtkUnicodeString.  More classes
> >> should be adapted to take vtkUnicodeString as input (but only, of
> course,
> >> if they are internally capable of using/rendering unicode).
> >>
> >> But I'm flexible.  Really, I'm just pushing for VTK's string handling to
> be
> >> more similar to Python's.  ;)
> >>
> >I am not too concerned about aligning with Python's string handling,
> >but agree with David - I think we should be adjusting existing classes
> >to deal with and take vtkUnicodeString, which can take UTF8 strings
> >for construction.
>
> Agreed.
>
> >It would probably be simplest to interpret all const
> >char* and vtkStdString as UTF8 when it came to rendering, as minimal
> >code/API changes would be required.
>
> I agree here too, but such a change would appear to break binary
> compatibility.  Today's vtkTextActor::SetInput() expects ISO-8859-1 (at
> least on my system), if we change it to expect UTF8 we break existing
> clients of VTK.
>
> In any case, API that take char* should document which encoding they
> expect.  Consider the tiny attached patch.
>
> >If you look at vtkContext2D and friends, where I have been prototyping
> >the UTF8 string handling and Unicode rendering, I have used
> >vtkUnicodeString as the function argument.
>
> Sounds great.
>
> >I certainly welcome people's thoughts on this. Working through the
> >relevant classes, and adding vtkUnicodeString API to them where and
> >when they can really render Unicode seems like a reasonable approach
> >to me.
>
> vtkTextActor appears to be in need of vtkUnicodeString support...
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montr?al, Qu?bec, Canada
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From aracha2010 at gmail.com  Mon Dec 13 09:14:50 2010
From: aracha2010 at gmail.com (Rachel)
Date: Mon, 13 Dec 2010 06:14:50 -0800 (PST)
Subject: [vtkusers] VTK/Examples/Cxx/ImageData/IterateImageData
In-Reply-To: 
References: <1292010091961-3300844.post@n5.nabble.com>
	
Message-ID: <1292249690501-3303147.post@n5.nabble.com>


Thank you Davis. i got the same results as you but when i change the code as
you see below, it gives me 0:

I change the input image and I assigned 2.0 to each pixel (as in the example
) 
int main(){
// Create an image data
  vtkSmartPointer imageData = 
    vtkSmartPointer::New();
  
	//imageData= LoadImage(OutputImage);
	vtkSmartPointer reader =
    vtkSmartPointer::New();
  reader->SetFileName(OutputImage);
  reader->Update();
  imageData= reader->GetOutput();
 
  //i removed these three lines
  // Specify the size of the image data
 /* imageData->SetDimensions(2,3,1);
  imageData->SetNumberOfScalarComponents(1);
  imageData->SetScalarTypeToDouble();*/
 
  int* dims = imageData->GetDimensions();
 
  std::cout << "Dims: " << " x: " << dims[0] << " y: " << dims[1] << " z: "
<< dims[2] << std::endl;
  std::cout << "Number of points: " << imageData->GetNumberOfPoints() <<
std::endl;
  std::cout << "Number of cells: " << imageData->GetNumberOfCells() <<
std::endl;
 
  // Fill every entry of the image data with "2.0"
 for (int z = 0; z < dims[2]; z++)
    {
    for (int y = 0; y < dims[1]; y++)
      {
      for (int x = 0; x < dims[0]; x++)
        {

        double* pixel =
static_cast(imageData->GetScalarPointer(x,y,z));
        pixel[0] = 2.0;

       }
    }
  }


  // Retrieve the entries from the image data and print them to the screen
  for (int z = 0; z < dims[2]; z++)
    {
    for (int y = 0; y < dims[1]; y++)
      {
      for (int x = 0; x < dims[0]; x++)
        {
        double* pixel =
static_cast(imageData->GetScalarPointer(x,y,z));
        // do something with v
        std::cout << pixel[0] << " ";
        }
    std::cout << std::endl;
      }
    std::cout << std::endl;
    }
   return EXIT_SUCCESS;
} 
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-Examples-Cxx-ImageData-IterateImageData-tp3300844p3303147.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From daviddoria at gmail.com  Mon Dec 13 09:44:31 2010
From: daviddoria at gmail.com (David Doria)
Date: Mon, 13 Dec 2010 09:44:31 -0500
Subject: [vtkusers] VTK/Examples/Cxx/ImageData/IterateImageData
In-Reply-To: <1292249690501-3303147.post@n5.nabble.com>
References: <1292010091961-3300844.post@n5.nabble.com>
	
	<1292249690501-3303147.post@n5.nabble.com>
Message-ID: 

On Mon, Dec 13, 2010 at 9:14 AM, Rachel  wrote:
>
> Thank you Davis. i got the same results as you but when i change the code as
> you see below, it gives me 0:
>
> I change the input image and I assigned 2.0 to each pixel (as in the example
> )

The problem is that the reader is creating an image with pixels of
type Unsigned Char.

You have to change the cast in both the loop setting the pixels and
reading the pixels:

Set loop:

unsigned char* pixel =
static_cast(imageData->GetScalarPointer(x,y,z));
pixel[0] = 2;

Get loop:

unsigned char* pixel =
static_cast(imageData->GetScalarPointer(x,y,z));
// do something with v
std::cout << (int)pixel[0] << " ";

David


From aracha2010 at gmail.com  Mon Dec 13 09:54:22 2010
From: aracha2010 at gmail.com (Rachel)
Date: Mon, 13 Dec 2010 06:54:22 -0800 (PST)
Subject: [vtkusers] VTK/Examples/Cxx/ImageData/IterateImageData
In-Reply-To: 
References: <1292010091961-3300844.post@n5.nabble.com>
	
	<1292249690501-3303147.post@n5.nabble.com>
	
Message-ID: <1292252062862-3303214.post@n5.nabble.com>


Thank you very much David. It works now :)
Have a great day :)
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-Examples-Cxx-ImageData-IterateImageData-tp3300844p3303214.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From jeff.baumes at kitware.com  Mon Dec 13 10:39:47 2010
From: jeff.baumes at kitware.com (Jeff Baumes)
Date: Mon, 13 Dec 2010 10:39:47 -0500
Subject: [vtkusers] Link error when building VTK with boost support in
 Visual Studio 2010
In-Reply-To: <3269F716AE5D424ABC02847989CA18CF1E43C7AA@exch-mbx1.ad.renci.org>
References: <3269F716AE5D424ABC02847989CA18CF1E43C255@exch-mbx1.ad.renci.org>
	
	<3269F716AE5D424ABC02847989CA18CF1E43C2D2@exch-mbx1.ad.renci.org>
	
	<3269F716AE5D424ABC02847989CA18CF1E43C7AA@exch-mbx1.ad.renci.org>
Message-ID: 

On Sat, Dec 11, 2010 at 10:52 PM, Hong Yi  wrote:

> Thanks, Jeff.
>
>
>
> I don?t get this error (i.e., fatal error LNK1104: cannot open file
> 'libboost_serialization-vc100-mt-gd-1_44.lib') any more after I turned off
> Windows 7 Account Access Control and rebuilt everything, so this error was
> caused by windows 7 Account Access Control. However, I got the following 3
> linking errors:
>
>
>
> 8>BoostArrayLogWeighting.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: static class vtkBoostLogWeighting * __cdecl
> vtkBoostLogWeighting::New(void)" (__imp_?New at vtkBoostLogWeighting
> @@SAPAV1 at XZ) referenced in function "public: static class
> vtkSmartPointer __cdecl vtkSmartPointer vtkBoostLogWeighting>::New(void)" (?New@
> ?$vtkSmartPointer at VvtkBoostLogWeighting@@@@SA?AV1 at XZ)
>
> 8>BoostArrayRandomSparseArraySource.obj : error LNK2019: unresolved
> external symbol "__declspec(dllimport) public: static class
> vtkBoostRandomSparseArraySource * __cdecl
> vtkBoostRandomSparseArraySource::New(void)"
> (__imp_?New at vtkBoostRandomSparseArraySource@@SAPAV1 at XZ) referenced in
> function "public: static class vtkSmartPointer vtkBoostRandomSparseArraySource> __cdecl vtkSmartPointer vtkBoostRandomSparseArraySource>::New(void)" (?New@
> ?$vtkSmartPointer at VvtkBoostRandomSparseArraySource@@@@SA?AV1 at XZ)
>
> 8>BoostArrayRandomSparseArraySource.obj : error LNK2019: unresolved
> external symbol "__declspec(dllimport) public: void __thiscall
> vtkBoostRandomSparseArraySource::SetExtents(class vtkArrayExtents const &)"
> (__imp_?SetExtents at vtkBoostRandomSparseArraySource
> @@QAEXABVvtkArrayExtents@@@Z) referenced in function "int __cdecl
> BoostArrayRandomSparseArraySource(int,char * * const)"
> (?BoostArrayRandomSparseArraySource@@YAHHQAPAD at Z)
>
> 8>C:\Users\hongyi.HONGYI-W510\VTK-CMake\bin\RelWithDebInfo\InfovisBoostArrayCxxTests.exe
> : fatal error LNK1120: 3 unresolved externals
>
>
>
> Any suggestions on what additional libs I should include in the link
> property setup to make above three symbols resolved?
>
>
It would seem that vtkInfovis is not building with vtkBoostLogWeighting
and vtkBoostRandomSparseArraySource, but they should if you have
VTK_USE_N_WAY_ARRAYS and VTK_USE_BOOST on. If either is not on, then the
executable InfovisBoostArrayCxxTests should not be built, so I'm not sure
what the issue is here.

Another not-directly-related question: I have written a simple example using
> VTK and QT and it only works with release configuration with VTK built and
> installed with release configuration also. When I run the example with debug
> configuration, I got an error message ?this application has failed to start
> because the application configuration is incorrect. Review the manifest file
> for possible errors.? I am new to VTK and read from the web that VTK should
> be installed with release configuration since the debug configuration does
> not work well, is that a true statement? I am currently using visual studio
> 2010 to build VTK 5.6 version. If I want my VTK+QT example to work with
> debug configuration, is there anything special I should do and be aware of?
> Thanks for any suggestions and guidelines on this.
>

You may want to start a new thread on this topic.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From zhuyanqiao0413 at gmail.com  Mon Dec 13 11:11:00 2010
From: zhuyanqiao0413 at gmail.com (=?UTF-8?B?5pyx6Imz5LmU?=)
Date: Tue, 14 Dec 2010 00:11:00 +0800
Subject: [vtkusers] About the VTK_USE_ANSI_STDLIB
Message-ID: 

Sorry, every one. I started to learn itk and vtk yesterday. I am using Arch
Linux, and I have installed vtk throught its software repos. But when I
tried to configure VTK as is told in "Starting with ITK and VIK", I can not
find the VTK_USE_ANSI_STDLIB option which needs to be turned on. My VTK is
the latest version, and does that matter? And what is the effect of this
option. Also, I can not find the option "USE_VTK" metioned in the itk faq
"

> In order to use ITK with VTK you must build VTK from sources and make sure
> that it is configured with the flag USE_ANSI_STDLIB enabled.
>
> Then you have to reconfigure ITK making sure that the option USE_VTK is
> enabled.
>
"


By the way, I am still not clear about the combination of ItK and vtk. It
seems I will have to copy the files like in
"InsightApplications-3.20.0/Auxiliary/vtk" to my application source
directory whenever I need to combine itk and vtk. Is that true?

Another question is why I can simply build the Examples\Installation in itk
but cannot build other examples like Examples\IO. I found that the
CMakeLists.txt are slightly different. CMakeLists.txt for
Examples\Installation has


> FIND_PACKAGE(ITK_REQIIRED)
>
    INCLUDE(${ITK_USE_FILE})

 I think the effection of these statement is to create ITK_DIR when build
the project using ccmake. This is crucial, am I right?

Sorry for the expression. And thanks in advance for help.




-------------------------------------------
???
??????????
????1#431
86-10-62742310
Luke
School of Mathematical Sciences,
Peking University.
phone: 86-10-62742310
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From bruno.bottazzini at cti.gov.br  Mon Dec 13 12:20:32 2010
From: bruno.bottazzini at cti.gov.br (Bruno Lara Bottazzini)
Date: Mon, 13 Dec 2010 15:20:32 -0200
Subject: [vtkusers] vtkusers Digest, Vol 80, Issue 16
In-Reply-To: 
References: 
Message-ID: 

I've tried this solution in python string to latin1 look:
self.string = string.encode("latin-1")

but it didn't work and I'd like to put some specials characters on my
project like "~ , ?  and ?" .

Could you help me?
Thanks

On Mon, Dec 13, 2010 at 3:00 PM,  wrote:

> 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. Problem with viewing vtkReebGraph (Mehdi Ben Larbi)
>   2. Re: Triangle Geometry and Vertices
>      (Paulo Henrique Junqueira Amorim)
>   3. Re: Problem with viewing vtkReebGraph (Jim Peterson)
>   4. Re: Triangle Geometry and Vertices (David Gobbi)
>   5. Re: Problem with viewing vtkReebGraph (David Doria)
>   6. Re: vtk.vtkExodusIIReader: information in GetOutput()?
>      (Nico Schl?mer)
>   7. Re: vtkPExodusIIWriter? (Nico Schl?mer)
>   8. DICOM information (Xiaopeng Yang)
>   9. Re: [Insight-users] DICOM information (Luis Ibanez)
>  10. Re: [Insight-users] DICOM information (Xiaopeng Yang)
>  11. Re: bug 0009618 and UTF 8 text rendering fix question
>      (Roger Bramon Feixas)
>  12. Re: VTK/Examples/Cxx/ImageData/IterateImageData (Rachel)
>  13. Re: VTK/Examples/Cxx/ImageData/IterateImageData (David Doria)
>  14. Re: VTK/Examples/Cxx/ImageData/IterateImageData (Rachel)
>  15. Re: Link error when building VTK with boost support in Visual
>      Studio 2010 (Jeff Baumes)
>  16. About the VTK_USE_ANSI_STDLIB (???)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 12 Dec 2010 21:21:44 +0100
> From: Mehdi Ben Larbi 
> Subject: [vtkusers] Problem with viewing vtkReebGraph
> To: vtkusers at vtk.org
> Message-ID:
>        
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello,
>
> I'm new to VTK,i'm working on a 3D indexing project for my research so i
> need to use Reeb's graph.
> I have been trying to view vtkReebGraph since 2 days now,i have he correct
> data but i'm not able to display it.
> I'm developing on Java and this is my code,the view part copied form this
> one http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraph i
> just translated it to Java  :
>
> vtkPolyDataToReebGraphFilter surfaceReebGraphFilter = new
> > vtkPolyDataToReebGraphFilter();
> >
>
>
> >         surfaceReebGraphFilter.SetInput(reader.GetOutput());
> >
> >         surfaceReebGraphFilter.Update();
> >
> >         vtkReebGraph surfaceReebGraph =
> surfaceReebGraphFilter.GetOutput();
> >
> >         System.out.println(surfaceReebGraph.Print());
> >
> >
> >          vtkGraphLayoutView graphLayoutView =new  vtkGraphLayoutView ();
> >
> >          vtkGraphLayout layout =     new   vtkGraphLayout ();
> >          vtkSimple2DLayoutStrategy strategy = new
> > vtkSimple2DLayoutStrategy ();
> >          layout.SetInput(surfaceReebGraph);
> >          layout.SetLayoutStrategy(strategy);
> > ......
> >
>
>
> The Graph is correctly printed but i have this weird error : Exception in
> thread "main" java.lang.UnsatisfiedLinkError:
> vtk.vtkGraphLayoutView.VTKInit()J
>
> The PATH is correctly set so i don't know where it may come from.
> Can you please help me ? I'm desperate.
> Maybe another method to display ReebGraph without using the graphLayoutView
> ?
>
> Thanks a lot.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20101212/0569a423/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 2
> Date: Sun, 12 Dec 2010 18:58:54 -0200
> From: Paulo Henrique Junqueira Amorim 
> Subject: Re: [vtkusers] Triangle Geometry and Vertices
> To: vtkusers at vtk.org
> Cc: David Gobbi 
> Message-ID:
>        
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Thank's David and Jim.
>
> Generate a triangle is really what I wanted.
>
> By the same token, there is some way from a vtkPolyData, generate a mesh of
> triangles more regular?
>
> I would like to improve the mesh for use in finite elements.
>
> Ragards,
> Paulo
>
>
>
> On 12 December 2010 14:04, David Gobbi  wrote:
>
> > I'm going to throw in a little addition.  You say "triangle verts" so
> > I'm guessing
> > you want your cells to be triangles, not verts.  If that is the case,
> > the code you
> > really need is as follows:
> >
> >  ids = vtkIdList()
> >  ids.SetNumberOfIds(3)
> >
> >  for i in xrange(3):
> >     ids.SetId(i, i)
> >     points.InsertNextPoint(X[i],Y[i],Z[i])
> >
> >  vertices.InsertNextCell(ids) # call for every cell, not for every point
> >
> >  polydata = vtkPolyData()
> >  polydata.SetPoints(points)
> >  polydata.SetPolys(vertices)  # use SetPolys for triangles
> >  polydata.Update()
> >
> > The above code will create a polydata that has one triangle.
> >
> >  David
> >
> >
> > On Sun, Dec 12, 2010 at 8:43 AM, David Gobbi 
> > wrote:
> > >
> > > On Sun, Dec 12, 2010 at 6:39 AM, Jim Peterson  wrote:
> > >>
> > >> Paulo,
> > >> I am no Python expert, but if I understand the sequence of events, you
> > should create the polydata object before writing the file.
> > >>
> > >> Hope that helps,
> > >> Jim
> > >
> > > What Jim said.  Also, the id list is never filled in.  The following
> code
> > is wrong:
> > >
> > > ids = vtkIdList()
> > > ids.SetNumberOfIds(3)
> > >
> > > for i in xrange(3):
> > >     ids.SetId(i, i)
> > >     points.InsertNextPoint(X[i],Y[i],Z[i])
> > >     vertices.InsertNextCell(ids)
> > >
> > > To fix it, you have two choices.  You can have all three verts in the
> > same cell:
> > >
> > > ids = vtkIdList()
> > > ids.SetNumberOfIds(3)
> > >
> > > for i in xrange(3):
> > >     ids.SetId(i, i)
> > >     points.InsertNextPoint(X[i],Y[i],Z[i])
> > >
> > > vertices.InsertNextCell(ids)
> > > Or you can have each vert in its own cell:
> > >
> > > ids = vtkIdList()
> > > ids.SetNumberOfIds(1)
> > >
> > > for i in xrange(3):
> > >     ids.SetId(0, i)
> > >     points.InsertNextPoint(X[i],Y[i],Z[i])
> > >     vertices.InsertNextCell(ids)
> > >
> > > In the "for" loop, you were calling vertices.InsertNextCell(ids)
> > > when "ids" still had some unititialized values, since the three
> > > ids values were not filled in until the third loop iteration.
> > >
> > >   - David
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20101212/24dcaa9d/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 3
> Date: Sun, 12 Dec 2010 16:10:15 -0500
> From: Jim Peterson 
> Subject: Re: [vtkusers] Problem with viewing vtkReebGraph
> To: Mehdi Ben Larbi 
> Cc: vtkusers at vtk.org
> Message-ID: <4D053A37.3050801 at cox.net>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Mehdi,
> The unsatisfied link error would mean you have not loaded the
> vtkViewsJava library in order to have access to the native vtk functions
> for the vtkGraphLayout class.
>
> I hope that helps,
> Jim
>
> Mehdi Ben Larbi wrote:
> > Hello,
> >
> > I'm new to VTK,i'm working on a 3D indexing project for my research so
> > i need to use Reeb's graph.
> > I have been trying to view vtkReebGraph since 2 days now,i have he
> > correct data but i'm not able to display it.
> > I'm developing on Java and this is my code,the view part copied form
> > this one
> > http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraph i
> > just translated it to Java  :
> >
> >     vtkPolyDataToReebGraphFilter surfaceReebGraphFilter = new
> >     vtkPolyDataToReebGraphFilter();
> >
> >
> >
> >             surfaceReebGraphFilter.SetInput(reader.GetOutput());
> >
> >             surfaceReebGraphFilter.Update();
> >
> >             vtkReebGraph surfaceReebGraph =
> >     surfaceReebGraphFilter.GetOutput();
> >
> >             System.out.println(surfaceReebGraph.Print());
> >
> >
> >              vtkGraphLayoutView graphLayoutView =new
> >     vtkGraphLayoutView ();
> >
> >              vtkGraphLayout layout =     new   vtkGraphLayout ();
> >              vtkSimple2DLayoutStrategy strategy = new
> >     vtkSimple2DLayoutStrategy ();
> >              layout.SetInput(surfaceReebGraph);
> >              layout.SetLayoutStrategy(strategy);
> >     ......
> >
> >
> >
> > The Graph is correctly printed but i have this weird error : Exception
> > in thread "main" java.lang.UnsatisfiedLinkError:
> > vtk.vtkGraphLayoutView.VTKInit()J
> >
> > The PATH is correctly set so i don't know where it may come from.
> > Can you please help me ? I'm desperate.
> > Maybe another method to display ReebGraph without using the
> > graphLayoutView ?
> >
> > Thanks a lot.
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
>
>
>
> ------------------------------
>
> Message: 4
> Date: Sun, 12 Dec 2010 14:17:11 -0700
> From: David Gobbi 
> Subject: Re: [vtkusers] Triangle Geometry and Vertices
> To: Paulo Henrique Junqueira Amorim 
> Cc: vtkusers at vtk.org
> Message-ID:
>        
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Paulo,
>
> You can use vtkMeshQuality to compute the quality of a mesh, but I don't
> think there is anything in VTK for improving the quality of a mesh.
>  Hopefully someone will tell me that I'm wrong about this...
>
>  David
>
>
> On Sun, Dec 12, 2010 at 1:58 PM, Paulo Henrique Junqueira Amorim <
> paulojamorim at gmail.com> wrote:
> > Thank's David and Jim.
> >
> > Generate a triangle is really what I wanted.
> >
> > By the same token, there is some way from a vtkPolyData, generate a mesh
> of
> > triangles more regular?
> >
> > I would like to improve the mesh for use in finite elements.
> >
> > Ragards,
> > Paulo
> >
> >
> >
> > On 12 December 2010 14:04, David Gobbi  wrote:
> >>
> >> I'm going to throw in a little addition.  You say "triangle verts" so
> >> I'm guessing
> >> you want your cells to be triangles, not verts.  If that is the case,
> >> the code you
> >> really need is as follows:
> >>
> >>  ids = vtkIdList()
> >>  ids.SetNumberOfIds(3)
> >>
> >>  for i in xrange(3):
> >>     ids.SetId(i, i)
> >>     points.InsertNextPoint(X[i],Y[i],Z[i])
> >>
> >>  vertices.InsertNextCell(ids) # call for every cell, not for every point
> >>
> >>  polydata = vtkPolyData()
> >>  polydata.SetPoints(points)
> >>  polydata.SetPolys(vertices)  # use SetPolys for triangles
> >>  polydata.Update()
> >>
> >> The above code will create a polydata that has one triangle.
> >>
> >>  David
> >>
> >>
> >> On Sun, Dec 12, 2010 at 8:43 AM, David Gobbi 
> >> wrote:
> >> >
> >> > On Sun, Dec 12, 2010 at 6:39 AM, Jim Peterson  wrote:
> >> >>
> >> >> Paulo,
> >> >> I am no Python expert, but if I understand the sequence of events,
> you
> >> >> should create the polydata object before writing the file.
> >> >>
> >> >> Hope that helps,
> >> >> Jim
> >> >
> >> > What Jim said.  Also, the id list is never filled in.  The following
> >> > code is wrong:
> >> >
> >> > ids = vtkIdList()
> >> > ids.SetNumberOfIds(3)
> >> >
> >> > for i in xrange(3):
> >> >     ids.SetId(i, i)
> >> >     points.InsertNextPoint(X[i],Y[i],Z[i])
> >> >     vertices.InsertNextCell(ids)
> >> >
> >> > To fix it, you have two choices.  You can have all three verts in the
> >> > same cell:
> >> >
> >> > ids = vtkIdList()
> >> > ids.SetNumberOfIds(3)
> >> >
> >> > for i in xrange(3):
> >> >     ids.SetId(i, i)
> >> >     points.InsertNextPoint(X[i],Y[i],Z[i])
> >> >
> >> > vertices.InsertNextCell(ids)
> >> > Or you can have each vert in its own cell:
> >> >
> >> > ids = vtkIdList()
> >> > ids.SetNumberOfIds(1)
> >> >
> >> > for i in xrange(3):
> >> >     ids.SetId(0, i)
> >> >     points.InsertNextPoint(X[i],Y[i],Z[i])
> >> >     vertices.InsertNextCell(ids)
> >> >
> >> > In the "for" loop, you were calling vertices.InsertNextCell(ids)
> >> > when "ids" still had some unititialized values, since the three
> >> > ids values were not filled in until the third loop iteration.
> >> >
> >> >   - David
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20101212/a7d63e5b/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 5
> Date: Sun, 12 Dec 2010 17:28:45 -0500
> From: David Doria 
> Subject: Re: [vtkusers] Problem with viewing vtkReebGraph
> Cc: vtkusers at vtk.org
> Message-ID:
>        
> Content-Type: text/plain; charset=ISO-8859-1
>
> >> Hello,
> >>
> >> I'm new to VTK,i'm working on a 3D indexing project for my research so i
> >> need to use Reeb's graph.
> >> I have been trying to view vtkReebGraph since 2 days now,i have he
> correct
> >> data but i'm not able to display it.
> >> I'm developing on Java and this is my code,the view part copied form
> this
> >> one http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraphi
> >> just translated it to Java ?:
>
> Mehdi,
>
> If you could add the example that you translated here:
> http://www.vtk.org/Wiki/VTK/Examples/Java#Graphs
>
> that would be great!
>
> David
>
>
> ------------------------------
>
> Message: 6
> Date: Mon, 13 Dec 2010 01:56:31 +0100
> From: Nico Schl?mer 
> Subject: Re: [vtkusers] vtk.vtkExodusIIReader: information in
>        GetOutput()?
> To: "Thompson, David C" 
> Cc: vtkusers 
> Message-ID:
>        
> Content-Type: text/plain; charset=ISO-8859-1
>
> I've written and alternative implementation for the Exodus
> reader/writer using vtkExodusReader (as opposed to the
> vtkExodusIIReader) and found that things work out much more easily.
>
> It's basically enough to
>
>    reader.ExodusModelMetadataOn()
>
> to get information on all the time steps, for example. With the
> vtkExodusIIReader (where there is no ModelMetadata), I could get the
> same to work only with a loop over [0:GetNumberOfTimeSteps()], then
> SetTimeStep(k) and subsequently retrieve a vtkUnstructuredGrid for
> each step with the corresponding point data.
>
> The only thing I need to do now is to figure out how to extract the
> individual time step arrays from the vtkUnstructuredGrid, work on
> them, and inject them back to be written to a file.
>
> Cheers,
> Nico
>
>
>
> On Sun, Dec 12, 2010 at 5:11 PM, Nico Schl?mer 
> wrote:
> > Hi,
> >
> > I was able to get it all together with
> >
> > ? ?reader.UpdateInformation()
> > ? ?for k in xrange( reader.GetNumberOfPointResultArrays() ):
> > ? ? ? ?arr_name = reader.GetPointResultArrayName( k )
> > ? ? ? ?reader.SetPointResultArrayStatus( arr_name, 1 )
> >
> > Then, after Update() has been called, the vtkUnstructuredGrid will
> > magically containt the array. Great!
> >
> >> Note that because "_R" and "_Z" imply cylindrical coordinates, the two
> scalars
> >> in the exodus file will be combined into a 2-component vector by the
> reader and
> >> the result will be named either "x0" or "x0_" (I forget whether the
> trailing underscore
> >> is omitted or not).
> >
> > Cylindrical coordinates, alright? Well, I got the data in there by
> > providing a complex valued array, but I guess that doesn't really
> > matter. The underscore is preserved by the way, so I'll just go ahead
> > and cut it off.
> >
> > Thanks for the help!
> > --Nico
> >
> >
> >
> > On Sun, Dec 12, 2010 at 3:30 AM, Thompson, David C 
> wrote:
> >> Hi Nico,
> >>
> >>> Alright, so this
> >>> ...
> >>> gives me all vtkUnstructuredGrid in the vtkExodusIIReader output. Nice!
> >>> However, there's more data in the Exodus file I'd like to retrieve,
> >>> for example a data array for point data. In the ExodusII file, the
> >>> values are declared as "vals_nod_var1=..." and "name_nod_var =
> >>> "x0_R", ?"x0_Z" ;", but those are certainly not contained in the block
> >>> hierarchy above.
> >>
> >> Each unstructured grid that is output may have point and cell
> >> arrays (I forget whether they are read by default or whether you
> >> must call SetObjectArrayStatus() to tell the reader you want them
> >> loaded). For the point variables "x0_R" and "x0_Z" in your example
> >> above, you would call
> >>
> >> ?rdr = vtkExodusIIReader()
> >> ?rdr.SetFileName( 'foo.exo' ) # or whatever
> >> ?rdr.UpdateInformation() # this tells the reader to fetch metadata from
> the file
> >> ?# Iterate over all the point arrays:
> >> ?for i in range( rdr.GetNumberOfObjectArrays( rdr.NODAL ) ):
> >> ? ?nname = rdr.GetObjectArrayName( rdr.NODAL, i )
> >> ? ?print 'Array %d is "%s"' % (i,nname)
> >> ? ?# if an array name matches, tell the reader we want to load it:
> >> ? ?if nname == 'x0' or nname == 'x0_':
> >> ? ? ?# 0 means "don't load", 1 means "load" the i-th nodal array
> >> ? ? ?rdr.SetObjectArrayStatus( rdr.NODAL, i, 1 )
> >> ?rdr.Update()
> >> ?out = rdr.GetOutput()
> >> ?# Assuming you have an element block, its point data will have
> >> ?# the x0 array.
> >> ?elem_blks = out.GetBlock( 0 )
> >> ?elem_blk0 = elem_blks.GetBlock( 0 )
> >> ?x0 = elem_blk0.GetPointData().GetArray( 'x0' )
> >>
> >> Note that because "_R" and "_Z" imply cylindrical coordinates, the two
> scalars
> >> in the exodus file will be combined into a 2-component vector by the
> reader and
> >> the result will be named either "x0" or "x0_" (I forget whether the
> trailing underscore
> >> is omitted or not).
> >>
> >> Because Exodus defines a single, global set of nodes for all
> element/face/edge
> >> blocks, any nodal variables you request will be present on every output
> block.
> >> However, because the cells in a block don't necessarily reference every
> point,
> >> the point coordinates and point data for each block are subsets of the
> global
> >> arrays. For instance, if you have 10 points defined in a mesh but the
> first
> >> element block contains a single quadrilateral (4 points), there will
> only be 4
> >> values in the 'x0' array attached to that element block's unstructured
> grid.
> >>
> >> ? ?David
> >>
> >>
> >> On Mon, Dec 6, 2010 at 9:21 PM, David Thompson 
> wrote:
> >>>> ... when reading an ExodusII file with
> >>>> ?reader = vtk.vtkExodusIIReader()
> >>>> ?reader.Update()
> >>>> ?out = reader.GetOutput()
> >>>> 'out' would contain a whole lot of output the significance of which I
> >>>> don't quite understant;
> >>>
> >>> Hi Nico,
> >>>
> >>> The old vtkExodusReader used to output a single unstructured grid. This
> made
> >>> it difficult to handle the case when a variable was defined on some
> cells
> >>> (in one element block) but not on others (in a different element
> block). It
> >>> was also awkward to provide information about node sets and face sets.
> At
> >>> the time, there was also no concept of pedigree and global ID arrays in
> >>> vtkDataSetAttributes. This made writing Exodus datasets back out to a
> file
> >>> after some manipulation difficult since much of the information in the
> >>> original file could not be preserved. The vtkExodusModel and
> >>> vtkModelMetadata classes were attempts to encapsulate some of that
> >>> information for later access by a writer.
> >>>
> >>> The new vtkExodusIIReader outputs a multiblock dataset. Each multiblock
> >>> dataset may have an arbitrary number of blocks, where each block is a
> >>> arbitary dataset (an unstructured grid, an image, or even another
> multiblock
> >>> dataset). The new reader outputs a multiblock dataset where each of the
> >>> top-level blocks is itself a multiblock dataset holding unstructured
> grids
> >>> of a single type (element blocks, face blocks, edge blocks, element
> sets,
> >>> side sets, face sets, edge sets, node sets). When you "print out" you
> are
> >>> seeing all of the internal variables associated with the one toplevel
> >>> multiblock dataset and its children.
> >>>
> >>> This should print some more concise information about the blocks:
> >>> ====================== *snip* ======================
> >>> for i in range( out.GetNumberOfBlocks() ):
> >>> ?print out.GetMetaData( i ).Get( vtkCompositeDataSet.NAME() )
> >>> ?blk = out.GetBlock( i )
> >>> ?for j in range( blk.GetNumberOfBlocks() ):
> >>> ? ?print ' ?' + blk.GetMetaData( j ).Get( vtkCompositeDataSet.NAME() )
> >>>
> >>> ====================== *snip* ======================
> >>> When the reader is told to read a block or set (only element blocks are
> read
> >>> by default), then an unstructured grid will be inserted into the
> appropriate
> >>> sub-block of the main reader's output.
> >>>
> >>> ? ? ? ?Hope this helps,
> >>> ? ? ? ?David
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >
>
>
> ------------------------------
>
> Message: 7
> Date: Mon, 13 Dec 2010 01:59:56 +0100
> From: Nico Schl?mer 
> Subject: Re: [vtkusers] vtkPExodusIIWriter?
> To: "Thompson, David C" 
> Cc: vtkusers 
> Message-ID:
>        
> Content-Type: text/plain; charset=ISO-8859-1
>
> I just came across the sentence
>
> "However if this writer is part of a parallel application (hence
> writing out a distributed Exodus file), then we need at the very least
> a list of all the block IDs that appear in the file. And we need the
> element array of block IDs for the input unstructured grid."
>
> in the vtkExodusIIWriter documentation, so I guess it *does* support
> parallel writes, just that the data has to be fitted for it somehow.
> Is there a newbie howto for parallel data structures in VTK?
>
> --Nico
>
>
>
> On Sun, Dec 12, 2010 at 3:30 AM, Thompson, David C 
> wrote:
> > Hi Nico,
> >
> > I didn't write the vtkExodusIIWriter, so I don't know about how/whether
> it works in parallel.
> >
> > ? ?David
> > ________________________________________
> > From: vtkusers-bounces at vtk.org [vtkusers-bounces at vtk.org] On Behalf Of
> Nico Schl?mer [nico.schloemer at gmail.com]
> > Sent: Saturday, December 11, 2010 11:10
> > To: vtkusers
> > Subject: [vtkusers] vtkPExodusIIWriter?
> >
> > Hi all,
> >
> > I notice that with VTK, it's possible to read parallel ExodusII files
> > via "vtkPExodusIIReader"
> > .
> > Curiously, however, I didn't find the corresponding vtkPExodusIIWriter
> > class.
> >
> > Is it possible to write parallel Exodus files with VTK at all then,
> > using the regular vtkExodusIIWriter classes?
> >
> > Cheers,
> > Nico
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
> >
>
>
> ------------------------------
>
> Message: 8
> Date: Mon, 13 Dec 2010 11:10:11 +0900
> From: "Xiaopeng Yang" 
> Subject: [vtkusers] DICOM information
> To: ,    
> Message-ID: <00b901cb9a6a$e467cd50$ad3767f0$@ac.kr>
> Content-Type: text/plain;       charset="us-ascii"
>
> Hello everyone,
>
> I'm trying to get patient name, age, and sex from a series of CT images.
> But
> I have no idea how to do this. I am using ITK GDCMImageIO to load the
> dataset, then connecting ITK to VTK, and then using VTK Imageviewer2 to
> visualize the dataset.
>
> Based on the algorithms I used, how can I get patient information?
>
> Thank you for your help.
>
> Best,
> Xiaopeng
>
>
>
>
>
>
>
> ------------------------------
>
> Message: 9
> Date: Sun, 12 Dec 2010 21:32:23 -0500
> From: Luis Ibanez 
> Subject: Re: [vtkusers] [Insight-users] DICOM information
> To: Xiaopeng Yang 
> Cc: insight-users at itk.org, vtkusers at vtk.org
> Message-ID:
>        
> >
> Content-Type: text/plain; charset=UTF-8
>
> Hi Xiaopeng,
>
> Please look at the example
>
>      ITK/Examples/IO/DicomImageReadPrintTags.cxx
>
> The tags that you need are listed here:
>
> http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/DICOM.html
>
> 0010,0010       PatientName
> 0010,0040       PatientSex
> 0010,1010       PatientAge
>
> In the Example above,
> the lines of code 300 to 333 show you
> how to get the patient name.
>
> You can get the other values by using the
> DICOM tags for Sex and Age.
>
>
>
>    Regards
>
>
>          Luis
>
>
> ------------------------------------------------------
> On Sun, Dec 12, 2010 at 9:10 PM, Xiaopeng Yang 
> wrote:
> > Hello everyone,
> >
> > I'm trying to get patient name, age, and sex from a series of CT images.
> But
> > I have no idea how to do this. I am using ITK GDCMImageIO to load the
> > dataset, then connecting ITK to VTK, and then using VTK Imageviewer2 to
> > visualize the dataset.
> >
> > Based on the algorithms I used, how can I get patient information?
> >
> > Thank you for your help.
> >
> > Best,
> > Xiaopeng
> >
> >
> >
> >
> >
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.html
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > http://www.itk.org/Wiki/ITK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.itk.org/mailman/listinfo/insight-users
> >
>
>
> ------------------------------
>
> Message: 10
> Date: Mon, 13 Dec 2010 14:33:17 +0900
> From: "Xiaopeng Yang" 
> Subject: Re: [vtkusers] [Insight-users] DICOM information
> To: "'Luis Ibanez'" 
> Cc: insight-users at itk.org, vtkusers at vtk.org
> Message-ID: <00c301cb9a87$3f18bf40$bd4a3dc0$@ac.kr>
> Content-Type: text/plain;       charset="utf-8"
>
> Hi Luis,
>
> Thanks very much. It works! May I ask you another question please? Do you
> know some fast hole filling algorithm for binary image?
>
> Best regards,
>
> Xiaopeng
>
> -----????-----
> ???: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> ????: 2010? 12? 13? ??? ?? 11:32
> ???: Xiaopeng Yang
> ??: insight-users at itk.org; vtkusers at vtk.org
> ??: Re: [Insight-users] DICOM information
>
> Hi Xiaopeng,
>
> Please look at the example
>
>      ITK/Examples/IO/DicomImageReadPrintTags.cxx
>
> The tags that you need are listed here:
>
> http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/DICOM.html
>
> 0010,0010       PatientName
> 0010,0040       PatientSex
> 0010,1010       PatientAge
>
> In the Example above,
> the lines of code 300 to 333 show you
> how to get the patient name.
>
> You can get the other values by using the
> DICOM tags for Sex and Age.
>
>
>
>    Regards
>
>
>          Luis
>
>
> ------------------------------------------------------
> On Sun, Dec 12, 2010 at 9:10 PM, Xiaopeng Yang 
> wrote:
> > Hello everyone,
> >
> > I'm trying to get patient name, age, and sex from a series of CT images.
> But
> > I have no idea how to do this. I am using ITK GDCMImageIO to load the
> > dataset, then connecting ITK to VTK, and then using VTK Imageviewer2 to
> > visualize the dataset.
> >
> > Based on the algorithms I used, how can I get patient information?
> >
> > Thank you for your help.
> >
> > Best,
> > Xiaopeng
> >
> >
> >
> >
> >
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.html
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > http://www.itk.org/Wiki/ITK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.itk.org/mailman/listinfo/insight-users
> >
>
>
>
>
>
>
>
>
>
>
>
> ------------------------------
>
> Message: 11
> Date: Mon, 13 Dec 2010 10:43:14 +0100
> From: Roger Bramon Feixas 
> Subject: Re: [vtkusers] bug 0009618 and UTF 8 text rendering fix
>        question
> To: Sean McBride 
> Cc: David Gobbi , vtkusers at vtk.org
> Message-ID:
>        
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
> Sean, at my system vtkTextActor::SetInput() also expects ISO-8859-1. I'm
> using Qt and I have to call QString::toLatin1() to be able to use accents
> in
> VTK.
>
> Marcus, let me know if you has any questions about the patch which tries to
> solve the drop shadow rendering problem.
>
> Thanks for your attention,
>
> Roger
>
>
> On Tue, Dec 7, 2010 at 10:35 PM, Sean McBride  >wrote:
>
> > On Tue, 7 Dec 2010 15:27:03 -0500, Marcus D. Hanwell said:
> >
> > >>> Just to clarify, what encoding should be given to
> > vtkTextActor::SetInput
> > >>> ()?  Last I tried, it seemed to expect ISO-8859-1.  Certainly a step
> up
> > >>> from ASCII!  Is the long term plan for it to accept UTF8?
> > >>
> > >> I think it is best if VTK strings use the system default encoding,
> > rather
> > >> than utf-8.  For unicode there is always vtkUnicodeString.  More
> classes
> > >> should be adapted to take vtkUnicodeString as input (but only, of
> > course,
> > >> if they are internally capable of using/rendering unicode).
> > >>
> > >> But I'm flexible.  Really, I'm just pushing for VTK's string handling
> to
> > be
> > >> more similar to Python's.  ;)
> > >>
> > >I am not too concerned about aligning with Python's string handling,
> > >but agree with David - I think we should be adjusting existing classes
> > >to deal with and take vtkUnicodeString, which can take UTF8 strings
> > >for construction.
> >
> > Agreed.
> >
> > >It would probably be simplest to interpret all const
> > >char* and vtkStdString as UTF8 when it came to rendering, as minimal
> > >code/API changes would be required.
> >
> > I agree here too, but such a change would appear to break binary
> > compatibility.  Today's vtkTextActor::SetInput() expects ISO-8859-1 (at
> > least on my system), if we change it to expect UTF8 we break existing
> > clients of VTK.
> >
> > In any case, API that take char* should document which encoding they
> > expect.  Consider the tiny attached patch.
> >
> > >If you look at vtkContext2D and friends, where I have been prototyping
> > >the UTF8 string handling and Unicode rendering, I have used
> > >vtkUnicodeString as the function argument.
> >
> > Sounds great.
> >
> > >I certainly welcome people's thoughts on this. Working through the
> > >relevant classes, and adding vtkUnicodeString API to them where and
> > >when they can really render Unicode seems like a reasonable approach
> > >to me.
> >
> > vtkTextActor appears to be in need of vtkUnicodeString support...
> >
> > --
> > ____________________________________________________________
> > Sean McBride, B. Eng                 sean at rogue-research.com
> > Rogue Research                        www.rogue-research.com
> > Mac Software Developer              Montr?al, Qu?bec, Canada
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20101213/18488da8/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 12
> Date: Mon, 13 Dec 2010 06:14:50 -0800 (PST)
> From: Rachel 
> Subject: Re: [vtkusers] VTK/Examples/Cxx/ImageData/IterateImageData
> To: vtkusers at vtk.org
> Message-ID: <1292249690501-3303147.post at n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Thank you Davis. i got the same results as you but when i change the code
> as
> you see below, it gives me 0:
>
> I change the input image and I assigned 2.0 to each pixel (as in the
> example
> )
> int main(){
> // Create an image data
>  vtkSmartPointer imageData =
>    vtkSmartPointer::New();
>
>        //imageData= LoadImage(OutputImage);
>        vtkSmartPointer reader =
>    vtkSmartPointer::New();
>  reader->SetFileName(OutputImage);
>  reader->Update();
>  imageData= reader->GetOutput();
>
>  //i removed these three lines
>  // Specify the size of the image data
>  /* imageData->SetDimensions(2,3,1);
>  imageData->SetNumberOfScalarComponents(1);
>  imageData->SetScalarTypeToDouble();*/
>
>  int* dims = imageData->GetDimensions();
>
>  std::cout << "Dims: " << " x: " << dims[0] << " y: " << dims[1] << " z: "
> << dims[2] << std::endl;
>  std::cout << "Number of points: " << imageData->GetNumberOfPoints() <<
> std::endl;
>  std::cout << "Number of cells: " << imageData->GetNumberOfCells() <<
> std::endl;
>
>  // Fill every entry of the image data with "2.0"
>  for (int z = 0; z < dims[2]; z++)
>    {
>    for (int y = 0; y < dims[1]; y++)
>      {
>      for (int x = 0; x < dims[0]; x++)
>        {
>
>        double* pixel =
> static_cast(imageData->GetScalarPointer(x,y,z));
>        pixel[0] = 2.0;
>
>       }
>    }
>  }
>
>
>  // Retrieve the entries from the image data and print them to the screen
>  for (int z = 0; z < dims[2]; z++)
>    {
>    for (int y = 0; y < dims[1]; y++)
>      {
>      for (int x = 0; x < dims[0]; x++)
>        {
>        double* pixel =
> static_cast(imageData->GetScalarPointer(x,y,z));
>        // do something with v
>        std::cout << pixel[0] << " ";
>        }
>    std::cout << std::endl;
>      }
>    std::cout << std::endl;
>    }
>   return EXIT_SUCCESS;
> }
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/VTK-Examples-Cxx-ImageData-IterateImageData-tp3300844p3303147.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 13
> Date: Mon, 13 Dec 2010 09:44:31 -0500
> From: David Doria 
> Subject: Re: [vtkusers] VTK/Examples/Cxx/ImageData/IterateImageData
> To: Rachel 
> Cc: vtkusers at vtk.org
> Message-ID:
>        
> >
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Mon, Dec 13, 2010 at 9:14 AM, Rachel  wrote:
> >
> > Thank you Davis. i got the same results as you but when i change the code
> as
> > you see below, it gives me 0:
> >
> > I change the input image and I assigned 2.0 to each pixel (as in the
> example
> > )
>
> The problem is that the reader is creating an image with pixels of
> type Unsigned Char.
>
> You have to change the cast in both the loop setting the pixels and
> reading the pixels:
>
> Set loop:
>
> unsigned char* pixel =
> static_cast(imageData->GetScalarPointer(x,y,z));
> pixel[0] = 2;
>
> Get loop:
>
> unsigned char* pixel =
> static_cast(imageData->GetScalarPointer(x,y,z));
> // do something with v
> std::cout << (int)pixel[0] << " ";
>
> David
>
>
> ------------------------------
>
> Message: 14
> Date: Mon, 13 Dec 2010 06:54:22 -0800 (PST)
> From: Rachel 
> Subject: Re: [vtkusers] VTK/Examples/Cxx/ImageData/IterateImageData
> To: vtkusers at vtk.org
> Message-ID: <1292252062862-3303214.post at n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Thank you very much David. It works now :)
> Have a great day :)
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/VTK-Examples-Cxx-ImageData-IterateImageData-tp3300844p3303214.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 15
> Date: Mon, 13 Dec 2010 10:39:47 -0500
> From: Jeff Baumes 
> Subject: Re: [vtkusers] Link error when building VTK with boost
>        support in Visual Studio 2010
> To: Hong Yi 
> Cc: VTK Users 
> Message-ID:
>        
> >
> Content-Type: text/plain; charset="windows-1252"
>
> On Sat, Dec 11, 2010 at 10:52 PM, Hong Yi  wrote:
>
> > Thanks, Jeff.
> >
> >
> >
> > I don?t get this error (i.e., fatal error LNK1104: cannot open file
> > 'libboost_serialization-vc100-mt-gd-1_44.lib') any more after I turned
> off
> > Windows 7 Account Access Control and rebuilt everything, so this error
> was
> > caused by windows 7 Account Access Control. However, I got the following
> 3
> > linking errors:
> >
> >
> >
> > 8>BoostArrayLogWeighting.obj : error LNK2019: unresolved external symbol
> > "__declspec(dllimport) public: static class vtkBoostLogWeighting *
> __cdecl
> > vtkBoostLogWeighting::New(void)" (__imp_?New at vtkBoostLogWeighting
> > @@SAPAV1 at XZ) referenced in function "public: static class
> > vtkSmartPointer __cdecl vtkSmartPointer > vtkBoostLogWeighting>::New(void)" (?New@
> > ?$vtkSmartPointer at VvtkBoostLogWeighting@@@@SA?AV1 at XZ)
> >
> > 8>BoostArrayRandomSparseArraySource.obj : error LNK2019: unresolved
> > external symbol "__declspec(dllimport) public: static class
> > vtkBoostRandomSparseArraySource * __cdecl
> > vtkBoostRandomSparseArraySource::New(void)"
> > (__imp_?New at vtkBoostRandomSparseArraySource@@SAPAV1 at XZ) referenced in
> > function "public: static class vtkSmartPointer > vtkBoostRandomSparseArraySource> __cdecl vtkSmartPointer > vtkBoostRandomSparseArraySource>::New(void)" (?New@
> > ?$vtkSmartPointer at VvtkBoostRandomSparseArraySource@@@@SA?AV1 at XZ)
> >
> > 8>BoostArrayRandomSparseArraySource.obj : error LNK2019: unresolved
> > external symbol "__declspec(dllimport) public: void __thiscall
> > vtkBoostRandomSparseArraySource::SetExtents(class vtkArrayExtents const
> &)"
> > (__imp_?SetExtents at vtkBoostRandomSparseArraySource
> > @@QAEXABVvtkArrayExtents@@@Z) referenced in function "int __cdecl
> > BoostArrayRandomSparseArraySource(int,char * * const)"
> > (?BoostArrayRandomSparseArraySource@@YAHHQAPAD at Z)
> >
> >
> 8>C:\Users\hongyi.HONGYI-W510\VTK-CMake\bin\RelWithDebInfo\InfovisBoostArrayCxxTests.exe
> > : fatal error LNK1120: 3 unresolved externals
> >
> >
> >
> > Any suggestions on what additional libs I should include in the link
> > property setup to make above three symbols resolved?
> >
> >
> It would seem that vtkInfovis is not building with vtkBoostLogWeighting
> and vtkBoostRandomSparseArraySource, but they should if you have
> VTK_USE_N_WAY_ARRAYS and VTK_USE_BOOST on. If either is not on, then the
> executable InfovisBoostArrayCxxTests should not be built, so I'm not sure
> what the issue is here.
>
> Another not-directly-related question: I have written a simple example
> using
> > VTK and QT and it only works with release configuration with VTK built
> and
> > installed with release configuration also. When I run the example with
> debug
> > configuration, I got an error message ?this application has failed to
> start
> > because the application configuration is incorrect. Review the manifest
> file
> > for possible errors.? I am new to VTK and read from the web that VTK
> should
> > be installed with release configuration since the debug configuration
> does
> > not work well, is that a true statement? I am currently using visual
> studio
> > 2010 to build VTK 5.6 version. If I want my VTK+QT example to work with
> > debug configuration, is there anything special I should do and be aware
> of?
> > Thanks for any suggestions and guidelines on this.
> >
>
> You may want to start a new thread on this topic.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20101213/070ac36d/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 16
> Date: Tue, 14 Dec 2010 00:11:00 +0800
> From: ??? 
> Subject: [vtkusers] About the VTK_USE_ANSI_STDLIB
> To: vtkusers at vtk.org
> Message-ID:
>        
> >
> Content-Type: text/plain; charset="gb2312"
>
> Sorry, every one. I started to learn itk and vtk yesterday. I am using Arch
> Linux, and I have installed vtk throught its software repos. But when I
> tried to configure VTK as is told in "Starting with ITK and VIK", I can not
> find the VTK_USE_ANSI_STDLIB option which needs to be turned on. My VTK is
> the latest version, and does that matter? And what is the effect of this
> option. Also, I can not find the option "USE_VTK" metioned in the itk faq
> "
>
> > In order to use ITK with VTK you must build VTK from sources and make
> sure
> > that it is configured with the flag USE_ANSI_STDLIB enabled.
> >
> > Then you have to reconfigure ITK making sure that the option USE_VTK is
> > enabled.
> >
> "
>
>
> By the way, I am still not clear about the combination of ItK and vtk. It
> seems I will have to copy the files like in
> "InsightApplications-3.20.0/Auxiliary/vtk" to my application source
> directory whenever I need to combine itk and vtk. Is that true?
>
> Another question is why I can simply build the Examples\Installation in itk
> but cannot build other examples like Examples\IO. I found that the
> CMakeLists.txt are slightly different. CMakeLists.txt for
> Examples\Installation has
>
>
> > FIND_PACKAGE(ITK_REQIIRED)
> >
>    INCLUDE(${ITK_USE_FILE})
>
>  I think the effection of these statement is to create ITK_DIR when build
> the project using ccmake. This is crucial, am I right?
>
> Sorry for the expression. And thanks in advance for help.
>
>
>
>
> -------------------------------------------
> ???
> ??????????
> ????1#431
> 86-10-62742310
> Luke
> School of Mathematical Sciences,
> Peking University.
> phone: 86-10-62742310
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20101214/795f448f/attachment-0001.htm
> >
>
> ------------------------------
>
> _______________________________________________
> vtkusers mailing list
> vtkusers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> End of vtkusers Digest, Vol 80, Issue 16
> ****************************************
>
>


--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From robert.maynard at kitware.com  Mon Dec 13 14:34:54 2010
From: robert.maynard at kitware.com (Robert Maynard)
Date: Mon, 13 Dec 2010 14:34:54 -0500
Subject: [vtkusers] VTK demo
In-Reply-To: 
References: 
Message-ID: 

Hi Luca,

For examples of VTK demos I would start by looking at the great VTK Examples
wiki which can be found at:
http://www.vtk.org/Wiki/VTK/Examples

You can find the data used in the
examples on the download page (
http://www.vtk.org/VTK/resources/software.html) under data.

On Fri, Dec 10, 2010 at 7:04 PM, Luca Pamparana wrote:

> Hello everyone,
>
> I want to demo VTK to my company CEO next week and one of the example
> that is sure to catch his eye is some volume/isosurface rendering
> (medical data would be good) and if there is some fancy CAD dataset
> available that could be visualized using VTK, that would be great.
>
> It does not really need to be something particular, just anything that
> would look good on the screen :)
>
> I was wondering if there are some datasets (maybe 2 or 3) and some
> associated VTK code available that would demonstrate some of the
> volume rendering, isosurface rendering, texturing/color map
> capabilities of VTK. If anyone can point me to such examples that
> would be really appreciated. I can take the code and integrate it with
> my demo app.
>
> Thanks,
>
> Luca
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
Robert Maynard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From aracha2010 at gmail.com  Mon Dec 13 17:10:41 2010
From: aracha2010 at gmail.com (Rachel)
Date: Mon, 13 Dec 2010 14:10:41 -0800 (PST)
Subject: [vtkusers] coordinate transformation between polydata and image
	data
In-Reply-To: 
References: <887B391A-2B68-4D6F-9EEA-1C7BF6A8716F@u.washington.edu>
	
	<1291839762279-3297909.post@n5.nabble.com>
	
Message-ID: <1292278241870-3303804.post@n5.nabble.com>


hi Davis Thanks for your suggestion. 
Unfortunately, I could not figure out how to use those functions in  the
link. My problem is :
we have 3D object then : 3D object---->2D  image--> 2D Silhouette.
i need to go from 2D Silhouette---->3D object 

ofcourse we don't have z information but in my knowledge and what i
understood from your solution is:
from each pixel in the silhouette  we project line to the 3D object and take
the closest point.

i did the following, where i try to find the corresponding coordinates to
the pixels (255) 

 imageData->GetOrigin(origImage);
  imageData->GetSpacing(spacing);
  int* dims = imageData->GetDimensions();
    for (int z = 0; z < dims[2]; z++)
    {
    for (int y = 0; y < dims[1]; y++)
      {
      for (int x = 0; x < dims[0]; x++)
        {
   	 unsigned char* pixel =static_cast(imageData->GetScalarPointer(x,y,z));
  			if((int)pixel[0]==255){		 
				double xx = origImage[0] + spacing[0] * x;
				double yy = origImage[1] + spacing[1] * y;
				double zz = origImage[2] + spacing[2] * z;
			    cout<<"new coordinate"<
References: 	<4D053A37.3050801@cox.net>
	
Message-ID: <4D06A943.9080907@cox.net>

Mehdi,
I am using vtk 5.6.1. The vtkReeb.... classes are new with vtk 5.7.0. I 
don't know what to expect from them, so I cannot help there.

I assume you have the source, maybe there is an author link you could 
contact there.

good luck,
Hope that helps,
Jim

Mehdi Ben Larbi wrote:
> Thanks a lot Jim,it works,the graph is displayed,i couldn't figure out 
> which DLL i had to add to make it work.
>  However,i think that i need the vtkReebGraphSurfaceSkeletonFilter 
>  
> to obtain what i'm expecting ( skeleton to compare the 3D objects ).Am 
> i right ?
>
> David,i'll gladly add the code to the Java examples but I'm a beginner 
> in VTK,I'm not sure it's the best way to do things.
>
> 2010/12/12 Jim Peterson >
>
>     Mehdi,
>     The unsatisfied link error would mean you have not loaded the
>     vtkViewsJava library in order to have access to the native vtk
>     functions for the vtkGraphLayout class.
>
>     I hope that helps,
>     Jim
>
>     Mehdi Ben Larbi wrote:
>
>         Hello,
>
>         I'm new to VTK,i'm working on a 3D indexing project for my
>         research so i need to use Reeb's graph.
>         I have been trying to view vtkReebGraph since 2 days now,i
>         have he correct data but i'm not able to display it.
>         I'm developing on Java and this is my code,the view part
>         copied form this one
>         http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraph
>         i just translated it to Java  :
>
>            vtkPolyDataToReebGraphFilter surfaceReebGraphFilter = new
>            vtkPolyDataToReebGraphFilter();
>
>          
>                    surfaceReebGraphFilter.SetInput(reader.GetOutput());
>
>                    surfaceReebGraphFilter.Update();
>
>                    vtkReebGraph surfaceReebGraph =
>            surfaceReebGraphFilter.GetOutput();
>                              
>         System.out.println(surfaceReebGraph.Print());
>                                           vtkGraphLayoutView
>         graphLayoutView =new     vtkGraphLayoutView ();
>                                  vtkGraphLayout layout =     new  
>         vtkGraphLayout ();
>                     vtkSimple2DLayoutStrategy strategy = new    
>         vtkSimple2DLayoutStrategy ();
>                     layout.SetInput(surfaceReebGraph);
>                     layout.SetLayoutStrategy(strategy);
>            ......
>
>
>
>         The Graph is correctly printed but i have this weird error :
>         Exception in thread "main" java.lang.UnsatisfiedLinkError:
>         vtk.vtkGraphLayoutView.VTKInit()J
>
>         The PATH is correctly set so i don't know where it may come from.
>         Can you please help me ? I'm desperate.
>         Maybe another method to display ReebGraph without using the
>         graphLayoutView ?
>
>         Thanks a lot.
>
>         ------------------------------------------------------------------------
>
>         _______________________________________________
>         Powered by www.kitware.com 
>
>         Visit other Kitware open-source projects at
>         http://www.kitware.com/opensource/opensource.html
>
>         Please keep messages on-topic and check the VTK FAQ at:
>         http://www.vtk.org/Wiki/VTK_FAQ
>
>         Follow this link to subscribe/unsubscribe:
>         http://www.vtk.org/mailman/listinfo/vtkusers
>          
>
>
>



From robbie.banks at gmail.com  Mon Dec 13 18:39:06 2010
From: robbie.banks at gmail.com (Robbie Banks)
Date: Mon, 13 Dec 2010 15:39:06 -0800
Subject: [vtkusers] VTKCallBack to Qt
In-Reply-To: 
References: 
Message-ID: <4d06ae2c.863fdc0a.6683.ffff8694@mx.google.com>

Hi All,

I'm wondering how I can connect a VTKCallBack function to Qt. I'm using a
vtkPointWidget to process user requests for determining location and
magnitude from an actor in the Scene.

Using qDebug() and cout I can see I am getting the right values back from
the pointWidget, but how do I then return this data to the QApplication?

Thoughts? Have anyone example of this?

Cheers
Robbie



From luis.ibanez at kitware.com  Mon Dec 13 19:15:44 2010
From: luis.ibanez at kitware.com (Luis Ibanez)
Date: Mon, 13 Dec 2010 19:15:44 -0500
Subject: [vtkusers] [Insight-users] DICOM information
In-Reply-To: <00c301cb9a87$3f18bf40$bd4a3dc0$@ac.kr>
References: <4CFF65C4.8050401@gmail.com>
	
	<006f01cb98d2$c28066a0$478133e0$@ac.kr>
	
	<00b901cb9a6a$e467cd50$ad3767f0$@ac.kr>
	
	<00c301cb9a87$3f18bf40$bd4a3dc0$@ac.kr>
Message-ID: 

Hi Xiaopeng,

It is great to hear that the DICOM tags worked for you.

--

Regarding your question about a
HoleFilling algorithm for binary images:

            Yes, we have one

Here it is:

http://www.itk.org/Doxygen/html/classitk_1_1VotingBinaryIterativeHoleFillingImageFilter.html

You will find an example at:

ITK/Examples/Filtering/
   VotingBinaryIterativeHoleFillingImageFilter.cxx


   Regards,


       Luis


---------------------------------------------------------------------
On Mon, Dec 13, 2010 at 12:33 AM, Xiaopeng Yang  wrote:
> Hi Luis,
>
> Thanks very much. It works! May I ask you another question please? Do you know some fast hole filling algorithm for binary image?
>
> Best regards,
>
> Xiaopeng
>
> -----????-----
> ???: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> ????: 2010? 12? 13? ??? ?? 11:32
> ???: Xiaopeng Yang
> ??: insight-users at itk.org; vtkusers at vtk.org
> ??: Re: [Insight-users] DICOM information
>
> Hi Xiaopeng,
>
> Please look at the example
>
> ? ? ?ITK/Examples/IO/DicomImageReadPrintTags.cxx
>
> The tags that you need are listed here:
>
> http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/DICOM.html
>
> 0010,0010 ? ? ? PatientName
> 0010,0040 ? ? ? PatientSex
> 0010,1010 ? ? ? PatientAge
>
> In the Example above,
> the lines of code 300 to 333 show you
> how to get the patient name.
>
> You can get the other values by using the
> DICOM tags for Sex and Age.
>
>
>
> ? ?Regards
>
>
> ? ? ? ? ?Luis
>
>
> ------------------------------------------------------
> On Sun, Dec 12, 2010 at 9:10 PM, Xiaopeng Yang  wrote:
>> Hello everyone,
>>
>> I'm trying to get patient name, age, and sex from a series of CT images. But
>> I have no idea how to do this. I am using ITK GDCMImageIO to load the
>> dataset, then connecting ITK to VTK, and then using VTK Imageviewer2 to
>> visualize the dataset.
>>
>> Based on the algorithms I used, how can I get patient information?
>>
>> Thank you for your help.
>>
>> Best,
>> Xiaopeng
>>
>>
>>
>>
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>
>
>
>
>
>
>
>
>
>


From basalt76 at gmail.com  Mon Dec 13 21:01:43 2010
From: basalt76 at gmail.com (cutelee)
Date: Tue, 14 Dec 2010 11:01:43 +0900
Subject: [vtkusers] Isosurface opacity problem
Message-ID: <4D06D007.80808@gmail.com>

Dears

I visualized isosurface using vtkMarchingContourFilter from
vtkUnstructuredGrid.

When the opacity is 1.0 , created picture looks normal.

But when i adjust opacity to below 1.0, the picture has speckles depends
on the position.

Do you have any solution ?

I'll really appreciate it.

Attached images

-------------- next part --------------
A non-text attachment was scrubbed...
Name: normal.JPG
Type: image/jpeg
Size: 63964 bytes
Desc: not available
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: speckle.JPG
Type: image/jpeg
Size: 60705 bytes
Desc: not available
URL: 

From tron.thomas at frontier.com  Mon Dec 13 21:30:15 2010
From: tron.thomas at frontier.com (Tron Thomas)
Date: Mon, 13 Dec 2010 18:30:15 -0800
Subject: [vtkusers] Fixing font size for vtkScalarBarActor
Message-ID: <4D06D6B7.7020502@frontier.com>

I'm working on a project that is using vtkScalarBarActor.  When the 
actor is rendered in the active window it's title and labels will scale 
with the size of the window.  How can someone configure the actor so 
that the font size for all text elements will remain the same size 
regardless of how large its window is?



From KRuvva at robodoc.com  Mon Dec 13 22:02:52 2010
From: KRuvva at robodoc.com (Rao Ruvva)
Date: Mon, 13 Dec 2010 19:02:52 -0800
Subject: [vtkusers] vtkGDCMImageReader
In-Reply-To: 
References: 
	,
	
Message-ID: 

Mark,

I have got VTK 5.6 and GDCM 2.0.16 and compiled successfully. I checked the USE_VTK option while compiling GDCM. All the examples were built without any issues. When I execute gdcmvolume (from Utilities/VTK/Examples/Cxx which uses the vtkGDCMImageReader) , I get the following error:

ERROR: In ~/VTK/Filtering/vtkDemandDrivenPipeline.cxx, line 803
vtkStreamingDemandDrivenPipeline (0x91634d8): Input for connection index 0 on input port index 0 for algorithm vtkFixedPointVolumeRayCastMapper(0xb5b28008) is NULL, but a vtkImageData is required.

Looks like problem in VTK.

I used "gdcmData/GE_DLX-8-MONO2-Multiframe-Jpeg_Lossless.dcm" as input.
I get the same error with my DICOM data set.

Any ideas?

Thanks
Rao
________________________________________
From: Mark Roden [mmroden at gmail.com]
Sent: Thursday, December 09, 2010 10:21 AM
To: Rao Ruvva
Cc: VTK
Subject: Re: vtkGDCMImageReader

Hi Rao,

The best thing for a linux system is probably to build via cmake.

Mark

On Thu, Dec 9, 2010 at 9:57 AM, Rao Ruvva  wrote:
> Mark,
>
> Thanks for your response. I'll install GDCM and try.
>
> I was looking at Sourceforge for GDCM for Linux and found installation files for 64 bit systems. But I am on 32 bit system. Any ideas, from where I get the GDCM source for 32 bit Linux system?
>
> Thank you
> Rao
>
> ________________________________________
> From: Mark Roden [mmroden at gmail.com]
> Sent: Wednesday, December 08, 2010 8:32 PM
> To: Rao Ruvva
> Cc: VTK
> Subject: vtkGDCMImageReader
>
> Hi Rao,
>
> You might want to try the vtkGDCMImageReader class.  This class is
> part of the gdcm project.
>
> You'll need to download GDCM from sourceforge, and then build it using
> cmake with the option to use vtk checked.  I don't know your level of
> using vtk, but I'd assume it's on the level of code, which would mean
> building via cmake.  gdcm on top of vtk is fairly straightforward,
> although you will need to use the IPP sorter class to sort your images
> by z position.
>
> This wiki entry should help:
> http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Using_GDCM_API#Automatic_ordering_of_slices_for_vtkGDCMImageReader.SetFileNames
>
> Good luck!
> Mark
>


From aashish.chaudhary at kitware.com  Mon Dec 13 23:49:42 2010
From: aashish.chaudhary at kitware.com (Aashish Chaudhary)
Date: Mon, 13 Dec 2010 23:49:42 -0500
Subject: [vtkusers] VTKCallBack to Qt
In-Reply-To: <4d06ae2c.863fdc0a.6683.ffff8694@mx.google.com>
References: 
	<4d06ae2c.863fdc0a.6683.ffff8694@mx.google.com>
Message-ID: 

Just quickly looking at your email.. I am thinking this class might help:

http://www.vtk.org/doc/nightly/html/classvtkEventQtSlotConnect.html



On Mon, Dec 13, 2010 at 6:39 PM, Robbie Banks wrote:

> Hi All,
>
> I'm wondering how I can connect a VTKCallBack function to Qt. I'm using a
> vtkPointWidget to process user requests for determining location and
> magnitude from an actor in the Scene.
>
> Using qDebug() and cout I can see I am getting the right values back from
> the pointWidget, but how do I then return this data to the QApplication?
>
> Thoughts? Have anyone example of this?
>
> Cheers
> Robbie
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From webmaster at insightsoftwareconsortium.org  Tue Dec 14 02:40:07 2010
From: webmaster at insightsoftwareconsortium.org (VTK Journal)
Date: Tue, 14 Dec 2010 02:40:07 -0500
Subject: [vtkusers] The VTK Journal-New Submission
Message-ID: <201012140740.oBE7e7ri015459@insight-journal.org>

Hello,
A new submission has been added to the VTK Journal.

Title: Entropy Image Filter
Author(s):Tamburo R.
Abstract: 
This paper describes an intensity image filter for computing the variance of pixel values contained within a neighborhood centered at each input pixel. The output image contains the calculated variance at each input pixel location. This paper is accompanied with source code for the filter and test, test images and parameters, and expected output images.  

Download and Review the paper at: http://www.insight-journal.org/browse/publication/781

Generated by the VTK Journal
You are receiving this email because you asked to be informed by the VTK Journal for new submissions.
                    
To change your email preference go to http://www.insight-journal.org .


From jazzkartell at gmx.de  Tue Dec 14 03:33:44 2010
From: jazzkartell at gmx.de (Jazz Kartell)
Date: Tue, 14 Dec 2010 09:33:44 +0100
Subject: [vtkusers] moving selected actor
Message-ID: <4D072BE8.3040307@gmx.de>

I am new to the mailing list, so first of all, "hello" to everybody...

My goal is to visualize 3D Graph Mining algorithms.
At the moment my little program can display nodes (vtkSphereSource), 
edges (vtkLineSource) and axis.
But I want to select a node (pressing 'P' for selection works) and move 
it around to change the coordinates of a node.
Can someone give me a hint how selected actors can be moved around?
And is it possible to display some kind of labeling for actors? The only 
idea i have is to place separate 'textfields' near the actors.
Perhaps a better solution is out there?
The program is written in Java, don't know if there is a difference in 
the amount of available functionality.

Thank you very much in advance

Best Regards

Benjamin


From basalt76 at gmail.com  Tue Dec 14 04:01:47 2010
From: basalt76 at gmail.com (=?EUC-KR?B?wMzH9sO2?=)
Date: Tue, 14 Dec 2010 18:01:47 +0900
Subject: [vtkusers]  Isosurface opacity problem
Message-ID: 

Dears

I visualized isosurface using vtkMarchingContourFilter from
vtkUnstructuredGrid.

When the opacity is 1.0 , created picture looks normal.

But when i adjust opacity to below 1.0, the picture has speckles depends
on the position.

Do you have any solution ?

I'll really appreciate it.

Attached images
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: normal.JPG
Type: image/jpeg
Size: 63964 bytes
Desc: not available
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: speckle.JPG
Type: image/jpeg
Size: 60705 bytes
Desc: not available
URL: 

From rodrigo.geof at gmail.com  Tue Dec 14 06:02:52 2010
From: rodrigo.geof at gmail.com (Rodrigo M.)
Date: Tue, 14 Dec 2010 09:02:52 -0200
Subject: [vtkusers] Rubber band zoom and pick on 2d image
In-Reply-To: 
References: <1291756464748-3296495.post@n5.nabble.com>
	
Message-ID: 

Hi Aashish,

Thanks a lot, this is exactly what I was looking for. =)

2010/12/14 Aashish Chaudhary :
> Hi Rodrigo,
> If you have not found the answer this might help:
> On the style you can query GetStartPosition() and GetEndPosition()
> Convert these positions to world coordinate using vtkViewPort functions
> something like this:
>
> double startWorldPosition[4], endWorldPosition[4];
>
>   this->MainRenderer->SetViewPoint(
>
>     (startPosition[0] - halfWidth) / halfWidth,
>
>     (startPosition[1] - halfHeight) / halfHeight,
>
>     1);
>
>   this->MainRenderer->ViewToWorld();
>
>   this->MainRenderer->GetWorldPoint(startWorldPosition);
>
>   this->MainRenderer->SetViewPoint(
>
>     (endPosition[0] - halfWidth) / halfWidth,
>
>     (endPosition[1] - halfHeight) / halfHeight,
>
>     1);
>
>   this->MainRenderer->ViewToWorld();
>
>   this->MainRenderer->GetWorldPoint(endWorldPosition);
>
>   int targetExtents[4] = {
>
>     startWorldPosition[0] < endWorldPosition[0] ? startWorldPosition[0] :
> endWorldPosition[0],
>
>     startWorldPosition[0] > endWorldPosition[0] ? startWorldPosition[0] :
> endWorldPosition[0],
>
>     startWorldPosition[1] < endWorldPosition[1] ? startWorldPosition[1] :
> endWorldPosition[1],
>
>     startWorldPosition[1] > endWorldPosition[1] ? startWorldPosition[1] :
> endWorldPosition[1]};
>
> Once you get target extents you can set camera center to center of these
> extents something like this:
>
>
>     camera->SetPosition(newCenter[0], newCenter[1], 1);
>
>     camera->SetFocalPoint(newCenter[0], newCenter[1], 0);
>
>     camera->SetViewUp(0, 1, 0); // just to make sure
>
>     camera->SetParallelScale((newExtents[3] - newExtents[2]) / 2.0);
>
> Hope this helps.
> On Tue, Dec 7, 2010 at 4:14 PM, rodrigo  wrote:
>>
>> Hello, I'm new to vtk, what I want to do is to zoom on a 2D image using a
>> Rubber band box, and to have my mouse coordinates showed up.
>>
>> I tried to modify one of the wiki examples, but I couldn't make the mouse
>> coordinates be showed up and have the rubber band ?at the same time.
>> Besides
>> that, I have no idea on how to make the rubber band zoom my image. I
>> really
>> want to use the coordinates grabbed by the rubber box to zoom the image.
>>
>> Here is my code:
>>
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>> #include 
>>
>> // The mouse motion callback, to pick the image and recover pixel values
>> class vtkImageInteractionCallback1 : public vtkCommand
>> {
>> public:
>>
>> ? ? ? ?static vtkImageInteractionCallback1 *New()
>> ? ? ? ?{
>> ? ? ? ? ? ? ? ?return new vtkImageInteractionCallback1;
>> ? ? ? ?}
>>
>> ? ? ? ?vtkImageInteractionCallback1()
>> ? ? ? ?{
>> ? ? ? ? ? ? ? ?this->Viewer = 0;
>> ? ? ? ? ? ? ? ?this->Picker = 0;
>> ? ? ? ? ? ? ? ?this->Annotation = 0;
>> ? ? ? ? ? ? ? ?this->PointData = vtkPointData::New();
>> ? ? ? ?}
>>
>> ? ? ? ?~vtkImageInteractionCallback1()
>> ? ? ? ?{
>> ? ? ? ? ? ? ? ?this->Viewer = 0;
>> ? ? ? ? ? ? ? ?this->Picker = 0;
>> ? ? ? ? ? ? ? ?this->Annotation = 0;
>> ? ? ? ? ? ? ? ?this->PointData->Delete();
>> ? ? ? ?}
>>
>> ? ? ? ?void SetPicker(vtkPropPicker *picker)
>> ? ? ? ?{
>> ? ? ? ? ? ? ? ?this->Picker = picker;
>> ? ? ? ?}
>>
>> ? ? ? ?void SetAnnotation(vtkCornerAnnotation *annotation)
>> ? ? ? ?{
>> ? ? ? ? ? ? ? ?this->Annotation = annotation;
>> ? ? ? ?}
>>
>> ? ? ? ?void SetViewer(vtkImageViewer2 *viewer)
>> ? ? ? ?{
>> ? ? ? ? ? ? ? ?this->Viewer = viewer;
>> ? ? ? ?}
>>
>> ? ? ? ?virtual void Execute(vtkObject *, unsigned long vtkNotUsed(event),
>> void *)
>> ? ? ? ?{
>> ? ? ? ? ? ? ? ?//this->Viewer;
>> ? ? ? ? ? ? ? ?vtkRenderWindowInteractor *interactor =
>> ? ? ? ? ? ? ? ? ? ? ? ?this->Viewer->GetRenderWindow()->GetInteractor();
>> ? ? ? ? ? ? ? ?vtkRenderer* renderer = this->Viewer->GetRenderer();
>> ? ? ? ? ? ? ? ?vtkImageActor* actor = this->Viewer->GetImageActor();
>> ? ? ? ? ? ? ? ?vtkImageData* image = this->Viewer->GetInput();
>> ? ? ? ? ? ? ? ?vtkInteractorStyle *style =
>> vtkInteractorStyle::SafeDownCast(
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?interactor->GetInteractorStyle());
>>
>> ? ? ? ? ? ? ? ?image->Update();
>>
>> ? ? ? ? ? ? ? ?// Pick at the mouse location provided by the interactor
>> ? ? ? ? ? ? ? ?this->Picker->Pick( interactor->GetEventPosition()[0],
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?interactor->GetEventPosition()[1],
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.0, renderer );
>>
>> ? ? ? ? ? ? ? ?// There could be other props assigned to this picker, so
>> ? ? ? ? ? ? ? ?// make sure we picked the image actor
>> ? ? ? ? ? ? ? ?vtkAssemblyPath* path = this->Picker->GetPath();
>> ? ? ? ? ? ? ? ?bool validPick = false;
>>
>> ? ? ? ? ? ? ? ?if( path )
>> ? ? ? ? ? ? ? ?{
>> ? ? ? ? ? ? ? ? ? ? ? ?vtkCollectionSimpleIterator sit;
>> ? ? ? ? ? ? ? ? ? ? ? ?path->InitTraversal( sit );
>> ? ? ? ? ? ? ? ? ? ? ? ?vtkAssemblyNode *node;
>> ? ? ? ? ? ? ? ? ? ? ? ?for( int i = 0; i < path->GetNumberOfItems() &&
>> !validPick; ++i )
>> ? ? ? ? ? ? ? ? ? ? ? ?{
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?node = path->GetNextNode( sit );
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?if( actor == vtkImageActor::SafeDownCast(
>> node->GetViewProp() ) )
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?validPick = true;
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?}
>> ? ? ? ? ? ? ? ? ? ? ? ?}
>> ? ? ? ? ? ? ? ?}
>>
>> ? ? ? ? ? ? ? ?if( !validPick )
>> ? ? ? ? ? ? ? ?{
>> ? ? ? ? ? ? ? ? ? ? ? ?this->Annotation->SetText( 0, "Off Image" );
>> ? ? ? ? ? ? ? ? ? ? ? ?interactor->Render();
>> ? ? ? ? ? ? ? ? ? ? ? ?// Pass the event further on
>> ? ? ? ? ? ? ? ? ? ? ? ?style->OnMouseMove();
>> ? ? ? ? ? ? ? ? ? ? ? ?return;
>> ? ? ? ? ? ? ? ?}
>>
>> ? ? ? ? ? ? ? ?// Get the world coordinates of the pick
>> ? ? ? ? ? ? ? ?double pos[3];
>> ? ? ? ? ? ? ? ?this->Picker->GetPickPosition( pos );
>> ? ? ? ? ? ? ? ?// Fixes some numerical problems with the picking
>> ? ? ? ? ? ? ? ?double *bounds = actor->GetDisplayBounds();
>> ? ? ? ? ? ? ? ?int axis = this->Viewer->GetSliceOrientation();
>> ? ? ? ? ? ? ? ?pos[axis] = bounds[2*axis];
>>
>> ? ? ? ? ? ? ? ?vtkPointData* pd = image->GetPointData();
>> ? ? ? ? ? ? ? ?if( !pd )
>> ? ? ? ? ? ? ? ?{
>> ? ? ? ? ? ? ? ? ? ? ? ?return;
>> ? ? ? ? ? ? ? ?}
>>
>> ? ? ? ? ? ? ? ?this->PointData->InterpolateAllocate( pd, 1, 1 );
>>
>> ? ? ? ? ? ? ? ?// Use tolerance as a function of size of source data
>> ? ? ? ? ? ? ? ?double tol2 = image->GetLength();
>> ? ? ? ? ? ? ? ?tol2 = tol2 ? tol2*tol2 / 1000.0 : 0.001;
>>
>> ? ? ? ? ? ? ? ?// Find the cell that contains pos
>> ? ? ? ? ? ? ? ?int subId;
>> ? ? ? ? ? ? ? ?double pcoords[3], weights[8];
>> ? ? ? ? ? ? ? ?vtkCell* cell = image->FindAndGetCell(
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pos, NULL, -1, tol2, subId, pcoords,
>> weights );
>> ? ? ? ? ? ? ? ?if( cell )
>> ? ? ? ? ? ? ? ?{
>> ? ? ? ? ? ? ? ? ? ? ? ?// Interpolate the point data
>> ? ? ? ? ? ? ? ? ? ? ? ?this->PointData->InterpolatePoint( pd, 0,
>> cell->PointIds, weights );
>> ? ? ? ? ? ? ? ? ? ? ? ?int components =
>>
>> ?this->PointData->GetScalars()->GetNumberOfComponents();
>> ? ? ? ? ? ? ? ? ? ? ? ?double* tuple =
>> this->PointData->GetScalars()->GetTuple( 0 );
>>
>> ? ? ? ? ? ? ? ? ? ? ? ?std::string message = "Location: ( ";
>> ? ? ? ? ? ? ? ? ? ? ? ?message += vtkVariant( pos[0] ).ToString();
>> ? ? ? ? ? ? ? ? ? ? ? ?message += ", ";
>> ? ? ? ? ? ? ? ? ? ? ? ?message += vtkVariant( pos[1] ).ToString();
>> ? ? ? ? ? ? ? ? ? ? ? ?message += ", ";
>> ? ? ? ? ? ? ? ? ? ? ? ?message += vtkVariant( pos[2] ).ToString();
>> ? ? ? ? ? ? ? ? ? ? ? ?message += " )\nValue: ( ";
>>
>> ? ? ? ? ? ? ? ? ? ? ? ?for( int c = 0; c < components; ++c )
>> ? ? ? ? ? ? ? ? ? ? ? ?{
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?message += vtkVariant( tuple[ c ]
>> ).ToString();
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?if( c != components - 1 )
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?message += ", ";
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?}
>> ? ? ? ? ? ? ? ? ? ? ? ?}
>> ? ? ? ? ? ? ? ? ? ? ? ?message += " )";
>> ? ? ? ? ? ? ? ? ? ? ? ?this->Annotation->SetText( 0, message.c_str() );
>> ? ? ? ? ? ? ? ? ? ? ? ?interactor->Render();
>> ? ? ? ? ? ? ? ? ? ? ? ?style->OnMouseMove();
>> ? ? ? ? ? ? ? ?}
>> ? ? ? ?}
>>
>> private:
>>
>> ? ? ? ?// Pointer to the viewer
>> ? ? ? ?vtkImageViewer2 *Viewer;
>>
>> ? ? ? ?// Pointer to the picker
>> ? ? ? ?vtkPropPicker *Picker;
>>
>> ? ? ? ?// Pointer to the annotation
>> ? ? ? ?vtkCornerAnnotation *Annotation;
>>
>> ? ? ? ?// Interpolator
>> ? ? ? ?vtkPointData* PointData;
>> };
>>
>>
>> void SelectionChangedCallbackFunction ( vtkObject* vtkNotUsed(caller),
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?long unsigned int
>> vtkNotUsed(eventId), void* vtkNotUsed(clientData),
>> void* callData )
>> {
>> ? ? ? ?std::cout << "SelectionChanged callback" << std::endl;
>>
>> ? ? ? ?unsigned int* rect = reinterpret_cast ( callData );
>> ? ? ? ?unsigned int pos1X = rect[0];
>> ? ? ? ?unsigned int pos1Y = rect[1];
>> ? ? ? ?unsigned int pos2X = rect[2];
>> ? ? ? ?unsigned int pos2Y = rect[3];
>>
>> ? ? ? ?std::cout << "Start x: " << pos1X << " Start y: " << pos1Y
>> ? ? ? ? ? ? ? ?<< " End x: " << pos2X << " End y: " << pos2Y << std::endl;
>> }
>>
>> int main ( int argc, char* argv[] )
>> {
>> ? ? ? ?//Verify input arguments
>> ? ? ? ?if ( argc != 2 )
>> ? ? ? ?{
>> ? ? ? ? ? ? ? ?std::cout << "Usage: " << argv[0]
>> ? ? ? ? ? ? ? ? ? ? ? ?<< " Filename(jpeg)" << std::endl;
>> ? ? ? ? ? ? ? ?return EXIT_FAILURE;
>> ? ? ? ?}
>>
>> ? ? ? ?//Parse input argument
>> ? ? ? ?std::string inputFilename = argv[1];
>>
>> ? ? ? ?//Read the image
>> ? ? ? ?vtkSmartPointer jpegReader =
>> ? ? ? ? ? ? ? ?vtkSmartPointer::New();
>> ? ? ? ?if( !jpegReader->CanReadFile( inputFilename.c_str() ) )
>> ? ? ? ?{
>> ? ? ? ? ? ? ? ?std::cout << argv[0] << ": Error reading file "
>> ? ? ? ? ? ? ? ? ? ? ? ?<< inputFilename << endl << "Exiting..." << endl;
>> ? ? ? ? ? ? ? ?return EXIT_FAILURE;
>> ? ? ? ?}
>> ? ? ? ?jpegReader->SetFileName ( inputFilename.c_str() );
>>
>> ? ? ? ?// Picker to pick pixels
>> ? ? ? ?vtkSmartPointer propPicker =
>> ? ? ? ? ? ? ? ?vtkSmartPointer::New();
>> ? ? ? ?propPicker->PickFromListOn();
>>
>> ? ? ? ?// Give the picker a prop to pick
>> ? ? ? ?vtkSmartPointer imageViewer =
>> ? ? ? ? ? ? ? ?vtkSmartPointer::New();
>> ? ? ? ?propPicker->AddPickList( imageViewer->GetImageActor() );
>>
>> ? ? ? ?// Visualize
>> ? ? ? ?vtkSmartPointer renderWindowInteractor =
>> ? ? ? ? ? ? ? ?vtkSmartPointer::New();
>> ? ? ? ?imageViewer->SetInputConnection( jpegReader->GetOutputPort() );
>> ? ? ? ?imageViewer->SetupInteractor( renderWindowInteractor );
>> ? ? ? ?imageViewer->SetSize( 600, 600 );
>>
>> ? ? ? ?vtkRenderer* renderer = imageViewer->GetRenderer();
>> ? ? ? ?renderer->ResetCamera();
>> ? ? ? ?renderer->GradientBackgroundOn();
>> ? ? ? ?renderer->SetBackground(0,0,0);
>> ? ? ? ?renderer->SetBackground2(1,1,1);
>>
>> ? ? ? ?// Annotate the image with window/level and mouse over pixel
>> information
>> ? ? ? ?vtkSmartPointer cornerAnnotation =
>> ? ? ? ? ? ? ? ?vtkSmartPointer::New();
>> ? ? ? ?cornerAnnotation->SetLinearFontScaleFactor( 2 );
>> ? ? ? ?cornerAnnotation->SetNonlinearFontScaleFactor( 1 );
>> ? ? ? ?cornerAnnotation->SetMaximumFontSize( 20 );
>> ? ? ? ?cornerAnnotation->SetText( 0, "Off Image" );
>> ? ? ? ?cornerAnnotation->SetText( 3, "\n" );
>> ? ? ? ?cornerAnnotation->GetTextProperty()->SetColor( 1,0,0);
>>
>> ? ? ? ?imageViewer->GetRenderer()->AddViewProp( cornerAnnotation );
>>
>> ? ? ? ?// Callback listens to MouseMoveEvents invoked by the interactor's
>> style
>> ? ? ? ?vtkSmartPointer callback =
>> ? ? ? ? ? ? ? ?vtkSmartPointer::New();
>> ? ? ? ?callback->SetViewer( imageViewer );
>> ? ? ? ?callback->SetAnnotation( cornerAnnotation );
>> ? ? ? ?callback->SetPicker( propPicker );
>>
>> ? ? ? ?// InteractorStyleImage allows for the following controls:
>> ? ? ? ?// 1) middle mouse + move = camera pan
>> ? ? ? ?// 2) left mouse + move = window/level
>> ? ? ? ?// 3) right mouse + move = camera zoom
>> ? ? ? ?// 4) middle mouse wheel scroll = zoom
>> ? ? ? ?// 5) 'r' = reset window/level
>> ? ? ? ?// 6) shift + 'r' = reset camera
>> ? ? ? ?vtkInteractorStyleImage* imageStyle =
>> imageViewer->GetInteractorStyle();
>> ? ? ? ?imageStyle->AddObserver( vtkCommand::MouseMoveEvent, callback );
>>
>> ? ? ? ?vtkSmartPointer selectionChangedCallback =
>> ? ? ? ? ? ? ? ?vtkSmartPointer::New();
>> ? ? ? ?selectionChangedCallback->SetCallback (
>> SelectionChangedCallbackFunction );
>>
>> ? ? ? ?vtkSmartPointer style =
>> ? ? ? ? ? ? ? ?vtkSmartPointer::New();
>> ? ? ? ?style->AddObserver ( vtkCommand::SelectionChangedEvent,
>> selectionChangedCallback );
>> ? ? ? ?renderWindowInteractor->SetInteractorStyle( style );
>>
>> ? ? ? ?renderWindowInteractor->Initialize();
>> ? ? ? ?renderWindowInteractor->Start();
>>
>> ? ? ? ?return EXIT_SUCCESS;
>> }
>>
>> --
>> View this message in context:
>> http://vtk.1045678.n5.nabble.com/Rubber-band-zoom-and-pick-on-2d-image-tp3296495p3296495.html
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
> --
> | Aashish Chaudhary
> | R&D Engineer
> | Kitware Inc.
> | www.kitware.com
>


From jimcp at cox.net  Tue Dec 14 07:13:15 2010
From: jimcp at cox.net (Jim Peterson)
Date: Tue, 14 Dec 2010 07:13:15 -0500
Subject: [vtkusers] moving selected actor
In-Reply-To: <4D072BE8.3040307@gmx.de>
References: <4D072BE8.3040307@gmx.de>
Message-ID: <4D075F5B.6090705@cox.net>

Jazz,
I have noticed that the default interactor appears to honor the A and C 
keyboard interactions to switch between Actor interaction and Camera 
interaction, There also appears to be support for T and J to switch 
Trackball and Joystick style interaction as well. This is all documented 
in the vtkInteractionStyleSwitch class. So you may be able to move an 
actor by pressing A then double click within the image of the objects 
represented by the actor. You should always be able to set the 
interaction style to vtkInteractionStyleSwitch to get this behavior.

This example 
http://www.vtk.org/Wiki/VTK/Examples/Java/Interaction/ExtrudeTest may help.

Hope that helps,
Jim

Jazz Kartell wrote:
> I am new to the mailing list, so first of all, "hello" to everybody...
>
> My goal is to visualize 3D Graph Mining algorithms.
> At the moment my little program can display nodes (vtkSphereSource), 
> edges (vtkLineSource) and axis.
> But I want to select a node (pressing 'P' for selection works) and 
> move it around to change the coordinates of a node.
> Can someone give me a hint how selected actors can be moved around?
> And is it possible to display some kind of labeling for actors? The 
> only idea i have is to place separate 'textfields' near the actors.
> Perhaps a better solution is out there?
> The program is written in Java, don't know if there is a difference in 
> the amount of available functionality.
>
> Thank you very much in advance
>
> Best Regards
>
> Benjamin
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: 
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



From daviddoria at gmail.com  Tue Dec 14 07:34:23 2010
From: daviddoria at gmail.com (David Doria)
Date: Tue, 14 Dec 2010 07:34:23 -0500
Subject: [vtkusers] VTKCallBack to Qt
In-Reply-To: 
References: 
	<4d06ae2c.863fdc0a.6683.ffff8694@mx.google.com>
	
Message-ID: 

On Mon, Dec 13, 2010 at 11:49 PM, Aashish Chaudhary
 wrote:
> Just quickly looking at your email.. I am thinking this class might help:
> http://www.vtk.org/doc/nightly/html/classvtkEventQtSlotConnect.html

I made a spot for an example of this here:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/EventQtSlotConnect if you
would be so kind to post it as you figure it out.

David


From mrapsouthern at gmail.com  Tue Dec 14 08:45:16 2010
From: mrapsouthern at gmail.com (Alex Southern)
Date: Tue, 14 Dec 2010 15:45:16 +0200
Subject: [vtkusers] VTK and QT headaches
Message-ID: <4D0774EC.3050104@gmail.com>

Hi,

Im running a QThread event loop and trying to execute a 
vtkInteractorWindow->Render() command after each iteration. I have tried 
two approaches so far but neither work well.

The First approach, gives a VTK error and is based on something like this:
At the initialization stage I pass a pointer to iren. Then in the run() 
function I execute iren->Render();

class myThread : public QThread
{
     Q_OBJECT

  public:
      vtkRenderWindowInteractor *iren;
      void run();
     {
         for (int i = 0; i < 2000; i++)
         {
             // process some data
             iren->Render();
         }
     }
};

This compiles but gives the error in the vtkOutputWindow on each call of 
Render()....

ERROR: In ..\..\Source\VTKGit\Rendering\vtkWin32OpenGLRenderWindow.cxx, 
line 247
vtkWin32OpenGLRenderWindow (05153168): wglMakeCurrent failed in 
MakeCurrent(), error: The requested resource is in use.

The second approach gives no errors, but results in a very jerky 
interaction. It is implemented by emitting a signal from the for loop 
after every iteration. The threads myRender() signal is connected to a 
updateRenderWindow() slot function i.e.

class myThread : public QThread
{
     Q_OBJECT

  public:
      void run()
     {
         for (int i = 0; i < 2000; i++)
         {
             // process some data
             emit myRender();
         }
     }
   signals:
      void myRender();
};

class myWindow : public QMainWindow
{
     Q_OBJECT

public:
     myThread Td;
     vtkRenderWindowInteractor *iren;

public slots:
     void updateRenderWindow()
     {
         iren->Render();
     }
}


Does anyone have any suggestions as to how I can improve either of these 
methods to give a better interaction?

Thanks
Alex





From oka at bpe.es.osaka-u.ac.jp  Tue Dec 14 09:06:40 2010
From: oka at bpe.es.osaka-u.ac.jp (oka)
Date: Tue, 14 Dec 2010 23:06:40 +0900
Subject: [vtkusers] Cellpicking
Message-ID: <20101214230411.1A87.F353B791@bpe.es.osaka-u.ac.jp>

Dear VTK users, 

I will send my question again.
Can anyone help me ?

When using example of cellPicking 
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Picking/CellPicking
I want to erase highlight when I pick again the same cell once 
selected. Is it possible ? 
I met cases  GetCellID value change to "0" if double clicked. 
Is it correct ? 
Normally GetCellID is ID number of selected cell id, I know. 

Best regards, 

Oka 



From aashish.chaudhary at kitware.com  Tue Dec 14 09:12:26 2010
From: aashish.chaudhary at kitware.com (Aashish Chaudhary)
Date: Tue, 14 Dec 2010 09:12:26 -0500
Subject: [vtkusers] Rubber band zoom and pick on 2d image
In-Reply-To: 
References: <1291756464748-3296495.post@n5.nabble.com>
	
	
Message-ID: 

You are welcome.

Glad that I was able to help.


On Tue, Dec 14, 2010 at 6:02 AM, Rodrigo M.  wrote:

> Hi Aashish,
>
> Thanks a lot, this is exactly what I was looking for. =)
>
> 2010/12/14 Aashish Chaudhary :
> > Hi Rodrigo,
> > If you have not found the answer this might help:
> > On the style you can query GetStartPosition() and GetEndPosition()
> > Convert these positions to world coordinate using vtkViewPort functions
> > something like this:
> >
> > double startWorldPosition[4], endWorldPosition[4];
> >
> >   this->MainRenderer->SetViewPoint(
> >
> >     (startPosition[0] - halfWidth) / halfWidth,
> >
> >     (startPosition[1] - halfHeight) / halfHeight,
> >
> >     1);
> >
> >   this->MainRenderer->ViewToWorld();
> >
> >   this->MainRenderer->GetWorldPoint(startWorldPosition);
> >
> >   this->MainRenderer->SetViewPoint(
> >
> >     (endPosition[0] - halfWidth) / halfWidth,
> >
> >     (endPosition[1] - halfHeight) / halfHeight,
> >
> >     1);
> >
> >   this->MainRenderer->ViewToWorld();
> >
> >   this->MainRenderer->GetWorldPoint(endWorldPosition);
> >
> >   int targetExtents[4] = {
> >
> >     startWorldPosition[0] < endWorldPosition[0] ? startWorldPosition[0] :
> > endWorldPosition[0],
> >
> >     startWorldPosition[0] > endWorldPosition[0] ? startWorldPosition[0] :
> > endWorldPosition[0],
> >
> >     startWorldPosition[1] < endWorldPosition[1] ? startWorldPosition[1] :
> > endWorldPosition[1],
> >
> >     startWorldPosition[1] > endWorldPosition[1] ? startWorldPosition[1] :
> > endWorldPosition[1]};
> >
> > Once you get target extents you can set camera center to center of these
> > extents something like this:
> >
> >
> >     camera->SetPosition(newCenter[0], newCenter[1], 1);
> >
> >     camera->SetFocalPoint(newCenter[0], newCenter[1], 0);
> >
> >     camera->SetViewUp(0, 1, 0); // just to make sure
> >
> >     camera->SetParallelScale((newExtents[3] - newExtents[2]) / 2.0);
> >
> > Hope this helps.
> > On Tue, Dec 7, 2010 at 4:14 PM, rodrigo  wrote:
> >>
> >> Hello, I'm new to vtk, what I want to do is to zoom on a 2D image using
> a
> >> Rubber band box, and to have my mouse coordinates showed up.
> >>
> >> I tried to modify one of the wiki examples, but I couldn't make the
> mouse
> >> coordinates be showed up and have the rubber band  at the same time.
> >> Besides
> >> that, I have no idea on how to make the rubber band zoom my image. I
> >> really
> >> want to use the coordinates grabbed by the rubber box to zoom the image.
> >>
> >> Here is my code:
> >>
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >> #include 
> >>
> >> // The mouse motion callback, to pick the image and recover pixel values
> >> class vtkImageInteractionCallback1 : public vtkCommand
> >> {
> >> public:
> >>
> >>        static vtkImageInteractionCallback1 *New()
> >>        {
> >>                return new vtkImageInteractionCallback1;
> >>        }
> >>
> >>        vtkImageInteractionCallback1()
> >>        {
> >>                this->Viewer = 0;
> >>                this->Picker = 0;
> >>                this->Annotation = 0;
> >>                this->PointData = vtkPointData::New();
> >>        }
> >>
> >>        ~vtkImageInteractionCallback1()
> >>        {
> >>                this->Viewer = 0;
> >>                this->Picker = 0;
> >>                this->Annotation = 0;
> >>                this->PointData->Delete();
> >>        }
> >>
> >>        void SetPicker(vtkPropPicker *picker)
> >>        {
> >>                this->Picker = picker;
> >>        }
> >>
> >>        void SetAnnotation(vtkCornerAnnotation *annotation)
> >>        {
> >>                this->Annotation = annotation;
> >>        }
> >>
> >>        void SetViewer(vtkImageViewer2 *viewer)
> >>        {
> >>                this->Viewer = viewer;
> >>        }
> >>
> >>        virtual void Execute(vtkObject *, unsigned long
> vtkNotUsed(event),
> >> void *)
> >>        {
> >>                //this->Viewer;
> >>                vtkRenderWindowInteractor *interactor =
> >>                        this->Viewer->GetRenderWindow()->GetInteractor();
> >>                vtkRenderer* renderer = this->Viewer->GetRenderer();
> >>                vtkImageActor* actor = this->Viewer->GetImageActor();
> >>                vtkImageData* image = this->Viewer->GetInput();
> >>                vtkInteractorStyle *style =
> >> vtkInteractorStyle::SafeDownCast(
> >>                                interactor->GetInteractorStyle());
> >>
> >>                image->Update();
> >>
> >>                // Pick at the mouse location provided by the interactor
> >>                this->Picker->Pick( interactor->GetEventPosition()[0],
> >>                                    interactor->GetEventPosition()[1],
> >>                                    0.0, renderer );
> >>
> >>                // There could be other props assigned to this picker, so
> >>                // make sure we picked the image actor
> >>                vtkAssemblyPath* path = this->Picker->GetPath();
> >>                bool validPick = false;
> >>
> >>                if( path )
> >>                {
> >>                        vtkCollectionSimpleIterator sit;
> >>                        path->InitTraversal( sit );
> >>                        vtkAssemblyNode *node;
> >>                        for( int i = 0; i < path->GetNumberOfItems() &&
> >> !validPick; ++i )
> >>                        {
> >>                                node = path->GetNextNode( sit );
> >>                                if( actor == vtkImageActor::SafeDownCast(
> >> node->GetViewProp() ) )
> >>                                {
> >>                                        validPick = true;
> >>                                }
> >>                        }
> >>                }
> >>
> >>                if( !validPick )
> >>                {
> >>                        this->Annotation->SetText( 0, "Off Image" );
> >>                        interactor->Render();
> >>                        // Pass the event further on
> >>                        style->OnMouseMove();
> >>                        return;
> >>                }
> >>
> >>                // Get the world coordinates of the pick
> >>                double pos[3];
> >>                this->Picker->GetPickPosition( pos );
> >>                // Fixes some numerical problems with the picking
> >>                double *bounds = actor->GetDisplayBounds();
> >>                int axis = this->Viewer->GetSliceOrientation();
> >>                pos[axis] = bounds[2*axis];
> >>
> >>                vtkPointData* pd = image->GetPointData();
> >>                if( !pd )
> >>                {
> >>                        return;
> >>                }
> >>
> >>                this->PointData->InterpolateAllocate( pd, 1, 1 );
> >>
> >>                // Use tolerance as a function of size of source data
> >>                double tol2 = image->GetLength();
> >>                tol2 = tol2 ? tol2*tol2 / 1000.0 : 0.001;
> >>
> >>                // Find the cell that contains pos
> >>                int subId;
> >>                double pcoords[3], weights[8];
> >>                vtkCell* cell = image->FindAndGetCell(
> >>                                pos, NULL, -1, tol2, subId, pcoords,
> >> weights );
> >>                if( cell )
> >>                {
> >>                        // Interpolate the point data
> >>                        this->PointData->InterpolatePoint( pd, 0,
> >> cell->PointIds, weights );
> >>                        int components =
> >>
> >>  this->PointData->GetScalars()->GetNumberOfComponents();
> >>                        double* tuple =
> >> this->PointData->GetScalars()->GetTuple( 0 );
> >>
> >>                        std::string message = "Location: ( ";
> >>                        message += vtkVariant( pos[0] ).ToString();
> >>                        message += ", ";
> >>                        message += vtkVariant( pos[1] ).ToString();
> >>                        message += ", ";
> >>                        message += vtkVariant( pos[2] ).ToString();
> >>                        message += " )\nValue: ( ";
> >>
> >>                        for( int c = 0; c < components; ++c )
> >>                        {
> >>                                message += vtkVariant( tuple[ c ]
> >> ).ToString();
> >>                                if( c != components - 1 )
> >>                                {
> >>                                        message += ", ";
> >>                                }
> >>                        }
> >>                        message += " )";
> >>                        this->Annotation->SetText( 0, message.c_str() );
> >>                        interactor->Render();
> >>                        style->OnMouseMove();
> >>                }
> >>        }
> >>
> >> private:
> >>
> >>        // Pointer to the viewer
> >>        vtkImageViewer2 *Viewer;
> >>
> >>        // Pointer to the picker
> >>        vtkPropPicker *Picker;
> >>
> >>        // Pointer to the annotation
> >>        vtkCornerAnnotation *Annotation;
> >>
> >>        // Interpolator
> >>        vtkPointData* PointData;
> >> };
> >>
> >>
> >> void SelectionChangedCallbackFunction ( vtkObject* vtkNotUsed(caller),
> >>                                        long unsigned int
> >> vtkNotUsed(eventId), void* vtkNotUsed(clientData),
> >> void* callData )
> >> {
> >>        std::cout << "SelectionChanged callback" << std::endl;
> >>
> >>        unsigned int* rect = reinterpret_cast ( callData
> );
> >>        unsigned int pos1X = rect[0];
> >>        unsigned int pos1Y = rect[1];
> >>        unsigned int pos2X = rect[2];
> >>        unsigned int pos2Y = rect[3];
> >>
> >>        std::cout << "Start x: " << pos1X << " Start y: " << pos1Y
> >>                << " End x: " << pos2X << " End y: " << pos2Y <<
> std::endl;
> >> }
> >>
> >> int main ( int argc, char* argv[] )
> >> {
> >>        //Verify input arguments
> >>        if ( argc != 2 )
> >>        {
> >>                std::cout << "Usage: " << argv[0]
> >>                        << " Filename(jpeg)" << std::endl;
> >>                return EXIT_FAILURE;
> >>        }
> >>
> >>        //Parse input argument
> >>        std::string inputFilename = argv[1];
> >>
> >>        //Read the image
> >>        vtkSmartPointer jpegReader =
> >>                vtkSmartPointer::New();
> >>        if( !jpegReader->CanReadFile( inputFilename.c_str() ) )
> >>        {
> >>                std::cout << argv[0] << ": Error reading file "
> >>                        << inputFilename << endl << "Exiting..." << endl;
> >>                return EXIT_FAILURE;
> >>        }
> >>        jpegReader->SetFileName ( inputFilename.c_str() );
> >>
> >>        // Picker to pick pixels
> >>        vtkSmartPointer propPicker =
> >>                vtkSmartPointer::New();
> >>        propPicker->PickFromListOn();
> >>
> >>        // Give the picker a prop to pick
> >>        vtkSmartPointer imageViewer =
> >>                vtkSmartPointer::New();
> >>        propPicker->AddPickList( imageViewer->GetImageActor() );
> >>
> >>        // Visualize
> >>        vtkSmartPointer renderWindowInteractor
> =
> >>                vtkSmartPointer::New();
> >>        imageViewer->SetInputConnection( jpegReader->GetOutputPort() );
> >>        imageViewer->SetupInteractor( renderWindowInteractor );
> >>        imageViewer->SetSize( 600, 600 );
> >>
> >>        vtkRenderer* renderer = imageViewer->GetRenderer();
> >>        renderer->ResetCamera();
> >>        renderer->GradientBackgroundOn();
> >>        renderer->SetBackground(0,0,0);
> >>        renderer->SetBackground2(1,1,1);
> >>
> >>        // Annotate the image with window/level and mouse over pixel
> >> information
> >>        vtkSmartPointer cornerAnnotation =
> >>                vtkSmartPointer::New();
> >>        cornerAnnotation->SetLinearFontScaleFactor( 2 );
> >>        cornerAnnotation->SetNonlinearFontScaleFactor( 1 );
> >>        cornerAnnotation->SetMaximumFontSize( 20 );
> >>        cornerAnnotation->SetText( 0, "Off Image" );
> >>        cornerAnnotation->SetText( 3, "\n" );
> >>        cornerAnnotation->GetTextProperty()->SetColor( 1,0,0);
> >>
> >>        imageViewer->GetRenderer()->AddViewProp( cornerAnnotation );
> >>
> >>        // Callback listens to MouseMoveEvents invoked by the
> interactor's
> >> style
> >>        vtkSmartPointer callback =
> >>                vtkSmartPointer::New();
> >>        callback->SetViewer( imageViewer );
> >>        callback->SetAnnotation( cornerAnnotation );
> >>        callback->SetPicker( propPicker );
> >>
> >>        // InteractorStyleImage allows for the following controls:
> >>        // 1) middle mouse + move = camera pan
> >>        // 2) left mouse + move = window/level
> >>        // 3) right mouse + move = camera zoom
> >>        // 4) middle mouse wheel scroll = zoom
> >>        // 5) 'r' = reset window/level
> >>        // 6) shift + 'r' = reset camera
> >>        vtkInteractorStyleImage* imageStyle =
> >> imageViewer->GetInteractorStyle();
> >>        imageStyle->AddObserver( vtkCommand::MouseMoveEvent, callback );
> >>
> >>        vtkSmartPointer selectionChangedCallback =
> >>                vtkSmartPointer::New();
> >>        selectionChangedCallback->SetCallback (
> >> SelectionChangedCallbackFunction );
> >>
> >>        vtkSmartPointer style =
> >>                vtkSmartPointer::New();
> >>        style->AddObserver ( vtkCommand::SelectionChangedEvent,
> >> selectionChangedCallback );
> >>        renderWindowInteractor->SetInteractorStyle( style );
> >>
> >>        renderWindowInteractor->Initialize();
> >>        renderWindowInteractor->Start();
> >>
> >>        return EXIT_SUCCESS;
> >> }
> >>
> >> --
> >> View this message in context:
> >>
> http://vtk.1045678.n5.nabble.com/Rubber-band-zoom-and-pick-on-2d-image-tp3296495p3296495.html
> >> Sent from the VTK - Users mailing list archive at Nabble.com.
> >> _______________________________________________
> >> Powered by www.kitware.com
> >>
> >> Visit other Kitware open-source projects at
> >> http://www.kitware.com/opensource/opensource.html
> >>
> >> Please keep messages on-topic and check the VTK FAQ at:
> >> http://www.vtk.org/Wiki/VTK_FAQ
> >>
> >> Follow this link to subscribe/unsubscribe:
> >> http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
> >
> > --
> > | Aashish Chaudhary
> > | R&D Engineer
> > | Kitware Inc.
> > | www.kitware.com
> >
>



-- 
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From aashish.chaudhary at kitware.com  Tue Dec 14 09:24:24 2010
From: aashish.chaudhary at kitware.com (Aashish Chaudhary)
Date: Tue, 14 Dec 2010 09:24:24 -0500
Subject: [vtkusers] VTK and QT headaches
In-Reply-To: <4D0774EC.3050104@gmail.com>
References: <4D0774EC.3050104@gmail.com>
Message-ID: 

Hi Alex,

You context is not shared between threads as its indicated in the error.
This is nothing new and you can find lot more information if you google for

"OpenGL share context between threads"

It works in second case because Qt is doing the job of signalling the
function in other thread in thread safe manner.

But looking at your sample code, I am not sure what kind of interaction
issues you are having...

Do you really need two threads? If you do (as I guess you might be loading
data in one and displaying in other), there could be ways around it..

May be this link helps giving you more insight:

http://hacksoflife.blogspot.com/2009/08/creating-opengl-textures-or-vbos-on.html




On Tue, Dec 14, 2010 at 8:45 AM, Alex Southern wrote:

> Hi,
>
> Im running a QThread event loop and trying to execute a
> vtkInteractorWindow->Render() command after each iteration. I have tried two
> approaches so far but neither work well.
>
> The First approach, gives a VTK error and is based on something like this:
> At the initialization stage I pass a pointer to iren. Then in the run()
> function I execute iren->Render();
>
> class myThread : public QThread
> {
>    Q_OBJECT
>
>  public:
>     vtkRenderWindowInteractor *iren;
>     void run();
>    {
>        for (int i = 0; i < 2000; i++)
>        {
>            // process some data
>            iren->Render();
>        }
>    }
> };
>
> This compiles but gives the error in the vtkOutputWindow on each call of
> Render()....
>
> ERROR: In ..\..\Source\VTKGit\Rendering\vtkWin32OpenGLRenderWindow.cxx,
> line 247
> vtkWin32OpenGLRenderWindow (05153168): wglMakeCurrent failed in
> MakeCurrent(), error: The requested resource is in use.
>
> The second approach gives no errors, but results in a very jerky
> interaction. It is implemented by emitting a signal from the for loop after
> every iteration. The threads myRender() signal is connected to a
> updateRenderWindow() slot function i.e.
>
> class myThread : public QThread
> {
>    Q_OBJECT
>
>  public:
>     void run()
>    {
>        for (int i = 0; i < 2000; i++)
>        {
>            // process some data
>            emit myRender();
>        }
>    }
>  signals:
>     void myRender();
> };
>
> class myWindow : public QMainWindow
> {
>    Q_OBJECT
>
> public:
>    myThread Td;
>    vtkRenderWindowInteractor *iren;
>
> public slots:
>    void updateRenderWindow()
>    {
>        iren->Render();
>    }
> }
>
>
> Does anyone have any suggestions as to how I can improve either of these
> methods to give a better interaction?
>
> Thanks
> Alex
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From jeff.baumes at kitware.com  Tue Dec 14 09:26:03 2010
From: jeff.baumes at kitware.com (Jeff Baumes)
Date: Tue, 14 Dec 2010 09:26:03 -0500
Subject: [vtkusers] moving selected actor
In-Reply-To: <4D072BE8.3040307@gmx.de>
References: <4D072BE8.3040307@gmx.de>
Message-ID: 

On Tue, Dec 14, 2010 at 3:33 AM, Jazz Kartell  wrote:

> I am new to the mailing list, so first of all, "hello" to everybody...
>
> My goal is to visualize 3D Graph Mining algorithms.
> At the moment my little program can display nodes (vtkSphereSource), edges
> (vtkLineSource) and axis.
> But I want to select a node (pressing 'P' for selection works) and move it
> around to change the coordinates of a node.
> Can someone give me a hint how selected actors can be moved around?
> And is it possible to display some kind of labeling for actors? The only
> idea i have is to place separate 'textfields' near the actors.
> Perhaps a better solution is out there?
> The program is written in Java, don't know if there is a difference in the
> amount of available functionality.
>
> Thank you very much in advance
>
>
You might also be interested in the vtkGraphLayoutView and
vtkRenderedGraphRepresentation for some ideas on how to render a graph. It
does not have support for moving nodes, but it could give you some pipeline
ideas for how to render a graph with colors, labels, etc. If you call
SetInteractionModeTo3D you are able to have 3D interactions in that view.

Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From mrapsouthern at gmail.com  Tue Dec 14 09:40:46 2010
From: mrapsouthern at gmail.com (Alex Southern)
Date: Tue, 14 Dec 2010 16:40:46 +0200
Subject: [vtkusers] VTK and QT headaches
In-Reply-To: 
References: <4D0774EC.3050104@gmail.com>
	
Message-ID: <4D0781EE.8090007@gmail.com>

Aashish,

Thanks for your reply. I am visualizing wave propagation over time using 
imageData, i require to be able to rotate and zoom using the mouse while 
the image data is being constantly updated and rendered on screen. It is 
the mouse interaction that is very jerky. I am using the new GTX 480 (so 
I know that my system is not the problem here - as my test case is very 
small as well).

So yes I need two threads, the main thread and myThread, as the user 
interaction is an important aspect here. Although I take your point that 
it is easier not to use threads, but in that case I lose the ability to 
interact with the scene while the simulation is running.

With regards the link you sent me.... im really not sure how to apply 
that to my own problem, could you or anyone else elaborate?

Thanks
Alex

On 14.12.2010 16:24, Aashish Chaudhary wrote:
> Hi Alex,
>
> You context is not shared between threads as its indicated in the 
> error. This is nothing new and you can find lot more information if 
> you google for
>
> "OpenGL share context between threads"
>
> It works in second case because Qt is doing the job of signalling the 
> function in other thread in thread safe manner.
>
> But looking at your sample code, I am not sure what kind of 
> interaction issues you are having...
>
> Do you really need two threads? If you do (as I guess you might be 
> loading data in one and displaying in other), there could be ways 
> around it..
>
> May be this link helps giving you more insight:
>
> http://hacksoflife.blogspot.com/2009/08/creating-opengl-textures-or-vbos-on.html 
>
>
>
>
> On Tue, Dec 14, 2010 at 8:45 AM, Alex Southern  > wrote:
>
>     Hi,
>
>     Im running a QThread event loop and trying to execute a
>     vtkInteractorWindow->Render() command after each iteration. I have
>     tried two approaches so far but neither work well.
>
>     The First approach, gives a VTK error and is based on something
>     like this:
>     At the initialization stage I pass a pointer to iren. Then in the
>     run() function I execute iren->Render();
>
>     class myThread : public QThread
>     {
>        Q_OBJECT
>
>      public:
>         vtkRenderWindowInteractor *iren;
>         void run();
>        {
>            for (int i = 0; i < 2000; i++)
>            {
>                // process some data
>                iren->Render();
>            }
>        }
>     };
>
>     This compiles but gives the error in the vtkOutputWindow on each
>     call of Render()....
>
>     ERROR: In
>     ..\..\Source\VTKGit\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 247
>     vtkWin32OpenGLRenderWindow (05153168): wglMakeCurrent failed in
>     MakeCurrent(), error: The requested resource is in use.
>
>     The second approach gives no errors, but results in a very jerky
>     interaction. It is implemented by emitting a signal from the for
>     loop after every iteration. The threads myRender() signal is
>     connected to a updateRenderWindow() slot function i.e.
>
>     class myThread : public QThread
>     {
>        Q_OBJECT
>
>      public:
>         void run()
>        {
>            for (int i = 0; i < 2000; i++)
>            {
>                // process some data
>                emit myRender();
>            }
>        }
>      signals:
>         void myRender();
>     };
>
>     class myWindow : public QMainWindow
>     {
>        Q_OBJECT
>
>     public:
>        myThread Td;
>        vtkRenderWindowInteractor *iren;
>
>     public slots:
>        void updateRenderWindow()
>        {
>            iren->Render();
>        }
>     }
>
>
>     Does anyone have any suggestions as to how I can improve either of
>     these methods to give a better interaction?
>
>     Thanks
>     Alex
>
>
>
>     _______________________________________________
>     Powered by www.kitware.com 
>
>     Visit other Kitware open-source projects at
>     http://www.kitware.com/opensource/opensource.html
>
>     Please keep messages on-topic and check the VTK FAQ at:
>     http://www.vtk.org/Wiki/VTK_FAQ
>
>     Follow this link to subscribe/unsubscribe:
>     http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
>
> -- 
> | Aashish Chaudhary
> | R&D Engineer
> | Kitware Inc.
> | www.kitware.com 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From aashish.chaudhary at kitware.com  Tue Dec 14 09:59:57 2010
From: aashish.chaudhary at kitware.com (Aashish Chaudhary)
Date: Tue, 14 Dec 2010 09:59:57 -0500
Subject: [vtkusers] VTK and QT headaches
In-Reply-To: <4D07816B.60703@gmail.com>
References: <4D0774EC.3050104@gmail.com>
	
	<4D07816B.60703@gmail.com>
Message-ID: 

Hi Alex,

On Tue, Dec 14, 2010 at 9:38 AM, Alex Southern wrote:

>  Aashish,
>
> Thanks for your reply. I am visualizing wave propagation over time using
> imageData, i require to be able to rotate and zoom using the mouse while the
> image data is being constantly updated and rendered on screen. It is the
> mouse interaction that is very jerky. I am using the new GTX 480 (so I know
> that my system is not the problem here - as my test case is very small as
> well).
>
> So yes I need two threads, the main thread and myThread, as the user
> interaction is an important aspect here. Although I take your point that it
> is easier not to use threads, but in that case I lose the ability to
> interact with the scene while the simulation is running.
>
> With regards the link you sent me.... im really not sure how to apply that
> to my own problem, could you or anyone else elaborate?
>
> I have to look into the VTK code to really if it is possible but the idea
is that you create main context, create another context sharing the main
(OpenGL implementation specific to OS calls) or share lists,  you use this
second context in your worker thread, but you would have to make this
context current, create GL objects emit the signal, make the context current
in other thread and follow on.

Its not straightforward and I myself have to look at the exact calls as it
been a very long time.  There could be some issues depending on the OS you
are running this.


>  Thanks
> Alex
>
>
> On 14.12.2010 16:24, Aashish Chaudhary wrote:
>
> Hi Alex,
>
>  You context is not shared between threads as its indicated in the error.
> This is nothing new and you can find lot more information if you google for
>
>
>  "OpenGL share context between threads"
>
>  It works in second case because Qt is doing the job of signalling the
> function in other thread in thread safe manner.
>
>  But looking at your sample code, I am not sure what kind of interaction
> issues you are having...
>
>  Do you really need two threads? If you do (as I guess you might be
> loading data in one and displaying in other), there could be ways around
> it..
>
>  May be this link helps giving you more insight:
>
>
> http://hacksoflife.blogspot.com/2009/08/creating-opengl-textures-or-vbos-on.html
>
>
>
>
> On Tue, Dec 14, 2010 at 8:45 AM, Alex Southern wrote:
>
>> Hi,
>>
>> Im running a QThread event loop and trying to execute a
>> vtkInteractorWindow->Render() command after each iteration. I have tried two
>> approaches so far but neither work well.
>>
>> The First approach, gives a VTK error and is based on something like this:
>> At the initialization stage I pass a pointer to iren. Then in the run()
>> function I execute iren->Render();
>>
>> class myThread : public QThread
>> {
>>    Q_OBJECT
>>
>>  public:
>>     vtkRenderWindowInteractor *iren;
>>     void run();
>>    {
>>        for (int i = 0; i < 2000; i++)
>>        {
>>            // process some data
>>            iren->Render();
>>        }
>>    }
>> };
>>
>> This compiles but gives the error in the vtkOutputWindow on each call of
>> Render()....
>>
>> ERROR: In ..\..\Source\VTKGit\Rendering\vtkWin32OpenGLRenderWindow.cxx,
>> line 247
>> vtkWin32OpenGLRenderWindow (05153168): wglMakeCurrent failed in
>> MakeCurrent(), error: The requested resource is in use.
>>
>> The second approach gives no errors, but results in a very jerky
>> interaction. It is implemented by emitting a signal from the for loop after
>> every iteration. The threads myRender() signal is connected to a
>> updateRenderWindow() slot function i.e.
>>
>> class myThread : public QThread
>> {
>>    Q_OBJECT
>>
>>  public:
>>     void run()
>>    {
>>        for (int i = 0; i < 2000; i++)
>>        {
>>            // process some data
>>            emit myRender();
>>        }
>>    }
>>  signals:
>>     void myRender();
>> };
>>
>> class myWindow : public QMainWindow
>> {
>>    Q_OBJECT
>>
>> public:
>>    myThread Td;
>>    vtkRenderWindowInteractor *iren;
>>
>> public slots:
>>    void updateRenderWindow()
>>    {
>>        iren->Render();
>>    }
>> }
>>
>>
>> Does anyone have any suggestions as to how I can improve either of these
>> methods to give a better interaction?
>>
>> Thanks
>> Alex
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
>
> --
> | Aashish Chaudhary
> | R&D Engineer
> | Kitware Inc.
> | www.kitware.com
>
>
>


-- 
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From i.reicht at dkfz-heidelberg.de  Tue Dec 14 12:10:02 2010
From: i.reicht at dkfz-heidelberg.de (Reicht Ignaz)
Date: Tue, 14 Dec 2010 18:10:02 +0100
Subject: [vtkusers] OpenGL VertexArrays in VTK5.6
Message-ID: <9FD0D799-588B-4A2B-9E57-F682367335B5@Dkfz-Heidelberg.de>

Hi,

On searching for an fast approach to visualize polydata with openGL VertexArrays we found references to the vtkOpenGLVertexArrayPainter and vtkOpenGLVertexArrayPolyDataMapper.

unfortunately we are not able to find a source of them within the vtk 5.6.
therefore we want to ask how to use OpenGL VertexArrays with VTK5.6.

Or is there any preferred way to render vtkPolyData using OpenGL hardware acceleration?

thanks in advise
Iggy



From sehaliao at hotmail.com  Tue Dec 14 17:24:58 2010
From: sehaliao at hotmail.com (Lucas Grijander)
Date: Tue, 14 Dec 2010 23:24:58 +0100
Subject: [vtkusers] Job position for 3D reconstruction specialist
Message-ID: 


Hello all!we are a start-up in Switzerland that develops a 3D physical simulator for plastic surgery, with a first product in Breast augmentation simulation. We are looking for a specialist in 3D reconstruction from 2D photographies. Very good work conditions and extremely motivating project! do not hesitate to contact us here if you are interested:jaime.garcia at crisalix.combestJaime. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From yxp233 at postech.ac.kr  Tue Dec 14 18:57:14 2010
From: yxp233 at postech.ac.kr (Xiaopeng Yang)
Date: Wed, 15 Dec 2010 08:57:14 +0900
Subject: [vtkusers] DICOM image visulization
In-Reply-To: 
References: <4CFF65C4.8050401@gmail.com>		<006f01cb98d2$c28066a0$478133e0$@ac.kr>		<00b901cb9a6a$e467cd50$ad3767f0$@ac.kr>		<00c301cb9a87$3f18bf40$bd4a3dc0$@ac.kr>
	
Message-ID: <017301cb9bea$a16d0480$e4470d80$@ac.kr>

Dear All,

In my program, VTKimageViewer2 is used for DICOM image visualization. ITK reader is used for DICOM image loading. I would like to create a slider bar which is connected to the gray value of the DICOM image. Then, if I adjust the slider bar, the visualization result changes. For example, some pixels disappear as long as enlarging the gray value. 

Does anybody know how to change the visualization result based on the change of gray value?

Thank you very much.

Best regards,
Xiaopeng







From zhuyinghua01 at gmail.com  Tue Dec 14 22:28:00 2010
From: zhuyinghua01 at gmail.com (finsher)
Date: Tue, 14 Dec 2010 19:28:00 -0800 (PST)
Subject: [vtkusers] How to Covert a 8 Bit vtkImageData Ojbect to a 12Bit
 vtkImageData Object?
Message-ID: <1292383680399-3305689.post@n5.nabble.com>


I read from BMP file, and need to convert the data to 0--4095 and display
that . how to do that?
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-Covert-a-8-Bit-vtkImageData-Ojbect-to-a-12Bit-vtkImageData-Object-tp3305689p3305689.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From david.gobbi at gmail.com  Tue Dec 14 22:57:41 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Tue, 14 Dec 2010 20:57:41 -0700
Subject: [vtkusers] How to Covert a 8 Bit vtkImageData Ojbect to a 12Bit
 vtkImageData Object?
In-Reply-To: <1292383680399-3305689.post@n5.nabble.com>
References: <1292383680399-3305689.post@n5.nabble.com>
Message-ID: 

On Tue, Dec 14, 2010 at 8:28 PM, finsher  wrote:

>
> I read from BMP file, and need to convert the data to 0--4095 and display
> that . how to do that?
>

You can use vtkImageShiftScale with these settings:
SetScale(4095.0/255.0)
SetOutputScalarTypeToUnsignedShort()

 - David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From zhuyinghua01 at gmail.com  Wed Dec 15 03:52:14 2010
From: zhuyinghua01 at gmail.com (finsher)
Date: Wed, 15 Dec 2010 00:52:14 -0800 (PST)
Subject: [vtkusers] How to Covert a 8 Bit vtkImageData Ojbect to a 12Bit
 vtkImageData Object?
In-Reply-To: 
References: <1292383680399-3305689.post@n5.nabble.com>
	
Message-ID: <1292403134207-3305916.post@n5.nabble.com>



Thank you.
Just use that.


David Gobbi wrote:
> 
> On Tue, Dec 14, 2010 at 8:28 PM, finsher  wrote:
> 
>>
>> I read from BMP file, and need to convert the data to 0--4095 and display
>> that . how to do that?
>>
> 
> You can use vtkImageShiftScale with these settings:
> SetScale(4095.0/255.0)
> SetOutputScalarTypeToUnsignedShort()
> 
>  - David
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-Covert-a-8-Bit-vtkImageData-Ojbect-to-a-12Bit-vtkImageData-Object-tp3305689p3305916.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From sebastien.jourdain at kitware.com  Wed Dec 15 06:59:31 2010
From: sebastien.jourdain at kitware.com (Sebastien Jourdain)
Date: Wed, 15 Dec 2010 12:59:31 +0100
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
Message-ID: 

You should enable depth peeling on the renderer to fix most of the
artefact. But the rendering will be slower.

Seb

On Tue, Dec 14, 2010 at 10:01 AM, ???  wrote:
> Dears
>
> I visualized isosurface using vtkMarchingContourFilter from
> vtkUnstructuredGrid.
>
> When the opacity is 1.0 , created picture looks normal.
>
> But when i adjust opacity to below 1.0, the picture has speckles depends
> on the position.
>
> Do you have any solution ?
>
> I'll really appreciate it.
>
> Attached images
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


From yxp233 at postech.ac.kr  Wed Dec 15 07:04:51 2010
From: yxp233 at postech.ac.kr (Xiaopeng Yang)
Date: Wed, 15 Dec 2010 21:04:51 +0900
Subject: [vtkusers] 2D CT image visualization problem
Message-ID: <018c01cb9c50$4719a1d0$d54ce570$@ac.kr>

Hello everyone,

 

I applied VTKimageViewer2 to visualize 2D CT images. And I succeeded.
Furthermore, I would like to only show the pixels within a given gray scale
threshold interval. But I have no idea how to do it. I would appreciate any
help.

 

Thank you very much,

Xiaopeng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From basalt76 at gmail.com  Wed Dec 15 08:16:33 2010
From: basalt76 at gmail.com (=?EUC-KR?B?wMzH9sO2?=)
Date: Wed, 15 Dec 2010 22:16:33 +0900
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
	
Message-ID: 

Thank you for your answering !

I have tried depth sorting and depth peeling, but it didn't work. so I
thought it was different problem.

In VTK/FAQ, the depth sorting solves *most* of problems and the depth
peeling needs supports of graphics card.

So if the depth sorting doesn't work and my graphics card does not support
depth peeling,
can't I solve this problem ?
or do I need to doubt my implementation ?

Thank you very much

Lee.


2010/12/15 Sebastien Jourdain 

> You should enable depth peeling on the renderer to fix most of the
> artefact. But the rendering will be slower.
>
> Seb
>
> On Tue, Dec 14, 2010 at 10:01 AM, ???  wrote:
> > Dears
> >
> > I visualized isosurface using vtkMarchingContourFilter from
> > vtkUnstructuredGrid.
> >
> > When the opacity is 1.0 , created picture looks normal.
> >
> > But when i adjust opacity to below 1.0, the picture has speckles depends
> > on the position.
> >
> > Do you have any solution ?
> >
> > I'll really appreciate it.
> >
> > Attached images
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From basalt76 at gmail.com  Wed Dec 15 08:32:53 2010
From: basalt76 at gmail.com (=?EUC-KR?B?wMzH9sO2?=)
Date: Wed, 15 Dec 2010 22:32:53 +0900
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
	
Message-ID: 

Sorry to interrupt you again.

I attach two images.

Before and after adding depth sorting.
There are some differences.

My graphics card seems not to support depth peeling.

Thank you very mush.

Lee.

2010/12/15 Sebastien Jourdain 

> You should enable depth peeling on the renderer to fix most of the
> artefact. But the rendering will be slower.
>
> Seb
>
> On Tue, Dec 14, 2010 at 10:01 AM, ???  wrote:
> > Dears
> >
> > I visualized isosurface using vtkMarchingContourFilter from
> > vtkUnstructuredGrid.
> >
> > When the opacity is 1.0 , created picture looks normal.
> >
> > But when i adjust opacity to below 1.0, the picture has speckles depends
> > on the position.
> >
> > Do you have any solution ?
> >
> > I'll really appreciate it.
> >
> > Attached images
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From sebastien.jourdain at kitware.com  Wed Dec 15 09:21:02 2010
From: sebastien.jourdain at kitware.com (Sebastien Jourdain)
Date: Wed, 15 Dec 2010 15:21:02 +0100
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
	
	
Message-ID: 

How did you defined your unstructured grid ? It seems that some inner
surface are detected...
This could happen if you duplicate the points so each cell has its own points ?

Try to load your data into ParaView and see if you can reproduce the problem.

Seb

2010/12/15 ??? :
> Sorry to interrupt you again.
>
> I attach two images.
>
> Before and after adding depth sorting.
> There are some differences.
>
> My graphics card seems not to support depth peeling.
>
> Thank you very mush.
>
> Lee.
>
> 2010/12/15 Sebastien Jourdain 
>>
>> You should enable depth peeling on the renderer to fix most of the
>> artefact. But the rendering will be slower.
>>
>> Seb
>>
>> On Tue, Dec 14, 2010 at 10:01 AM, ???  wrote:
>> > Dears
>> >
>> > I visualized isosurface using vtkMarchingContourFilter from
>> > vtkUnstructuredGrid.
>> >
>> > When the opacity is 1.0 , created picture looks normal.
>> >
>> > But when i adjust opacity to below 1.0, the picture has speckles depends
>> > on the position.
>> >
>> > Do you have any solution ?
>> >
>> > I'll really appreciate it.
>> >
>> > Attached images
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >
>> >
>
>


From nsarrasin at phenix-systems.com  Wed Dec 15 12:46:03 2010
From: nsarrasin at phenix-systems.com (nsarrasin)
Date: Wed, 15 Dec 2010 09:46:03 -0800 (PST)
Subject: [vtkusers] Extracting edges by using mouse
Message-ID: <1292435163782-3306680.post@n5.nabble.com>


Hi all,

I would like to extract edges of a vtkPolyData by selecting them with my
mouse.

I felt on this example : VTK/Examples/Cxx/Graphs/SelectedVerticesAndEdges
which is exactly what I want to do but it works with the
vtkGraphLayoutView->GetRepresentation()->GetAnnotationLink()->GetCurrentSelection().

So I'm actually trying to modify this example, but I can't find any similar
methods with vtkRenderWindow in the documentation.

Can someone enlighten me please ?
Or maybe there's a completly different method for 3D ??

Thx by advance.
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Extracting-edges-by-using-mouse-tp3306680p3306680.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From aracha2010 at gmail.com  Wed Dec 15 13:36:11 2010
From: aracha2010 at gmail.com (Rachel)
Date: Wed, 15 Dec 2010 10:36:11 -0800 (PST)
Subject: [vtkusers] help !!!!! From pixel to 3D point
In-Reply-To: <1292278241870-3303804.post@n5.nabble.com>
References: <887B391A-2B68-4D6F-9EEA-1C7BF6A8716F@u.washington.edu>
	
	<1291839762279-3297909.post@n5.nabble.com>
	
	<1292278241870-3303804.post@n5.nabble.com>
Message-ID: <1292438171760-3306759.post@n5.nabble.com>


I got the  2D silhouette of 3D object. Then given a pixel i want to find it
corresponding 3D point.

Any help please 
Thanks 
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/coordinate-transformation-between-polydata-and-image-data-tp3216899p3306759.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From aracha2010 at gmail.com  Wed Dec 15 13:57:49 2010
From: aracha2010 at gmail.com (Rachel)
Date: Wed, 15 Dec 2010 10:57:49 -0800 (PST)
Subject: [vtkusers] Are there any functions which similar to
 gluUnproject() in OpenGL?
In-Reply-To: <1282224292291-2640907.post@n5.nabble.com>
References: <1282224292291-2640907.post@n5.nabble.com>
Message-ID: <1292439469878-3306776.post@n5.nabble.com>


Hi AddOil,
I have the same problem. Did you find solution ?
Thanks

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Are-there-any-functions-which-similar-to-gluUnproject-in-OpenGL-tp2640907p3306776.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From webmaster at insightsoftwareconsortium.org  Wed Dec 15 13:45:58 2010
From: webmaster at insightsoftwareconsortium.org (Insight Journal)
Date: Wed, 15 Dec 2010 13:45:58 -0500
Subject: [vtkusers] The Insight Journal-New Submission
Message-ID: <201012151845.oBFIjwDO013013@insight-journal.org>

Hello,
A new submission has been added to the Insight Journal.

Title: Distributed Anisotropic Diffusion
Author(s):Hobbs K.
Abstract: 
Distributed anisotropic diffusion provides a wrapper program around ITK's anisotropic diffusion filters that allows an input image to be spread across the memory of several computers and the processors of all of the computers to work simultaneously on the output. Distributed anisotropic diffusion allows the Visible Woman Head dataset to be smoothed with 100 iterations of the vector gradient magnitude anisotropic diffusion filter in 47 minutes on an 8 node 64 core cluster versus 53 minutes for just 10 iterations of standard vector gradient magnitude anisotropic diffusion on a single node.

Download and Review the paper at: http://www.insight-journal.org/browse/publication/782

Generated by the Insight Journal
You are receiving this email because you asked to be informed by the Insight Journal for new submissions.
                    
To change your email preference go to http://www.insight-journal.org .


From david.gobbi at gmail.com  Wed Dec 15 13:58:17 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Wed, 15 Dec 2010 11:58:17 -0700
Subject: [vtkusers] help !!!!! From pixel to 3D point
In-Reply-To: <1292438171760-3306759.post@n5.nabble.com>
References: <887B391A-2B68-4D6F-9EEA-1C7BF6A8716F@u.washington.edu>
	
	<1291839762279-3297909.post@n5.nabble.com>
	
	<1292278241870-3303804.post@n5.nabble.com>
	<1292438171760-3306759.post@n5.nabble.com>
Message-ID: 

Hi Rachel,

If your data is a polydata, then you should use vtkCellLocator's
IntersectWithLine() method.

locator->SetDataSet(data);
locator->BuildLocator();

Then, you need to create a line segment where one end is at the center of
the pixel, and the other end is some large distance away in the direction of
the silhouette plane normal:

n = silhouette plane normal
p1 = pixel location
p2 = p1 + d*n  where d is approximately twice the distance from the
silhouette to the 3D object

locator->IntersectWithLine(p1, p2, tolerance, t, x, pcoords, subId, cellId);

The IntersectWithLine method gives you "x" which is the position you want,
and it also gives you a lot of information you don't need like parametric
coordinates, the cell ID, and the sub ID.  Look at the
vtkAbstractCellLocator documentation for more info on IntersectWithLine.

   David




On Wed, Dec 15, 2010 at 11:36 AM, Rachel  wrote:

>
> I got the  2D silhouette of 3D object. Then given a pixel i want to find it
> corresponding 3D point.
>
> Any help please
> Thanks
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/coordinate-transformation-between-polydata-and-image-data-tp3216899p3306759.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From david.gobbi at gmail.com  Wed Dec 15 13:59:44 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Wed, 15 Dec 2010 11:59:44 -0700
Subject: [vtkusers] Are there any functions which similar to
 gluUnproject() in OpenGL?
In-Reply-To: <1282224292291-2640907.post@n5.nabble.com>
References: <1282224292291-2640907.post@n5.nabble.com>
Message-ID: 

Hi AddOil,

For going to window coords to 3D data coords, you can use vtkCellPicker.

   David


On Thu, Aug 19, 2010 at 7:24 AM, AddOil  wrote:

>
> Dear all,
>
> Are there any functions in VTK which similar to gluUnproject() in OpenGL?
>
> My input are 2D window coordinates and a z value. I want to know the
> point's
> coordinates in 3D space. What should I do?
>
> Thanks a lot!
>
> Regards,
> AddOil
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Are-there-any-functions-which-similar-to-gluUnproject-in-OpenGL-tp2640907p2640907.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From aracha2010 at gmail.com  Wed Dec 15 14:05:37 2010
From: aracha2010 at gmail.com (Rachel)
Date: Wed, 15 Dec 2010 11:05:37 -0800 (PST)
Subject: [vtkusers] help !!!!! From pixel to 3D point
In-Reply-To: 
References: <887B391A-2B68-4D6F-9EEA-1C7BF6A8716F@u.washington.edu>
	
	<1291839762279-3297909.post@n5.nabble.com>
	
	<1292278241870-3303804.post@n5.nabble.com>
	<1292438171760-3306759.post@n5.nabble.com>
	
Message-ID: <1292439937183-3306789.post@n5.nabble.com>


Thank you very much David, I will try your suggestion.

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/coordinate-transformation-between-polydata-and-image-data-tp3216899p3306789.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From beekmaarten at yahoo.com  Wed Dec 15 14:08:11 2010
From: beekmaarten at yahoo.com (Maarten Beek)
Date: Wed, 15 Dec 2010 11:08:11 -0800 (PST)
Subject: [vtkusers] vtkImageStencilData question
Message-ID: <372641.57894.qm@web45715.mail.sp1.yahoo.com>

Hi group,

I seem to be able to use stencils to mask images and get i.e., some     stats 
data using the vtkImageAccumulate filter.
However since the region of the image mask is very small I would     like to use 
a small stencil to get those stats (thus improving     efficiency).

Therefore I am using theSetOutputWholeExtent()       function in the 
vtkPolyDataToImageStencil to give the stencil a sub-extent (say: 250 260 150 160 
10 15) and     apply it on an image with a full extent (say: 0 511 0 511 0 50) 
in     i.e. vtkImageAccumulate. However I get an error regarding one extent     
being outside another extent.

Is it possible to apply a stencil with a sub-extent to a full image     and if 
so I would I do this? Do I have to (temporarily) set the     update extent of 
the image to the sub-extent of the stencil?

Thanks - Maarten


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From david.gobbi at gmail.com  Wed Dec 15 14:34:10 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Wed, 15 Dec 2010 12:34:10 -0700
Subject: [vtkusers] vtkImageStencilData question
In-Reply-To: <372641.57894.qm@web45715.mail.sp1.yahoo.com>
References: <372641.57894.qm@web45715.mail.sp1.yahoo.com>
Message-ID: 

Hi Maarten,

Can you send the exact text of the error that VTK gives you?

In general, the extent of the stencil must be exactly the same as the extent
of the image.  This might change in some future release of VTK, but for VTK
5.6 and the upcoming VTK 5.8 it is definitely the case.

Here is something that you can try: before you put the data into
vtkImageAccumulate, use vtkImageClip to clip it down to the size of the
stencil.  The default behaviour of vtkImageClip is to only change the
information, while passing the data itself unchanged, so it should not slow
things down at all.  Changing the UpdateExtent like you suggested
unfortunately will not work, because vtkImageAccumulate always forces its
UpdateExtent to be the WholeExtent of whatever filter precedes it.

  David


On Wed, Dec 15, 2010 at 12:08 PM, Maarten Beek wrote:

> Hi group,
>
> I seem to be able to use stencils to mask images and get i.e., some stats
> data using the vtkImageAccumulate filter.
> However since the region of the image mask is very small I would like to
> use a small stencil to get those stats (thus improving efficiency).
>
> Therefore I am using the SetOutputWholeExtent()
> function in the vtkPolyDataToImageStencilto give the stencil a sub-extent (say: 250 260 150 160 10 15) and apply it
> on an image with a full extent (say: 0 511 0 511 0 50) in i.e.
> vtkImageAccumulate. However I get an error regarding one extent being
> outside another extent.
>
> Is it possible to apply a stencil with a sub-extent to a full image and if
> so I would I do this? Do I have to (temporarily) set the update extent of
> the image to the sub-extent of the stencil?
>
> Thanks - Maarten
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From aracha2010 at gmail.com  Wed Dec 15 14:56:11 2010
From: aracha2010 at gmail.com (Rachel)
Date: Wed, 15 Dec 2010 11:56:11 -0800 (PST)
Subject: [vtkusers] help !!!!! From pixel to 3D point
In-Reply-To: 
References: <887B391A-2B68-4D6F-9EEA-1C7BF6A8716F@u.washington.edu>
	
	<1291839762279-3297909.post@n5.nabble.com>
	
	<1292278241870-3303804.post@n5.nabble.com>
	<1292438171760-3306759.post@n5.nabble.com>
	
Message-ID: <1292442971285-3306856.post@n5.nabble.com>


Hi David 
what do you mean by :center of the pixel.? is it display coordinates or
pixel coordinates?
Thanks
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/coordinate-transformation-between-polydata-and-image-data-tp3216899p3306856.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From david.gobbi at gmail.com  Wed Dec 15 15:07:51 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Wed, 15 Dec 2010 13:07:51 -0700
Subject: [vtkusers] help !!!!! From pixel to 3D point
In-Reply-To: <1292442971285-3306856.post@n5.nabble.com>
References: <887B391A-2B68-4D6F-9EEA-1C7BF6A8716F@u.washington.edu>
	
	<1291839762279-3297909.post@n5.nabble.com>
	
	<1292278241870-3303804.post@n5.nabble.com>
	<1292438171760-3306759.post@n5.nabble.com>
	
	<1292442971285-3306856.post@n5.nabble.com>
Message-ID: 

Hi Rachel,

IntersectWithLine works in 3D data coordinates, i.e the coordinate system of
your 3D data set.  Your silhouette lies on some plane in 3D space, and each
pixel in the silhouette has a specific location on that plane.  The
IntersectWithLine method can be used to project that point back towards the
3D data.

But if your silhouette is in display coordinates, then vtkCellPicker will be
a better solution than vtkCellLocator. The vtkCellPicker can convert
directly from display coordinates to 3D data coordinates.

 - David


On Wed, Dec 15, 2010 at 12:56 PM, Rachel  wrote:

>
> Hi David
> what do you mean by :center of the pixel.? is it display coordinates or
> pixel coordinates?
> Thanks
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/coordinate-transformation-between-polydata-and-image-data-tp3216899p3306856.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From aracha2010 at gmail.com  Wed Dec 15 15:16:25 2010
From: aracha2010 at gmail.com (Rachel)
Date: Wed, 15 Dec 2010 12:16:25 -0800 (PST)
Subject: [vtkusers] help !!!!! From pixel to 3D point
In-Reply-To: 
References: <887B391A-2B68-4D6F-9EEA-1C7BF6A8716F@u.washington.edu>
	
	<1291839762279-3297909.post@n5.nabble.com>
	
	<1292278241870-3303804.post@n5.nabble.com>
	<1292438171760-3306759.post@n5.nabble.com>
	
	<1292442971285-3306856.post@n5.nabble.com>
	
Message-ID: <1292444185830-3306895.post@n5.nabble.com>


No, from image. Punctually i took this image from rendered windows and save
it as image. and i should work with the image without mouse inetraction.....
I was wondering if i have to change pixel value to another system to be able
to construct the line. 
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/coordinate-transformation-between-polydata-and-image-data-tp3216899p3306895.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From aracha2010 at gmail.com  Wed Dec 15 15:18:29 2010
From: aracha2010 at gmail.com (Rachel)
Date: Wed, 15 Dec 2010 12:18:29 -0800 (PST)
Subject: [vtkusers] help !!!!! From pixel to 3D point
In-Reply-To: 
References: <887B391A-2B68-4D6F-9EEA-1C7BF6A8716F@u.washington.edu>
	
	<1291839762279-3297909.post@n5.nabble.com>
	
	<1292278241870-3303804.post@n5.nabble.com>
	<1292438171760-3306759.post@n5.nabble.com>
	
	<1292442971285-3306856.post@n5.nabble.com>
	
Message-ID: <1292444309754-3306899.post@n5.nabble.com>


It means i have to compute the corresponding of each pixel in the plane. Is
it correct?
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/coordinate-transformation-between-polydata-and-image-data-tp3216899p3306899.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From david.gobbi at gmail.com  Wed Dec 15 15:36:32 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Wed, 15 Dec 2010 13:36:32 -0700
Subject: [vtkusers] help !!!!! From pixel to 3D point
In-Reply-To: <1292444309754-3306899.post@n5.nabble.com>
References: <887B391A-2B68-4D6F-9EEA-1C7BF6A8716F@u.washington.edu>
	
	<1291839762279-3297909.post@n5.nabble.com>
	
	<1292278241870-3303804.post@n5.nabble.com>
	<1292438171760-3306759.post@n5.nabble.com>
	
	<1292442971285-3306856.post@n5.nabble.com>
	
	<1292444309754-3306899.post@n5.nabble.com>
Message-ID: 

On Wed, Dec 15, 2010 at 1:18 PM, Rachel  wrote:

>
> It means i have to compute the corresponding of each pixel in the plane. Is
> it correct?
>

Yes, you have to compute an (x,y,z) coordinate for each pixel in the plane,
and transform that coordinate into the coordinate system of your 3D data.
 If you know all the camera parameters from when the image was grabbed, then
you can figure out where the "silhouette plane" lies with respect to your 3D
data.

Normally, if you do this while you are rendering the data, the vtkCellPicker
can do all the work for you.  In your case, though, you might have to look
inside the vtkCellPicker code and do more-or-less the same thing that it
does, but with the vtkCellLocator instead.

  David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From nico.schloemer at gmail.com  Thu Dec 16 02:34:04 2010
From: nico.schloemer at gmail.com (=?ISO-8859-1?Q?Nico_Schl=F6mer?=)
Date: Thu, 16 Dec 2010 08:34:04 +0100
Subject: [vtkusers] rendering vtkUnstructuredGrid?
Message-ID: 

Hi all,

I would like to start looking into visualizing vtkUnstructuredGrids,
and particularly exporting the rendered image of a grid into PNG
files. It's the first time that I approach this area in VTK; what's a
good starting point?

Cheers,
Nico


From dorafriends at gmail.com  Thu Dec 16 03:10:52 2010
From: dorafriends at gmail.com (karenkawing)
Date: Thu, 16 Dec 2010 00:10:52 -0800 (PST)
Subject: [vtkusers] GLSliceView frozes when parallely using
 vtkFlRenderWindowInteractor
In-Reply-To: <488734E2.1040409@stud.fh-dortmund.de>
References: <488734E2.1040409@stud.fh-dortmund.de>
Message-ID: <1292487052050-3307549.post@n5.nabble.com>


Though this is a rather old thread, I am posting my solution in case anyone
is also trying hard to solve this problem just like what I did before...

I got stuck in this problem for a long time and could not find any suitable
answer.
After lots of trial, I found that if I commented out the following code in
the draw() function of glsliceview.h, I got both the glsliceciew and
vtkFlRenderWindowInteractor work! (though I do not know why yet...):

if( this->cViewClickedPoints )
    {
        glColor3f( 0.8, 0.4, 0.4 );
        glPointSize( 3.0 );
        glBegin(GL_POINTS);
        {
            for ( int ii = 0; ii < this->numClickedPointsStored(); ii++ )
            {
                ClickPoint p;
                this->getClickedPoint( ii, p );
                float pts[3] = { p.x, p.y, p.z };

                if ( static_cast( pts[this->cWinOrder[2]] ) ==
                     (int)this->sliceNum() )
                {
                    float xx;
                    if(this->cFlipX[this->cWinOrientation])
                    {
                        xx = this->cW - (pts[this->cWinOrder[0]]
                                        - this->cWinMinX) * scale0
                            - originX;
                    }
                    else
                    {
                        xx = (pts[this->cWinOrder[0]] - this->cWinMinX) *
scale0
                            + originX;
                    }

                    float yy;
                    if(this->cFlipY[this->cWinOrientation])
                    {
                        yy = this->cH - (pts[this->cWinOrder[1]]
                                        - this->cWinMinY) * scale1
                            - originY;
                    }
                    else
                    {
                        yy = (pts[this->cWinOrder[1]] - this->cWinMinY) *
scale1
                             + originY;
                    }
                    glVertex2f( xx, yy );
                }
            }
        }
        glEnd();
    }

    if( this->cViewAxisLabel )
      {
      glEnable(GL_BLEND);
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
      glColor4f(0.2, 0.2, 0.78, (float)0.75);
      gl_font(FL_TIMES_BOLD, 12);
     
      if( !this->cFlipX[this->cWinOrientation] )
        {
        const int yy = static_cast(  this->cH/2-gl_height()/2  );
        gl_draw( this->cAxisLabelX[this->cWinOrientation],
          this->cW-(gl_width(this->cAxisLabelX[this->cWinOrientation])+10),
          static_cast( yy ) );
        }
      else
        {
        const int yy = static_cast( this->cH/2-gl_height()/2  );
        gl_draw( this->cAxisLabelX[this->cWinOrientation],
          (gl_width(this->cAxisLabelX[this->cWinOrientation])+10),
          static_cast( yy ));
        }
     
      if(!this->cFlipY[this->cWinOrientation])
        {
        const int yy = static_cast( this->cH-gl_height()-10 ) ;
        gl_draw( this->cAxisLabelY[this->cWinOrientation],
          this->cW/2-(gl_width(this->cAxisLabelY[this->cWinOrientation])/2),
          static_cast(yy) );
        }
      else
        {
        const int yy = static_cast( gl_height()+10 );
        gl_draw( this->cAxisLabelY[this->cWinOrientation],
          this->cW/2-(gl_width(this->cAxisLabelY[this->cWinOrientation])/2),
          static_cast(yy));
        }
     
      glDisable(GL_BLEND);
      }
    if( this->cViewValue )
      {
      glEnable(GL_BLEND);
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
      glColor4f(0.1, 0.64, 0.2, (float)0.75);
      gl_font(FL_TIMES_BOLD, 12);
      char s[80];
      float px, py, pz, val = this->cClickSelectV;
      const char * suffix = "";
      if( this->cViewValuePhysicalUnits )
        {
        IndexType index;
        typedef typename IndexType::IndexValueType    IndexValueType;
        index[0] = static_cast< IndexValueType >( this->cClickSelect[0] );
        index[1] = static_cast< IndexValueType >( this->cClickSelect[1] );
        index[2] = static_cast< IndexValueType >( this->cClickSelect[2] );
        PointType point;
        this->cImData->TransformIndexToPhysicalPoint( index, point );
        px = point[0];
        py = point[1];
        pz = point[2];
        suffix = this->cPhysicalUnitsName;
        }
       else
        {
        px = this->cClickSelect[0];
        py = this->cClickSelect[1];
        pz = this->cClickSelect[2];
        }
      if((ImagePixelType)1.5==1.5)
        {
        sprintf(s, "(%0.1f%s,  %0.1f%s,  %0.1f%s) = %0.3f",
                px, suffix,
                py, suffix,
                pz, suffix,
                val);
        }
      else
        {
        sprintf(s, "(%0.1f%s,  %0.1f%s,  %0.1f%s) = %d",
                px, suffix,
                py, suffix,
                pz, suffix,
                (int)val);
        }
      gl_draw( s,
        (int)(this->cW-(gl_width(s)+2)), 2);
      glDisable(GL_BLEND);
     
      }
    if( this->cViewDetails )
      {
      glEnable(GL_BLEND);
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
      glColor4f(0.9, 0.4, 0.1, (float)0.75);
      gl_font(FL_TIMES_BOLD, 12);
      char s[80];
      if(this->cWinOrientation == 0)
        sprintf(s, "X - Slice: %3d", this->cWinCenter[0]);
      else if(this->cWinOrientation == 1)
        sprintf(s, "Y - Slice: %3d", this->cWinCenter[1]);
      else
        sprintf(s, "Z - Slice: %3d", this->cWinCenter[2]);
      gl_draw( s, 2, 2+5*(gl_height()+2) );
      sprintf(s, "Dims: %3d x %3d x %3d",
        (int)this->cDimSize[0], (int)this->cDimSize[1],
(int)this->cDimSize[2]);
      gl_draw( s, 2, 2+4*(gl_height()+2) );
      sprintf(s, "Voxel: %0.3f x %0.3f x %0.3f",
        this->cSpacing[0], this->cSpacing[1], this->cSpacing[2]);
      gl_draw( s, 2, 2+3*(gl_height()+2) );
      sprintf(s, "Int. Range: %0.3f - %0.3f", (float)this->cDataMin,
              (float)this->cDataMax);
      gl_draw( s, 2, 2+2*(gl_height()+2) );
      sprintf(s, "Int. Window: %0.3f(%s) - %0.3f(%s)",
        (float)this->cIWMin, IWModeTypeName[this->cIWModeMin],
        (float)this->cIWMax, IWModeTypeName[this->cIWModeMax]);
      gl_draw( s, 2, 2+1*(gl_height()+2) );
      sprintf(s, "View Mode: %s", ImageModeTypeName[this->cImageMode]);
      gl_draw( s, 2, 2+0*(gl_height()+2) );
      glDisable(GL_BLEND);
      }

If you do not want to change glsliceview.h, simply create a subclass of
glsliceview and override the draw() function. Hope this solution is helpful~
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/GLSliceView-frozes-when-parallely-using-vtkFlRenderWindowInteractor-tp1239557p3307549.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From swilfart at gmail.com  Thu Dec 16 03:56:48 2010
From: swilfart at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Wilfart?=)
Date: Thu, 16 Dec 2010 09:56:48 +0100
Subject: [vtkusers] DICOM Overlay
Message-ID: 

Is it possible to read and display DICOM Overlay Data (tag 6000|3000) using
VTK?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From zhuyinghua01 at gmail.com  Thu Dec 16 03:57:39 2010
From: zhuyinghua01 at gmail.com (finsher)
Date: Thu, 16 Dec 2010 00:57:39 -0800 (PST)
Subject: [vtkusers] How to clear vtkImageViewer2 window?
Message-ID: <1292489859808-3307592.post@n5.nabble.com>


Hi, folks,
i want to clear the window and change the images, how to do that?
i try to  GetRender()->Clear(), and set the vtkImageViewer2's Input data to
NULL,
but the window still has images.
has any suggestion?

Thanks.
Finsher.
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-clear-vtkImageViewer2-window-tp3307592p3307592.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From mathieu.malaterre at gmail.com  Thu Dec 16 04:28:15 2010
From: mathieu.malaterre at gmail.com (Mathieu Malaterre)
Date: Thu, 16 Dec 2010 10:28:15 +0100
Subject: [vtkusers] DICOM Overlay
In-Reply-To: 
References: 
Message-ID: 

Yes.

It is integrated in GDCM:

http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Gdcmviewer#Overlay_data

HTH

2010/12/16 S?bastien Wilfart :
> Is it possible to read and display DICOM Overlay Data (tag 6000|3000) using
> VTK?
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



-- 
Mathieu


From lars-friedrich at gmx.net  Thu Dec 16 04:38:17 2010
From: lars-friedrich at gmx.net (Lars Friedrich Lars)
Date: Thu, 16 Dec 2010 10:38:17 +0100
Subject: [vtkusers] How to clear vtkImageViewer2 window?
In-Reply-To: <1292489859808-3307592.post@n5.nabble.com>
References: <1292489859808-3307592.post@n5.nabble.com>
Message-ID: <20101216093817.101220@gmx.net>

Hello,

as far as I can remember this thread

http://vtk.1045678.n5.nabble.com/QVTK-issue-with-vtkImageViewer2-td1235984.html#a1235985

answers the question more or less.

HTH,
lars

-------- Original-Nachricht --------
> Datum: Thu, 16 Dec 2010 00:57:39 -0800 (PST)
> Von: finsher 
> An: vtkusers at vtk.org
> Betreff: [vtkusers] How to clear vtkImageViewer2 window?

> 
> Hi, folks,
> i want to clear the window and change the images, how to do that?
> i try to  GetRender()->Clear(), and set the vtkImageViewer2's Input data
> to
> NULL,
> but the window still has images.
> has any suggestion?
> 
> Thanks.
> Finsher.
> -- 
> View this message in context:
> http://vtk.1045678.n5.nabble.com/How-to-clear-vtkImageViewer2-window-tp3307592p3307592.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail


From lisa.avila at kitware.com  Thu Dec 16 11:48:36 2010
From: lisa.avila at kitware.com (Lisa Avila)
Date: Thu, 16 Dec 2010 11:48:36 -0500
Subject: [vtkusers] ANN: Training Course in Lyon, France
Message-ID: 

More great news for folks in the EU: Kitware will be holding a developers
training course on February 2-4, 2011 in Lyon, France. This course will
cover ITK, VTK, ParaView, and CMake, and there will be an optional ski trip
to L'Alpe d'Huez on Saturday, February 5. Please visit our web site for more
information and registration details (early registration ends January 7th!)
at either:

http://www.kitware.com/products/protraining3.html (in English)

or

http://www.kitware.fr/products/protraining.php (in French)

Note that the course will be taught in English. If you have any questions,
please contact us at formations at kitware.fr or courses at kitware.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From jcplatt at dsl.pipex.com  Thu Dec 16 12:18:01 2010
From: jcplatt at dsl.pipex.com (John Platt)
Date: Thu, 16 Dec 2010 17:18:01 -0000
Subject: [vtkusers] Problem with InterpolateScalarsBeforeMappingOn() & 1-D
	cells
Message-ID: <3825624377384ADFAE16960EA7A9E945@pafec5>

Hi all,

Colour mapping a line of 1D cells using float point scalars and InterpolateScalarsBeforeMappingOn(), shows colours which are much darker than expected. The line width is exaggerated to illustrate the effect and a scalar bar actor shows the expected colour range.



There are no problems with InterpolateScalarsBeforeMappingOff().

Interestingly, if the actor colour is set to white(it is green above), the colours are correct. If the actor colour is set to black, all the cells are black. I have not noticed any similar problems with 2D cells.  I am using VTK 5.4.2 & VS2008 build.

Any help in resolving this problem would be much appreciated.

Thanks for your time.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 4280 bytes
Desc: not available
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 2505 bytes
Desc: not available
URL: 

From aracha2010 at gmail.com  Thu Dec 16 13:23:34 2010
From: aracha2010 at gmail.com (Rachel)
Date: Thu, 16 Dec 2010 10:23:34 -0800 (PST)
Subject: [vtkusers] help !!!!! From pixel to 3D point
In-Reply-To: 
References: 
	<1291839762279-3297909.post@n5.nabble.com>
	
	<1292278241870-3303804.post@n5.nabble.com>
	<1292438171760-3306759.post@n5.nabble.com>
	
	<1292442971285-3306856.post@n5.nabble.com>
	
	<1292444309754-3306899.post@n5.nabble.com>
	
Message-ID: <1292523814362-3308339.post@n5.nabble.com>


i  computed an (x,y,z) coordinate for each pixel in the plane i have even
displayed them, but the displayed silhouette (in plane) is not on the right
position (it is shifted to the left ) and looks bigger than the object .....
so the resolution has effect on the size .... still i m working on it and
until now no results :(.

many thanks David
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/coordinate-transformation-between-polydata-and-image-data-tp3216899p3308339.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From italo.ribeiro at gmail.com  Thu Dec 16 13:53:36 2010
From: italo.ribeiro at gmail.com (Italo Ribeiro)
Date: Thu, 16 Dec 2010 15:53:36 -0300
Subject: [vtkusers] Copy matrix fast for VTK
Message-ID: 

Hi,

I have one matrix 512x512x108 and i want copy the values of all indices for
any VTK data type but i dont want do:

for(int i = 0; i<512; i++){
    for(int j=0; j<512; j++){
        for(int k=0; k<108; k++){
            imageData->SetScalarComponentFromFloat(i, j, k, 0,
matrix[i][j][k]);
        }
    }
}

VTK have one way to do copy like imageData->DeepCopy(matrix) ?

-- 
?talo Mendes
ogre.irados.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From david.gobbi at gmail.com  Thu Dec 16 14:11:02 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Thu, 16 Dec 2010 12:11:02 -0700
Subject: [vtkusers] Copy matrix fast for VTK
In-Reply-To: 
References: 
Message-ID: 

Hi Italo,

Take a look at vtkImageImport, it is a special filter that allows you to
copy an array into an image data.

  David


On Thu, Dec 16, 2010 at 11:53 AM, Italo Ribeiro  wrote:
> Hi,
> I have one matrix 512x512x108 and i want copy the values of all indices for
> any VTK data type but i dont want do:
> for(int i = 0; i<512; i++){
> ?? ?for(int j=0; j<512; j++){
> ?? ? ? ?for(int k=0; k<108; k++){
> ?? ? ? ? ? ?imageData->SetScalarComponentFromFloat(i, j, k, 0,
> matrix[i][j][k]);
> ?? ? ? ?}
> ?? ?}
> }
> VTK have one way to do copy like?imageData->DeepCopy(matrix) ?
> --
> ?talo Mendes
> ogre.irados.org


From daviddoria at gmail.com  Thu Dec 16 14:15:37 2010
From: daviddoria at gmail.com (David Doria)
Date: Thu, 16 Dec 2010 14:15:37 -0500
Subject: [vtkusers] Copy matrix fast for VTK
In-Reply-To: 
References: 
	
Message-ID: 

On Thu, Dec 16, 2010 at 2:11 PM, David Gobbi  wrote:

> Hi Italo,
>
> Take a look at vtkImageImport, it is a special filter that allows you to
> copy an array into an image data.
>
>  David
>

There is a place for an example here:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/Images/ImageImport

If you
can get it to work, please add it :)

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From david.gobbi at gmail.com  Thu Dec 16 14:19:27 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Thu, 16 Dec 2010 12:19:27 -0700
Subject: [vtkusers] Copy matrix fast for VTK
In-Reply-To: 
References: 
	
	
Message-ID: 

On Thu, Dec 16, 2010 at 12:15 PM, David Doria  wrote:
> On Thu, Dec 16, 2010 at 2:11 PM, David Gobbi  wrote:
>>
>> Hi Italo,
>>
>> Take a look at vtkImageImport, it is a special filter that allows you to
>> copy an array into an image data.
>>
>> ?David
>
> There is a place for an example here:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/Images/ImageImport
> If you can get it to work, please add it :)

There is a working example as part of the VTK regression tests:
VTK/Imaging/Testing/Cxx/ImportExport.cxx

 - David


From daviddoria at gmail.com  Thu Dec 16 14:31:12 2010
From: daviddoria at gmail.com (David Doria)
Date: Thu, 16 Dec 2010 14:31:12 -0500
Subject: [vtkusers] Copy matrix fast for VTK
In-Reply-To: 
References: 
	
	
	
Message-ID: 

>
> There is a working example as part of the VTK regression tests:
> VTK/Imaging/Testing/Cxx/ImportExport.cxx


Yes, but it has some bizarre lines
(reader->SetDataExtent(0,63,0,63,1,93);  reader->SetDataMask(0x7fff);),
exports before it imports, and is generally as unclear as a test usually is.
(Maybe Italo will argue otherwise)

I'd rather see a simpler demo which programmatically creates a (2D) image in
memory (following some standard convention) and then loads it into a
vtkImageData. It should also explain the conventions of the input (array
created in memory) and how it maps to the output indices of the
vtkImageData.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From g.bogle at auckland.ac.nz  Thu Dec 16 15:07:23 2010
From: g.bogle at auckland.ac.nz (Gib Bogle)
Date: Fri, 17 Dec 2010 09:07:23 +1300
Subject: [vtkusers] Surface from points
Message-ID: <4D0A717B.4030502@auckland.ac.nz>

I'm looking at a dataset that is a collection of (x,y,z) points that lie on a 
complex surface.  The way the points are generated ensures that they are closely 
spaced.  I want to generate and render the 3D surface in VTK.  I'm guessing that 
this is a commonly-encountered situation, and I'm hoping that someone can give 
me a quick pointer to the best way to approach it.

The points are actually in the form of 540 z-slices, and in each slice there is 
a set of polygons, i.e. a set of (x,y) sequences.  The (x,y) point spacing is 
less than the (constant) z spacing.  (The slices were extracted from microscopic 
images.)  There are about 1,000,000 points.

Thanks.


From daviddoria at gmail.com  Thu Dec 16 15:11:55 2010
From: daviddoria at gmail.com (David Doria)
Date: Thu, 16 Dec 2010 15:11:55 -0500
Subject: [vtkusers] Surface from points
In-Reply-To: <4D0A717B.4030502@auckland.ac.nz>
References: <4D0A717B.4030502@auckland.ac.nz>
Message-ID: 

On Thu, Dec 16, 2010 at 3:07 PM, Gib Bogle  wrote:

> I'm looking at a dataset that is a collection of (x,y,z) points that lie on
> a complex surface.  The way the points are generated ensures that they are
> closely spaced.  I want to generate and render the 3D surface in VTK.  I'm
> guessing that this is a commonly-encountered situation, and I'm hoping that
> someone can give me a quick pointer to the best way to approach it.
>
> The points are actually in the form of 540 z-slices, and in each slice
> there is a set of polygons, i.e. a set of (x,y) sequences.  The (x,y) point
> spacing is less than the (constant) z spacing.  (The slices were extracted
> from microscopic images.)  There are about 1,000,000 points.
>
> Thanks.


Take a look at these examples:

http://www.vtk.org/Wiki/VTK/Examples/Cxx#Surface_reconstruction

Particularly the ones that use:

vtkSurfaceReconstructionFilter

Let us know how it goes.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From foo at iastate.edu  Thu Dec 16 19:03:50 2010
From: foo at iastate.edu (Eric Foo)
Date: Thu, 16 Dec 2010 18:03:50 -0600
Subject: [vtkusers] Memory issues with vtkOpenGLGPUVolumeRayCastMapper and
	DirectX
Message-ID: 

Hi all, 

Having some trouble compiling a GPU volume render code using vtkOpenGLGPUVolumeRayCastMapper. I know the code works because it was modified from a working version using vtkFixedPointVolumeRayCastMapper. The dataset size is in unsigned short, 512 x 512 x 300 voxels and I am running on a Windows 7 with a Quadro FX 4800 with 1.5GB of video memory. Initially I was getting poor frame rates, about 1-2 fps.

I did find this post http://vtk.1045678.n5.nabble.com/dashboard-maintainers-To-make-TestGPUInfo-works-properly-td1254242.html. The post says to build VTK with DirectX, which I have done. I installed the latest DirectX SDK (June 2010), and pointed CMake to this directory before building VTK 5.6.1. 

To compile and build the code, I linked the Visual Studio project to the installed directory and including d3d9.lib, dxgi.lib, ole32.lib. The code built fine but upon loading the dataset, the app is throwing an error for vtkOpenGLGPUVolumeRayCastMapper.cxx at line 5810 "No memory left on the GPU even for a minimal block."  And in theory, the graphics card should have enough memory to cover this dataset. When loading a smaller dataset (512 x 512 x 100), the app does not throw the line 5810 error but nothing gets rendered.

Any help or ideas would be appreciated. Thanks!

eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From zhuyinghua01 at gmail.com  Thu Dec 16 20:37:28 2010
From: zhuyinghua01 at gmail.com (finsher)
Date: Thu, 16 Dec 2010 17:37:28 -0800 (PST)
Subject: [vtkusers] How to clear vtkImageViewer2 window?
In-Reply-To: <20101216093817.101220@gmx.net>
References: <1292489859808-3307592.post@n5.nabble.com>
	<20101216093817.101220@gmx.net>
Message-ID: <1292549848716-3308857.post@n5.nabble.com>


After i SetInput(NULL) with vtkImageViewer2 and reset the camera the
vtkImageViewer2 window also display the image !
any suggestion?


Lars Friedrich Lars wrote:
> 
> Hello,
> 
> as far as I can remember this thread
> 
> http://vtk.1045678.n5.nabble.com/QVTK-issue-with-vtkImageViewer2-td1235984.html#a1235985
> 
> answers the question more or less.
> 
> HTH,
> lars
> 
> -------- Original-Nachricht --------
>> Datum: Thu, 16 Dec 2010 00:57:39 -0800 (PST)
>> Von: finsher 
>> An: vtkusers at vtk.org
>> Betreff: [vtkusers] How to clear vtkImageViewer2 window?
> 
>> 
>> Hi, folks,
>> i want to clear the window and change the images, how to do that?
>> i try to  GetRender()->Clear(), and set the vtkImageViewer2's Input data
>> to
>> NULL,
>> but the window still has images.
>> has any suggestion?
>> 
>> Thanks.
>> Finsher.
>> -- 
>> View this message in context:
>> http://vtk.1045678.n5.nabble.com/How-to-clear-vtkImageViewer2-window-tp3307592p3307592.html
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> -- 
> Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
> Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-clear-vtkImageViewer2-window-tp3307592p3308857.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From zhuyinghua01 at gmail.com  Thu Dec 16 20:58:59 2010
From: zhuyinghua01 at gmail.com (finsher)
Date: Thu, 16 Dec 2010 17:58:59 -0800 (PST)
Subject: [vtkusers] How to clear vtkImageViewer2 window?
In-Reply-To: <1292549848716-3308857.post@n5.nabble.com>
References: <1292489859808-3307592.post@n5.nabble.com>
	<20101216093817.101220@gmx.net>
	<1292549848716-3308857.post@n5.nabble.com>
Message-ID: <1292551139757-3308868.post@n5.nabble.com>


Solved that problem. first i delete the vtkImageViewer2, and next i recreate
the vtkImageViewer2,
i think this method not good.
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-clear-vtkImageViewer2-window-tp3307592p3308868.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From basalt76 at gmail.com  Thu Dec 16 22:55:19 2010
From: basalt76 at gmail.com (=?EUC-KR?B?wMzH9sO2?=)
Date: Fri, 17 Dec 2010 12:55:19 +0900
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
	
	
	
Message-ID: 

Thank you for your advice

I loaded my isosurface into ParaView and set opacity under 1.0.
It looks normal ~

Is this means that the ParaView do something special to solve transparency
problem ?

I attached the result.

2010? 12? 15? ?? 11:21, Sebastien Jourdain ??
?:

> How did you defined your unstructured grid ? It seems that some inner
> surface are detected...
> This could happen if you duplicate the points so each cell has its own
> points ?
>
> Try to load your data into ParaView and see if you can reproduce the
> problem.
>
> Seb
>
> 2010/12/15 ??? :
>  > Sorry to interrupt you again.
> >
> > I attach two images.
> >
> > Before and after adding depth sorting.
> > There are some differences.
> >
> > My graphics card seems not to support depth peeling.
> >
> > Thank you very mush.
> >
> > Lee.
> >
> > 2010/12/15 Sebastien Jourdain 
> >>
> >> You should enable depth peeling on the renderer to fix most of the
> >> artefact. But the rendering will be slower.
> >>
> >> Seb
> >>
> >> On Tue, Dec 14, 2010 at 10:01 AM, ???  wrote:
> >> > Dears
> >> >
> >> > I visualized isosurface using vtkMarchingContourFilter from
> >> > vtkUnstructuredGrid.
> >> >
> >> > When the opacity is 1.0 , created picture looks normal.
> >> >
> >> > But when i adjust opacity to below 1.0, the picture has speckles
> depends
> >> > on the position.
> >> >
> >> > Do you have any solution ?
> >> >
> >> > I'll really appreciate it.
> >> >
> >> > Attached images
> >> >
> >> > _______________________________________________
> >> > Powered by www.kitware.com
> >> >
> >> > Visit other Kitware open-source projects at
> >> > http://www.kitware.com/opensource/opensource.html
> >> >
> >> > Please keep messages on-topic and check the VTK FAQ at:
> >> > http://www.vtk.org/Wiki/VTK_FAQ
> >> >
> >> > Follow this link to subscribe/unsubscribe:
> >> > http://www.vtk.org/mailman/listinfo/vtkusers
> >> >
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Paraview_normal.JPG
Type: image/jpeg
Size: 86224 bytes
Desc: not available
URL: 

From g.bogle at auckland.ac.nz  Thu Dec 16 23:14:25 2010
From: g.bogle at auckland.ac.nz (Gib Bogle)
Date: Fri, 17 Dec 2010 17:14:25 +1300
Subject: [vtkusers] Surface from points
In-Reply-To: 
References: <4D0A717B.4030502@auckland.ac.nz>
	
Message-ID: <4D0AE3A1.9050005@auckland.ac.nz>

On 17/12/2010 9:11 a.m., David Doria wrote:
> On Thu, Dec 16, 2010 at 3:07 PM, Gib Bogle  > wrote:
>
>     I'm looking at a dataset that is a collection of (x,y,z) points that lie on
>     a complex surface.  The way the points are generated ensures that they are
>     closely spaced.  I want to generate and render the 3D surface in VTK.  I'm
>     guessing that this is a commonly-encountered situation, and I'm hoping that
>     someone can give me a quick pointer to the best way to approach it.
>
>     The points are actually in the form of 540 z-slices, and in each slice there
>     is a set of polygons, i.e. a set of (x,y) sequences.  The (x,y) point
>     spacing is less than the (constant) z spacing.  (The slices were extracted
>     from microscopic images.)  There are about 1,000,000 points.
>
>     Thanks.
>
>
> Take a look at these examples:
>
> http://www.vtk.org/Wiki/VTK/Examples/Cxx#Surface_reconstruction
>
> Particularly the ones that use:
> vtkSurfaceReconstructionFilter
> 
>
> Let us know how it goes.
>
> David

Well my Corei7 machine laboured mightily, and managed to generate a surface from 
the 1034680 points - an impressive feat.  I have to say that it doesn't look as 
I expected, but it is very interesting.  :-)  Now I have to decide whether it's 
right, and if not whether I did something wrong.  All I have to go on at the 
moment is the appearance of the individual slices, with their polygon sets. 
Apart from the fact that the surface looks more complex than I anticipated, it 
also has a distinct staircase character that I wouldn't expect to see at this 
resolution.  Altogether things are quite jagged while I'd expect them to be 
smooth.  I wasn't witness to the creation of this geometry, so I can't really 
vouch for its quality.  I'll delve further ...

Gib




From vinicius.ras at gmail.com  Thu Dec 16 23:26:34 2010
From: vinicius.ras at gmail.com (=?ISO-8859-1?Q?Vinicius_Rog=E9rio_Araujo_Silva?=)
Date: Fri, 17 Dec 2010 01:26:34 -0300
Subject: [vtkusers] Distance from eye to viewplane
Message-ID: 

Hi all,

I'm new to VTK and after spending some time searching, I've decided to join
the mailing list to see if you guys can help solving my questions.
It seems pretty simple, yet I just couldn't find a way to solve it.

Question is:
Is there any way to retrieve the distance between the eye of projection
("camera") and the view plane?
Or is there any way I can retrieve the plane equation for the view plane?

Any help is really apreciated. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From david.gobbi at gmail.com  Fri Dec 17 00:02:08 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Thu, 16 Dec 2010 22:02:08 -0700
Subject: [vtkusers] Distance from eye to viewplane
In-Reply-To: 
References: 
Message-ID: 

2010/12/16 Vinicius Rog?rio Araujo Silva :
> Hi all,
> I'm new to VTK and after spending some time searching, I've decided to join
> the mailing list to see if you guys can help solving my questions.
> It seems pretty simple, yet I just couldn't find a way to solve it.
> Question is:
> Is there any way to retrieve the distance between the eye of projection
> ("camera") and the view plane?
> Or is there any way I can retrieve the plane equation for the view plane?
> Any help is really apreciated. Thank you.

Camera->GetClippingRange() is probably what you want, it will return the
distance from the camera to the near and the far clipping planes.  You can
use Camera->GetViewPlaneNormal() to get the normal.

The renderer also has methods for doing coordinate conversion between
display coordinates (i.e. pixels at the view plane) and world coordinates
(i.e. 3D coordinates in the scene):

Renderer->SetDisplayPoint(x, y, z);  // use z = 0 for view plane
Renderer->DisplayToWorld();
double p[3];
Renderer->GetWorldPoint(p);

So you can, for instance, give the display coords for the four corners of
your window, and this will provide the 3D coords corresponding to the
corners of the view plane.  Display coords start from (0,0) in the lower
left corner of the window.

   David


From basalt76 at gmail.com  Fri Dec 17 00:27:41 2010
From: basalt76 at gmail.com (=?EUC-KR?B?wMzH9sO2?=)
Date: Fri, 17 Dec 2010 14:27:41 +0900
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
	
	
	
	
	
Message-ID: 

Send it again because of too big files.

2010? 12? 17? ?? 1:32, ??? ?? ?:

> I'm very sorry for bothering you.
>
> I got something interesting.
>
> In the ParaView, when I set Representation with "Surface with edges".
>
> The isosurface image went through vtkMarchingContourFilter has the
> triangles.
> But the original image looks normal.
>
> I have used vtkCleanPolyData and vtkPolyDataNormals.
>
> I attached two iamges.
>
> Thank you ver much.
>
> Lee.
>
> 2010? 12? 17? ?? 12:55, ??? ?? ?:
>
>  Thank you for your advice
>>
>> I loaded my isosurface into ParaView and set opacity under 1.0.
>> It looks normal ~
>>
>> Is this means that the ParaView do something special to solve transparency
>> problem ?
>>
>> I attached the result.
>>
>> 2010? 12? 15? ?? 11:21, Sebastien Jourdain <
>> sebastien.jourdain at kitware.com>?? ?:
>>
>> How did you defined your unstructured grid ? It seems that some inner
>>> surface are detected...
>>> This could happen if you duplicate the points so each cell has its own
>>> points ?
>>>
>>> Try to load your data into ParaView and see if you can reproduce the
>>> problem.
>>>
>>> Seb
>>>
>>> 2010/12/15 ??? :
>>>  > Sorry to interrupt you again.
>>> >
>>> > I attach two images.
>>> >
>>> > Before and after adding depth sorting.
>>> > There are some differences.
>>> >
>>> > My graphics card seems not to support depth peeling.
>>> >
>>> > Thank you very mush.
>>> >
>>> > Lee.
>>> >
>>> > 2010/12/15 Sebastien Jourdain 
>>> >>
>>> >> You should enable depth peeling on the renderer to fix most of the
>>> >> artefact. But the rendering will be slower.
>>> >>
>>> >> Seb
>>> >>
>>> >> On Tue, Dec 14, 2010 at 10:01 AM, ???  wrote:
>>> >> > Dears
>>> >> >
>>> >> > I visualized isosurface using vtkMarchingContourFilter from
>>> >> > vtkUnstructuredGrid.
>>> >> >
>>> >> > When the opacity is 1.0 , created picture looks normal.
>>> >> >
>>> >> > But when i adjust opacity to below 1.0, the picture has speckles
>>> depends
>>> >> > on the position.
>>> >> >
>>> >> > Do you have any solution ?
>>> >> >
>>> >> > I'll really appreciate it.
>>> >> >
>>> >> > Attached images
>>> >> >
>>> >> > _______________________________________________
>>> >> > Powered by www.kitware.com
>>> >> >
>>> >> > Visit other Kitware open-source projects at
>>> >> > http://www.kitware.com/opensource/opensource.html
>>> >> >
>>> >> > Please keep messages on-topic and check the VTK FAQ at:
>>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>>> >> >
>>> >> > Follow this link to subscribe/unsubscribe:
>>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>>> >> >
>>> >> >
>>> >
>>> >
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: originalImage.JPG
Type: image/jpeg
Size: 61630 bytes
Desc: not available
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filteredImage.JPG
Type: image/jpeg
Size: 83775 bytes
Desc: not available
URL: 

From yxp233 at postech.ac.kr  Fri Dec 17 01:12:49 2010
From: yxp233 at postech.ac.kr (Xiaopeng Yang)
Date: Fri, 17 Dec 2010 15:12:49 +0900
Subject: [vtkusers] Volume Calculation for Binary Images
Message-ID: <001201cb9db1$6e2fcdf0$4a8f69d0$@ac.kr>

Dear Users,

 

After segmenting some organ from CT images, I get a volume binary image for
that organ. Could you please tell me how to calculate the volume of that
organ?

 

Thanks,

Xiaopeng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From cartik_sharma at yahoo.com  Fri Dec 17 01:09:06 2010
From: cartik_sharma at yahoo.com (Cartik Sharma)
Date: Thu, 16 Dec 2010 22:09:06 -0800 (PST)
Subject: [vtkusers] [vtk-developers] ANN: Training Course in Lyon, France
In-Reply-To: 
Message-ID: <733902.59139.qm@web111416.mail.gq1.yahoo.com>

Hi:
Great location for a VTK course..is this also going to include the GPU support part of version 5.6?
Wish I didnt know as much vtk as I already do :)
cheers,

Cartik

--- On Thu, 12/16/10, Lisa Avila  wrote:

From: Lisa Avila 
Subject: [vtk-developers] ANN: Training Course in Lyon, France
To: "VTK Developers" , "vtk vtk" , insight-users at itk.org, paraview at paraview.org, cmake at cmake.org
Date: Thursday, December 16, 2010, 11:48 AM


More great news for folks in the EU: Kitware will be holding a developers training course on February 2-4, 2011 in Lyon, France. This course will cover ITK, VTK, ParaView, and CMake, and there will be an optional ski trip to L'Alpe d'Huez on Saturday, February 5. Please visit our web site for more information and registration details (early registration ends January 7th!) at either:


http://www.kitware.com/products/protraining3.html (in English)

or 

http://www.kitware.fr/products/protraining.php (in French)


Note that the course will be taught in English. If you have any questions, please contact us at 
                formations at kitware.fr or courses at kitware.com.


-----Inline Attachment Follows-----

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtk-developers




      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From darshanpai at gmail.com  Fri Dec 17 01:58:44 2010
From: darshanpai at gmail.com (Darshan Pai)
Date: Fri, 17 Dec 2010 01:58:44 -0500
Subject: [vtkusers] Volume Calculation for Binary Images
In-Reply-To: <001201cb9db1$6e2fcdf0$4a8f69d0$@ac.kr>
References: <001201cb9db1$6e2fcdf0$4a8f69d0$@ac.kr>
Message-ID: 

I usually just count the voxels and consider that as volume

On Fri, Dec 17, 2010 at 1:12 AM, Xiaopeng Yang  wrote:

> Dear Users,
>
>
>
> After segmenting some organ from CT images, I get a volume binary image for
> that organ. Could you please tell me how to calculate the volume of that
> organ?
>
>
>
> Thanks,
>
> Xiaopeng
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From yxp233 at postech.ac.kr  Fri Dec 17 02:39:34 2010
From: yxp233 at postech.ac.kr (Xiaopeng Yang)
Date: Fri, 17 Dec 2010 16:39:34 +0900
Subject: [vtkusers] Volume Calculation for Binary Images
In-Reply-To: 
References: <001201cb9db1$6e2fcdf0$4a8f69d0$@ac.kr>
	
Message-ID: <003c01cb9dbd$8cb60530$a6220f90$@ac.kr>

Hi  Pai,

 

Thank you. But do you know how to count the voxels? I know that ITKStatisticsImageFilter can do this but I don?t know how.

 

Thanks,

Xiaopeng

 

???: Darshan Pai [mailto:darshanpai at gmail.com] 
????: 2010? 12? 17? ??? ?? 3:59
???: Xiaopeng Yang
??: vtkusers at vtk.org; insight-users at itk.org
??: Re: [vtkusers] Volume Calculation for Binary Images

 

I usually just count the voxels and consider that as volume

On Fri, Dec 17, 2010 at 1:12 AM, Xiaopeng Yang  wrote:

Dear Users,

 

After segmenting some organ from CT images, I get a volume binary image for that organ. Could you please tell me how to calculate the volume of that organ?

 

Thanks,

Xiaopeng


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From sebastien.jourdain at kitware.com  Fri Dec 17 03:35:17 2010
From: sebastien.jourdain at kitware.com (Sebastien Jourdain)
Date: Fri, 17 Dec 2010 09:35:17 +0100
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
	
	
	
	
	
Message-ID: 

The reason is because you ask to look at the input file and not the
iso-contour. The little eye on the left is disable in front of the
contour.

Seb

PS: Once you change something on a filter, don't forget to click on Apply

2010/12/17 ??? :
> I'm very sorry for bothering you.
>
> I got something interesting.
>
> In the ParaView, when I set Representation with "Surface with edges".
>
> The isosurface image went through vtkMarchingContourFilter has the
> triangles.
> But the original image looks normal.
>
> I have used vtkCleanPolyData and vtkPolyDataNormals.
>
> I attached two iamges.
>
> Thank you ver much.
>
> Lee.
>
> 2010? 12? 17? ?? 12:55, ??? ?? ?:
>>
>> Thank you for your advice
>>
>> I loaded my isosurface into ParaView and set opacity under 1.0.
>> It looks normal ~
>>
>> Is this means that the ParaView do something special to solve transparency
>> problem ?
>>
>> I attached the result.
>>
>> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
>> ?? ?:
>>>
>>> How did you defined your unstructured grid ? It seems that some inner
>>> surface are detected...
>>> This could happen if you duplicate the points so each cell has its own
>>> points ?
>>>
>>> Try to load your data into ParaView and see if you can reproduce the
>>> problem.
>>>
>>> Seb
>>>
>>> 2010/12/15 ??? :
>>> > Sorry to interrupt you again.
>>> >
>>> > I attach two images.
>>> >
>>> > Before and after adding depth sorting.
>>> > There are some differences.
>>> >
>>> > My graphics card seems not to support depth peeling.
>>> >
>>> > Thank you very mush.
>>> >
>>> > Lee.
>>> >
>>> > 2010/12/15 Sebastien Jourdain 
>>> >>
>>> >> You should enable depth peeling on the renderer to fix most of the
>>> >> artefact. But the rendering will be slower.
>>> >>
>>> >> Seb
>>> >>
>>> >> On Tue, Dec 14, 2010 at 10:01 AM, ???  wrote:
>>> >> > Dears
>>> >> >
>>> >> > I visualized isosurface using vtkMarchingContourFilter from
>>> >> > vtkUnstructuredGrid.
>>> >> >
>>> >> > When the opacity is 1.0 , created picture looks normal.
>>> >> >
>>> >> > But when i adjust opacity to below 1.0, the picture has speckles
>>> >> > depends
>>> >> > on the position.
>>> >> >
>>> >> > Do you have any solution ?
>>> >> >
>>> >> > I'll really appreciate it.
>>> >> >
>>> >> > Attached images
>>> >> >
>>> >> > _______________________________________________
>>> >> > Powered by www.kitware.com
>>> >> >
>>> >> > Visit other Kitware open-source projects at
>>> >> > http://www.kitware.com/opensource/opensource.html
>>> >> >
>>> >> > Please keep messages on-topic and check the VTK FAQ at:
>>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>>> >> >
>>> >> > Follow this link to subscribe/unsubscribe:
>>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>>> >> >
>>> >> >
>>> >
>>> >
>>
>
>


From raul at torresyvalero.com  Fri Dec 17 05:12:12 2010
From: raul at torresyvalero.com (=?ISO-8859-15?Q?Ra=FAl_Ferriz?=)
Date: Fri, 17 Dec 2010 11:12:12 +0100
Subject: [vtkusers] Non-visible point handlers
Message-ID: <4D0B377C.8010907@torresyvalero.com>

Hello!

I'm using a vtkDistanceWidget, with vtkDistanceWidgetRepresentation 
attached to it. I want that point handler that is sawn on line edges (a 
cross by default) will be not visible.

I have searched for an example on wiki and web, but nothing found, any 
help ?


From raul at torresyvalero.com  Fri Dec 17 06:04:14 2010
From: raul at torresyvalero.com (=?ISO-8859-15?Q?Ra=FAl_Ferriz?=)
Date: Fri, 17 Dec 2010 12:04:14 +0100
Subject: [vtkusers] Non-visible point handlers
In-Reply-To: <4D0B377C.8010907@torresyvalero.com>
References: <4D0B377C.8010907@torresyvalero.com>
Message-ID: <4D0B43AE.3060108@torresyvalero.com>

El 17/12/2010 11:12, Ra?l Ferriz escribi?:
> Hello!
>
> I'm using a vtkDistanceWidget, with vtkDistanceWidgetRepresentation 
> attached to it. I want that point handler that is sawn on line edges 
> (a cross by default) will be not visible.
>
> I have searched for an example on wiki and web, but nothing found, any 
> help ?
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: 
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
It doesn't matter, already found a pointer handler smaller and beautifull.


From yxp233 at postech.ac.kr  Fri Dec 17 07:13:04 2010
From: yxp233 at postech.ac.kr (Xiaopeng Yang)
Date: Fri, 17 Dec 2010 21:13:04 +0900
Subject: [vtkusers] Programming challenges with QT, VTK, and ITK
In-Reply-To: <005b01cb75dc$974fb7b0$c5ef2710$@park@case.edu>
References: <008401cb7573$2c99b1f0$85cd15d0$@ac.kr>
	<005b01cb75dc$974fb7b0$c5ef2710$@park@case.edu>
Message-ID: <006e01cb9de3$c1f902d0$45eb0870$@ac.kr>

Hello Park,

 

It has been a very long time since I received your help. These days I am still working on this problem. Now I can get the VTK coordinate (i.e., world coordinate). You mentioned that if I use itk ImageToVTKImageFilter, I can directly use the VTK coordinate as ITK coordinate. However, I could not understand clearly. In my program, I need ITK coordinate for applying ITK region growing algorithm. I do not know how to translate VTK coordinate to ITK coordinate. Could you please explain more in detail?

 

Thanks very much!

 

Xiaopeng

 

???: (Samuel) Byeongjun Park [mailto:byeongjun.park at case.edu] 
????: 2010? 10? 27? ??? ?? 10:41
???: 'Xiaopeng Yang'
??: 'vtk'
??: RE: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Hi,

 

My name is Sam Park. Since you told you are using QT, I think you are using QVTKWidget.

You can make your own QVTK widget class inheriting QVTKWidget.

In there, override 

   Virtual void mousePressEvent(QMouseEvent *pevent);

You can read the mouse position in QVTKWidget window.

Then,

1.       Get the QT coordinate point (x,y)

2.       Flip y value by  y=height-y;

3.       Get the pointer of the Render in your QVTKWidget object.

4.       double wpoint[4];

5.       Render->SetDisplayPoint(x,y,0);

6.       Render->DisplayToWorld(); 

7.       Render->GetWorldPoint(wpoint);

 

Now You have the VTK coordinate of the point you clicked.

If you imported CT image in ITK and utilized itk::ImageToVTKImageFilter, 

you can directly use the VTK coordinate as ITK coordinate.

 

Good luck.

 

Sam.

-------------- Innovation for the Future Radiation Oncology 

(Samuel) Byeongjun Park, Ph.D.  -- Research associate of Sohn Lab.

Case Western Reserve Univerisity, School of Medicine

Visiting: Wood building W517,  Phone: 1-216-368-6583

 

 

 

From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Xiaopeng Yang
Sent: Tuesday, October 26, 2010 9:06 PM
To: 'Luis Ibanez'
Cc: 'itk'; 'vtk'
Subject: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Dear Luis,

 

How are you doing? Thank you very much for your help so far. Sorry to ask you a question again.

 

I am now developing a liver segmentation program using QT, VTK, and ITK based on CT images. In my program, fast marching algorithm is used to extract the liver by multiple seed points. To pick the positions of the seed points, vtkImagePlaneWidget is applied. The problem is how to save the multiple seed points I selected by left-clicking of the mouse so that I do not need to type those positions into the code, which is time consuming.

 

Please provide me with your suggestions. I working on this for almost one week still I cannot figure it out.

 

Thanks,

Xiaopeng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From basalt76 at gmail.com  Fri Dec 17 07:47:10 2010
From: basalt76 at gmail.com (=?EUC-KR?B?wMzH9sO2?=)
Date: Fri, 17 Dec 2010 21:47:10 +0900
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
	
	
	
	
	
	
Message-ID: 

I sent you two images, input file and iso-contour image.
I had no problem to look at input file and iso-contour.

Problem is
when I set Representation option with "Surface with edges".

Input file image looks normal but iso-contour image gone through
vtkMarchingContourFilter  has triangles.
Thank you very much.

2010? 12? 17? ?? 5:35, Sebastien Jourdain ??
?:

> The reason is because you ask to look at the input file and not the
> iso-contour. The little eye on the left is disable in front of the
> contour.
>
> Seb
>
> PS: Once you change something on a filter, don't forget to click on Apply
>
> 2010/12/17 ??? :
>  > I'm very sorry for bothering you.
> >
> > I got something interesting.
> >
> > In the ParaView, when I set Representation with "Surface with edges".
> >
> > The isosurface image went through vtkMarchingContourFilter has the
> > triangles.
> > But the original image looks normal.
> >
> > I have used vtkCleanPolyData and vtkPolyDataNormals.
> >
> > I attached two iamges.
> >
> > Thank you ver much.
> >
> > Lee.
> >
> > 2010? 12? 17? ?? 12:55, ??? ?? ?:
> >>
> >> Thank you for your advice
> >>
> >> I loaded my isosurface into ParaView and set opacity under 1.0.
> >> It looks normal ~
> >>
> >> Is this means that the ParaView do something special to solve
> transparency
> >> problem ?
> >>
> >> I attached the result.
> >>
> >> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
> >> ?? ?:
> >>>
> >>> How did you defined your unstructured grid ? It seems that some inner
> >>> surface are detected...
> >>> This could happen if you duplicate the points so each cell has its own
> >>> points ?
> >>>
> >>> Try to load your data into ParaView and see if you can reproduce the
> >>> problem.
> >>>
> >>> Seb
> >>>
> >>> 2010/12/15 ??? :
> >>> > Sorry to interrupt you again.
> >>> >
> >>> > I attach two images.
> >>> >
> >>> > Before and after adding depth sorting.
> >>> > There are some differences.
> >>> >
> >>> > My graphics card seems not to support depth peeling.
> >>> >
> >>> > Thank you very mush.
> >>> >
> >>> > Lee.
> >>> >
> >>> > 2010/12/15 Sebastien Jourdain 
> >>> >>
> >>> >> You should enable depth peeling on the renderer to fix most of the
> >>> >> artefact. But the rendering will be slower.
> >>> >>
> >>> >> Seb
> >>> >>
> >>> >> On Tue, Dec 14, 2010 at 10:01 AM, ???  wrote:
> >>> >> > Dears
> >>> >> >
> >>> >> > I visualized isosurface using vtkMarchingContourFilter from
> >>> >> > vtkUnstructuredGrid.
> >>> >> >
> >>> >> > When the opacity is 1.0 , created picture looks normal.
> >>> >> >
> >>> >> > But when i adjust opacity to below 1.0, the picture has speckles
> >>> >> > depends
> >>> >> > on the position.
> >>> >> >
> >>> >> > Do you have any solution ?
> >>> >> >
> >>> >> > I'll really appreciate it.
> >>> >> >
> >>> >> > Attached images
> >>> >> >
> >>> >> > _______________________________________________
> >>> >> > Powered by www.kitware.com
> >>> >> >
> >>> >> > Visit other Kitware open-source projects at
> >>> >> > http://www.kitware.com/opensource/opensource.html
> >>> >> >
> >>> >> > Please keep messages on-topic and check the VTK FAQ at:
> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
> >>> >> >
> >>> >> > Follow this link to subscribe/unsubscribe:
> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
> >>> >> >
> >>> >> >
> >>> >
> >>> >
> >>
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From sebastien.jourdain at kitware.com  Fri Dec 17 07:59:13 2010
From: sebastien.jourdain at kitware.com (Sebastien Jourdain)
Date: Fri, 17 Dec 2010 13:59:13 +0100
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
	
	
	
	
	
	
	
Message-ID: 

Ok,

but this is normal because the ContourFilter will generate a triangulated mesh.

Seb

2010/12/17 ??? :
> I sent you two images, input file and iso-contour image.
> I had no problem to look at input file and iso-contour.
>
> Problem is
> when I set Representation option with "Surface with edges".
>
> Input file image looks normal but iso-contour image gone through
> vtkMarchingContourFilter  has triangles.
> Thank you very much.
>
> 2010? 12? 17? ?? 5:35, Sebastien Jourdain ??
> ?:
>>
>> The reason is because you ask to look at the input file and not the
>> iso-contour. The little eye on the left is disable in front of the
>> contour.
>>
>> Seb
>>
>> PS: Once you change something on a filter, don't forget to click on Apply
>>
>> 2010/12/17 ??? :
>> > I'm very sorry for bothering you.
>> >
>> > I got something interesting.
>> >
>> > In the ParaView, when I set Representation with "Surface with edges".
>> >
>> > The isosurface image went through vtkMarchingContourFilter has the
>> > triangles.
>> > But the original image looks normal.
>> >
>> > I have used vtkCleanPolyData and vtkPolyDataNormals.
>> >
>> > I attached two iamges.
>> >
>> > Thank you ver much.
>> >
>> > Lee.
>> >
>> > 2010? 12? 17? ?? 12:55, ??? ?? ?:
>> >>
>> >> Thank you for your advice
>> >>
>> >> I loaded my isosurface into ParaView and set opacity under 1.0.
>> >> It looks normal ~
>> >>
>> >> Is this means that the ParaView do something special to solve
>> >> transparency
>> >> problem ?
>> >>
>> >> I attached the result.
>> >>
>> >> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
>> >> ?? ?:
>> >>>
>> >>> How did you defined your unstructured grid ? It seems that some inner
>> >>> surface are detected...
>> >>> This could happen if you duplicate the points so each cell has its own
>> >>> points ?
>> >>>
>> >>> Try to load your data into ParaView and see if you can reproduce the
>> >>> problem.
>> >>>
>> >>> Seb
>> >>>
>> >>> 2010/12/15 ??? :
>> >>> > Sorry to interrupt you again.
>> >>> >
>> >>> > I attach two images.
>> >>> >
>> >>> > Before and after adding depth sorting.
>> >>> > There are some differences.
>> >>> >
>> >>> > My graphics card seems not to support depth peeling.
>> >>> >
>> >>> > Thank you very mush.
>> >>> >
>> >>> > Lee.
>> >>> >
>> >>> > 2010/12/15 Sebastien Jourdain 
>> >>> >>
>> >>> >> You should enable depth peeling on the renderer to fix most of the
>> >>> >> artefact. But the rendering will be slower.
>> >>> >>
>> >>> >> Seb
>> >>> >>
>> >>> >> On Tue, Dec 14, 2010 at 10:01 AM, ???  wrote:
>> >>> >> > Dears
>> >>> >> >
>> >>> >> > I visualized isosurface using vtkMarchingContourFilter from
>> >>> >> > vtkUnstructuredGrid.
>> >>> >> >
>> >>> >> > When the opacity is 1.0 , created picture looks normal.
>> >>> >> >
>> >>> >> > But when i adjust opacity to below 1.0, the picture has speckles
>> >>> >> > depends
>> >>> >> > on the position.
>> >>> >> >
>> >>> >> > Do you have any solution ?
>> >>> >> >
>> >>> >> > I'll really appreciate it.
>> >>> >> >
>> >>> >> > Attached images
>> >>> >> >
>> >>> >> > _______________________________________________
>> >>> >> > Powered by www.kitware.com
>> >>> >> >
>> >>> >> > Visit other Kitware open-source projects at
>> >>> >> > http://www.kitware.com/opensource/opensource.html
>> >>> >> >
>> >>> >> > Please keep messages on-topic and check the VTK FAQ at:
>> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>> >>> >> >
>> >>> >> > Follow this link to subscribe/unsubscribe:
>> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >>> >> >
>> >>> >> >
>> >>> >
>> >>> >
>> >>
>> >
>> >
>
>


From aracha2010 at gmail.com  Fri Dec 17 08:02:03 2010
From: aracha2010 at gmail.com (Rachel)
Date: Fri, 17 Dec 2010 05:02:03 -0800 (PST)
Subject: [vtkusers] Line/triangle intersection
In-Reply-To: 
References: 
	
	
Message-ID: <1292590923541-3309374.post@n5.nabble.com>


Hi David, if there is no intersection between the ray and the 3D object, what
would the function return?

Thanks
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Line-triangle-intersection-tp1246634p3309374.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From daviddoria at gmail.com  Fri Dec 17 08:09:20 2010
From: daviddoria at gmail.com (David Doria)
Date: Fri, 17 Dec 2010 08:09:20 -0500
Subject: [vtkusers] Line/triangle intersection
In-Reply-To: <1292590923541-3309374.post@n5.nabble.com>
References: 
	
	
	<1292590923541-3309374.post@n5.nabble.com>
Message-ID: 

On Fri, Dec 17, 2010 at 8:02 AM, Rachel  wrote:

>
> Hi David, if there is no intersection between the ray and the 3D object,
> what
> would the function return?
>
> Thanks
>
>
Are you talking about the IntersectWithLine function?

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From basalt76 at gmail.com  Fri Dec 17 08:19:29 2010
From: basalt76 at gmail.com (=?EUC-KR?B?wMzH9sO2?=)
Date: Fri, 17 Dec 2010 22:19:29 +0900
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
	
	
	
	
	
	
	
	
Message-ID: 

Yes it looks normal in ParaView.

But In my application, after applying depth sorting,
the iso-surface looks like attached file.

Is it vtk version problem ? My vtk is 5.2.1

2010? 12? 17? ?? 9:59, Sebastien Jourdain ??
?:

> Ok,
>
> but this is normal because the ContourFilter will generate a triangulated
> mesh.
>
> Seb
>
> 2010/12/17 ??? :
> > I sent you two images, input file and iso-contour image.
> > I had no problem to look at input file and iso-contour.
> >
> > Problem is
> > when I set Representation option with "Surface with edges".
> >
> > Input file image looks normal but iso-contour image gone through
> > vtkMarchingContourFilter  has triangles.
> > Thank you very much.
> >
> > 2010? 12? 17? ?? 5:35, Sebastien Jourdain <
> sebastien.jourdain at kitware.com>??
> > ?:
> >>
> >> The reason is because you ask to look at the input file and not the
> >> iso-contour. The little eye on the left is disable in front of the
> >> contour.
> >>
> >> Seb
> >>
> >> PS: Once you change something on a filter, don't forget to click on
> Apply
> >>
> >> 2010/12/17 ??? :
> >> > I'm very sorry for bothering you.
> >> >
> >> > I got something interesting.
> >> >
> >> > In the ParaView, when I set Representation with "Surface with edges".
> >> >
> >> > The isosurface image went through vtkMarchingContourFilter has the
> >> > triangles.
> >> > But the original image looks normal.
> >> >
> >> > I have used vtkCleanPolyData and vtkPolyDataNormals.
> >> >
> >> > I attached two iamges.
> >> >
> >> > Thank you ver much.
> >> >
> >> > Lee.
> >> >
> >> > 2010? 12? 17? ?? 12:55, ??? ?? ?:
> >> >>
> >> >> Thank you for your advice
> >> >>
> >> >> I loaded my isosurface into ParaView and set opacity under 1.0.
> >> >> It looks normal ~
> >> >>
> >> >> Is this means that the ParaView do something special to solve
> >> >> transparency
> >> >> problem ?
> >> >>
> >> >> I attached the result.
> >> >>
> >> >> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
> >> >> ?? ?:
> >> >>>
> >> >>> How did you defined your unstructured grid ? It seems that some
> inner
> >> >>> surface are detected...
> >> >>> This could happen if you duplicate the points so each cell has its
> own
> >> >>> points ?
> >> >>>
> >> >>> Try to load your data into ParaView and see if you can reproduce the
> >> >>> problem.
> >> >>>
> >> >>> Seb
> >> >>>
> >> >>> 2010/12/15 ??? :
> >> >>> > Sorry to interrupt you again.
> >> >>> >
> >> >>> > I attach two images.
> >> >>> >
> >> >>> > Before and after adding depth sorting.
> >> >>> > There are some differences.
> >> >>> >
> >> >>> > My graphics card seems not to support depth peeling.
> >> >>> >
> >> >>> > Thank you very mush.
> >> >>> >
> >> >>> > Lee.
> >> >>> >
> >> >>> > 2010/12/15 Sebastien Jourdain 
> >> >>> >>
> >> >>> >> You should enable depth peeling on the renderer to fix most of
> the
> >> >>> >> artefact. But the rendering will be slower.
> >> >>> >>
> >> >>> >> Seb
> >> >>> >>
> >> >>> >> On Tue, Dec 14, 2010 at 10:01 AM, ??? 
> wrote:
> >> >>> >> > Dears
> >> >>> >> >
> >> >>> >> > I visualized isosurface using vtkMarchingContourFilter from
> >> >>> >> > vtkUnstructuredGrid.
> >> >>> >> >
> >> >>> >> > When the opacity is 1.0 , created picture looks normal.
> >> >>> >> >
> >> >>> >> > But when i adjust opacity to below 1.0, the picture has
> speckles
> >> >>> >> > depends
> >> >>> >> > on the position.
> >> >>> >> >
> >> >>> >> > Do you have any solution ?
> >> >>> >> >
> >> >>> >> > I'll really appreciate it.
> >> >>> >> >
> >> >>> >> > Attached images
> >> >>> >> >
> >> >>> >> > _______________________________________________
> >> >>> >> > Powered by www.kitware.com
> >> >>> >> >
> >> >>> >> > Visit other Kitware open-source projects at
> >> >>> >> > http://www.kitware.com/opensource/opensource.html
> >> >>> >> >
> >> >>> >> > Please keep messages on-topic and check the VTK FAQ at:
> >> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
> >> >>> >> >
> >> >>> >> > Follow this link to subscribe/unsubscribe:
> >> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
> >> >>> >> >
> >> >>> >> >
> >> >>> >
> >> >>> >
> >> >>
> >> >
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: depthSorting.JPG
Type: image/jpeg
Size: 34149 bytes
Desc: not available
URL: 

From sebastien.jourdain at kitware.com  Fri Dec 17 08:28:47 2010
From: sebastien.jourdain at kitware.com (Sebastien Jourdain)
Date: Fri, 17 Dec 2010 14:28:47 +0100
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
	
	
	
	
	
	
	
	
	
Message-ID: 

I don't know if it is a VTK problem, but ParaView is using vtk 5.6 (at least).
On the other hand I don't know the underneath setting inside ParaView
for the opacity.
Maybe you can ask what are those setting so you can reproduce them
inside your vtk application on the ParaView mailing list.

Seb

PS: How did you set the depth peeling/sorting inside your code ?

2010/12/17 ??? :
> Yes it looks normal in ParaView.
>
> But In my application, after applying depth sorting,
> the iso-surface looks like attached file.
>
> Is it vtk version problem ? My vtk is 5.2.1
>
> 2010? 12? 17? ?? 9:59, Sebastien Jourdain ??
> ?:
>>
>> Ok,
>>
>> but this is normal because the ContourFilter will generate a triangulated
>> mesh.
>>
>> Seb
>>
>> 2010/12/17 ??? :
>> > I sent you two images, input file and iso-contour image.
>> > I had no problem to look at input file and iso-contour.
>> >
>> > Problem is
>> > when I set Representation option with "Surface with edges".
>> >
>> > Input file image looks normal but iso-contour image gone through
>> > vtkMarchingContourFilter  has triangles.
>> > Thank you very much.
>> >
>> > 2010? 12? 17? ?? 5:35, Sebastien Jourdain
>> > ??
>> > ?:
>> >>
>> >> The reason is because you ask to look at the input file and not the
>> >> iso-contour. The little eye on the left is disable in front of the
>> >> contour.
>> >>
>> >> Seb
>> >>
>> >> PS: Once you change something on a filter, don't forget to click on
>> >> Apply
>> >>
>> >> 2010/12/17 ??? :
>> >> > I'm very sorry for bothering you.
>> >> >
>> >> > I got something interesting.
>> >> >
>> >> > In the ParaView, when I set Representation with "Surface with edges".
>> >> >
>> >> > The isosurface image went through vtkMarchingContourFilter has the
>> >> > triangles.
>> >> > But the original image looks normal.
>> >> >
>> >> > I have used vtkCleanPolyData and vtkPolyDataNormals.
>> >> >
>> >> > I attached two iamges.
>> >> >
>> >> > Thank you ver much.
>> >> >
>> >> > Lee.
>> >> >
>> >> > 2010? 12? 17? ?? 12:55, ??? ?? ?:
>> >> >>
>> >> >> Thank you for your advice
>> >> >>
>> >> >> I loaded my isosurface into ParaView and set opacity under 1.0.
>> >> >> It looks normal ~
>> >> >>
>> >> >> Is this means that the ParaView do something special to solve
>> >> >> transparency
>> >> >> problem ?
>> >> >>
>> >> >> I attached the result.
>> >> >>
>> >> >> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
>> >> >> ?? ?:
>> >> >>>
>> >> >>> How did you defined your unstructured grid ? It seems that some
>> >> >>> inner
>> >> >>> surface are detected...
>> >> >>> This could happen if you duplicate the points so each cell has its
>> >> >>> own
>> >> >>> points ?
>> >> >>>
>> >> >>> Try to load your data into ParaView and see if you can reproduce
>> >> >>> the
>> >> >>> problem.
>> >> >>>
>> >> >>> Seb
>> >> >>>
>> >> >>> 2010/12/15 ??? :
>> >> >>> > Sorry to interrupt you again.
>> >> >>> >
>> >> >>> > I attach two images.
>> >> >>> >
>> >> >>> > Before and after adding depth sorting.
>> >> >>> > There are some differences.
>> >> >>> >
>> >> >>> > My graphics card seems not to support depth peeling.
>> >> >>> >
>> >> >>> > Thank you very mush.
>> >> >>> >
>> >> >>> > Lee.
>> >> >>> >
>> >> >>> > 2010/12/15 Sebastien Jourdain 
>> >> >>> >>
>> >> >>> >> You should enable depth peeling on the renderer to fix most of
>> >> >>> >> the
>> >> >>> >> artefact. But the rendering will be slower.
>> >> >>> >>
>> >> >>> >> Seb
>> >> >>> >>
>> >> >>> >> On Tue, Dec 14, 2010 at 10:01 AM, ??? 
>> >> >>> >> wrote:
>> >> >>> >> > Dears
>> >> >>> >> >
>> >> >>> >> > I visualized isosurface using vtkMarchingContourFilter from
>> >> >>> >> > vtkUnstructuredGrid.
>> >> >>> >> >
>> >> >>> >> > When the opacity is 1.0 , created picture looks normal.
>> >> >>> >> >
>> >> >>> >> > But when i adjust opacity to below 1.0, the picture has
>> >> >>> >> > speckles
>> >> >>> >> > depends
>> >> >>> >> > on the position.
>> >> >>> >> >
>> >> >>> >> > Do you have any solution ?
>> >> >>> >> >
>> >> >>> >> > I'll really appreciate it.
>> >> >>> >> >
>> >> >>> >> > Attached images
>> >> >>> >> >
>> >> >>> >> > _______________________________________________
>> >> >>> >> > Powered by www.kitware.com
>> >> >>> >> >
>> >> >>> >> > Visit other Kitware open-source projects at
>> >> >>> >> > http://www.kitware.com/opensource/opensource.html
>> >> >>> >> >
>> >> >>> >> > Please keep messages on-topic and check the VTK FAQ at:
>> >> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>> >> >>> >> >
>> >> >>> >> > Follow this link to subscribe/unsubscribe:
>> >> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >> >>> >> >
>> >> >>> >> >
>> >> >>> >
>> >> >>> >
>> >> >>
>> >> >
>> >> >
>> >
>> >
>
>


From basalt76 at gmail.com  Fri Dec 17 08:36:10 2010
From: basalt76 at gmail.com (=?EUC-KR?B?wMzH9sO2?=)
Date: Fri, 17 Dec 2010 22:36:10 +0900
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
	
	
	
	
	
	
	
	
	
	
Message-ID: 

Thank you for your invaluable advice.
I really appreciate it.

Here is my depth sorting code just like vtk example.

vtkSmartPointer camera = vtkCamera::New();
  renderer_->SetActiveCamera (camera);
  contourFilter->SetInput(input);

  vtkSmartPointer depthSort =
vtkDepthSortPolyData::New();
  depthSort->SetInputConnection(contourFilter->GetOutputPort());
  depthSort->SetDirectionToBackToFront();
  depthSort->SetVector(1, 1, 1);
  depthSort->SetCamera(camera);
  depthSort->SortScalarsOn();
  depthSort->Update();

  ugridMapper->SetInput(depthSort->GetOutput());



2010? 12? 17? ?? 10:28, Sebastien Jourdain ??
?:

> I don't know if it is a VTK problem, but ParaView is using vtk 5.6 (at
> least).
> On the other hand I don't know the underneath setting inside ParaView
> for the opacity.
> Maybe you can ask what are those setting so you can reproduce them
> inside your vtk application on the ParaView mailing list.
>
> Seb
>
> PS: How did you set the depth peeling/sorting inside your code ?
>
> 2010/12/17 ??? :
> > Yes it looks normal in ParaView.
> >
> > But In my application, after applying depth sorting,
> > the iso-surface looks like attached file.
> >
> > Is it vtk version problem ? My vtk is 5.2.1
> >
> > 2010? 12? 17? ?? 9:59, Sebastien Jourdain <
> sebastien.jourdain at kitware.com>??
> > ?:
> >>
> >> Ok,
> >>
> >> but this is normal because the ContourFilter will generate a
> triangulated
> >> mesh.
> >>
> >> Seb
> >>
> >> 2010/12/17 ??? :
> >> > I sent you two images, input file and iso-contour image.
> >> > I had no problem to look at input file and iso-contour.
> >> >
> >> > Problem is
> >> > when I set Representation option with "Surface with edges".
> >> >
> >> > Input file image looks normal but iso-contour image gone through
> >> > vtkMarchingContourFilter  has triangles.
> >> > Thank you very much.
> >> >
> >> > 2010? 12? 17? ?? 5:35, Sebastien Jourdain
> >> > ??
> >> > ?:
> >> >>
> >> >> The reason is because you ask to look at the input file and not the
> >> >> iso-contour. The little eye on the left is disable in front of the
> >> >> contour.
> >> >>
> >> >> Seb
> >> >>
> >> >> PS: Once you change something on a filter, don't forget to click on
> >> >> Apply
> >> >>
> >> >> 2010/12/17 ??? :
> >> >> > I'm very sorry for bothering you.
> >> >> >
> >> >> > I got something interesting.
> >> >> >
> >> >> > In the ParaView, when I set Representation with "Surface with
> edges".
> >> >> >
> >> >> > The isosurface image went through vtkMarchingContourFilter has the
> >> >> > triangles.
> >> >> > But the original image looks normal.
> >> >> >
> >> >> > I have used vtkCleanPolyData and vtkPolyDataNormals.
> >> >> >
> >> >> > I attached two iamges.
> >> >> >
> >> >> > Thank you ver much.
> >> >> >
> >> >> > Lee.
> >> >> >
> >> >> > 2010? 12? 17? ?? 12:55, ??? ?? ?:
> >> >> >>
> >> >> >> Thank you for your advice
> >> >> >>
> >> >> >> I loaded my isosurface into ParaView and set opacity under 1.0.
> >> >> >> It looks normal ~
> >> >> >>
> >> >> >> Is this means that the ParaView do something special to solve
> >> >> >> transparency
> >> >> >> problem ?
> >> >> >>
> >> >> >> I attached the result.
> >> >> >>
> >> >> >> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
> >> >> >> ?? ?:
> >> >> >>>
> >> >> >>> How did you defined your unstructured grid ? It seems that some
> >> >> >>> inner
> >> >> >>> surface are detected...
> >> >> >>> This could happen if you duplicate the points so each cell has
> its
> >> >> >>> own
> >> >> >>> points ?
> >> >> >>>
> >> >> >>> Try to load your data into ParaView and see if you can reproduce
> >> >> >>> the
> >> >> >>> problem.
> >> >> >>>
> >> >> >>> Seb
> >> >> >>>
> >> >> >>> 2010/12/15 ??? :
> >> >> >>> > Sorry to interrupt you again.
> >> >> >>> >
> >> >> >>> > I attach two images.
> >> >> >>> >
> >> >> >>> > Before and after adding depth sorting.
> >> >> >>> > There are some differences.
> >> >> >>> >
> >> >> >>> > My graphics card seems not to support depth peeling.
> >> >> >>> >
> >> >> >>> > Thank you very mush.
> >> >> >>> >
> >> >> >>> > Lee.
> >> >> >>> >
> >> >> >>> > 2010/12/15 Sebastien Jourdain 
> >> >> >>> >>
> >> >> >>> >> You should enable depth peeling on the renderer to fix most of
> >> >> >>> >> the
> >> >> >>> >> artefact. But the rendering will be slower.
> >> >> >>> >>
> >> >> >>> >> Seb
> >> >> >>> >>
> >> >> >>> >> On Tue, Dec 14, 2010 at 10:01 AM, ??? 
> >> >> >>> >> wrote:
> >> >> >>> >> > Dears
> >> >> >>> >> >
> >> >> >>> >> > I visualized isosurface using vtkMarchingContourFilter from
> >> >> >>> >> > vtkUnstructuredGrid.
> >> >> >>> >> >
> >> >> >>> >> > When the opacity is 1.0 , created picture looks normal.
> >> >> >>> >> >
> >> >> >>> >> > But when i adjust opacity to below 1.0, the picture has
> >> >> >>> >> > speckles
> >> >> >>> >> > depends
> >> >> >>> >> > on the position.
> >> >> >>> >> >
> >> >> >>> >> > Do you have any solution ?
> >> >> >>> >> >
> >> >> >>> >> > I'll really appreciate it.
> >> >> >>> >> >
> >> >> >>> >> > Attached images
> >> >> >>> >> >
> >> >> >>> >> > _______________________________________________
> >> >> >>> >> > Powered by www.kitware.com
> >> >> >>> >> >
> >> >> >>> >> > Visit other Kitware open-source projects at
> >> >> >>> >> > http://www.kitware.com/opensource/opensource.html
> >> >> >>> >> >
> >> >> >>> >> > Please keep messages on-topic and check the VTK FAQ at:
> >> >> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
> >> >> >>> >> >
> >> >> >>> >> > Follow this link to subscribe/unsubscribe:
> >> >> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
> >> >> >>> >> >
> >> >> >>> >> >
> >> >> >>> >
> >> >> >>> >
> >> >> >>
> >> >> >
> >> >> >
> >> >
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From h0ppel at web.de  Fri Dec 17 08:40:57 2010
From: h0ppel at web.de (h0ppel)
Date: Fri, 17 Dec 2010 05:40:57 -0800 (PST)
Subject: [vtkusers] convert cutterline in scalardata
Message-ID: <1292593257139-3309409.post@n5.nabble.com>


Hi,

im cutting a 3d polydatasource with a cutter. I get as result a polydata
line from the cutter, but now I need this line in scalardata to save it in
an array?
Are there any convertigfunctions given?

thanks
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/convert-cutterline-in-scalardata-tp3309409p3309409.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From aracha2010 at gmail.com  Fri Dec 17 08:43:46 2010
From: aracha2010 at gmail.com (Rachel)
Date: Fri, 17 Dec 2010 05:43:46 -0800 (PST)
Subject: [vtkusers] Line/triangle intersection
In-Reply-To: 
References: 
	
	
	<1292590923541-3309374.post@n5.nabble.com>
	
Message-ID: <1292593426521-3309412.post@n5.nabble.com>


Yes . it same that if no intersection the GetNumberOfPoints() is 0. is it
correct?
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Line-triangle-intersection-tp1246634p3309412.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From daviddoria at gmail.com  Fri Dec 17 08:46:52 2010
From: daviddoria at gmail.com (David Doria)
Date: Fri, 17 Dec 2010 08:46:52 -0500
Subject: [vtkusers] Line/triangle intersection
In-Reply-To: <1292593426521-3309412.post@n5.nabble.com>
References: 
	
	
	<1292590923541-3309374.post@n5.nabble.com>
	
	<1292593426521-3309412.post@n5.nabble.com>
Message-ID: 

On Fri, Dec 17, 2010 at 8:43 AM, Rachel  wrote:

>
> Yes . it same that if no intersection the GetNumberOfPoints() is 0. is it
> correct?
>
>
Quickly looking through the code it looks like it returns 0 if there is no
intersection and 1 otherwise.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From aracha2010 at gmail.com  Fri Dec 17 09:04:03 2010
From: aracha2010 at gmail.com (Rachel)
Date: Fri, 17 Dec 2010 06:04:03 -0800 (PST)
Subject: [vtkusers] Line/triangle intersection
In-Reply-To: 
References: 
	
	
	<1292590923541-3309374.post@n5.nabble.com>
	
	<1292593426521-3309412.post@n5.nabble.com>
	
Message-ID: <1292594643627-3309432.post@n5.nabble.com>


Thank you David for the quick reply  :)

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Line-triangle-intersection-tp1246634p3309432.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From basalt76 at gmail.com  Fri Dec 17 09:53:38 2010
From: basalt76 at gmail.com (=?EUC-KR?B?wMzH9sO2?=)
Date: Fri, 17 Dec 2010 23:53:38 +0900
Subject: [vtkusers] Isosurface opacity problem
In-Reply-To: 
References: 
	
	
	
	
	
	
	
	
	
	
	
Message-ID: 

Thank you, I might solve the problem.

Using vtk 5.6.0, the problem is gone.
Even without depth sorting, the image is normal.

I'll look for another way to solve this problem with vkt 5.2.1

Thank you again.

Lee.

2010? 12? 17? ?? 10:36, ??? ?? ?:

> Thank you for your invaluable advice.
> I really appreciate it.
>
> Here is my depth sorting code just like vtk example.
>
> vtkSmartPointer camera = vtkCamera::New();
>   renderer_->SetActiveCamera (camera);
>   contourFilter->SetInput(input);
>
>   vtkSmartPointer depthSort =
> vtkDepthSortPolyData::New();
>   depthSort->SetInputConnection(contourFilter->GetOutputPort());
>   depthSort->SetDirectionToBackToFront();
>   depthSort->SetVector(1, 1, 1);
>   depthSort->SetCamera(camera);
>   depthSort->SortScalarsOn();
>   depthSort->Update();
>
>   ugridMapper->SetInput(depthSort->GetOutput());
>
>
>
> 2010? 12? 17? ?? 10:28, Sebastien Jourdain  >?? ?:
>
> I don't know if it is a VTK problem, but ParaView is using vtk 5.6 (at
>> least).
>> On the other hand I don't know the underneath setting inside ParaView
>> for the opacity.
>> Maybe you can ask what are those setting so you can reproduce them
>> inside your vtk application on the ParaView mailing list.
>>
>> Seb
>>
>> PS: How did you set the depth peeling/sorting inside your code ?
>>
>> 2010/12/17 ??? :
>> > Yes it looks normal in ParaView.
>> >
>> > But In my application, after applying depth sorting,
>> > the iso-surface looks like attached file.
>> >
>> > Is it vtk version problem ? My vtk is 5.2.1
>> >
>> > 2010? 12? 17? ?? 9:59, Sebastien Jourdain <
>> sebastien.jourdain at kitware.com>??
>> > ?:
>> >>
>> >> Ok,
>> >>
>> >> but this is normal because the ContourFilter will generate a
>> triangulated
>> >> mesh.
>> >>
>> >> Seb
>> >>
>> >> 2010/12/17 ??? :
>> >> > I sent you two images, input file and iso-contour image.
>> >> > I had no problem to look at input file and iso-contour.
>> >> >
>> >> > Problem is
>> >> > when I set Representation option with "Surface with edges".
>> >> >
>> >> > Input file image looks normal but iso-contour image gone through
>> >> > vtkMarchingContourFilter  has triangles.
>> >> > Thank you very much.
>> >> >
>> >> > 2010? 12? 17? ?? 5:35, Sebastien Jourdain
>> >> > ??
>> >> > ?:
>> >> >>
>> >> >> The reason is because you ask to look at the input file and not the
>> >> >> iso-contour. The little eye on the left is disable in front of the
>> >> >> contour.
>> >> >>
>> >> >> Seb
>> >> >>
>> >> >> PS: Once you change something on a filter, don't forget to click on
>> >> >> Apply
>> >> >>
>> >> >> 2010/12/17 ??? :
>> >> >> > I'm very sorry for bothering you.
>> >> >> >
>> >> >> > I got something interesting.
>> >> >> >
>> >> >> > In the ParaView, when I set Representation with "Surface with
>> edges".
>> >> >> >
>> >> >> > The isosurface image went through vtkMarchingContourFilter has the
>> >> >> > triangles.
>> >> >> > But the original image looks normal.
>> >> >> >
>> >> >> > I have used vtkCleanPolyData and vtkPolyDataNormals.
>> >> >> >
>> >> >> > I attached two iamges.
>> >> >> >
>> >> >> > Thank you ver much.
>> >> >> >
>> >> >> > Lee.
>> >> >> >
>> >> >> > 2010? 12? 17? ?? 12:55, ??? ?? ?:
>> >> >> >>
>> >> >> >> Thank you for your advice
>> >> >> >>
>> >> >> >> I loaded my isosurface into ParaView and set opacity under 1.0.
>> >> >> >> It looks normal ~
>> >> >> >>
>> >> >> >> Is this means that the ParaView do something special to solve
>> >> >> >> transparency
>> >> >> >> problem ?
>> >> >> >>
>> >> >> >> I attached the result.
>> >> >> >>
>> >> >> >> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
>> >> >> >> ?? ?:
>> >> >> >>>
>> >> >> >>> How did you defined your unstructured grid ? It seems that some
>> >> >> >>> inner
>> >> >> >>> surface are detected...
>> >> >> >>> This could happen if you duplicate the points so each cell has
>> its
>> >> >> >>> own
>> >> >> >>> points ?
>> >> >> >>>
>> >> >> >>> Try to load your data into ParaView and see if you can reproduce
>> >> >> >>> the
>> >> >> >>> problem.
>> >> >> >>>
>> >> >> >>> Seb
>> >> >> >>>
>> >> >> >>> 2010/12/15 ??? :
>> >> >> >>> > Sorry to interrupt you again.
>> >> >> >>> >
>> >> >> >>> > I attach two images.
>> >> >> >>> >
>> >> >> >>> > Before and after adding depth sorting.
>> >> >> >>> > There are some differences.
>> >> >> >>> >
>> >> >> >>> > My graphics card seems not to support depth peeling.
>> >> >> >>> >
>> >> >> >>> > Thank you very mush.
>> >> >> >>> >
>> >> >> >>> > Lee.
>> >> >> >>> >
>> >> >> >>> > 2010/12/15 Sebastien Jourdain > >
>> >> >> >>> >>
>> >> >> >>> >> You should enable depth peeling on the renderer to fix most
>> of
>> >> >> >>> >> the
>> >> >> >>> >> artefact. But the rendering will be slower.
>> >> >> >>> >>
>> >> >> >>> >> Seb
>> >> >> >>> >>
>> >> >> >>> >> On Tue, Dec 14, 2010 at 10:01 AM, ??? 
>> >> >> >>> >> wrote:
>> >> >> >>> >> > Dears
>> >> >> >>> >> >
>> >> >> >>> >> > I visualized isosurface using vtkMarchingContourFilter from
>> >> >> >>> >> > vtkUnstructuredGrid.
>> >> >> >>> >> >
>> >> >> >>> >> > When the opacity is 1.0 , created picture looks normal.
>> >> >> >>> >> >
>> >> >> >>> >> > But when i adjust opacity to below 1.0, the picture has
>> >> >> >>> >> > speckles
>> >> >> >>> >> > depends
>> >> >> >>> >> > on the position.
>> >> >> >>> >> >
>> >> >> >>> >> > Do you have any solution ?
>> >> >> >>> >> >
>> >> >> >>> >> > I'll really appreciate it.
>> >> >> >>> >> >
>> >> >> >>> >> > Attached images
>> >> >> >>> >> >
>> >> >> >>> >> > _______________________________________________
>> >> >> >>> >> > Powered by www.kitware.com
>> >> >> >>> >> >
>> >> >> >>> >> > Visit other Kitware open-source projects at
>> >> >> >>> >> > http://www.kitware.com/opensource/opensource.html
>> >> >> >>> >> >
>> >> >> >>> >> > Please keep messages on-topic and check the VTK FAQ at:
>> >> >> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>> >> >> >>> >> >
>> >> >> >>> >> > Follow this link to subscribe/unsubscribe:
>> >> >> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >> >> >>> >> >
>> >> >> >>> >> >
>> >> >> >>> >
>> >> >> >>> >
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >
>> >> >
>> >
>> >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From byeongjun.park at case.edu  Fri Dec 17 10:50:26 2010
From: byeongjun.park at case.edu ((Samuel) Byeongjun Park)
Date: Fri, 17 Dec 2010 10:50:26 -0500
Subject: [vtkusers] Programming challenges with QT, VTK, and ITK
In-Reply-To: <006e01cb9de3$c1f902d0$45eb0870$@ac.kr>
References: <008401cb7573$2c99b1f0$85cd15d0$@ac.kr>
	<005b01cb75dc$974fb7b0$c5ef2710$@park@case.edu>
	<006e01cb9de3$c1f902d0$45eb0870$@ac.kr>
Message-ID: <009c01cb9e02$28d0b200$7a721600$@park@case.edu>

Xiaopeng,

 

If you use iktImageToVTKImageFilter, it means the image data is in itk::Image object, not in vtkImageData.

So if you got world coordinate, then the first three elements of world coordinate array is the PhysicalPoint of itk::Image.

You can get the index of itkImage using itk::Image::TransformPhysicalPointToIndex(..).

You shouldn?t read the image to both of itk::Image and vtkImageData.

 

Summarizing..

1.       Read the image to itk::Image.

2.       Apply itkImageToVTKImageFilter

3.       Get a point from vtk

4.       Change it to world coordinate point

5.       Store the x,y,z coordinate into Itk::Image::PointType object

6.       Itk::Image::TransformPhysicalPointToIndex()

 

Now you get the index of the itk::Image where you picked in vtk window.

 

Good luck and merry Christmas!

 

Sam.

-------------- Innovation for the Future Radiation Oncology  (http://rophys.meds.case.edu  )

(Samuel) Byeongjun Park, Ph.D.  -- Research associate of Sohn Lab.

Case Western Reserve Univerisity, School of Medicine

Visiting: Wood building W517,  Phone: 1-216-368-6583

 

 

 

From: Xiaopeng Yang [mailto:yxp233 at postech.ac.kr] 
Sent: Friday, December 17, 2010 7:13 AM
To: '(Samuel) Byeongjun Park'
Cc: insight-users at itk.org; 'vtk'
Subject: RE: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Hello Park,

 

It has been a very long time since I received your help. These days I am still working on this problem. Now I can get the VTK coordinate (i.e., world coordinate). You mentioned that if I use itk ImageToVTKImageFilter, I can directly use the VTK coordinate as ITK coordinate. However, I could not understand clearly. In my program, I need ITK coordinate for applying ITK region growing algorithm. I do not know how to translate VTK coordinate to ITK coordinate. Could you please explain more in detail?

 

Thanks very much!

 

Xiaopeng

 

???: (Samuel) Byeongjun Park [mailto:byeongjun.park at case.edu] 
????: 2010? 10? 27? ??? ?? 10:41
???: 'Xiaopeng Yang'
??: 'vtk'
??: RE: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Hi,

 

My name is Sam Park. Since you told you are using QT, I think you are using QVTKWidget.

You can make your own QVTK widget class inheriting QVTKWidget.

In there, override 

   Virtual void mousePressEvent(QMouseEvent *pevent);

You can read the mouse position in QVTKWidget window.

Then,

1.       Get the QT coordinate point (x,y)

2.       Flip y value by  y=height-y;

3.       Get the pointer of the Render in your QVTKWidget object.

4.       double wpoint[4];

5.       Render->SetDisplayPoint(x,y,0);

6.       Render->DisplayToWorld(); 

7.       Render->GetWorldPoint(wpoint);

 

Now You have the VTK coordinate of the point you clicked.

If you imported CT image in ITK and utilized itk::ImageToVTKImageFilter, 

you can directly use the VTK coordinate as ITK coordinate.

 

Good luck.

 

Sam.

-------------- Innovation for the Future Radiation Oncology 

(Samuel) Byeongjun Park, Ph.D.  -- Research associate of Sohn Lab.

Case Western Reserve Univerisity, School of Medicine

Visiting: Wood building W517,  Phone: 1-216-368-6583

 

 

 

From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Xiaopeng Yang
Sent: Tuesday, October 26, 2010 9:06 PM
To: 'Luis Ibanez'
Cc: 'itk'; 'vtk'
Subject: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Dear Luis,

 

How are you doing? Thank you very much for your help so far. Sorry to ask you a question again.

 

I am now developing a liver segmentation program using QT, VTK, and ITK based on CT images. In my program, fast marching algorithm is used to extract the liver by multiple seed points. To pick the positions of the seed points, vtkImagePlaneWidget is applied. The problem is how to save the multiple seed points I selected by left-clicking of the mouse so that I do not need to type those positions into the code, which is time consuming.

 

Please provide me with your suggestions. I working on this for almost one week still I cannot figure it out.

 

Thanks,

Xiaopeng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From cartik_sharma at yahoo.com  Fri Dec 17 10:58:56 2010
From: cartik_sharma at yahoo.com (Cartik Sharma)
Date: Fri, 17 Dec 2010 07:58:56 -0800 (PST)
Subject: [vtkusers] vtkusers Digest, Vol 80, Issue 24
Message-ID: <697410.19788.qm@web111414.mail.gq1.yahoo.com>

hi Xiaopeng:
I'd slice the binary volume into individual ROIs of finite thickness, ?thenthen calculate the sum of pixels multiplied by individual?slice thicknesses.
This should ?give the approximate volume of the binary volume accurate to nearest?pixel resolution.

cheers,

Cartik

--- On Fri, 12/17/10, vtkusers-request at vtk.org  wrote:

From: vtkusers-request at vtk.org 
Subject: vtkusers Digest, Vol 80, Issue 24
To: vtkusers at vtk.org
Date: Friday, December 17, 2010, 9:53 AM

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. Volume Calculation for Binary Images (Xiaopeng Yang)
???2. Re: [vtk-developers] ANN: Training Course in Lyon, France
? ? ? (Cartik Sharma)
???3. Re: Volume Calculation for Binary Images (Darshan Pai)
???4. Re: Volume Calculation for Binary Images (Xiaopeng Yang)
???5. Re: Isosurface opacity problem (Sebastien Jourdain)
???6. Non-visible point handlers (Ra?l Ferriz)
???7. Re: Non-visible point
 handlers (Ra?l Ferriz)
???8. Re: Programming challenges with QT, VTK, and ITK (Xiaopeng Yang)
???9. Re: Isosurface opacity problem (???)
? 10. Re: Isosurface opacity problem (Sebastien Jourdain)
? 11. Re: Line/triangle intersection (Rachel)
? 12. Re: Line/triangle intersection (David Doria)
? 13. Re: Isosurface opacity problem (???)
? 14. Re: Isosurface opacity problem (Sebastien Jourdain)
? 15. Re: Isosurface opacity problem (???)
? 16. convert cutterline in scalardata (h0ppel)
? 17. Re: Line/triangle intersection (Rachel)
? 18. Re: Line/triangle intersection (David Doria)
? 19. Re: Line/triangle intersection (Rachel)
? 20. Re: Isosurface opacity problem (???)


----------------------------------------------------------------------

Message: 1
Date: Fri, 17 Dec 2010 15:12:49 +0900
From: "Xiaopeng Yang" 
Subject: [vtkusers] Volume Calculation for Binary Images
To: ,??? 
Message-ID: <001201cb9db1$6e2fcdf0$4a8f69d0$@ac.kr>
Content-Type: text/plain; charset="us-ascii"

Dear Users,

 

After segmenting some organ from CT images, I get a volume binary image for
that organ. Could you please tell me how to calculate the volume of that
organ?

 

Thanks,

Xiaopeng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

------------------------------

Message: 2
Date: Thu,
 16 Dec 2010 22:09:06 -0800 (PST)
From: Cartik Sharma 
Subject: Re: [vtkusers] [vtk-developers] ANN: Training Course in Lyon,
??? France
To: VTK Developers , vtk vtk
??? ,??? insight-users at itk.org, paraview at paraview.org,
??? cmake at cmake.org,??? Lisa Avila 
Message-ID: <733902.59139.qm at web111416.mail.gq1.yahoo.com>
Content-Type: text/plain; charset="us-ascii"

Hi:
Great location for a VTK course..is this also going to include the GPU support part of version 5.6?
Wish I didnt know as much vtk as I already do :)
cheers,

Cartik

--- On Thu,
 12/16/10, Lisa Avila  wrote:

From:
 Lisa Avila 
Subject: [vtk-developers] ANN: Training Course in Lyon, France
To: "VTK Developers" , "vtk vtk" , insight-users at itk.org, paraview at paraview.org, cmake at cmake.org
Date: Thursday, December 16, 2010, 11:48 AM


More great news for folks in the EU: Kitware will be holding a developers training course on February 2-4, 2011 in Lyon,
 France. This course will cover ITK, VTK, ParaView, and CMake, and there will be an optional ski trip to L'Alpe d'Huez on Saturday, February 5. Please visit our web site for more information and registration details (early registration ends January 7th!) at either:


http://www.kitware.com/products/protraining3.html (in English)

or 

http://www.kitware.fr/products/protraining.php (in French)


Note that the course will be taught in English. If you have any questions, please contact us at 
? ? ? ? ? ? ? ? formations at kitware.fr or courses at kitware.com.


-----Inline Attachment
 Follows-----

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtk-developers




? ? ? 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

------------------------------

Message:
 3
Date: Fri, 17 Dec 2010 01:58:44 -0500
From: Darshan Pai 
Subject: Re: [vtkusers] Volume Calculation for Binary Images
To: Xiaopeng Yang 
Cc: insight-users at itk.org, vtkusers at vtk.org
Message-ID:
??? 
Content-Type: text/plain; charset="iso-8859-1"

I usually just count the voxels and
 consider that as volume

On Fri, Dec 17, 2010 at 1:12 AM, Xiaopeng Yang  wrote:

> Dear Users,
>
>
>
> After segmenting some organ from CT images, I get a volume binary image for
> that organ. Could you please tell me how to calculate the volume of that
> organ?
>
>
>
> Thanks,
>
> Xiaopeng
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to
 subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

------------------------------

Message: 4
Date: Fri, 17 Dec 2010 16:39:34 +0900
From: "Xiaopeng Yang" 
Subject: Re: [vtkusers] Volume Calculation for Binary Images
To: "'Darshan Pai'" 
Cc: vtkusers at vtk.org
Message-ID: <003c01cb9dbd$8cb60530$a6220f90$@ac.kr>
Content-Type: text/plain;
 charset="utf-8"

Hi? Pai,

 

Thank you. But do you know how to count the voxels? I know that ITKStatisticsImageFilter can do this but I don?t know how.

 

Thanks,

Xiaopeng

 

???: Darshan Pai [mailto:darshanpai at gmail.com] 
????: 2010? 12? 17? ??? ?? 3:59
???: Xiaopeng Yang
??: vtkusers at vtk.org; insight-users at itk.org
??: Re: [vtkusers] Volume Calculation for Binary
 Images

 

I usually just count the voxels and consider that as volume

On Fri, Dec 17, 2010 at 1:12 AM, Xiaopeng Yang  wrote:

Dear Users,

 

After segmenting some organ from CT images, I get a volume binary image for that organ. Could you please tell me how to calculate the volume of that organ?

 

Thanks,

Xiaopeng


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to
 subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

------------------------------

Message: 5
Date: Fri, 17 Dec 2010 09:35:17 +0100
From: Sebastien Jourdain 
Subject: Re: [vtkusers] Isosurface opacity problem
To: ??? 
Cc: vtkusers at vtk.org
Message-ID:
??? 
Content-Type: text/plain; charset=EUC-KR

The reason is because you ask to look at the input file and not the
iso-contour. The little eye on the left is disable in front of the
contour.

Seb

PS: Once you change something on a filter, don't forget to click on Apply

2010/12/17 ??? :
> I'm very sorry for bothering you.
>
> I got something interesting.
>
> In the ParaView, when I set Representation with "Surface with edges".
>
> The isosurface image went through
 vtkMarchingContourFilter has the
> triangles.
> But the original image looks normal.
>
> I have used vtkCleanPolyData and vtkPolyDataNormals.
>
> I attached two iamges.
>
> Thank you ver much.
>
> Lee.
>
> 2010? 12? 17? ?? 12:55, ??? ?? ?:
>>
>> Thank you for your advice
>>
>> I loaded my isosurface into ParaView and set opacity under 1.0.
>> It looks normal ~
>>
>> Is this means that the ParaView do something special to solve transparency
>> problem ?
>>
>> I attached the result.
>>
>> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
>> ?? ?:
>>>
>>> How did you defined your unstructured grid ? It seems that some inner
>>> surface
 are detected...
>>> This could happen if you duplicate the points so each cell has its own
>>> points ?
>>>
>>> Try to load your data into ParaView and see if you can reproduce the
>>> problem.
>>>
>>> Seb
>>>
>>> 2010/12/15 ??? :
>>> > Sorry to interrupt you again.
>>> >
>>> > I attach two images.
>>> >
>>> > Before and after adding depth sorting.
>>> > There are some differences.
>>> >
>>> > My
 graphics card seems not to support depth peeling.
>>> >
>>> > Thank you very mush.
>>> >
>>> > Lee.
>>> >
>>> > 2010/12/15 Sebastien Jourdain 
>>> >>
>>> >> You should enable depth peeling on the renderer to fix most of the
>>> >> artefact. But the rendering will be slower.
>>> >>
>>> >> Seb
>>> >>
>>> >> On Tue, Dec 14, 2010 at 10:01 AM, ???  wrote:
>>> >> > Dears
>>> >> >
>>> >> > I visualized isosurface using
 vtkMarchingContourFilter from
>>> >> > vtkUnstructuredGrid.
>>> >> >
>>> >> > When the opacity is 1.0 , created picture looks normal.
>>> >> >
>>> >> > But when i adjust opacity to below 1.0, the picture has speckles
>>> >> > depends
>>> >> > on the position.
>>> >> >
>>> >> > Do you have any solution ?
>>> >> >
>>> >> > I'll really appreciate it.
>>> >> >
>>> >> > Attached images
>>> >> >
>>> >> > _______________________________________________
>>> >> > Powered by www.kitware.com
>>> >> >
>>> >> > Visit other Kitware open-source projects at
>>> >> > http://www.kitware.com/opensource/opensource.html
>>> >> >
>>> >> > Please keep messages on-topic and check the VTK FAQ at:
>>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>>> >> >
>>> >> > Follow this link to subscribe/unsubscribe:
>>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>>> >> >
>>> >> >
>>> >
>>> >
>>
>
>


------------------------------

Message: 6
Date: Fri, 17 Dec 2010 11:12:12 +0100
From: Ra?l Ferriz 
Subject: [vtkusers] Non-visible point handlers
To: vtkusers at vtk.org
Message-ID: <4D0B377C.8010907 at torresyvalero.com>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed

Hello!

I'm using a vtkDistanceWidget, with vtkDistanceWidgetRepresentation 
attached to it. I want that point handler that is sawn on line edges (a 
cross by default) will be not visible.

I have searched for an example on wiki and web, but nothing found, any 
help ?


------------------------------

Message: 7
Date: Fri, 17 Dec 2010 12:04:14 +0100
From: Ra?l Ferriz 
Subject: Re: [vtkusers] Non-visible point handlers
To: vtkusers at vtk.org
Message-ID: <4D0B43AE.3060108 at torresyvalero.com>
Content-Type: text/plain;
 charset=ISO-8859-15; format=flowed

El 17/12/2010 11:12, Ra?l Ferriz escribi?:
> Hello!
>
> I'm using a vtkDistanceWidget, with vtkDistanceWidgetRepresentation 
> attached to it. I want that point handler that is sawn on line edges 
> (a cross by default) will be not visible.
>
> I have searched for an example on wiki and web, but nothing found, any 
> help ?
> _______________________________________________
> Powered by www.kitware.com
>
> Visit
 other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: 
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
It doesn't matter, already found a pointer handler smaller and beautifull.


------------------------------

Message: 8
Date: Fri, 17 Dec 2010 21:13:04 +0900
From: "Xiaopeng Yang" 
Subject: Re: [vtkusers] Programming challenges with QT, VTK, and ITK
To: "'\(Samuel\)
 Byeongjun Park'" 
Cc: insight-users at itk.org, 'vtk' 
Message-ID: <006e01cb9de3$c1f902d0$45eb0870$@ac.kr>
Content-Type: text/plain; charset="utf-8"

Hello Park,

 

It has been a very long time since I received your help. These days I am still working on this problem. Now I can get the VTK coordinate (i.e., world coordinate). You mentioned that if I use itk ImageToVTKImageFilter, I can directly use the VTK coordinate as ITK coordinate. However, I could not understand clearly. In my program, I need ITK coordinate for applying ITK region growing algorithm. I do not know how to translate VTK coordinate to ITK
 coordinate. Could you please explain more in detail?

 

Thanks very much!

 

Xiaopeng

 

???: (Samuel) Byeongjun Park [mailto:byeongjun.park at case.edu] 
????: 2010? 10? 27? ??? ?? 10:41
???: 'Xiaopeng Yang'
??: 'vtk'
??: RE: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Hi,

 

My name is Sam Park. Since you told you are using QT, I think you are using QVTKWidget.

You can make your own QVTK widget class inheriting QVTKWidget.

In there, override 

???Virtual void mousePressEvent(QMouseEvent *pevent);

You can read the mouse position in QVTKWidget window.

Then,

1.? ? ???Get the QT coordinate point (x,y)

2.? ? ???Flip y value by? y=height-y;

3.?
 ? ???Get the pointer of the Render in your QVTKWidget object.

4.? ? ???double wpoint[4];

5.? ? ???Render->SetDisplayPoint(x,y,0);

6.? ? ???Render->DisplayToWorld(); 

7.? ? ???Render->GetWorldPoint(wpoint);

 

Now You have the VTK coordinate of the point you clicked.

If you imported CT image in ITK and utilized itk::ImageToVTKImageFilter, 

you can directly use the VTK coordinate as ITK coordinate.

 

Good luck.

 

Sam.

-------------- Innovation for the Future Radiation Oncology 

(Samuel) Byeongjun Park, Ph.D.? -- Research associate of Sohn Lab.

Case Western Reserve Univerisity, School of Medicine

Visiting: Wood building W517,? Phone: 1-216-368-6583

 

 

 

From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Xiaopeng Yang
Sent: Tuesday, October 26, 2010 9:06 PM
To: 'Luis Ibanez'
Cc: 'itk'; 'vtk'
Subject: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Dear Luis,

 

How are you doing? Thank you very much for your help so far. Sorry to ask you a question again.

 

I am now developing a liver segmentation program using QT, VTK, and ITK based on CT images. In my program, fast marching algorithm is used to extract the liver by multiple seed points. To pick the positions of the seed points, vtkImagePlaneWidget is applied. The problem is how to save the multiple seed points I selected by left-clicking of the mouse so that I do not need to type
 those positions into the code, which is time consuming.

 

Please provide me with your suggestions. I working on this for almost one week still I cannot figure it out.

 

Thanks,

Xiaopeng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

------------------------------

Message: 9
Date: Fri, 17 Dec 2010 21:47:10 +0900
From: ??? 
Subject: Re: [vtkusers] Isosurface opacity problem
To: Sebastien Jourdain 
Cc: vtkusers at vtk.org
Message-ID:
??? 
Content-Type: text/plain; charset="euc-kr"

I sent you two images, input file and iso-contour image.
I had no problem to look at input file and iso-contour.

Problem is
when I set Representation option with "Surface with edges".

Input file image looks normal but iso-contour image gone through
vtkMarchingContourFilter? has triangles.
Thank you very much.

2010? 12? 17? ?? 5:35, Sebastien Jourdain ??
?:

> The reason is because you ask to look at the input file and not the
> iso-contour. The little eye on the left is disable in front of the
> contour.
>
> Seb
>
> PS: Once you change something on a filter, don't forget to click on Apply
>
> 2010/12/17 ??? :
>? > I'm
 very sorry for bothering you.
> >
> > I got something interesting.
> >
> > In the ParaView, when I set Representation with "Surface with edges".
> >
> > The isosurface image went through vtkMarchingContourFilter has the
> > triangles.
> > But the original image looks normal.
> >
> > I have used vtkCleanPolyData and
 vtkPolyDataNormals.
> >
> > I attached two iamges.
> >
> > Thank you ver much.
> >
> > Lee.
> >
> > 2010? 12? 17? ?? 12:55, ??? ?? ?:
> >>
> >> Thank you for your advice
> >>
> >> I loaded my isosurface into ParaView and set opacity under 1.0.
> >> It looks normal ~
> >>
> >> Is this means that the ParaView do something special to solve
> transparency
> >> problem ?
> >>
> >> I attached the result.
> >>
> >> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
> >> ?? ?:
>
 >>>
> >>> How did you defined your unstructured grid ? It seems that some inner
> >>> surface are detected...
> >>> This could happen if you duplicate the points so each cell has its own
> >>> points ?
> >>>
> >>> Try to load your data into ParaView and see if you can reproduce the
> >>> problem.
> >>>
> >>> Seb
> >>>
> >>> 2010/12/15 ??? :
> >>> > Sorry to interrupt you again.
> >>> >
> >>> > I attach two images.
> >>> >
> >>> > Before and after adding depth sorting.
> >>> > There are some differences.
> >>> >
> >>> > My graphics
 card seems not to support depth peeling.
> >>> >
> >>> > Thank you very mush.
> >>> >
> >>> > Lee.
> >>> >
> >>> > 2010/12/15 Sebastien Jourdain 
> >>> >>
> >>> >> You should enable depth peeling on the renderer to fix most of the
> >>> >> artefact. But the rendering will be slower.
> >>> >>
> >>> >> Seb
> >>> >>
> >>> >> On Tue, Dec 14, 2010 at 10:01 AM, ???  wrote:
> >>> >> > Dears
> >>> >> >
>
 >>> >> > I visualized isosurface using vtkMarchingContourFilter from
> >>> >> > vtkUnstructuredGrid.
> >>> >> >
> >>> >> > When the opacity is 1.0 , created picture looks normal.
> >>> >> >
> >>> >> > But when i adjust opacity to below 1.0, the picture has speckles
> >>> >> > depends
> >>> >> > on the position.
> >>> >> >
> >>> >> > Do you have any solution ?
> >>> >> >
> >>> >> > I'll really appreciate it.
> >>> >> >
> >>> >> > Attached images
> >>> >> >
> >>> >> > _______________________________________________
> >>> >> > Powered by www.kitware.com
>
 >>> >> >
> >>> >> > Visit other Kitware open-source projects at
> >>> >> > http://www.kitware.com/opensource/opensource.html
> >>> >> >
> >>> >> > Please keep messages on-topic and check the VTK FAQ at:
> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
> >>> >> >
> >>> >> > Follow this link to subscribe/unsubscribe:
> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
> >>> >> >
> >>> >> >
> >>> >
> >>>
 >
> >>
> >
>
 >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

------------------------------

Message: 10
Date: Fri, 17 Dec 2010 13:59:13 +0100
From: Sebastien Jourdain 
Subject: Re: [vtkusers] Isosurface opacity problem
To: ??? 
Cc: vtkusers at vtk.org
Message-ID:
??? 
Content-Type: text/plain; charset=EUC-KR

Ok,

but this is normal because the ContourFilter will generate a triangulated
 mesh.

Seb

2010/12/17 ??? :
> I sent you two images, input file and iso-contour image.
> I had no problem to look at input file and iso-contour.
>
> Problem is
> when I set Representation option with "Surface with edges".
>
> Input file image looks normal but iso-contour image gone through
> vtkMarchingContourFilter? has triangles.
> Thank you very much.
>
> 2010? 12? 17? ?? 5:35, Sebastien Jourdain ??
> ?:
>>
>> The reason is because you ask to look at the input file and not the
>> iso-contour. The little eye on the left is disable in front of the
>> contour.
>>
>> Seb
>>
>> PS: Once you change something on a filter, don't forget to click on Apply
>>
>> 2010/12/17 ???
 :
>> > I'm very sorry for bothering you.
>> >
>> > I got something interesting.
>> >
>> > In the ParaView, when I set Representation with "Surface with edges".
>> >
>> > The isosurface image went through vtkMarchingContourFilter has the
>> > triangles.
>> > But the original image looks
 normal.
>> >
>> > I have used vtkCleanPolyData and vtkPolyDataNormals.
>> >
>> > I attached two iamges.
>> >
>> > Thank you ver much.
>> >
>> > Lee.
>> >
>> > 2010? 12? 17? ?? 12:55, ??? ?? ?:
>> >>
>> >> Thank you for your advice
>> >>
>> >> I loaded my isosurface into ParaView and set opacity under 1.0.
>> >> It looks normal ~
>> >>
>> >> Is this means that the ParaView do something special to solve
>> >> transparency
>> >> problem ?
>> >>
>> >> I attached the result.
>> >>
>> >> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
>>
 >> ?? ?:
>> >>>
>> >>> How did you defined your unstructured grid ? It seems that some inner
>> >>> surface are detected...
>> >>> This could happen if you duplicate the points so each cell has its own
>> >>> points ?
>> >>>
>> >>> Try to load your data into ParaView and see if you can reproduce the
>> >>> problem.
>> >>>
>> >>> Seb
>> >>>
>> >>> 2010/12/15 ??? :
>> >>> > Sorry to interrupt you again.
>> >>> >
>> >>> > I
 attach two images.
>> >>> >
>> >>> > Before and after adding depth sorting.
>> >>> > There are some differences.
>> >>> >
>> >>> > My graphics card seems not to support depth peeling.
>> >>> >
>> >>> > Thank you very mush.
>> >>> >
>> >>> > Lee.
>> >>> >
>> >>> > 2010/12/15 Sebastien Jourdain 
>> >>> >>
>> >>> >> You should enable depth peeling on the renderer to fix most of the
>> >>> >> artefact. But the rendering will be slower.
>> >>> >>
>> >>> >>
 Seb
>> >>> >>
>> >>> >> On Tue, Dec 14, 2010 at 10:01 AM, ???  wrote:
>> >>> >> > Dears
>> >>> >> >
>> >>> >> > I visualized isosurface using vtkMarchingContourFilter from
>> >>> >> > vtkUnstructuredGrid.
>> >>> >> >
>> >>> >> > When the opacity is 1.0 , created picture looks normal.
>> >>> >> >
>> >>> >> > But when i adjust opacity to below 1.0, the picture has speckles
>> >>> >> > depends
>> >>> >> > on the position.
>> >>> >> >
>> >>> >> > Do you have any solution ?
>>
 >>> >> >
>> >>> >> > I'll really appreciate it.
>> >>> >> >
>> >>> >> > Attached images
>> >>> >> >
>> >>> >> > _______________________________________________
>> >>> >> > Powered by www.kitware.com
>> >>> >> >
>> >>> >> > Visit other Kitware open-source projects at
>> >>> >> > http://www.kitware.com/opensource/opensource.html
>> >>> >> >
>> >>> >> > Please keep messages on-topic and check the VTK FAQ at:
>> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>> >>>
 >> >
>> >>> >> > Follow this link to subscribe/unsubscribe:
>> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >>> >> >
>> >>> >> >
>> >>> >
>> >>> >
>> >>
>> >
>> >
>
>


------------------------------

Message: 11
Date: Fri, 17 Dec 2010 05:02:03 -0800 (PST)
From: Rachel 
Subject: Re: [vtkusers] Line/triangle intersection
To: vtkusers at vtk.org
Message-ID: <1292590923541-3309374.post at n5.nabble.com>
Content-Type: text/plain; charset=us-ascii


Hi David, if there is no intersection between the ray and the 3D
 object, what
would the function return?

Thanks
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Line-triangle-intersection-tp1246634p3309374.html
Sent from the VTK - Users mailing list archive at Nabble.com.


------------------------------

Message: 12
Date: Fri, 17 Dec 2010 08:09:20 -0500
From: David Doria 
Subject: Re: [vtkusers] Line/triangle intersection
To: Rachel 
Cc: vtkusers at vtk.org
Message-ID:
??? 
Content-Type: text/plain; charset="iso-8859-1"

On Fri, Dec 17, 2010 at 8:02 AM, Rachel  wrote:

>
> Hi David, if there is no intersection between the ray and the 3D object,
> what
> would the function return?
>
> Thanks
>
>
Are you talking about the IntersectWithLine function?

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

------------------------------

Message: 13
Date: Fri, 17 Dec 2010 22:19:29 +0900
From: ??? 
Subject: Re: [vtkusers] Isosurface opacity problem
To: Sebastien Jourdain 
Cc: vtkusers at vtk.org
Message-ID:
??? 
Content-Type: text/plain; charset="euc-kr"

Yes it looks normal in ParaView.

But In my application, after applying depth sorting,
the iso-surface looks like attached file.

Is it vtk version problem ? My vtk is 5.2.1

2010? 12? 17? ?? 9:59, Sebastien Jourdain ??
?:

> Ok,
>
> but this is normal because the ContourFilter will generate a triangulated
> mesh.
>
> Seb
>
> 2010/12/17 ??? :
> > I sent you two images, input file and iso-contour image.
> > I
 had no problem to look at input file and iso-contour.
> >
> > Problem is
> > when I set Representation option with "Surface with edges".
> >
> > Input file image looks normal but iso-contour image gone through
> > vtkMarchingContourFilter? has triangles.
> > Thank you very much.
> >
> > 2010? 12? 17? ?? 5:35, Sebastien Jourdain <
> sebastien.jourdain at kitware.com>??
> > ?:
> >>
> >> The reason is because you ask to look at the input file and not the
> >> iso-contour. The little eye on the left is disable in front of the
> >> contour.
> >>
> >> Seb
> >>
> >> PS: Once you change something on a filter, don't forget to click on
> Apply
>
 >>
> >> 2010/12/17 ??? :
> >> > I'm very sorry for bothering you.
> >> >
> >> > I got something interesting.
> >> >
> >> > In the ParaView, when I set Representation with "Surface with edges".
> >> >
> >> > The isosurface image went through vtkMarchingContourFilter has the
> >> > triangles.
> >> > But the original image looks normal.
> >> >
> >> > I have used vtkCleanPolyData and vtkPolyDataNormals.
> >> >
> >> > I attached two iamges.
> >> >
> >> > Thank you ver much.
> >> >
> >> > Lee.
> >> >
> >> > 2010? 12? 17? ?? 12:55, ??? ?? ?:
> >>
 >>
> >> >> Thank you for your advice
> >> >>
> >> >> I loaded my isosurface into ParaView and set opacity under 1.0.
> >> >> It looks normal ~
> >> >>
> >> >> Is this means that the ParaView do something special to solve
> >> >> transparency
> >> >> problem ?
> >> >>
> >> >> I attached the result.
> >> >>
> >> >> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
> >> >> ?? ?:
> >> >>>
> >> >>> How did you defined
 your unstructured grid ? It seems that some
> inner
> >> >>> surface are detected...
> >> >>> This could happen if you duplicate the points so each cell has its
> own
> >> >>> points ?
> >> >>>
> >> >>> Try to load your data into ParaView and see if you can reproduce the
> >> >>> problem.
> >> >>>
> >> >>> Seb
> >> >>>
> >> >>> 2010/12/15 ??? :
> >> >>> > Sorry to interrupt you again.
> >> >>> >
> >> >>> > I attach two images.
> >> >>> >
> >> >>> > Before and after adding depth sorting.
> >>
 >>> > There are some differences.
> >> >>> >
> >> >>> > My graphics card seems not to support depth peeling.
> >> >>> >
> >> >>> > Thank you very mush.
> >> >>> >
> >> >>> > Lee.
> >> >>> >
> >> >>> > 2010/12/15 Sebastien Jourdain 
> >> >>> >>
> >> >>> >> You should enable depth peeling on the renderer to fix most of
> the
> >> >>> >> artefact. But the rendering will be slower.
> >> >>> >>
> >> >>> >> Seb
> >> >>> >>
> >>
 >>> >> On Tue, Dec 14, 2010 at 10:01 AM, ??? 
> wrote:
> >> >>> >> > Dears
> >> >>> >> >
> >> >>> >> > I visualized isosurface using vtkMarchingContourFilter from
> >> >>> >> > vtkUnstructuredGrid.
> >> >>> >> >
> >> >>> >> > When the opacity is 1.0 , created picture looks normal.
> >> >>> >> >
> >> >>> >> > But when i adjust opacity to below 1.0, the picture has
> speckles
> >> >>> >> > depends
> >> >>> >> > on the position.
> >> >>> >> >
> >> >>> >> > Do you have
 any solution ?
> >> >>> >> >
> >> >>> >> > I'll really appreciate it.
> >> >>> >> >
> >> >>> >> > Attached images
> >> >>> >> >
> >> >>> >> > _______________________________________________
> >> >>> >> > Powered by www.kitware.com
> >> >>> >> >
> >> >>> >> > Visit other Kitware open-source projects at
> >> >>> >> > http://www.kitware.com/opensource/opensource.html
> >> >>> >> >
> >> >>> >> > Please keep messages on-topic and check the VTK FAQ at:
> >> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
> >> >>> >> >
> >> >>> >> > Follow this link to subscribe/unsubscribe:
> >> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
> >> >>> >> >
> >> >>> >> >
> >> >>> >
> >> >>> >
> >> >>
> >> >
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: depthSorting.JPG
Type: image/jpeg
Size: 34149 bytes
Desc: not available
URL: 

------------------------------

Message: 14
Date: Fri, 17 Dec 2010 14:28:47 +0100
From: Sebastien Jourdain 
Subject: Re: [vtkusers] Isosurface opacity problem
To: ??? 
Cc:
 vtkusers at vtk.org
Message-ID:
??? 
Content-Type: text/plain; charset=EUC-KR

I don't know if it is a VTK problem, but ParaView is using vtk 5.6 (at least).
On the other hand I don't know the underneath setting inside ParaView
for the opacity.
Maybe you can ask what are those setting so you can reproduce them
inside your vtk application on the ParaView mailing list.

Seb

PS: How did you set the depth peeling/sorting inside your code ?

2010/12/17 ??? :
> Yes it looks normal in ParaView.
>
> But In my application, after
 applying depth sorting,
> the iso-surface looks like attached file.
>
> Is it vtk version problem ? My vtk is 5.2.1
>
> 2010? 12? 17? ?? 9:59, Sebastien Jourdain ??
> ?:
>>
>> Ok,
>>
>> but this is normal because the ContourFilter will generate a triangulated
>> mesh.
>>
>> Seb
>>
>> 2010/12/17 ??? :
>> > I sent you two images, input file and iso-contour image.
>> > I had no problem to look at input file and iso-contour.
>> >
>> > Problem is
>> > when I set Representation option with "Surface with edges".
>>
 >
>> > Input file image looks normal but iso-contour image gone through
>> > vtkMarchingContourFilter? has triangles.
>> > Thank you very much.
>> >
>> > 2010? 12? 17? ?? 5:35, Sebastien Jourdain
>> > ??
>> > ?:
>> >>
>> >> The reason is because you ask to look at the input file and not the
>> >> iso-contour. The little eye on the left is disable in front of the
>> >> contour.
>> >>
>> >> Seb
>> >>
>> >> PS: Once you change something on a filter, don't forget to click on
>> >> Apply
>> >>
>> >> 2010/12/17 ??? :
>> >> > I'm very sorry for bothering you.
>> >>
 >
>> >> > I got something interesting.
>> >> >
>> >> > In the ParaView, when I set Representation with "Surface with edges".
>> >> >
>> >> > The isosurface image went through vtkMarchingContourFilter has the
>> >> > triangles.
>> >> > But the original image looks normal.
>> >> >
>> >> > I have used vtkCleanPolyData and vtkPolyDataNormals.
>> >> >
>> >> > I attached two iamges.
>> >> >
>> >> > Thank you ver much.
>> >> >
>> >> > Lee.
>> >> >
>> >> > 2010? 12? 17? ?? 12:55, ??? ?? ?:
>> >> >>
>> >> >> Thank you for your advice
>> >>
 >>
>> >> >> I loaded my isosurface into ParaView and set opacity under 1.0.
>> >> >> It looks normal ~
>> >> >>
>> >> >> Is this means that the ParaView do something special to solve
>> >> >> transparency
>> >> >> problem ?
>> >> >>
>> >> >> I attached the result.
>> >> >>
>> >> >> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
>> >> >> ?? ?:
>> >>
 >>>
>> >> >>> How did you defined your unstructured grid ? It seems that some
>> >> >>> inner
>> >> >>> surface are detected...
>> >> >>> This could happen if you duplicate the points so each cell has its
>> >> >>> own
>> >> >>> points ?
>> >> >>>
>> >> >>> Try to load your data into ParaView and see if you can reproduce
>> >> >>> the
>> >> >>> problem.
>> >> >>>
>> >> >>> Seb
>> >> >>>
>> >> >>> 2010/12/15 ??? :
>> >> >>> > Sorry to interrupt you again.
>> >>
 >>> >
>> >> >>> > I attach two images.
>> >> >>> >
>> >> >>> > Before and after adding depth sorting.
>> >> >>> > There are some differences.
>> >> >>> >
>> >> >>> > My graphics card seems not to support depth peeling.
>> >> >>> >
>> >> >>> > Thank you very mush.
>> >> >>> >
>> >> >>> > Lee.
>> >> >>> >
>> >> >>> > 2010/12/15 Sebastien Jourdain 
>> >> >>> >>
>> >> >>> >> You should enable depth peeling on the renderer to
 fix most of
>> >> >>> >> the
>> >> >>> >> artefact. But the rendering will be slower.
>> >> >>> >>
>> >> >>> >> Seb
>> >> >>> >>
>> >> >>> >> On Tue, Dec 14, 2010 at 10:01 AM, ??? 
>> >> >>> >> wrote:
>> >> >>> >> > Dears
>> >> >>> >> >
>> >> >>> >> > I visualized isosurface using vtkMarchingContourFilter from
>> >> >>> >> > vtkUnstructuredGrid.
>> >> >>> >> >
>> >> >>> >> > When the opacity is 1.0 , created picture looks normal.
>>
 >> >>> >> >
>> >> >>> >> > But when i adjust opacity to below 1.0, the picture has
>> >> >>> >> > speckles
>> >> >>> >> > depends
>> >> >>> >> > on the position.
>> >> >>> >> >
>> >> >>> >> > Do you have any solution ?
>> >> >>> >> >
>> >> >>> >> > I'll really appreciate it.
>> >> >>> >> >
>> >> >>> >> > Attached images
>> >> >>> >> >
>> >> >>> >> > _______________________________________________
>> >> >>> >> > Powered by www.kitware.com
>> >> >>> >> >
>> >>
 >>> >> > Visit other Kitware open-source projects at
>> >> >>> >> > http://www.kitware.com/opensource/opensource.html
>> >> >>> >> >
>> >> >>> >> > Please keep messages on-topic and check the VTK FAQ at:
>> >> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>> >> >>> >> >
>> >> >>> >> > Follow this link to subscribe/unsubscribe:
>> >> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >> >>> >> >
>> >>
 >>> >> >
>> >>
 >>> >
>> >> >>> >
>> >> >>
>> >> >
>> >> >
>> >
>> >
>
>


------------------------------

Message: 15
Date: Fri, 17 Dec 2010 22:36:10 +0900
From: ??? 
Subject: Re: [vtkusers] Isosurface opacity problem
To: Sebastien Jourdain 
Cc: vtkusers at vtk.org
Message-ID:
??? 
Content-Type: text/plain; charset="euc-kr"

Thank you for your invaluable advice.
I really appreciate it.

Here is my depth sorting code just like vtk example.

vtkSmartPointer camera = vtkCamera::New();
? renderer_->SetActiveCamera
 (camera);
? contourFilter->SetInput(input);

? vtkSmartPointer depthSort =
vtkDepthSortPolyData::New();
? depthSort->SetInputConnection(contourFilter->GetOutputPort());
? depthSort->SetDirectionToBackToFront();
? depthSort->SetVector(1, 1, 1);
? depthSort->SetCamera(camera);
? depthSort->SortScalarsOn();
? depthSort->Update();

? ugridMapper->SetInput(depthSort->GetOutput());



2010? 12? 17? ?? 10:28, Sebastien Jourdain ??
?:

> I don't know if it is a VTK problem, but ParaView is using vtk 5.6 (at
> least).
> On the other hand I don't know the underneath setting inside ParaView
> for the opacity.
> Maybe you can ask what are those setting so you can reproduce them
> inside your vtk application on the
 ParaView mailing list.
>
> Seb
>
> PS: How did you set the depth peeling/sorting inside your code ?
>
> 2010/12/17 ??? :
> > Yes it looks normal in ParaView.
> >
> > But In my application, after applying depth sorting,
> > the iso-surface looks like attached file.
> >
> > Is it vtk version problem
 ? My vtk is 5.2.1
> >
> > 2010? 12? 17? ?? 9:59, Sebastien Jourdain <
> sebastien.jourdain at kitware.com>??
> > ?:
> >>
> >> Ok,
> >>
> >> but this is normal because the ContourFilter will generate a
> triangulated
> >> mesh.
> >>
> >> Seb
> >>
> >> 2010/12/17 ??? :
> >> > I sent you two images, input file and iso-contour image.
> >> > I had no problem to look at input file and iso-contour.
> >> >
> >> > Problem is
> >> > when I set Representation option with "Surface with edges".
> >> >
>
 >> > Input file image looks normal but iso-contour image gone through
> >> > vtkMarchingContourFilter? has triangles.
> >> > Thank you very much.
> >> >
> >> > 2010? 12? 17? ?? 5:35, Sebastien Jourdain
> >> > ??
> >> > ?:
> >> >>
> >> >> The reason is because you ask to look at the input file and not the
> >> >> iso-contour. The little eye on the left is disable in front of the
> >> >> contour.
> >> >>
> >> >> Seb
> >> >>
> >> >> PS: Once you change something on a filter, don't forget to click on
> >> >> Apply
> >> >>
>
 >> >> 2010/12/17 ??? :
> >> >> > I'm very sorry for bothering you.
> >> >> >
> >> >> > I got something interesting.
> >> >> >
> >> >> > In the ParaView, when I set Representation with "Surface with
> edges".
> >> >> >
> >> >> > The isosurface image went through vtkMarchingContourFilter has the
> >> >> > triangles.
> >> >> > But the original image looks normal.
> >> >> >
> >> >> > I have used vtkCleanPolyData and vtkPolyDataNormals.
> >> >> >
> >> >> > I attached two iamges.
> >> >> >
> >> >> > Thank you ver
 much.
> >> >> >
> >> >> > Lee.
> >> >> >
> >> >> > 2010? 12? 17? ?? 12:55, ??? ?? ?:
> >> >> >>
> >> >> >> Thank you for your advice
> >> >> >>
> >> >> >> I loaded my isosurface into ParaView and set opacity under 1.0.
> >> >> >> It looks normal ~
> >> >> >>
> >> >> >> Is this means that the ParaView do something special to solve
> >> >> >> transparency
> >> >> >> problem ?
> >> >> >>
> >> >> >> I attached the result.
> >> >> >>
> >> >> >> 2010? 12? 15? ??
 11:21, Sebastien Jourdain
> >> >> >> ?? ?:
> >> >> >>>
> >> >> >>> How did you defined your unstructured grid ? It seems that some
> >> >> >>> inner
> >> >> >>> surface are detected...
> >> >> >>> This could happen if you duplicate the points so each cell has
> its
> >> >> >>> own
> >> >> >>> points ?
> >> >> >>>
> >> >> >>> Try to load your data into ParaView and see if you can reproduce
> >> >> >>> the
> >> >> >>> problem.
> >> >> >>>
> >> >>
 >>> Seb
> >> >> >>>
> >> >> >>> 2010/12/15 ??? :
> >> >> >>> > Sorry to interrupt you again.
> >> >> >>> >
> >> >> >>> > I attach two images.
> >> >> >>> >
> >> >> >>> > Before and after adding depth sorting.
> >> >> >>> > There are some differences.
> >> >> >>> >
> >> >> >>> > My graphics card seems not to support depth peeling.
> >> >> >>> >
> >> >> >>> > Thank you very mush.
> >> >> >>> >
> >> >> >>> > Lee.
> >>
 >> >>> >
> >> >> >>> > 2010/12/15 Sebastien Jourdain 
> >> >> >>> >>
> >> >> >>> >> You should enable depth peeling on the renderer to fix most of
> >> >> >>> >> the
> >> >> >>> >> artefact. But the rendering will be slower.
> >> >> >>> >>
> >> >> >>> >> Seb
> >> >> >>> >>
> >> >> >>> >> On Tue, Dec 14, 2010 at 10:01 AM, ??? 
> >> >> >>> >> wrote:
> >>
 >> >>> >> > Dears
> >> >> >>> >> >
> >> >> >>> >> > I visualized isosurface using vtkMarchingContourFilter from
> >> >> >>> >> > vtkUnstructuredGrid.
> >> >> >>> >> >
> >> >> >>> >> > When the opacity is 1.0 , created picture looks normal.
> >> >> >>> >> >
> >> >> >>> >> > But when i adjust opacity to below 1.0, the picture has
> >> >> >>> >> > speckles
> >> >> >>> >> > depends
> >> >> >>> >> > on the position.
> >> >> >>> >> >
> >> >> >>> >> > Do you have any solution ?
> >> >>
 >>> >> >
> >> >> >>> >> > I'll really appreciate it.
> >> >> >>> >> >
> >> >> >>> >> > Attached images
> >> >> >>> >> >
> >> >> >>> >> > _______________________________________________
> >> >> >>> >> > Powered by www.kitware.com
> >> >> >>> >> >
> >> >> >>> >> > Visit other Kitware open-source projects at
> >> >> >>> >> > http://www.kitware.com/opensource/opensource.html
> >> >> >>> >> >
> >> >> >>> >> > Please keep messages on-topic and check the VTK
 FAQ at:
>
 >> >> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
> >> >> >>> >> >
> >> >> >>> >> > Follow this link to subscribe/unsubscribe:
> >> >> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
> >> >> >>> >> >
> >> >> >>> >> >
> >> >> >>> >
> >> >> >>> >
> >> >> >>
> >> >> >
> >> >> >
> >> >
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

------------------------------

Message: 16
Date: Fri, 17 Dec 2010 05:40:57 -0800 (PST)
From: h0ppel 
Subject: [vtkusers] convert cutterline in scalardata
To: vtkusers at vtk.org
Message-ID: <1292593257139-3309409.post at n5.nabble.com>
Content-Type: text/plain; charset=us-ascii


Hi,

im cutting a 3d polydatasource with a cutter. I get as result a polydata
line from the cutter, but now I need this line
 in scalardata to save it in
an array?
Are there any convertigfunctions given?

thanks
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/convert-cutterline-in-scalardata-tp3309409p3309409.html
Sent from the VTK - Users mailing list archive at Nabble.com.


------------------------------

Message: 17
Date: Fri, 17 Dec 2010 05:43:46 -0800 (PST)
From: Rachel 
Subject: Re: [vtkusers] Line/triangle intersection
To: vtkusers at vtk.org
Message-ID: <1292593426521-3309412.post at n5.nabble.com>
Content-Type: text/plain; charset=us-ascii


Yes . it same that if no intersection the GetNumberOfPoints() is 0. is it
correct?
-- 
View this message in
 context: http://vtk.1045678.n5.nabble.com/Line-triangle-intersection-tp1246634p3309412.html
Sent from the VTK - Users mailing list archive at Nabble.com.


------------------------------

Message: 18
Date: Fri, 17 Dec 2010 08:46:52 -0500
From: David Doria 
Subject: Re: [vtkusers] Line/triangle intersection
To: Rachel 
Cc: vtkusers at vtk.org
Message-ID:
??? 
Content-Type: text/plain; charset="iso-8859-1"

On Fri, Dec 17, 2010 at 8:43 AM, Rachel  wrote:

>
> Yes . it same that if no intersection
 the GetNumberOfPoints() is 0. is it
> correct?
>
>
Quickly looking through the code it looks like it returns 0 if there is no
intersection and 1 otherwise.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

------------------------------

Message: 19
Date: Fri, 17 Dec 2010 06:04:03 -0800 (PST)
From: Rachel 
Subject: Re: [vtkusers] Line/triangle intersection
To: vtkusers at vtk.org
Message-ID: <1292594643627-3309432.post at n5.nabble.com>
Content-Type: text/plain; charset=us-ascii


Thank you David for the quick reply?
 :)

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Line-triangle-intersection-tp1246634p3309432.html
Sent from the VTK - Users mailing list archive at Nabble.com.


------------------------------

Message: 20
Date: Fri, 17 Dec 2010 23:53:38 +0900
From: ??? 
Subject: Re: [vtkusers] Isosurface opacity problem
To: Sebastien Jourdain 
Cc: vtkusers at vtk.org
Message-ID:
??? 
Content-Type: text/plain; charset="euc-kr"

Thank you, I might solve the problem.

Using vtk 5.6.0, the problem is gone.
Even without depth
 sorting, the image is normal.

I'll look for another way to solve this problem with vkt 5.2.1

Thank you again.

Lee.

2010? 12? 17? ?? 10:36, ??? ?? ?:

> Thank you for your invaluable advice.
> I really appreciate it.
>
> Here is my depth sorting code just like vtk example.
>
> vtkSmartPointer camera = vtkCamera::New();
>???renderer_->SetActiveCamera
 (camera);
>???contourFilter->SetInput(input);
>
>???vtkSmartPointer depthSort =
> vtkDepthSortPolyData::New();
>???depthSort->SetInputConnection(contourFilter->GetOutputPort());
>???depthSort->SetDirectionToBackToFront();
>???depthSort->SetVector(1, 1, 1);
>???depthSort->SetCamera(camera);
>???depthSort->SortScalarsOn();
>???depthSort->Update();
>
>???ugridMapper->SetInput(depthSort->GetOutput());
>
>
>
> 2010? 12? 17? ?? 10:28, Sebastien Jourdain  >?? ?:
>
> I don't know if it is a VTK problem, but ParaView
 is using vtk 5.6 (at
>> least).
>> On the other hand I don't know the underneath setting inside ParaView
>> for the opacity.
>> Maybe you can ask what are those setting so you can reproduce them
>> inside your vtk application on the ParaView mailing list.
>>
>> Seb
>>
>> PS: How did you set the depth peeling/sorting inside your code ?
>>
>> 2010/12/17 ??? :
>> > Yes it looks normal in ParaView.
>> >
>> > But In my application, after applying depth sorting,
>> > the iso-surface looks like attached file.
>> >
>> > Is it vtk version problem ? My vtk is 5.2.1
>> >
>> > 2010? 12? 17? ?? 9:59, Sebastien Jourdain <
>> sebastien.jourdain at kitware.com>??
>> > ?:
>>
 >>
>> >> Ok,
>> >>
>> >> but this is normal because the ContourFilter will generate a
>> triangulated
>> >> mesh.
>> >>
>> >> Seb
>> >>
>> >> 2010/12/17 ??? :
>> >> > I sent you two images, input file and iso-contour image.
>> >> > I had no problem to look at input file and iso-contour.
>> >> >
>> >> > Problem is
>> >> > when I set Representation option with "Surface with edges".
>> >> >
>> >> > Input file image looks
 normal but iso-contour image gone through
>> >> > vtkMarchingContourFilter? has triangles.
>> >> > Thank you very much.
>> >> >
>> >> > 2010? 12? 17? ?? 5:35, Sebastien Jourdain
>> >> > ??
>> >> > ?:
>> >> >>
>> >> >> The reason is because you ask to look at the input file and not the
>> >> >> iso-contour. The little eye on the left is disable in front of the
>> >> >> contour.
>> >> >>
>> >> >> Seb
>> >> >>
>> >> >> PS: Once you change something on a filter, don't forget to click on
>> >> >> Apply
>>
 >> >>
>> >> >> 2010/12/17 ??? :
>> >> >> > I'm very sorry for bothering you.
>> >> >> >
>> >> >> > I got something interesting.
>> >> >> >
>> >> >> > In the ParaView, when I set Representation with "Surface with
>> edges".
>> >> >> >
>> >> >> > The isosurface image went through vtkMarchingContourFilter has the
>> >> >> > triangles.
>> >> >> > But the original image looks normal.
>> >> >> >
>> >> >> > I have used vtkCleanPolyData and vtkPolyDataNormals.
>> >> >> >
>> >> >> > I attached two
 iamges.
>> >> >> >
>> >> >> > Thank you ver much.
>> >> >> >
>> >> >> > Lee.
>> >> >> >
>> >> >> > 2010? 12? 17? ?? 12:55, ??? ?? ?:
>> >> >> >>
>> >> >> >> Thank you for your advice
>> >> >> >>
>> >> >> >> I loaded my isosurface into ParaView and set opacity under 1.0.
>> >> >> >> It looks normal ~
>> >> >> >>
>> >> >> >> Is this means that the ParaView do something special to solve
>> >> >> >> transparency
>> >> >> >> problem ?
>> >> >>
 >>
>> >> >> >> I attached the result.
>> >> >> >>
>> >> >> >> 2010? 12? 15? ?? 11:21, Sebastien Jourdain
>> >> >> >> ?? ?:
>> >> >> >>>
>> >> >> >>> How did you defined your unstructured grid ? It seems that some
>> >> >> >>> inner
>> >> >> >>> surface are detected...
>> >> >> >>> This could happen if you duplicate the points so each cell has
>> its
>> >> >> >>> own
>> >> >> >>> points ?
>> >> >> >>>
>> >> >> >>> Try to load
 your data into ParaView and see if you can reproduce
>> >> >> >>> the
>> >> >> >>> problem.
>> >> >> >>>
>> >> >> >>> Seb
>> >> >> >>>
>> >> >> >>> 2010/12/15 ??? :
>> >> >> >>> > Sorry to interrupt you again.
>> >> >> >>> >
>> >> >> >>> > I attach two images.
>> >> >> >>> >
>> >> >> >>> > Before and after adding depth sorting.
>> >> >> >>> > There are some differences.
>> >> >> >>> >
>> >> >> >>> > My
 graphics card seems not to support depth peeling.
>> >> >> >>> >
>> >> >> >>> > Thank you very mush.
>> >> >> >>> >
>> >> >> >>> > Lee.
>> >> >> >>> >
>> >> >> >>> > 2010/12/15 Sebastien Jourdain > >
>> >> >> >>> >>
>> >> >> >>> >> You should enable depth peeling on the renderer to fix most
>> of
>> >> >> >>> >> the
>> >> >> >>> >> artefact. But the rendering will be slower.
>> >> >> >>> >>
>> >> >>
 >>> >> Seb
>> >> >> >>> >>
>> >> >> >>> >> On Tue, Dec 14, 2010 at 10:01 AM, ??? 
>> >> >> >>> >> wrote:
>> >> >> >>> >> > Dears
>> >> >> >>> >> >
>> >> >> >>> >> > I visualized isosurface using vtkMarchingContourFilter from
>> >> >> >>> >> > vtkUnstructuredGrid.
>> >> >> >>> >> >
>> >> >> >>> >> > When the opacity is 1.0 , created picture looks normal.
>> >> >> >>> >> >
>> >> >> >>> >> > But when i adjust opacity to
 below 1.0, the picture has
>> >> >> >>> >> > speckles
>> >> >> >>> >> > depends
>> >> >> >>> >> > on the position.
>> >> >> >>> >> >
>> >> >> >>> >> > Do you have any solution ?
>> >> >> >>> >> >
>> >> >> >>> >> > I'll really appreciate it.
>> >> >> >>> >> >
>> >> >> >>> >> > Attached images
>> >> >> >>> >> >
>> >> >> >>> >> > _______________________________________________
>> >> >> >>> >> > Powered by www.kitware.com
>> >> >> >>> >> >
>> >>
 >> >>> >> > Visit other Kitware open-source projects at
>> >> >> >>> >> > http://www.kitware.com/opensource/opensource.html
>> >> >> >>> >> >
>> >> >> >>> >> > Please keep messages on-topic and check the VTK FAQ at:
>> >> >> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>> >> >> >>> >> >
>> >> >> >>> >> > Follow this link to subscribe/unsubscribe:
>> >> >> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >> >> >>>
 >> >
>> >> >> >>> >> >
>> >> >> >>> >
>> >> >> >>> >
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >
>> >> >
>> >
>> >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

------------------------------

_______________________________________________
vtkusers mailing list
vtkusers at vtk.org
http://www.vtk.org/mailman/listinfo/vtkusers


End of vtkusers Digest, Vol 80, Issue 24
****************************************



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From rodrigo.geof at gmail.com  Fri Dec 17 12:34:11 2010
From: rodrigo.geof at gmail.com (rodrigo)
Date: Fri, 17 Dec 2010 09:34:11 -0800 (PST)
Subject: [vtkusers] How to create a Image mapper to display seismic wiggles
Message-ID: <1292607251398-3309746.post@n5.nabble.com>


Dear List,

I want to create a new image mapper to display seismic data as wiggles (here
is an example of how wiggles look like
http://www.sub-surfrocks.co.uk/images/pat.png). And I was hoping that
someone could give me some guidelines on how to do that in a efficient way.

Basically, what I need to know is how to do a mapper that draws 2d lines and
filled 2d polygons based on a vtkImageData with z = 0 and a scalar as
amplitude (2d data)


Thanks in advance,

Rodrigo
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-create-a-Image-mapper-to-display-seismic-wiggles-tp3309746p3309746.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From vinicius.ras at gmail.com  Fri Dec 17 17:59:26 2010
From: vinicius.ras at gmail.com (=?ISO-8859-1?Q?Vinicius_Rog=E9rio_Araujo_Silva?=)
Date: Fri, 17 Dec 2010 19:59:26 -0300
Subject: [vtkusers] Distance from eye to viewplane
In-Reply-To: 
References: 
	
Message-ID: 

Well, these conversion functions will help me a lot.
But I got a little confused about the viewplane now..

Can I consider the near clipping plane as the viewplane?
Are they the same thing?

I'll try to explain my problem a bit further.
I'm trying to implement a selection algorithm which involves a cone. The
user should be able to select points that lie inside of that "virtual cone".
Because of my application's requirements, the user should be able to provide
two things to the application: a radius R and an height H.
Then the application should then be able to calculate the cone in the
following way: the height of the cone will be given by H, and the radius
will be calculated as a value proportional to H, in such a way that if H
equals the distance from the camera to the viewplane, the radius of the
cone's base will be R.

That is why it is so important to me to find the distance from the camera to
the viewplane.
Also, I've tried using the near clipping plane as the "viewplane" of my
problem, but unfortunately it did not produce the results I've expected.

Em 17 de dezembro de 2010 02:02, David Gobbi escreveu:

> 2010/12/16 Vinicius Rog?rio Araujo Silva :
> > Hi all,
> > I'm new to VTK and after spending some time searching, I've decided to
> join
> > the mailing list to see if you guys can help solving my questions.
> > It seems pretty simple, yet I just couldn't find a way to solve it.
> > Question is:
> > Is there any way to retrieve the distance between the eye of projection
> > ("camera") and the view plane?
> > Or is there any way I can retrieve the plane equation for the view plane?
> > Any help is really apreciated. Thank you.
>
> Camera->GetClippingRange() is probably what you want, it will return the
> distance from the camera to the near and the far clipping planes.  You can
> use Camera->GetViewPlaneNormal() to get the normal.
>
> The renderer also has methods for doing coordinate conversion between
> display coordinates (i.e. pixels at the view plane) and world coordinates
> (i.e. 3D coordinates in the scene):
>
> Renderer->SetDisplayPoint(x, y, z);  // use z = 0 for view plane
> Renderer->DisplayToWorld();
> double p[3];
> Renderer->GetWorldPoint(p);
>
> So you can, for instance, give the display coords for the four corners of
> your window, and this will provide the 3D coords corresponding to the
> corners of the view plane.  Display coords start from (0,0) in the lower
> left corner of the window.
>
>   David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From david.gobbi at gmail.com  Fri Dec 17 18:30:09 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Fri, 17 Dec 2010 16:30:09 -0700
Subject: [vtkusers] Distance from eye to viewplane
In-Reply-To: 
References: 
	
	
Message-ID: 

2010/12/17 Vinicius Rog?rio Araujo Silva 

> Well, these conversion functions will help me a lot.
> But I got a little confused about the viewplane now..
>
> Can I consider the near clipping plane as the viewplane?
> Are they the same thing?
>

As far as I know, any plane that is parallel to the near or
far clipping planes can be considered a "view plane".  But since you need to
know the distance, you have to choose one specific plane: usually the near
plane, the far plane, or the focal plane.

I'll try to explain my problem a bit further.
> I'm trying to implement a selection algorithm which involves a cone. The
> user should be able to select points that lie inside of that "virtual cone".
> Because of my application's requirements, the user should be able to
> provide two things to the application: a radius R and an height H.
> Then the application should then be able to calculate the cone in the
> following way: the height of the cone will be given by H, and the radius
> will be calculated as a value proportional to H, in such a way that if H
> equals the distance from the camera to the viewplane, the radius of the
> cone's base will be R.
>

You lost me here.  First you say that the user chooses R and H, and then you
say that R will be calculated.


> That is why it is so important to me to find the distance from the camera
> to the viewplane.
> Also, I've tried using the near clipping plane as the "viewplane" of my
> problem, but unfortunately it did not produce the results I've expected.
>

The viewplane that you choose should be the plane at the base of your cone.
 I'm guessing that your cone has its tip at the camera position, and has its
base either at the far clipping plane or at some position in between the
near and far clipping plane.  Wherever its base is, I'm guessing that you
should use that position as your view plane.  So the distance to the view
plane is H, i.e. whatever you choose as the height of the cone.  I might be
misunderstanding, though.

  David



>
> Em 17 de dezembro de 2010 02:02, David Gobbi escreveu:
>
> 2010/12/16 Vinicius Rog?rio Araujo Silva :
>> > Hi all,
>> > I'm new to VTK and after spending some time searching, I've decided to
>> join
>> > the mailing list to see if you guys can help solving my questions.
>> > It seems pretty simple, yet I just couldn't find a way to solve it.
>> > Question is:
>> > Is there any way to retrieve the distance between the eye of projection
>> > ("camera") and the view plane?
>> > Or is there any way I can retrieve the plane equation for the view
>> plane?
>> > Any help is really apreciated. Thank you.
>>
>> Camera->GetClippingRange() is probably what you want, it will return the
>> distance from the camera to the near and the far clipping planes.  You can
>> use Camera->GetViewPlaneNormal() to get the normal.
>>
>> The renderer also has methods for doing coordinate conversion between
>> display coordinates (i.e. pixels at the view plane) and world coordinates
>> (i.e. 3D coordinates in the scene):
>>
>> Renderer->SetDisplayPoint(x, y, z);  // use z = 0 for view plane
>> Renderer->DisplayToWorld();
>> double p[3];
>> Renderer->GetWorldPoint(p);
>>
>> So you can, for instance, give the display coords for the four corners of
>> your window, and this will provide the 3D coords corresponding to the
>> corners of the view plane.  Display coords start from (0,0) in the lower
>> left corner of the window.
>>
>>   David
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From robbie.banks at gmail.com  Fri Dec 17 19:59:27 2010
From: robbie.banks at gmail.com (Robbie Banks)
Date: Fri, 17 Dec 2010 16:59:27 -0800
Subject: [vtkusers] Combined Interaction Events
In-Reply-To: 
References: 	
	
Message-ID: <4d0c0706.0120970a.44b6.ffffeae1@mx.google.com>

Hi All,

 

I was looking to create a popup menu on my QVTKWidget to control aspects of
the data output.

 

Was wondering if there was a way to combine OnKeyDown() and
OnRightButtonDown() events to create a Popup when the user holds shift and
the mouse button. I've seen example of changing the interaction for single
events, but not combined ones.

 

Cheers

Robbie

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From yxp233 at postech.ac.kr  Fri Dec 17 20:37:33 2010
From: yxp233 at postech.ac.kr (Xiaopeng Yang)
Date: Sat, 18 Dec 2010 10:37:33 +0900
Subject: [vtkusers] Programming challenges with QT, VTK, and ITK
In-Reply-To: <009c01cb9e02$28d0b200$7a721600$@park@case.edu>
References: <008401cb7573$2c99b1f0$85cd15d0$@ac.kr>
	<005b01cb75dc$974fb7b0$c5ef2710$@park@case.edu>
	<006e01cb9de3$c1f902d0$45eb0870$@ac.kr>
	<009c01cb9e02$28d0b200$7a721600$@park@case.edu>
Message-ID: <00ce01cb9e54$246fa890$6d4ef9b0$@ac.kr>

Dear Sam,

 

Thanks a lot for your help. It works now! Still I have another small question. Here is my code. You can find that I define some variables such as picked[3] and pixelIndex. Then I made the transformation from physical point to index in the interaction style class and showed the index in command line. So far everything worked well. And then in the int main code, I would like to use the transformed index to do something, for example using the index as a seed point for segmentation. However, the index always 0, 0, 0. Do you know why?

 

#include 

. . .

 

double picked[3];

 

typedef unsigned short  InputPixelType;

. . .

 

InputImageType::Pointer image = reader->GetOutput();

 

InputImageType::IndexType pixelIndex;

 

// Define interaction style

class MouseInteractorStylePP : public vtkInteractorStyleTrackballCamera

{

 public:

    static MouseInteractorStylePP* New();

    vtkTypeMacro(MouseInteractorStylePP, vtkInteractorStyleTrackballCamera);

    virtual void OnLeftButtonDown() 

    {

      . . .

        point[0]=picked[0];

        point[1]=picked[1];

        point[2]=picked[2];

              

      bool isInside = image->TransformPhysicalPointToIndex( point, pixelIndex ); 

 

      if ( isInside )

        {

        InputImageType::PixelType pixelValue = image->GetPixel( pixelIndex );

        pixelValue += 5;

        image->SetPixel( pixelIndex, pixelValue );

        }

      std::cout << "pixelIndex: " << pixelIndex[0] << " " << pixelIndex[1] << " " << pixelIndex[2] << std::endl; //works fine

     

      vtkInteractorStyleTrackballCamera::OnLeftButtonDown();

    }

};

vtkStandardNewMacro(MouseInteractorStylePP);

 

int main(int, char *[])

{

. . .

std::cout << "pixelIndex: " << pixelIndex[0] << " " << pixelIndex[1] << " " << pixelIndex[2] << std::endl; //Always zero

. . .

}

 

Merry Christmas and Happy new year!

 

Best regards,

Xiaopeng

???: (Samuel) Byeongjun Park [mailto:byeongjun.park at case.edu] 
????: 2010? 12? 18? ??? ?? 12:50
???: 'Xiaopeng Yang'
??: insight-users at itk.org; 'vtk'
??: RE: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Xiaopeng,

 

If you use iktImageToVTKImageFilter, it means the image data is in itk::Image object, not in vtkImageData.

So if you got world coordinate, then the first three elements of world coordinate array is the PhysicalPoint of itk::Image.

You can get the index of itkImage using itk::Image::TransformPhysicalPointToIndex(..).

You shouldn?t read the image to both of itk::Image and vtkImageData.

 

Summarizing..

1.       Read the image to itk::Image.

2.       Apply itkImageToVTKImageFilter

3.       Get a point from vtk

4.       Change it to world coordinate point

5.       Store the x,y,z coordinate into Itk::Image::PointType object

6.       Itk::Image::TransformPhysicalPointToIndex()

 

Now you get the index of the itk::Image where you picked in vtk window.

 

Good luck and merry Christmas!

 

Sam.

-------------- Innovation for the Future Radiation Oncology  (http://rophys.meds.case.edu  )

(Samuel) Byeongjun Park, Ph.D.  -- Research associate of Sohn Lab.

Case Western Reserve Univerisity, School of Medicine

Visiting: Wood building W517,  Phone: 1-216-368-6583

 

 

 

From: Xiaopeng Yang [mailto:yxp233 at postech.ac.kr] 
Sent: Friday, December 17, 2010 7:13 AM
To: '(Samuel) Byeongjun Park'
Cc: insight-users at itk.org; 'vtk'
Subject: RE: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Hello Park,

 

It has been a very long time since I received your help. These days I am still working on this problem. Now I can get the VTK coordinate (i.e., world coordinate). You mentioned that if I use itk ImageToVTKImageFilter, I can directly use the VTK coordinate as ITK coordinate. However, I could not understand clearly. In my program, I need ITK coordinate for applying ITK region growing algorithm. I do not know how to translate VTK coordinate to ITK coordinate. Could you please explain more in detail?

 

Thanks very much!

 

Xiaopeng

 

???: (Samuel) Byeongjun Park [mailto:byeongjun.park at case.edu] 
????: 2010? 10? 27? ??? ?? 10:41
???: 'Xiaopeng Yang'
??: 'vtk'
??: RE: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Hi,

 

My name is Sam Park. Since you told you are using QT, I think you are using QVTKWidget.

You can make your own QVTK widget class inheriting QVTKWidget.

In there, override 

   Virtual void mousePressEvent(QMouseEvent *pevent);

You can read the mouse position in QVTKWidget window.

Then,

1.       Get the QT coordinate point (x,y)

2.       Flip y value by  y=height-y;

3.       Get the pointer of the Render in your QVTKWidget object.

4.       double wpoint[4];

5.       Render->SetDisplayPoint(x,y,0);

6.       Render->DisplayToWorld(); 

7.       Render->GetWorldPoint(wpoint);

 

Now You have the VTK coordinate of the point you clicked.

If you imported CT image in ITK and utilized itk::ImageToVTKImageFilter, 

you can directly use the VTK coordinate as ITK coordinate.

 

Good luck.

 

Sam.

-------------- Innovation for the Future Radiation Oncology 

(Samuel) Byeongjun Park, Ph.D.  -- Research associate of Sohn Lab.

Case Western Reserve Univerisity, School of Medicine

Visiting: Wood building W517,  Phone: 1-216-368-6583

 

 

 

From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Xiaopeng Yang
Sent: Tuesday, October 26, 2010 9:06 PM
To: 'Luis Ibanez'
Cc: 'itk'; 'vtk'
Subject: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Dear Luis,

 

How are you doing? Thank you very much for your help so far. Sorry to ask you a question again.

 

I am now developing a liver segmentation program using QT, VTK, and ITK based on CT images. In my program, fast marching algorithm is used to extract the liver by multiple seed points. To pick the positions of the seed points, vtkImagePlaneWidget is applied. The problem is how to save the multiple seed points I selected by left-clicking of the mouse so that I do not need to type those positions into the code, which is time consuming.

 

Please provide me with your suggestions. I working on this for almost one week still I cannot figure it out.

 

Thanks,

Xiaopeng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From kjafari at rad.hfh.edu  Fri Dec 17 21:45:54 2010
From: kjafari at rad.hfh.edu (Jafari, Kourosh)
Date: Fri, 17 Dec 2010 21:45:54 -0500
Subject: [vtkusers] Multiple renderes and interactors in single window?
Message-ID: <6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F8728@RISMAIL1.rad.hfh.edu>

Dear VTK users,

I have a single render window and 4 renderes, 3 of them showing 2D images and one showing 3D object. Currently, I can only assign one interactor to the whole render window.  But I need to use different interactors for the renderers: vtkInteractorStyleImage for images and vtkInteractorStyleTrackballCamera for the 3D object. How do I do that?

I highly appreciate your help.

Regards,
Kourosh


From yxp233 at postech.ac.kr  Fri Dec 17 21:55:29 2010
From: yxp233 at postech.ac.kr (Xiaopeng Yang)
Date: Sat, 18 Dec 2010 11:55:29 +0900
Subject: [vtkusers] Iso surface rendering
Message-ID: <00e801cb9e5f$0780bbb0$16823310$@ac.kr>

Dear Users,

 

I applied vtkContourFilter to extract iso surface from binary images of
blood vessel. It works well with the blood vessel. The 3D visualization
result looks good. However, when I applied the same process to the
skeletonized vessel, the 3D visualization result looks not good. Only a few
discrete points appears on the screen. When I turn the skeletonized vessel,
some points show up while some disappear. I used another software MITK to
visualize the same skeletonized vessel, the result looks fine. Do you have
any idea about my problem?

 

Thanks,

Xiaopeng

 

Here are the results in my program and another program MITK:

 

   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 15251 bytes
Desc: not available
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 5491 bytes
Desc: not available
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 9052 bytes
Desc: not available
URL: 

From daviddoria at gmail.com  Fri Dec 17 22:00:24 2010
From: daviddoria at gmail.com (David Doria)
Date: Fri, 17 Dec 2010 22:00:24 -0500
Subject: [vtkusers] Multiple renderes and interactors in single window?
In-Reply-To: <6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F8728@RISMAIL1.rad.hfh.edu>
References: <6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F8728@RISMAIL1.rad.hfh.edu>
Message-ID: 

On Fri, Dec 17, 2010 at 9:45 PM, Jafari, Kourosh  wrote:
> Dear VTK users,
>
> I have a single render window and 4 renderes, 3 of them showing 2D images and one showing 3D object. Currently, I can only assign one interactor to the whole render window. ?But I need to use different interactors for the renderers: vtkInteractorStyleImage for images and vtkInteractorStyleTrackballCamera for the 3D object. How do I do that?
>
> I highly appreciate your help.
>
> Regards,
> Kourosh

I believe the only way to do this is to use multiple QVTKWidgets in a
Qt application:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindows

It may seem like overkill, but your application will definitely turn
out better using Qt anyway :)

David


From clinton at elemtech.com  Fri Dec 17 22:38:38 2010
From: clinton at elemtech.com (Clinton Stimpson)
Date: Fri, 17 Dec 2010 20:38:38 -0700
Subject: [vtkusers] Multiple renderes and interactors in single window?
In-Reply-To: 
References: <6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F8728@RISMAIL1.rad.hfh.edu>
	
Message-ID: 


On Dec 17, 2010, at 8:00 PM, David Doria wrote:

> On Fri, Dec 17, 2010 at 9:45 PM, Jafari, Kourosh  wrote:
>> Dear VTK users,
>> 
>> I have a single render window and 4 renderes, 3 of them showing 2D images and one showing 3D object. Currently, I can only assign one interactor to the whole render window.  But I need to use different interactors for the renderers: vtkInteractorStyleImage for images and vtkInteractorStyleTrackballCamera for the 3D object. How do I do that?
>> 
>> I highly appreciate your help.
>> 
>> Regards,
>> Kourosh
> 
> I believe the only way to do this is to use multiple QVTKWidgets in a
> Qt application:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindows
> 
> It may seem like overkill, but your application will definitely turn
> out better using Qt anyway :)


I'm sure you can still do it with one interactor and one render window.
You'll probably need your own custom interactor style that chooses which interactor style to delegate to based on the renderer under the mouse.

Clint

From vinicius.ras at gmail.com  Sat Dec 18 01:26:34 2010
From: vinicius.ras at gmail.com (=?ISO-8859-1?Q?Vinicius_Rog=E9rio_Araujo_Silva?=)
Date: Sat, 18 Dec 2010 03:26:34 -0300
Subject: [vtkusers] Distance from eye to viewplane
In-Reply-To: 
References: 
	
	
	
Message-ID: 

Actually, R is not the radius of the cone's base. Rather, the radius is
calculated based on the values of R and H.
One more thing. A question about your example:

Renderer->SetDisplayPoint(x, y, z);
Renderer->DisplayToWorld();
double p[3];
Renderer->GetWorldPoint(p);

Let me see if I understood it correctly.
If I set Z to a value that is equal to the Near Clipping Plane's distance,
then the output will be a point that lies on the near clipping plane?

Thank you for your answers!

Em 17 de dezembro de 2010 20:30, David Gobbi escreveu:

> 2010/12/17 Vinicius Rog?rio Araujo Silva 
>
>> Well, these conversion functions will help me a lot.
>> But I got a little confused about the viewplane now..
>>
>> Can I consider the near clipping plane as the viewplane?
>> Are they the same thing?
>>
>
> As far as I know, any plane that is parallel to the near or
> far clipping planes can be considered a "view plane".  But since you need to
> know the distance, you have to choose one specific plane: usually the near
> plane, the far plane, or the focal plane.
>
> I'll try to explain my problem a bit further.
>> I'm trying to implement a selection algorithm which involves a cone. The
>> user should be able to select points that lie inside of that "virtual cone".
>> Because of my application's requirements, the user should be able to
>> provide two things to the application: a radius R and an height H.
>> Then the application should then be able to calculate the cone in the
>> following way: the height of the cone will be given by H, and the radius
>> will be calculated as a value proportional to H, in such a way that if H
>> equals the distance from the camera to the viewplane, the radius of the
>> cone's base will be R.
>>
>
> You lost me here.  First you say that the user chooses R and H, and then
> you say that R will be calculated.
>
>
>> That is why it is so important to me to find the distance from the camera
>> to the viewplane.
>> Also, I've tried using the near clipping plane as the "viewplane" of my
>> problem, but unfortunately it did not produce the results I've expected.
>>
>
> The viewplane that you choose should be the plane at the base of your cone.
>  I'm guessing that your cone has its tip at the camera position, and has its
> base either at the far clipping plane or at some position in between the
> near and far clipping plane.  Wherever its base is, I'm guessing that you
> should use that position as your view plane.  So the distance to the view
> plane is H, i.e. whatever you choose as the height of the cone.  I might be
> misunderstanding, though.
>
>   David
>
>
>
>>
>> Em 17 de dezembro de 2010 02:02, David Gobbi escreveu:
>>
>> 2010/12/16 Vinicius Rog?rio Araujo Silva :
>>> > Hi all,
>>> > I'm new to VTK and after spending some time searching, I've decided to
>>> join
>>> > the mailing list to see if you guys can help solving my questions.
>>> > It seems pretty simple, yet I just couldn't find a way to solve it.
>>> > Question is:
>>> > Is there any way to retrieve the distance between the eye of projection
>>> > ("camera") and the view plane?
>>> > Or is there any way I can retrieve the plane equation for the view
>>> plane?
>>> > Any help is really apreciated. Thank you.
>>>
>>> Camera->GetClippingRange() is probably what you want, it will return the
>>> distance from the camera to the near and the far clipping planes.  You
>>> can
>>> use Camera->GetViewPlaneNormal() to get the normal.
>>>
>>> The renderer also has methods for doing coordinate conversion between
>>> display coordinates (i.e. pixels at the view plane) and world coordinates
>>> (i.e. 3D coordinates in the scene):
>>>
>>> Renderer->SetDisplayPoint(x, y, z);  // use z = 0 for view plane
>>> Renderer->DisplayToWorld();
>>> double p[3];
>>> Renderer->GetWorldPoint(p);
>>>
>>> So you can, for instance, give the display coords for the four corners of
>>> your window, and this will provide the 3D coords corresponding to the
>>> corners of the view plane.  Display coords start from (0,0) in the lower
>>> left corner of the window.
>>>
>>>   David
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From dongli at lasg.iap.ac.cn  Sat Dec 18 01:55:36 2010
From: dongli at lasg.iap.ac.cn (DONG Li)
Date: Sat, 18 Dec 2010 14:55:36 +0800
Subject: [vtkusers] How to plot polygon on the sphere
Message-ID: <3B9F6F96-E0D5-4479-A06E-03807C837FCE@lasg.iap.ac.cn>

Dear all,

I have calculated the Delaunay triangulation and Voronoi diagram of some data points on the SPHERE. How do I plot them on the sphere? The edge should be spherical great-circle. Any idea?

Best regards,

DONG Li




From david.gobbi at gmail.com  Sat Dec 18 02:05:14 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Sat, 18 Dec 2010 00:05:14 -0700
Subject: [vtkusers] Distance from eye to viewplane
In-Reply-To: 
References: 
	
	
	
	
Message-ID: 

2010/12/17 Vinicius Rog?rio Araujo Silva 

> Actually, R is not the radius of the cone's base. Rather, the radius is
> calculated based on the values of R and H.
> One more thing. A question about your example:
>
> Renderer->SetDisplayPoint(x, y, z);
> Renderer->DisplayToWorld();
> double p[3];
> Renderer->GetWorldPoint(p);
>
> Let me see if I understood it correctly.
> If I set Z to a value that is equal to the Near Clipping Plane's distance,
> then the output will be a point that lies on the near clipping plane?
>

Not quite.  In SetDisplayPoint(x, y, z), the "z" is a depth-buffer value in
the range [0, 1] where z=0 gives a point on the near clipping plane and z=1
gives a point on the far clipping plane.  The x and y are the screen pixel
offset from the lower left corner of the window.

  David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From daviddoria at gmail.com  Sat Dec 18 08:54:47 2010
From: daviddoria at gmail.com (David Doria)
Date: Sat, 18 Dec 2010 08:54:47 -0500
Subject: [vtkusers] How to plot polygon on the sphere
In-Reply-To: <3B9F6F96-E0D5-4479-A06E-03807C837FCE@lasg.iap.ac.cn>
References: <3B9F6F96-E0D5-4479-A06E-03807C837FCE@lasg.iap.ac.cn>
Message-ID: 

On Sat, Dec 18, 2010 at 1:55 AM, DONG Li  wrote:
> Dear all,
>
> I have calculated the Delaunay triangulation and Voronoi diagram of some data points on the SPHERE. How do I plot them on the sphere? The edge should be spherical great-circle. Any idea?
>
> Best regards,
>
> DONG Li

So you have a PolyData of a sphere (A) and a PolyData of some lines
that should be "on" the sphere (B)? I think you can just display both
of them but make the edges of (B) thicker and a different color:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/LineWidth

Maybe I misunderstood your goal?

David


From jimcp at cox.net  Sat Dec 18 12:07:53 2010
From: jimcp at cox.net (Jim Peterson)
Date: Sat, 18 Dec 2010 12:07:53 -0500
Subject: [vtkusers] How to plot polygon on the sphere
In-Reply-To: 
References: <3B9F6F96-E0D5-4479-A06E-03807C837FCE@lasg.iap.ac.cn>
	
Message-ID: <4D0CEA69.6030805@cox.net>

David Doria wrote:
> On Sat, Dec 18, 2010 at 1:55 AM, DONG Li  wrote:
>   
>> Dear all,
>>
>> I have calculated the Delaunay triangulation and Voronoi diagram of some data points on the SPHERE. How do I plot them on the sphere? The edge should be spherical great-circle. Any idea?
>>
>> Best regards,
>>
>> DONG Li
>>     
Maybe I am missing the lesson we are trying to explore here, but isn't a 
spherical great circle the points on the surface of the sphere that 
intersect with the plane described by the center of the sphere and the 
start and end points and "between" those two points? I think I would 
treat it as a clipping problem more than a spacial analysis.

Hope that helps,
Jim


From g.bogle at auckland.ac.nz  Sat Dec 18 17:59:50 2010
From: g.bogle at auckland.ac.nz (Gib Bogle)
Date: Sun, 19 Dec 2010 11:59:50 +1300
Subject: [vtkusers] Filling in blood vessels
Message-ID: <20101219115950.862603v5qb5uegh2@webmail.bioeng.auckland.ac.nz>

I've just started to become aware of the image-processing capabilities  
of VTK, and I'm wondering if I can use it for some tasks that I was  
expecting to use Amira for.  We are generating images in which the  
walls of blood vessels are stained, so that the vessels appear in 3D  
as tubes.  I believe the first processing step I need to make is to  
"fill in" the vessels, i.e. generate a thresholded 3D image in which  
the vessels appear solid.  Is this the kind of thing that VTK can  
handle?

Thanks
Gib

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



From mauromaiorca at gmail.com  Sat Dec 18 19:37:01 2010
From: mauromaiorca at gmail.com (Mauro Maiorca)
Date: Sun, 19 Dec 2010 11:37:01 +1100
Subject: [vtkusers] Filling in blood vessels
In-Reply-To: <20101219115950.862603v5qb5uegh2@webmail.bioeng.auckland.ac.nz>
References: <20101219115950.862603v5qb5uegh2@webmail.bioeng.auckland.ac.nz>
Message-ID: 

Hi Gib,

if I've understood correctly your problem, you want to segment ("fill
in") the vessels then render the segmented image.
VTK is great for rendering, but you might want to use ITK
(www.itk.org) for segmentation (for just a threshold you can still use
VTK - though).
You might also want to have a look to ITK-snap
(http://www.itksnap.org) and other VTK-related applications
(http://www.vtk.org/VTK/resources/applications.html).

cheers,
Mauro




On Sun, Dec 19, 2010 at 9:59 AM, Gib Bogle  wrote:
>
> I've just started to become aware of the image-processing capabilities of VTK, and I'm wondering if I can use it for some tasks that I was expecting to use Amira for. ?We are generating images in which the walls of blood vessels are stained, so that the vessels appear in 3D as tubes. ?I believe the first processing step I need to make is to "fill in" the vessels, i.e. generate a thresholded 3D image in which the vessels appear solid. ?Is this the kind of thing that VTK can handle?
>
> Thanks
> Gib
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers


From david.gobbi at gmail.com  Sat Dec 18 19:47:59 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Sat, 18 Dec 2010 17:47:59 -0700
Subject: [vtkusers] Filling in blood vessels
In-Reply-To: 
References: <20101219115950.862603v5qb5uegh2@webmail.bioeng.auckland.ac.nz>
	
Message-ID: 

Hi Gib,

I have a VTK filter that does thresholded flood-filling, it would do a
little better than thresholding by itself:
http://github.com/dgobbi/VTK/blob/5df7a182240c/Imaging/vtkImageFloodFill.h
http://github.com/dgobbi/VTK/blob/5df7a182240c/Imaging/vtkImageFloodFill.cxx
http://github.com/dgobbi/VTK/blob/5df7a182/Imaging/Testing/Tcl/TestFloodFill.tcl
But I'd have to agree with Mauro that vessel segmentation might be tough
with VTK alone.

  David

On Sat, Dec 18, 2010 at 5:37 PM, Mauro Maiorca wrote:

> Hi Gib,
>
> if I've understood correctly your problem, you want to segment ("fill
> in") the vessels then render the segmented image.
> VTK is great for rendering, but you might want to use ITK
> (www.itk.org) for segmentation (for just a threshold you can still use
> VTK - though).
> You might also want to have a look to ITK-snap
> (http://www.itksnap.org) and other VTK-related applications
> (http://www.vtk.org/VTK/resources/applications.html).
>
> cheers,
> Mauro
>
>
>
>
> On Sun, Dec 19, 2010 at 9:59 AM, Gib Bogle  wrote:
> >
> > I've just started to become aware of the image-processing capabilities of
> VTK, and I'm wondering if I can use it for some tasks that I was expecting
> to use Amira for.  We are generating images in which the walls of blood
> vessels are stained, so that the vessels appear in 3D as tubes.  I believe
> the first processing step I need to make is to "fill in" the vessels, i.e.
> generate a thresholded 3D image in which the vessels appear solid.  Is this
> the kind of thing that VTK can handle?
> >
> > Thanks
> > Gib
> >
> > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From g.bogle at auckland.ac.nz  Sun Dec 19 01:14:42 2010
From: g.bogle at auckland.ac.nz (Gib Bogle)
Date: Sun, 19 Dec 2010 19:14:42 +1300
Subject: [vtkusers] Filling in blood vessels
In-Reply-To: 
References: <20101219115950.862603v5qb5uegh2@webmail.bioeng.auckland.ac.nz>
	
Message-ID: <20101219191442.68866dkqexqdrjyq@webmail.bioeng.auckland.ac.nz>

Yes, I wasn't sure of the correct language.  I've heard of ITK, but  
have no experience with it.  Will check it out.

Thanks
Gib

Quoting Mauro Maiorca :

> Hi Gib,
>
> if I've understood correctly your problem, you want to segment ("fill
> in") the vessels then render the segmented image.
> VTK is great for rendering, but you might want to use ITK
> (www.itk.org) for segmentation (for just a threshold you can still use
> VTK - though).
> You might also want to have a look to ITK-snap
> (http://www.itksnap.org) and other VTK-related applications
> (http://www.vtk.org/VTK/resources/applications.html).
>
> cheers,
> Mauro
>
>
>
>
> On Sun, Dec 19, 2010 at 9:59 AM, Gib Bogle  wrote:
>>
>> I've just started to become aware of the image-processing  
>> capabilities of VTK, and I'm wondering if I can use it for some  
>> tasks that I was expecting to use Amira for. ?We are generating  
>> images in which the walls of blood vessels are stained, so that the  
>> vessels appear in 3D as tubes. ?I believe the first processing step  
>> I need to make is to "fill in" the vessels, i.e. generate a  
>> thresholded 3D image in which the vessels appear solid. ?Is this  
>> the kind of thing that VTK can handle?
>>
>> Thanks
>> Gib
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at  
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:  
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


From ritesh.haria at gmail.com  Sun Dec 19 03:05:41 2010
From: ritesh.haria at gmail.com (Ritesh Haria)
Date: Sun, 19 Dec 2010 13:35:41 +0530
Subject: [vtkusers] An unhandled exception of type
 'System.AccessViolationException' occurred in vtkFormsWindow.dll.. while
 using VTK .NET Wrapper
Message-ID: 

Dear Mr. Mark,

I am using Programming with VTK .NET Wrappers control
vtkFormsWindowControl (http://vtkdotnet.sourceforge.net/Programming.html)
user control to display a dicom image and add window level feature to it.
I am able to display the image. On right mouse click and drag it zooms in
and out as expected.
On left click and drag it should perform window and level operations. But
when I left click mouse, I get the following error:

An unhandled exception of type 'System.AccessViolationException' occurred in
vtkFormsWindow.dll

Additional information: Attempted to read or write protected memory. This is
often an indication that other memory is corrupt.

> vtkFormsWindow.dll!vtk::vtkFormsWindowControl::OnMouseDown(System::Windows::Forms::MouseEventArgs^
ea = 0x03cfe4d4) Line 401 C++


Kindly provide a feasible solution

Thanking you,
Ritesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From eliya.mir at gmail.com  Sun Dec 19 09:28:46 2010
From: eliya.mir at gmail.com (eliya.mir at gmail.com)
Date: Sun, 19 Dec 2010 16:28:46 +0200
Subject: [vtkusers] converting vtkPolydata to vtkUnstructuredgrid
Message-ID: 

found this way to transform a polydata to unstructuredgrid:


    disk = vtkDiskSource()
    disk.SetInnerRadius(internal_radius)
    disk.SetOuterRadius(external_radius)
    disk.SetRadialResolution(radial_resolution)
    disk.SetCircumferentialResolution(circumferential_resolution)
    disk_polyData = disk.GetOutput()
    disk_usg = vtkUnstructuredGrid()
    appendFilter = vtkAppendFilter()
    appendFilter.AddInput(disk_polyData)
    merge = vtkExtractUnstructuredGrid()
    merge.SetInputConnection(appendFilter.GetOutputPort())
    merge.MergingOn()
    merge.Update()
    disk_usg = merge.GetOutput()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From khan.imranh at gmail.com  Sun Dec 19 12:21:12 2010
From: khan.imranh at gmail.com (imran khan)
Date: Sun, 19 Dec 2010 12:21:12 -0500
Subject: [vtkusers] 32bit vtk app in a 64 bit Windows 7
Message-ID: 

I am noticing that my 32 bit vtk app runs on some 64 bits Windows 7 systems
and not others. I have tracked the potential
problem to be in the NVidia drivers nvoglv32.dll. I was wondering if others
have experienced similar problems and if so what
might be the solution.

Thanks in advance.

-- 
Imran 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From drescherjm at gmail.com  Sun Dec 19 12:36:03 2010
From: drescherjm at gmail.com (John Drescher)
Date: Sun, 19 Dec 2010 12:36:03 -0500
Subject: [vtkusers] 32bit vtk app in a 64 bit Windows 7
In-Reply-To: 
References: 
Message-ID: 

On Sun, Dec 19, 2010 at 12:21 PM, imran khan  wrote:
> I am noticing that my 32 bit vtk app runs on some 64 bits Windows 7 systems
> and not others. I have tracked the potential
> problem to be in the NVidia drivers nvoglv32.dll. I was wondering if others
> have experienced similar problems and if so what
> might be the solution.
>

Nope. All of my 32 bit vtk applications (cmake based + Qt + vtk + itk)
developed on 64 bit windows under visual studio 2008 work when I move
them to other machines. I have cmake add the runtimes to the generated
NSIS install package for my applications.

John


From Martin_Klamm at gmx.de  Mon Dec 20 03:16:25 2010
From: Martin_Klamm at gmx.de (BountyHuntA)
Date: Mon, 20 Dec 2010 00:16:25 -0800 (PST)
Subject: [vtkusers] Read DICOM memory stream to use in VTK
In-Reply-To: <1291987335899-3300278.post@n5.nabble.com>
References: <1291859270217-3298355.post@n5.nabble.com>
	
	<1291987335899-3300278.post@n5.nabble.com>
Message-ID: <1292832985474-3311717.post@n5.nabble.com>


Hello.
No one knows a solution for my problem?

Martin
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Read-DICOM-memory-stream-to-use-in-VTK-tp3298355p3311717.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From xabivtk at gmail.com  Mon Dec 20 03:54:42 2010
From: xabivtk at gmail.com (xabivtk)
Date: Mon, 20 Dec 2010 00:54:42 -0800 (PST)
Subject: [vtkusers] Problem with InterpolateScalarsBeforeMappingOn() &
	1-D cells
In-Reply-To: <3825624377384ADFAE16960EA7A9E945@pafec5>
References: <3825624377384ADFAE16960EA7A9E945@pafec5>
Message-ID: <1292835282031-3311730.post@n5.nabble.com>


Hi John,
I don't know how to resolve your problem, but i also had some issues with
InterpolateScalarsBeforeMappingOn reported in the mantis bug tracker with
the id 0010708.
Maybe you can fill it out with your case if it makes sense.

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-InterpolateScalarsBeforeMappingOn-1-D-cells-tp3308257p3311730.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From ritesh.haria at gmail.com  Mon Dec 20 04:22:37 2010
From: ritesh.haria at gmail.com (Ritesh Haria)
Date: Mon, 20 Dec 2010 14:52:37 +0530
Subject: [vtkusers] Fwd: An unhandled exception of type
 'System.AccessViolationException' occurred in vtkFormsWindow.dll.. while
 using VTK .NET Wrapper
In-Reply-To: 
References: 
Message-ID: 

---------- Forwarded message ----------
From: Ritesh Haria 
Date: Sun, Dec 19, 2010 at 1:35 PM
Subject: An unhandled exception of type 'System.AccessViolationException'
occurred in vtkFormsWindow.dll.. while using VTK .NET Wrapper
To: vtkusers at vtk.org


Dear Mr. Mark,

I am using Programming with VTK .NET Wrappers control
vtkFormsWindowControl (http://vtkdotnet.sourceforge.net/Programming.html)
user control to display a dicom image and add window level feature to it.
I am able to display the image. On right mouse click and drag it zooms in
and out as expected.
On left click and drag it should perform window and level operations. But
when I left click mouse, I get the following error:

An unhandled exception of type 'System.AccessViolationException' occurred in
vtkFormsWindow.dll

Additional information: Attempted to read or write protected memory. This is
often an indication that other memory is corrupt.

> vtkFormsWindow.dll!vtk::vtkFormsWindowControl::OnMouseDown(System::Windows::Forms::MouseEventArgs^
ea = 0x03cfe4d4) Line 401 C++


Kindly provide a feasible solution

Thanking you,
Ritesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From jcplatt at dsl.pipex.com  Mon Dec 20 05:14:02 2010
From: jcplatt at dsl.pipex.com (John Platt)
Date: Mon, 20 Dec 2010 10:14:02 -0000
Subject: [vtkusers] Problem with InterpolateScalarsBeforeMappingOn()
	&1-D cells
References: <3825624377384ADFAE16960EA7A9E945@pafec5>
	<1292835282031-3311730.post@n5.nabble.com>
Message-ID: <365FD98BD83347C391B22E09F21CFB00@pafec5>

Hi Xabi,

Thanks for your response. I have looked at your report. The scene you 
describe is slightly more complex. Here, there are simply 1D cells using 
vtkActor so perhaps there is a more fundamental problem.

I am quite prepared to do some debugging if someone could give a hint as 
where to start.

Thanks again for your reply.

John.





----- Original Message ----- 
From: "xabivtk" 
To: 
Sent: Monday, December 20, 2010 8:54 AM
Subject: Re: [vtkusers] Problem with InterpolateScalarsBeforeMappingOn() 
&1-D cells


>
> Hi John,
> I don't know how to resolve your problem, but i also had some issues with
> InterpolateScalarsBeforeMappingOn reported in the mantis bug tracker with
> the id 0010708.
> Maybe you can fill it out with your case if it makes sense.
>
> -- 
> View this message in context: 
> http://vtk.1045678.n5.nabble.com/Problem-with-InterpolateScalarsBeforeMappingOn-1-D-cells-tp3308257p3311730.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: 
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 




From mckinnondavid at gmail.com  Mon Dec 20 07:19:15 2010
From: mckinnondavid at gmail.com (David McKinnon)
Date: Mon, 20 Dec 2010 22:19:15 +1000
Subject: [vtkusers] Using OpenGL Textures with VTK
Message-ID: 

Hi,
  I have a project where I have a managed collection of OpenGL textures.
The textures all have unique identifiers (GLuint) and their various
characteristics (GL_RGBA, width, height, etc) are stored in a set of
classes.

Is there some way that I can wrap these texture objects that are already
stored on the GPU within one of the vtk classes such as vtkTexture or
vtkTextureObject so that I might be able to display them in a
vtkRenderWindow?

If this is not possible is there some other example of binding OpenGL
textures to a context so that they can be rendered within a window?

Best Regards,
David...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From igorznt at gmail.com  Mon Dec 20 08:59:31 2010
From: igorznt at gmail.com (igorznt)
Date: Mon, 20 Dec 2010 05:59:31 -0800 (PST)
Subject: [vtkusers] Fill vtkActor
Message-ID: <1292853571116-3311991.post@n5.nabble.com>


I have a Actor, that i adquire from a vtk.vtkXMLPolyDataReader(). I created 
a cutter to cut the the scene at the plane im seeing. I only can see the
wireframe of the actor. Id like to fill its inside to see the part that is
inside the actor colored. Does anybody know how?
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Fill-vtkActor-tp3311991p3311991.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From aashish.chaudhary at kitware.com  Mon Dec 20 09:11:42 2010
From: aashish.chaudhary at kitware.com (Aashish Chaudhary)
Date: Mon, 20 Dec 2010 09:11:42 -0500
Subject: [vtkusers] Using OpenGL Textures with VTK
In-Reply-To: 
References: 
Message-ID: 

I won't claim if I understood exactly what you are trying to do here but in
my understanding you want to bind GL texture objects already in memory to
VTK.  I don't know that you can do that without modifying VTK's vtkTexture
or vtkOpenGLTexture classes.


Now if you are using shader, this make it easier as you can just pass the
sampler id and if you know what object binds to what texture you can write a
very simple shader to achieve what you are trying to do.

Hope this helps.


On Mon, Dec 20, 2010 at 7:19 AM, David McKinnon wrote:

> Hi,
>   I have a project where I have a managed collection of OpenGL textures.
> The textures all have unique identifiers (GLuint) and their various
> characteristics (GL_RGBA, width, height, etc) are stored in a set of
> classes.
>
> Is there some way that I can wrap these texture objects that are already
> stored on the GPU within one of the vtk classes such as vtkTexture or
> vtkTextureObject so that I might be able to display them in a
> vtkRenderWindow?
>
> If this is not possible is there some other example of binding OpenGL
> textures to a context so that they can be rendered within a window?
>
> Best Regards,
> David...
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From gd0514 at gmail.com  Mon Dec 20 10:22:33 2010
From: gd0514 at gmail.com (Greg051)
Date: Mon, 20 Dec 2010 07:22:33 -0800 (PST)
Subject: [vtkusers] Rendering two isosurfaces
	(vtkVolumeRayCastIsosurfaceFunction)
Message-ID: <1292858553279-3312127.post@n5.nabble.com>


Hello, 

I try to render two different isosurfaces values but 
it does not work as expected. 

Is there a way to render the two isosurfaces in the same renderer ?

Please look at the tcl code below and the attached image.

Is there a way to add transparency to the rendering ?
http://vtk.1045678.n5.nabble.com/file/n3312127/IsoSurfaces.jpg 

#Filename: TestRayCastIsosurface.tcl

package require vtk
package require vtkinteraction

# create pipeline

vtkVolume16Reader v16
  v16 SetDataDimensions 64 64
  [v16 GetOutput] SetOrigin 0.0 0.0 0.0
  v16 SetDataByteOrderToLittleEndian
  v16 SetFilePrefix "$VTK_DATA_ROOT/Data/headsq/quarter"
  v16 SetImageRange 1 93
  v16 SetDataSpacing 3.2 3.2 1.5

# first actor

vtkColorTransferFunction constColorTransferFunc
		constColorTransferFunc RemoveAllPoints
		constColorTransferFunc AddRGBPoint 0.0   1.0 0.0 0.0
		constColorTransferFunc AddRGBPoint 255.0 1.0 0.0 0.0

vtkVolumeProperty	volumeProperty
		volumeProperty SetColor constColorTransferFunc
		volumeProperty ShadeOn
		 volumeProperty SetInterpolationType 1

vtkVolumeRayCastIsosurfaceFunction isosurfaceFunc
		isosurfaceFunc SetIsoValue 127

vtkVolumeRayCastMapper volumeRayCastMapper
		volumeRayCastMapper SetInput [v16 GetOutput]
		volumeRayCastMapper SetVolumeRayCastFunction isosurfaceFunc

vtkVolume actor
		actor SetMapper volumeRayCastMapper
		actor SetProperty volumeProperty

# second actor

vtkColorTransferFunction constColorTransferFunc2
		constColorTransferFunc2 RemoveAllPoints
		constColorTransferFunc2 AddRGBPoint 0.0   0.0 0.0 1.0
		constColorTransferFunc2 AddRGBPoint 255.0 0.0 0.0 1.0

vtkVolumeProperty	volumeProperty2
		volumeProperty2 SetColor constColorTransferFunc2
		volumeProperty2 ShadeOn
		volumeProperty2 SetInterpolationType 1

vtkVolumeRayCastIsosurfaceFunction isosurfaceFunc2
		isosurfaceFunc2 SetIsoValue 30

vtkVolumeRayCastMapper volumeRayCastMapper2
		volumeRayCastMapper2 SetInput [v16 GetOutput]
		volumeRayCastMapper2 SetVolumeRayCastFunction isosurfaceFunc2

vtkVolume actor2
		actor2 SetMapper volumeRayCastMapper2
		actor2 SetProperty volumeProperty2


vtkRenderer ren1
vtkRenderWindow renWin
    renWin AddRenderer ren1
    
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin
    [iren GetInteractorStyle] SetCurrentStyleToTrackballCamera
vtkCamera camera
    ren1 SetActiveCamera camera

ren1 AddActor actor
ren1 AddActor actor2
ren1 SetBackground 1 1 1

renWin SetSize 400 400

# render the image
#
iren AddObserver UserEvent {wm deiconify .vtkInteract}
ren1 ResetCamera
[ren1 GetActiveCamera] Zoom 1.0
renWin Render

# prevent the tk window from showing up then start the event loop
wm withdraw .

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Rendering-two-isosurfaces-vtkVolumeRayCastIsosurfaceFunction-tp3312127p3312127.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From jonmorra at gmail.com  Mon Dec 20 12:15:31 2010
From: jonmorra at gmail.com (Jonathan Morra)
Date: Mon, 20 Dec 2010 09:15:31 -0800
Subject: [vtkusers] test if vtkImageData is blank
Message-ID: 

Is there a way to quickly tell if a vtkImageData is blank (contains all
0's)?  I can't iterate the pixels cause I'm in Java and that's too slow.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From martin.dulovits at woogieworks.at  Mon Dec 20 14:06:23 2010
From: martin.dulovits at woogieworks.at (Martin Dulovits)
Date: Mon, 20 Dec 2010 20:06:23 +0100
Subject: [vtkusers] VTK.NET
In-Reply-To: 
References: 
Message-ID: <4D0FA92F.2060706@woogieworks.at>

When did the .net support get droppen from the VTK Sources ?
Is there a working .net wrapper for 5.6.1 ?
Is there a working wrapper for x64 windows ?

help appreciated

thx martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: martin_dulovits.vcf
Type: text/x-vcard
Size: 438 bytes
Desc: not available
URL: 

From g.bogle at auckland.ac.nz  Mon Dec 20 15:15:54 2010
From: g.bogle at auckland.ac.nz (Gib Bogle)
Date: Tue, 21 Dec 2010 09:15:54 +1300
Subject: [vtkusers] Filling in blood vessels
In-Reply-To: 
References: <20101219115950.862603v5qb5uegh2@webmail.bioeng.auckland.ac.nz>
	
Message-ID: <4D0FB97A.4040403@auckland.ac.nz>

Hi Mauro,

I've installed ITK and ITK-snap, and I can see that the tools I'm going to need 
are in these packages.  I've immediately encountered an issue I've never had to 
deal with - medical image formats.  Our images come from a multi-photon 
microscope, and are simply TIFFs.  ITK-snap requires the data to be in a DICOM 
volume (or some other special format like MetaImage).  I would have thought that 
it would be a simple matter to convert a stack of TIFF files into a DICOM 
volume, for example, but this doesn't seem to be the case.  Are you aware of a 
simple way to take a stack of TIFF files and convert it into a form readable by 
ITK-snap?

(I know that the ITK forum would be a better place to ask this, but I don't want 
to subscribe unless I need to.)

Thanks
Gib

On 19/12/2010 1:37 p.m., Mauro Maiorca wrote:
> Hi Gib,
>
> if I've understood correctly your problem, you want to segment ("fill
> in") the vessels then render the segmented image.
> VTK is great for rendering, but you might want to use ITK
> (www.itk.org) for segmentation (for just a threshold you can still use
> VTK - though).
> You might also want to have a look to ITK-snap
> (http://www.itksnap.org) and other VTK-related applications
> (http://www.vtk.org/VTK/resources/applications.html).
>
> cheers,
> Mauro
>
>
>
>
> On Sun, Dec 19, 2010 at 9:59 AM, Gib Bogle  wrote:
>>
>> I've just started to become aware of the image-processing capabilities of VTK, and I'm wondering if I can use it for some tasks that I was expecting to use Amira for.  We are generating images in which the walls of blood vessels are stained, so that the vessels appear in 3D as tubes.  I believe the first processing step I need to make is to "fill in" the vessels, i.e. generate a thresholded 3D image in which the vessels appear solid.  Is this the kind of thing that VTK can handle?
>>
>> Thanks
>> Gib
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers


From hobbsk at ohiou.edu  Mon Dec 20 15:34:35 2010
From: hobbsk at ohiou.edu (Kevin H. Hobbs)
Date: Mon, 20 Dec 2010 15:34:35 -0500
Subject: [vtkusers] Filling in blood vessels
In-Reply-To: <4D0FB97A.4040403@auckland.ac.nz>
References: <20101219115950.862603v5qb5uegh2@webmail.bioeng.auckland.ac.nz>	
	<4D0FB97A.4040403@auckland.ac.nz>
Message-ID: <4D0FBDDB.1090302@ohiou.edu>

On 12/20/2010 03:15 PM, Gib Bogle wrote:
> Are you aware of a simple way to take a
> stack of TIFF files and convert it into a form readable by ITK-snap?
> 
I just created 6 tiff 100x100 files in the gimp.

I wrote a mhd file :

$ cat stack.mhd
NDims = 3
DimSize = 100 100 6
ElementSpacing = 1 1 20
ElementType = MET_UCHAR
ElementDataFile = LIST 2
1.tiff
2.tiff
3.tiff
4.tiff
5.tiff
6.tiff

I started paraview, opened stack.mhd and volume rendered it (for kicks)
and all was well.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
URL: 

From g.bogle at auckland.ac.nz  Mon Dec 20 15:49:30 2010
From: g.bogle at auckland.ac.nz (Gib Bogle)
Date: Tue, 21 Dec 2010 09:49:30 +1300
Subject: [vtkusers] Filling in blood vessels
In-Reply-To: <4D0FBDDB.1090302@ohiou.edu>
References: <20101219115950.862603v5qb5uegh2@webmail.bioeng.auckland.ac.nz>	
	<4D0FB97A.4040403@auckland.ac.nz> <4D0FBDDB.1090302@ohiou.edu>
Message-ID: <4D0FC15A.7050505@auckland.ac.nz>

On 21/12/2010 9:34 a.m., Kevin H. Hobbs wrote:
> On 12/20/2010 03:15 PM, Gib Bogle wrote:
>> Are you aware of a simple way to take a
>> stack of TIFF files and convert it into a form readable by ITK-snap?
>>
> I just created 6 tiff 100x100 files in the gimp.
>
> I wrote a mhd file :
>
> $ cat stack.mhd
> NDims = 3
> DimSize = 100 100 6
> ElementSpacing = 1 1 20
> ElementType = MET_UCHAR
> ElementDataFile = LIST 2
> 1.tiff
> 2.tiff
> 3.tiff
> 4.tiff
> 5.tiff
> 6.tiff
>
> I started paraview, opened stack.mhd and volume rendered it (for kicks)
> and all was well.
>

That looks very promising!  I'll give it a shot...

It works!  Nice and simple.

Thanks a lot
Gib



From dave.partyka at kitware.com  Mon Dec 20 15:54:50 2010
From: dave.partyka at kitware.com (Dave Partyka)
Date: Mon, 20 Dec 2010 15:54:50 -0500
Subject: [vtkusers] ParaView HDF5 migration to VTK
Message-ID: 

Dear Developers,

I have just merged commits to VTK and ParaView that move ParaView's HDF5
into VTK. This migration makes it possible for VTK developers to begin using
HDF5 storage in their own VTK classes and will also allow us to enable HDF5
functionality in other Utilities (such as HDF5 enabled NetCDF). HDF5 is
located under Utilities/vtkhdf5. This version of HDF5 is the same that was
in ParaView (1.8.5) but now is also mangled with vtk as a prefix.

I strongly recommend that ParaView developers do a clean build after pulling
these changes to reduce the likelihood of build failures. We will be
watching the dashboard carefully for the next few days. If anyone
experiences any issues please feel free to let us know and/or report a bug.

Thanks and happy VTK/ParaView-ing!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From zkhan at modusmed.com  Mon Dec 20 15:55:37 2010
From: zkhan at modusmed.com (Zamir Khan)
Date: Mon, 20 Dec 2010 15:55:37 -0500
Subject: [vtkusers] VTK.NET
In-Reply-To: <4D0FA92F.2060706@woogieworks.at>
References: 
	<4D0FA92F.2060706@woogieworks.at>
Message-ID: <24402C04465DF3439AF65818811BB51229DA46BBDE@SERVER.modusmed.local>

Have you looked at Activiz?

http://www.kitware.com/products/activiz.html

Zamir

From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Martin Dulovits
Sent: December-20-10 2:06 PM
To: vtkusers at vtk.org
Subject: [vtkusers] VTK.NET

When did the .net support get droppen from the VTK Sources ?
Is there a working .net wrapper for 5.6.1 ?
Is there a working wrapper for x64 windows ?

help appreciated

thx martin

________________________________
Total Control Panel

Login


To: zkhan at modusmed.com

From: vtkusers-bounces at vtk.org


Remove this sender from my allow list



You received this message because the sender is on your allow list.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From martin.dulovits at woogieworks.at  Mon Dec 20 16:42:20 2010
From: martin.dulovits at woogieworks.at (Martin Dulovits)
Date: Mon, 20 Dec 2010 22:42:20 +0100
Subject: [vtkusers] VTK.NET
In-Reply-To: <24402C04465DF3439AF65818811BB51229DA46BBDE@SERVER.modusmed.local>
References: 
	<4D0FA92F.2060706@woogieworks.at>
	<24402C04465DF3439AF65818811BB51229DA46BBDE@SERVER.modusmed.local>
Message-ID: <4D0FCDBC.8050805@woogieworks.at>

On 12/20/2010 9:55 PM, Zamir Khan wrote:
>
> Have you looked at Activiz?
>
> http://www.kitware.com/products/activiz.html
>
> Zamir
>
> *From:*vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] *On 
> Behalf Of *Martin Dulovits
> *Sent:* December-20-10 2:06 PM
> *To:* vtkusers at vtk.org
> *Subject:* [vtkusers] VTK.NET
>
> When did the .net support get droppen from the VTK Sources ?
> Is there a working .net wrapper for 5.6.1 ?
> Is there a working wrapper for x64 windows ?
>
> help appreciated
>
> thx martin
>
> ------------------------------------------------------------------------
>
> *Total Control Panel*
>
> 	
>
> Login 
>
> To: zkhan at modusmed.com 
> 
>
> From: vtkusers-bounces at vtk.org 
> 
>
> 	
>
> Remove 
>  
> this sender from my allow list
>
> /You received this message because the sender is on your allow list./
>
Well that seems to be quite expensive. One License for 2900 $ .. is 
quite hefty and the wrapper was included in 5.2 wasnt it ?? it was quite 
a pain in the ass to compile a x64 version but it worked. I even managed 
to compile an icc x64 version of 5.2.

thx for your suggestion

martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From bastianra at gmail.com  Mon Dec 20 18:59:28 2010
From: bastianra at gmail.com (Bastian A.)
Date: Mon, 20 Dec 2010 18:59:28 -0500
Subject: [vtkusers] QVTKWidget and depth peeling.
Message-ID: 

Hi,

I am unable to use depth peeling in a class derived from QVTKWidget,
using C++ and
VTK 5.6.0/QT 4.5.2. The test
Rendering/Testing/Cxx/TestTranslucentLUTDepthPeeling
successfully uses depth peeling. I found the discussion regarding the QVTKWidget
and depth peeling using python on this mailing list.
( http://public.kitware.com/pipermail/vtkusers/2010-August/111040.html )
Not having any better ideas, I patched GUIsuppout/Qt/QVTKWidget.* such that the
QVTKWidget derives from QGLWidget and is constructed as:

QVTKWidget::QVTKWidget(QWidget* p, Qt::WFlags f)
  : QGLWidget(QGLFormat(QGL::AlphaChannel),p,0, f | Qt::MSWindowsOwnDC),
    mRenWin(NULL), cachedImageCleanFlag(false),
    automaticImageCache(false), maxImageCacheRenderRate(1.0)

however this did not change that I am unable to use depth peeling in the
QVTKWidget.

After reverting my changes I tried using the
TestTranslucentLUTDepthPeeling within
my class derived from QVTKWidget removing only the interactor and exchanging
the vtkRenderWindow renWin with a call to GetRenderWindow() (for
details see below).
Depth peeling was not used.

Any help getting depth peeling to work would be greatly appreciated.

Cheers,
Bastian


In case this is relevant: I am using Kubuntu 9.10 and a Nvidia Quadro FX 4800
with the 190.53 driver.

VtkCellView::VtkCellView(QWidget *parent) :
	QVTKWidget(parent)
{
	  // vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();

	  GetRenderWindow()->SetMultiSamples(0);

	  GetRenderWindow()->SetAlphaBitPlanes(1);
	  //  iren->SetRenderWindow(GetRenderWindow());
	  //  renWin->Delete();

	  vtkRenderer *renderer = vtkRenderer::New();
	  GetRenderWindow()->AddRenderer(renderer);
	  renderer->Delete();
	  renderer->SetUseDepthPeeling(1);
	  renderer->SetMaximumNumberOfPeels(200);
	  renderer->SetOcclusionRatio(0.1);

	  vtkImageSinusoidSource *imageSource=vtkImageSinusoidSource::New();
	  imageSource->SetWholeExtent(0,9,0,9,0,9);
	  imageSource->SetPeriod(5);
	  imageSource->Update();

	  vtkImageData *image=imageSource->GetOutput();
	  double range[2];
	  image->GetScalarRange(range);

	  vtkDataSetSurfaceFilter *surface=vtkDataSetSurfaceFilter::New();

	  surface->SetInputConnection(imageSource->GetOutputPort());
	  imageSource->Delete();

	  vtkPolyDataMapper *mapper=vtkPolyDataMapper::New();
	  mapper->SetInputConnection(surface->GetOutputPort());
	  surface->Delete();

	  vtkLookupTable *lut=vtkLookupTable::New();
	  lut->SetTableRange(range);
	  lut->SetAlphaRange(0.5,0.5);
	  lut->SetHueRange(0.2,0.7);
	  lut->SetNumberOfTableValues(256);
	  lut->Build();

	  mapper->SetScalarVisibility(1);
	  mapper->SetLookupTable(lut);
	  lut->Delete();

	  vtkActor *actor=vtkActor::New();
	  renderer->AddActor(actor);
	  actor->Delete();
	  actor->SetMapper(mapper);
	  mapper->Delete();

	  renderer->SetBackground(0.1,0.3,0.0);


	  GetRenderWindow()->Render();
	  if(renderer->GetLastRenderingUsedDepthPeeling())
	  {
        cout<<"depth peeling was used"<

Hi all,

Does anyone know how I can update the color transfer function for a vtkOpenGLGPUVolumeRayCastMapper type volume?

The volume is constructed like so:

_volumeProperty = vtkVolumeProperty::New();
_volumeProperty->SetColor(_color);
_volumeProperty->SetScalarOpacity(_opacity);
_volumeProperty->SetInterpolationTypeToLinear();
_volumeProperty->ShadeOff();

_gpuVolumeMapper = vtkOpenGLGPUVolumeRayCastMapper::New();
_gpuVolumeMapper->SetImageSampleDistance(_imageSampleDistance);
_gpuVolumeMapper->SetSampleDistance(_sampleDistance);
_gpuVolumeMapper->AutoAdjustSampleDistancesOff();
_gpuVolumeMapper->SetInput(_voxels);

_volume = vtkVolume::New();
_volume->SetProperty(_volumeProperty);
_volume->SetMapper(_gpuVolumeMapper);

To swap between different predefined color transfer functions, I call:

_volumeProperty->SetColor(someNewColor);

This is where the problem starts. The only way the volume will update to the new color is if I delete the current volume mapper and then recreate it with the new color transfer function, which is bad for performance. I've tried calling _volume->Update() and _gpuVolumeMapper->Update(), which doesn't seem to work. 

Any help or ideas would be appreciated. Thanks in advance!

eric

From trshash at gmail.com  Tue Dec 21 01:19:37 2010
From: trshash at gmail.com (Shashwath T.R.)
Date: Tue, 21 Dec 2010 11:49:37 +0530
Subject: [vtkusers] Updating color transfer function for GPU volume
In-Reply-To: <2F1979CB-50AA-4D5B-98C2-ED8123EE027C@iastate.edu>
References: <2F1979CB-50AA-4D5B-98C2-ED8123EE027C@iastate.edu>
Message-ID: 

Hi Eric,

Try removing all points and modifying the same color transfer function,
instead of creating a new one... It seems to work for us.

Shash

On Tue, Dec 21, 2010 at 6:33 AM, Eric Foo  wrote:

> Hi all,
>
> Does anyone know how I can update the color transfer function for a
> vtkOpenGLGPUVolumeRayCastMapper type volume?
>
> The volume is constructed like so:
>
> _volumeProperty = vtkVolumeProperty::New();
> _volumeProperty->SetColor(_color);
> _volumeProperty->SetScalarOpacity(_opacity);
> _volumeProperty->SetInterpolationTypeToLinear();
> _volumeProperty->ShadeOff();
>
> _gpuVolumeMapper = vtkOpenGLGPUVolumeRayCastMapper::New();
> _gpuVolumeMapper->SetImageSampleDistance(_imageSampleDistance);
> _gpuVolumeMapper->SetSampleDistance(_sampleDistance);
> _gpuVolumeMapper->AutoAdjustSampleDistancesOff();
> _gpuVolumeMapper->SetInput(_voxels);
>
> _volume = vtkVolume::New();
> _volume->SetProperty(_volumeProperty);
> _volume->SetMapper(_gpuVolumeMapper);
>
> To swap between different predefined color transfer functions, I call:
>
> _volumeProperty->SetColor(someNewColor);
>
> This is where the problem starts. The only way the volume will update to
> the new color is if I delete the current volume mapper and then recreate it
> with the new color transfer function, which is bad for performance. I've
> tried calling _volume->Update() and _gpuVolumeMapper->Update(), which
> doesn't seem to work.
>
> Any help or ideas would be appreciated. Thanks in advance!
>
> eric
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From jimcp at cox.net  Tue Dec 21 07:02:46 2010
From: jimcp at cox.net (Jim Peterson)
Date: Tue, 21 Dec 2010 07:02:46 -0500
Subject: [vtkusers] Updating color transfer function for GPU volume
In-Reply-To: 
References: <2F1979CB-50AA-4D5B-98C2-ED8123EE027C@iastate.edu>
	
Message-ID: <4D109766.6030406@cox.net>

Eric and Shashwath,

I believe you will find the vtk pipeline is optimized to only process 
"new" data in the pipeline. Unfortunately there is no mechanism that 
automatically sets the last change time with a call that changes the 
content. What is required is a call to ->Modified() for any object with 
changed content. this includes changes to points, cells, scalars, 
transformations and maps.

I suggest you add a ->Modified() call to the affected pipeline objects 
to cause the ->Update() to recognize the need to re-evaluate the pipeline.

Hope that helps,
Jim

Shashwath T.R. wrote:
> Hi Eric,
>
> Try removing all points and modifying the same color transfer 
> function, instead of creating a new one... It seems to work for us.
>
> Shash
>
> On Tue, Dec 21, 2010 at 6:33 AM, Eric Foo  > wrote:
>
>     Hi all,
>
>     Does anyone know how I can update the color transfer function for
>     a vtkOpenGLGPUVolumeRayCastMapper type volume?
>
>     The volume is constructed like so:
>
>     _volumeProperty = vtkVolumeProperty::New();
>     _volumeProperty->SetColor(_color);
>     _volumeProperty->SetScalarOpacity(_opacity);
>     _volumeProperty->SetInterpolationTypeToLinear();
>     _volumeProperty->ShadeOff();
>
>     _gpuVolumeMapper = vtkOpenGLGPUVolumeRayCastMapper::New();
>     _gpuVolumeMapper->SetImageSampleDistance(_imageSampleDistance);
>     _gpuVolumeMapper->SetSampleDistance(_sampleDistance);
>     _gpuVolumeMapper->AutoAdjustSampleDistancesOff();
>     _gpuVolumeMapper->SetInput(_voxels);
>
>     _volume = vtkVolume::New();
>     _volume->SetProperty(_volumeProperty);
>     _volume->SetMapper(_gpuVolumeMapper);
>
>     To swap between different predefined color transfer functions, I call:
>
>     _volumeProperty->SetColor(someNewColor);
>
>     This is where the problem starts. The only way the volume will
>     update to the new color is if I delete the current volume mapper
>     and then recreate it with the new color transfer function, which
>     is bad for performance. I've tried calling _volume->Update() and
>     _gpuVolumeMapper->Update(), which doesn't seem to work.
>
>     Any help or ideas would be appreciated. Thanks in advance!
>
>     eric
>     _______________________________________________
>     Powered by www.kitware.com 
>
>     Visit other Kitware open-source projects at
>     http://www.kitware.com/opensource/opensource.html
>
>     Please keep messages on-topic and check the VTK FAQ at:
>     http://www.vtk.org/Wiki/VTK_FAQ
>
>     Follow this link to subscribe/unsubscribe:
>     http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   



From italo.ribeiro at gmail.com  Tue Dec 21 08:44:14 2010
From: italo.ribeiro at gmail.com (Italo Ribeiro)
Date: Tue, 21 Dec 2010 10:44:14 -0300
Subject: [vtkusers] Copy matrix fast for VTK
In-Reply-To: 
References: 
	
	
	
	
Message-ID: 

Hi,

I get use vtkImageImport but i am trying use vtkImageExport, it dont copy
the values.

2010/12/16 David Doria 

> There is a working example as part of the VTK regression tests:
>> VTK/Imaging/Testing/Cxx/ImportExport.cxx
>
>
> Yes, but it has some bizarre lines
> (reader->SetDataExtent(0,63,0,63,1,93);  reader->SetDataMask(0x7fff);),
> exports before it imports, and is generally as unclear as a test usually is.
> (Maybe Italo will argue otherwise)
>
> I'd rather see a simpler demo which programmatically creates a (2D) image
> in memory (following some standard convention) and then loads it into a
> vtkImageData. It should also explain the conventions of the input (array
> created in memory) and how it maps to the output indices of the
> vtkImageData.
>
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
?talo Mendes
ogre.irados.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From italo.ribeiro at gmail.com  Tue Dec 21 09:32:30 2010
From: italo.ribeiro at gmail.com (Italo Ribeiro)
Date: Tue, 21 Dec 2010 11:32:30 -0300
Subject: [vtkusers] Copy matrix fast for VTK
In-Reply-To: 
References: 
	
	
	
	
	
Message-ID: 

Hi,

I get use vtkImageExport, the problem is the array type must be same of the
DataScalarType of image.

thanks guys for you help.


2010/12/21 Italo Ribeiro 

> Hi,
>
> I get use vtkImageImport but i am trying use vtkImageExport, it dont copy
> the values.
>
> 2010/12/16 David Doria 
>
>> There is a working example as part of the VTK regression tests:
>>> VTK/Imaging/Testing/Cxx/ImportExport.cxx
>>
>>
>> Yes, but it has some bizarre lines
>> (reader->SetDataExtent(0,63,0,63,1,93);  reader->SetDataMask(0x7fff);),
>> exports before it imports, and is generally as unclear as a test usually is.
>> (Maybe Italo will argue otherwise)
>>
>> I'd rather see a simpler demo which programmatically creates a (2D) image
>> in memory (following some standard convention) and then loads it into a
>> vtkImageData. It should also explain the conventions of the input (array
>> created in memory) and how it maps to the output indices of the
>> vtkImageData.
>>
>> David
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
>
> --
> ?talo Mendes
> ogre.irados.org
>



-- 
?talo Mendes
ogre.irados.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From webmaster at insightsoftwareconsortium.org  Tue Dec 21 10:03:17 2010
From: webmaster at insightsoftwareconsortium.org (Insight Journal)
Date: Tue, 21 Dec 2010 10:03:17 -0500
Subject: [vtkusers] The Insight Journal-New Submission
Message-ID: <201012211503.oBLF3HoQ018699@insight-journal.org>

Hello,
A new submission has been added to the Insight Journal.

Title: New Features for MinimumMaximumImageCalculator
Author(s):Tamburo R.
Abstract: 
New functions are proposed for itkMinimumMaximumImageCalculator. One function allows for excluding pixels of a specified value from the computations. Another function stores all pixel indices of the maximum/minimum value. This paper is accompanied with source code for the filter and test, test images and parameters, and expected output images.  

Download and Review the paper at: http://www.insight-journal.org/browse/publication/783

Generated by the Insight Journal
You are receiving this email because you asked to be informed by the Insight Journal for new submissions.
                    
To change your email preference go to http://www.insight-journal.org .


From italo.ribeiro at gmail.com  Tue Dec 21 10:59:12 2010
From: italo.ribeiro at gmail.com (Italo Ribeiro)
Date: Tue, 21 Dec 2010 12:59:12 -0300
Subject: [vtkusers] Copy matrix fast for VTK
In-Reply-To: 
References: 
	
	
	
	
	
	
	
Message-ID: 

Hi,

I will use the code that i do. I hope be good.

?talo Mendes

2010/12/21 David Doria 

> If you would be so kind as to fix these examples to demonstrate a
> reasonable usage:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/Images/ImageExport
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/Images/ImageImport
>
> it would be much appreciated!
>
> Thanks,
>
> David
>
>
>
> On Tue, Dec 21, 2010 at 9:32 AM, Italo Ribeiro 
> wrote:
> > Hi,
> > I get use vtkImageExport, the problem is the array type must be same of
> the
> > DataScalarType of image.
> > thanks guys for you help.
> >
> > 2010/12/21 Italo Ribeiro 
> >>
> >> Hi,
> >> I get use vtkImageImport but i am trying use vtkImageExport, it dont
> copy
> >> the values.
> >>
> >> 2010/12/16 David Doria 
> >>>>
> >>>> There is a working example as part of the VTK regression tests:
> >>>> VTK/Imaging/Testing/Cxx/ImportExport.cxx
> >>>
> >>> Yes, but it has some bizarre lines
> >>> (reader->SetDataExtent(0,63,0,63,1,93);  reader->SetDataMask(0x7fff);),
> >>> exports before it imports, and is generally as unclear as a test
> usually is.
> >>> (Maybe Italo will argue otherwise)
> >>> I'd rather see a simpler demo which programmatically creates a (2D)
> image
> >>> in memory (following some standard convention) and then loads it into a
> >>> vtkImageData. It should also explain the conventions of the input
> (array
> >>> created in memory) and how it maps to the output indices of the
> >>> vtkImageData.
> >>> David
> >>> _______________________________________________
> >>> Powered by www.kitware.com
> >>>
> >>> Visit other Kitware open-source projects at
> >>> http://www.kitware.com/opensource/opensource.html
> >>>
> >>> Please keep messages on-topic and check the VTK FAQ at:
> >>> http://www.vtk.org/Wiki/VTK_FAQ
> >>>
> >>> Follow this link to subscribe/unsubscribe:
> >>> http://www.vtk.org/mailman/listinfo/vtkusers
> >>>
> >>
> >>
> >>
> >> --
> >> ?talo Mendes
> >> ogre.irados.org
> >
> >
> >
> > --
> > ?talo Mendes
> > ogre.irados.org
> >
>



-- 
?talo Mendes
ogre.irados.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From thereinliestherub at hotmail.com  Tue Dec 21 19:10:50 2010
From: thereinliestherub at hotmail.com (Gary Holton)
Date: Wed, 22 Dec 2010 01:10:50 +0100
Subject: [vtkusers] vtkTableBasedClipDataSet and complex clipping
Message-ID: 



A) I want to carve out an "undulating half-circle" in an unstructured grid, my idea was to use clipping, especially the new clipper = vtkTableBasedClipDataSet. Cannot get this working properly after several different attempts.

B) The grid to be cut is the result of an original grid clipped vertically using vtkTableBasedClipDateSet with an implicit function defined by vtkImplicitSelectionLoop. This clipping has been successful!!  FYI: The implicit function defined by vtkImplicitSelectionLoop is following the same undulating path to be used in A) above.

A) continued: My ideas now are:
   I) continue test and explore with many different ways to formulate the ImplicitFunctions
   II) explore if a particular Actor can configured to always take precedence, even if   

I hope there is something essential I am missing here so that someone quickly can guide me onto the right track!

GH 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From foo at iastate.edu  Tue Dec 21 21:24:13 2010
From: foo at iastate.edu (Eric Foo)
Date: Tue, 21 Dec 2010 20:24:13 -0600
Subject: [vtkusers] Updating color transfer function for GPU volume
In-Reply-To: <4D109766.6030406@cox.net>
References: <2F1979CB-50AA-4D5B-98C2-ED8123EE027C@iastate.edu>
	
	<4D109766.6030406@cox.net>
Message-ID: 

Hi Jim,

Thanks for your response. Calling Modified() in the color transfer function object did the trick.

eric

On Dec 21, 2010, at 6:02 AM, Jim Peterson wrote:

> Eric and Shashwath,
> 
> I believe you will find the vtk pipeline is optimized to only process "new" data in the pipeline. Unfortunately there is no mechanism that automatically sets the last change time with a call that changes the content. What is required is a call to ->Modified() for any object with changed content. this includes changes to points, cells, scalars, transformations and maps.
> 
> I suggest you add a ->Modified() call to the affected pipeline objects to cause the ->Update() to recognize the need to re-evaluate the pipeline.
> 
> Hope that helps,
> Jim
> 
> Shashwath T.R. wrote:
>> Hi Eric,
>> 
>> Try removing all points and modifying the same color transfer function, instead of creating a new one... It seems to work for us.
>> 
>> Shash
>> 
>> On Tue, Dec 21, 2010 at 6:33 AM, Eric Foo > wrote:
>> 
>>    Hi all,
>> 
>>    Does anyone know how I can update the color transfer function for
>>    a vtkOpenGLGPUVolumeRayCastMapper type volume?
>> 
>>    The volume is constructed like so:
>> 
>>    _volumeProperty = vtkVolumeProperty::New();
>>    _volumeProperty->SetColor(_color);
>>    _volumeProperty->SetScalarOpacity(_opacity);
>>    _volumeProperty->SetInterpolationTypeToLinear();
>>    _volumeProperty->ShadeOff();
>> 
>>    _gpuVolumeMapper = vtkOpenGLGPUVolumeRayCastMapper::New();
>>    _gpuVolumeMapper->SetImageSampleDistance(_imageSampleDistance);
>>    _gpuVolumeMapper->SetSampleDistance(_sampleDistance);
>>    _gpuVolumeMapper->AutoAdjustSampleDistancesOff();
>>    _gpuVolumeMapper->SetInput(_voxels);
>> 
>>    _volume = vtkVolume::New();
>>    _volume->SetProperty(_volumeProperty);
>>    _volume->SetMapper(_gpuVolumeMapper);
>> 
>>    To swap between different predefined color transfer functions, I call:
>> 
>>    _volumeProperty->SetColor(someNewColor);
>> 
>>    This is where the problem starts. The only way the volume will
>>    update to the new color is if I delete the current volume mapper
>>    and then recreate it with the new color transfer function, which
>>    is bad for performance. I've tried calling _volume->Update() and
>>    _gpuVolumeMapper->Update(), which doesn't seem to work.
>> 
>>    Any help or ideas would be appreciated. Thanks in advance!
>> 
>>    eric
>>    _______________________________________________
>>    Powered by www.kitware.com 
>> 
>>    Visit other Kitware open-source projects at
>>    http://www.kitware.com/opensource/opensource.html
>> 
>>    Please keep messages on-topic and check the VTK FAQ at:
>>    http://www.vtk.org/Wiki/VTK_FAQ
>> 
>>    Follow this link to subscribe/unsubscribe:
>>    http://www.vtk.org/mailman/listinfo/vtkusers
>> 
>> 
>> ------------------------------------------------------------------------
>> 
>> _______________________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>  
> 



From webmaster at insightsoftwareconsortium.org  Wed Dec 22 02:31:22 2010
From: webmaster at insightsoftwareconsortium.org (Insight Journal)
Date: Wed, 22 Dec 2010 02:31:22 -0500
Subject: [vtkusers] The Insight Journal-New Submission
Message-ID: <201012220731.oBM7VMD1013753@insight-journal.org>

Hello,
A new submission has been added to the Insight Journal.

Title: ITK-Based Implementation of Two-Projection 2D/3D Registration Method with an Application in Patient Setup for External Beam Radiotherapy
Author(s):Wu J.
Abstract: 
This document describes an ITK-based implementation of intensity-based 2D/3D rigid image registration for patient setup assessment in external beam radiotherapy. The registration framework was designed to simultaneously register two projection images to a 3D image volume. The projection geometry was set up to simulate the x-ray imaging system that attached to a medical linear accelerator for cancer treatment. The normalized correlation was used as the similarity measure and the Powell's optimizer was used as the optimization method. Siddon-Jacobs fast ray-tracing algorithm was implemented to compute projection images from a 3D image volume.

Download and Review the paper at: http://www.insight-journal.org/browse/publication/784

Generated by the Insight Journal
You are receiving this email because you asked to be informed by the Insight Journal for new submissions.
                    
To change your email preference go to http://www.insight-journal.org .


From shnh500 at ohm.york.ac.uk  Tue Dec 21 15:02:11 2010
From: shnh500 at ohm.york.ac.uk (Sorrel)
Date: Tue, 21 Dec 2010 20:02:11 +0000 (UTC)
Subject: [vtkusers] VTK and Python installation on Windows XP 32 bit
Message-ID: 

Hi,
I've been trying to install VTK with Python in Windows.
My VTK build in cmake seemed to work ok. I got:

Found PythonLibs: C:/Python27/libs/python27.lib 
Configuring done
Generating done

(It did say in the variable list VTK_DATA_ROOT - NOTFOUND - does that matter?)

Anyway, I added the vtk.pth file to Python's use-packages folder:

C:\Program Files\VTK\Wrapping\Python
C:\Program Files\VTK\Wrapping\Python\vtk\tk
C:\Program Files\VTK\bin\Release

(as they are in my build folder, also tried

C:\Progra~1\VTK\Wrapping\Python
C:\Progra~1\VTK\Wrapping\Python\vtk\tk
C:\Progra~1\VTK\bin\Release

)

But I still can't import the vtk module in Python and get the error:

from vtkpython import *
ImportError: No module named vtkpython

I don't know what I've done wrong! Can anyone make any suggestions please?
Thanks!



From a.blassnig at blueline3d.at  Wed Dec 22 05:32:16 2010
From: a.blassnig at blueline3d.at (A_n_d_y)
Date: Wed, 22 Dec 2010 02:32:16 -0800 (PST)
Subject: [vtkusers] Rendering large point clouds including normals
Message-ID: <1293013936237-3314820.post@n5.nabble.com>


Hi everybody,

I worked with OpenGL and OpenSceneGraph and now I wanna use vtk - so I'm new
to vtk.
I want to display large 3D point clouds including normals (up to 1M points).
Now I'm searching the most efficient way to store and render my data. Later
on I want to use Splatting to let appear my point cloud as a surface
(perhaps vtkGaussianSplatter...?). 
So, I am searching for the best method now. Should I use vtkPoints and
vtkPolyData->SetPoints() and vtkPolyData->GetPointData()->SetNormals() or
anything else? Which mapper would be the best choice for me?
Does vtk support Vertex Arrays or Vertex Buffer Objects? 

Thanks a lot in advance!

Greets from Austria, Andy
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Rendering-large-point-clouds-including-normals-tp3314820p3314820.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From top.grzechu at gmail.com  Wed Dec 22 08:01:27 2010
From: top.grzechu at gmail.com (Grzegorz Toporek)
Date: Wed, 22 Dec 2010 14:01:27 +0100
Subject: [vtkusers] What is Data Type returned by
	vtkDataObject::GetDataObjectType method?
Message-ID: 

Dear all,

when I read DICOM files, ones via vtkDICOMImageReader (all DICOMs from
directory) and second time by using vtkDataSetReader (a .vtk file with the
same data, that has been read and saved with ITK) I got different Data Type
from vtkDataObject::GetDataObjectType method.

What does it mean that Data Type is 1 or 6? How can I change one Data Type
into another? The problem is, my volume is not rendering correctly for Data
Type 6 (vtkDICOMImageReader).

I use following code to get information about my data:

public void getImageDataInformation(vtkImageData object){
        //show information about data
        dataType = object.GetDataObjectType();
        String scalarType = object.GetScalarTypeAsString();
        //vtkInformation outInfo = new vtkInformation();
        // if 1 - grayscale if 3 RGB, HSV, HSI etc
        numberOfScalarComponents    = object.GetNumberOfScalarComponents();
        dim                         = object.GetDimensions();
        scalarTypeMax               = object.GetScalarTypeMax();
        scalarTypeMin               = object.GetScalarTypeMin();
        spacing                     = object.GetSpacing();
        dataRange                   = object.GetScalarRange();

        StringBuffer buffer = new StringBuffer();
        buffer.append("Number of components :
").append(numberOfScalarComponents);
        buffer.append("\n");
        buffer.append("Data dimentions:
").append(dim[0]).append("x").append(dim[1]).append("x").append(dim[2]);
        buffer.append("\n");
        buffer.append("Data type : ").append(dataType);
        buffer.append("\n");
        buffer.append("Data spacing :
").append(spacing[0]).append(spacing[1]).append(spacing[2]);
        buffer.append("\n");
        buffer.append("Scalar type: ").append(scalarType);
        buffer.append("\n");
        buffer.append("Data sclar min : ").append(scalarTypeMin).append("
and max: ").append(scalarTypeMax);
        buffer.append("\n");
        buffer.append("Image range:
").append(dataRange[0]).append("-").append(dataRange[1]);
        buffer.append("\n");

        if (debug){
            log.append(buffer.toString());
            log.setCaretPosition(log.getDocument().getLength());
            System.out.println(buffer.toString());
        }
    }

The output is:

1) for DICOMs

Number of components : 1
Data dimentions: 512x512x220
Data type : 6
Data spacing : 0.3906250.3906251.0
Scalar type: unsigned short
Data sclar min : 0.0 and max: 65535.0
Image range: 0.0-65535.0

2) for .vtk file

Number of components : 1
Data dimentions: 512x512x220
Data type : 1
Data spacing : 0.3906250.3906251.0
Scalar type: unsigned short
Data sclar min : 0.0 and max: 65535.0
Image range: 0.0-65535.0

Could you please give me some feedbacks?


Regards,
Grzegorz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From ali.mahmoud.habib at gmail.com  Wed Dec 22 09:00:20 2010
From: ali.mahmoud.habib at gmail.com (Ali Habib)
Date: Wed, 22 Dec 2010 16:00:20 +0200
Subject: [vtkusers] linking error while using itk for IOS programming
Message-ID: 

Dear All



I just finished reading your paper regarding IOS and itk , I tried to apply
it

The ITK build successfully

The compile of test project compiled well but at link stage it give 44 error
 and many warnings



*For example*



ld: warning: in /ITK_BINARY_DIR/bin/Release/libitktestlib.a, file was built
for unsupported file format which is not the architecture being linked
(i386)



"itk::ImageIORegion::~ImageIORegion()", referenced from:





Attached is snap shot of the error



I used the class ITKIOSIMAGE



*And added the search header paths as following :*



/ITK_SOURCE_DIR/Code/Common

/ITK_SOURCE_DIR/Utilities/vxl/vcl

/ITK_SOURCE_DIR/Utilities/vxl/core

/ITK_SOURCE_DIR/Code/IO

/ITK_SOURCE_DIR/Code/BasicFilters

/ITK_SOURCE_DIR/

/ITK_BINARY_DIR

/ITK_BINARY_DIR/Utilities/vxl/vcl

/ITK_BINARY_DIR/Utilities/vxl/core

/ITK_BINARY_DIR/Utilities



I don?t know why  any suggestion please or am I missing something I use the
latest xcode and sdk 4.2



Best regards



Eng. Ali Habib



Biomedical engineer and researcher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mac OS Snow Leopard-2010-12-22-14-22-06.rar
Type: application/rar
Size: 156809 bytes
Desc: not available
URL: 

From alessandromartini at gmail.com  Wed Dec 22 10:11:33 2010
From: alessandromartini at gmail.com (Alessandro Martini)
Date: Wed, 22 Dec 2010 11:11:33 -0400
Subject: [vtkusers] vtkSmartVolumeMapper on vtk 5.6.1
Message-ID: 

Hello All,

I compiled the sources of VTK 5.6.1, and I can't locate the
vtkSmartVolumeMapper that I use on VTK 5.6...

Anyone know what happened with it?

-- 
Alessandro Martini
alessandromartini at gmail.com
-------------------------------------------------
'Existem 10 tipos de pessoas no mundo:
aquelem que entendem bin?rio, e aqueles que n?o!'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From sean at rogue-research.com  Wed Dec 22 10:41:45 2010
From: sean at rogue-research.com (Sean McBride)
Date: Wed, 22 Dec 2010 10:41:45 -0500
Subject: [vtkusers] linking error while using itk for IOS programming
In-Reply-To: 
References: 
Message-ID: <20101222154145.1240285491@mail.rogue-research.com>

On Wed, 22 Dec 2010 16:00:20 +0200, Ali Habib said:

>Dear All
>
>
>
>I just finished reading your paper regarding IOS and itk , I tried to apply
>it
>
>The ITK build successfully
>
>The compile of test project compiled well but at link stage it give 44 error
> and many warnings
>
>
>
>*For example*
>
>
>
>ld: warning: in /ITK_BINARY_DIR/bin/Release/libitktestlib.a, file was built
>for unsupported file format which is not the architecture being linked
>(i386)

Could you clarify?

Are you asking about VTK or ITK?  You say ITK, but post on the VTK list?

You're asking about iOS but your attachment is named Mac OS?

What are you trying to do?

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montr?al, Qu?bec, Canada




From ron.trickey at siemens.com  Wed Dec 22 12:12:50 2010
From: ron.trickey at siemens.com (Trickey, Ronald (SCR US))
Date: Wed, 22 Dec 2010 12:12:50 -0500
Subject: [vtkusers] File submission size limit
Message-ID: <5D95A1067D89DE43A7C8E1FA73C96A6A9C05943F50@USMLVA0E914MSX.ww017.siemens.net>

Good Afternoon,

When attempting to submit build reports into CDash, any file above 8kb does not submit. There is no error; it simply doesn't show up in CDash.
The only setting I know of that would set maximum sizes would be in the php.ini file; however, these are set correctly and other services have no problem submitting large files.

Any suggestions?

Ron Trickey

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From pasamd2001 at yahoo.co.in  Wed Dec 22 15:05:53 2010
From: pasamd2001 at yahoo.co.in (paru_85)
Date: Wed, 22 Dec 2010 12:05:53 -0800 (PST)
Subject: [vtkusers] New To VTK
Message-ID: <1293048353769-3315597.post@n5.nabble.com>


Hello Everyone,

i am new to vtk..i am reviewing my materials and stuff...
I was thing to write vtk using CMake...
how do i write my first vtk file ??

thanks 
paru
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/New-To-VTK-tp3315597p3315597.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From drescherjm at gmail.com  Wed Dec 22 15:23:21 2010
From: drescherjm at gmail.com (John Drescher)
Date: Wed, 22 Dec 2010 15:23:21 -0500
Subject: [vtkusers] New To VTK
In-Reply-To: <1293048353769-3315597.post@n5.nabble.com>
References: <1293048353769-3315597.post@n5.nabble.com>
Message-ID: 

On Wed, Dec 22, 2010 at 3:05 PM, paru_85  wrote:
>
> Hello Everyone,
>
> i am new to vtk..i am reviewing my materials and stuff...
> I was thing to write vtk using CMake...
> how do i write my first vtk file ??

Look at the examples. There are hundreds of examples including
CMakeList.txt files in the wiki.

http://www.vtk.org/Wiki/VTK/Examples/Cxx

John


From vinicius.ras at gmail.com  Wed Dec 22 20:10:07 2010
From: vinicius.ras at gmail.com (=?ISO-8859-1?Q?Vinicius_Rog=E9rio_Araujo_Silva?=)
Date: Wed, 22 Dec 2010 22:10:07 -0300
Subject: [vtkusers] Using vtkSmartPointer with my own classes
Message-ID: 

Hello all,

I've created a simple class, which is a subclass of vtkObject, and tried to
use vtkSmartPointer with it. The class is as follows:

class MyClass : public vtkObject
{
public:
MyClass()
{
std::cout << "BEING CONSTRUCTED" << std::endl;
}
~MyClass()
{
std::cout << "BEING DESTRUCTED" << std::endl;
}
};


And I'm trying to create a smart pointer for it like this:

vtkSmartPointer myPtr = vtkSmartPointer::New();

But the instantiation of the object/smartptr generates compiler errors.
Can anyone help me with that?

Compiling under Visual C++ 2008, my build log follows:

1>------ Build started: Project: TesteVTK, Configuration: Debug Win32 ------
1>Compiling...
1>TesteVTK.cpp
1>c:\users\vinicius\desktop\labmint\vtk\vtk-5.6.0\common\vtksmartpointer.h(113)
: error C2665: 'vtkSmartPointer::vtkSmartPointer' : none of the 4
overloads could convert all the argument types
1>        with
1>        [
1>            T=MyClass
1>        ]
1>
 c:\users\vinicius\desktop\labmint\vtk\vtk-5.6.0\common\vtksmartpointer.h(163):
could be 'vtkSmartPointer::vtkSmartPointer(T *,const
vtkSmartPointerBase::NoReference &)'
1>        with
1>        [
1>            T=MyClass
1>        ]
1>        while trying to match the argument list '(vtkObject *,
vtkSmartPointerBase::NoReference)'
1>
 c:\users\vinicius\desktop\labmint\vtk\vtk-5.6.0\common\vtksmartpointer.h(112)
: while compiling class template member function 'vtkSmartPointer
vtkSmartPointer::New(void)'
1>        with
1>        [
1>            T=MyClass
1>        ]
1>        c:\users\vinicius\documents\my
dropbox\projetos\testevtk\testevtk.cpp(70) : see reference to class template
instantiation 'vtkSmartPointer' being compiled
1>        with
1>        [
1>            T=MyClass
1>        ]
1>Build log was saved at "file://c:\Users\Vinicius\Documents\Visual Studio
2008\Projects\TesteVTK\TesteVTK\Debug\BuildLog.htm"
1>TesteVTK - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From drescherjm at gmail.com  Wed Dec 22 20:20:41 2010
From: drescherjm at gmail.com (John Drescher)
Date: Wed, 22 Dec 2010 20:20:41 -0500
Subject: [vtkusers] Using vtkSmartPointer with my own classes
In-Reply-To: 
References: 
Message-ID: 

2010/12/22 Vinicius Rog?rio Araujo Silva :
> Hello all,
> I've created a simple class, which is a subclass of vtkObject, and tried to
> use vtkSmartPointer with it. The class is as follows:
> class MyClass : public vtkObject
> {
> public:
> MyClass()
> {
> std::cout << "BEING CONSTRUCTED" << std::endl;
> }
> ~MyClass()
> {
> std::cout << "BEING DESTRUCTED" << std::endl;
> }
> };
>

You need to implement the static New function and have your
constructor and destructor protected. Here is the smallest example of
a class that I use vtkSmartPointer with in VS2008.

class smvtkMarkerData : public vtkObject
{
public:
	vtkTypeRevisionMacro(smvtkMarkerData,vtkObject);	
	static smvtkMarkerData*	New();

	typedef vtkSmartPointer< smvtkMarkerData > Ptr;
protected:
	smvtkMarkerData();
	~smvtkMarkerData();

public:
	smPropertyMap*	getSMProps();
	bool			setSMProps(smPropertyMap* pProps);
	bool			isReadOnly();
	void			setReadOnly(bool bReadOnly);
	void			PrintSelf(ostream& os, vtkIndent indent);

private:
	class		smPrivate;
	smPrivate*	m_pPrivate;

private:
	smvtkMarkerData(const smvtkMarkerData&);	// Intentionally Not implemented.
	void operator=(const smvtkMarkerData&);		// Intentionally Not implemented.
};


From ritesh.haria at gmail.com  Thu Dec 23 04:15:59 2010
From: ritesh.haria at gmail.com (Ritesh Haria)
Date: Thu, 23 Dec 2010 14:45:59 +0530
Subject: [vtkusers] Fwd: An unhandled exception of type
 'System.AccessViolationException' occurred in vtkFormsWindow.dll.. while
 using VTK .NET Wrapper
In-Reply-To: 
References: 
Message-ID: 

Need Help

---------- Forwarded message ----------
From: Ritesh Haria 
Date: Sun, Dec 19, 2010 at 1:35 PM
Subject: An unhandled exception of type 'System.AccessViolationException'
occurred in vtkFormsWindow.dll.. while using VTK .NET Wrapper
To: vtkusers at vtk.org


Dear Mr. Mark,

I am using Programming with VTK .NET Wrappers control
vtkFormsWindowControl (http://vtkdotnet.sourceforge.net/Programming.html)
user control to display a dicom image and add window level feature to it.
I am able to display the image. On right mouse click and drag it zooms in
and out as expected.
On left click and drag it should perform window and level operations. But
when I left click mouse, I get the following error:

An unhandled exception of type 'System.AccessViolationException' occurred in
vtkFormsWindow.dll

Additional information: Attempted to read or write protected memory. This is
often an indication that other memory is corrupt.

> vtkFormsWindow.dll!vtk::vtkFormsWindowControl::OnMouseDown(System::Windows::Forms::MouseEventArgs^
ea = 0x03cfe4d4) Line 401 C++


Kindly provide a feasible solution

Thanking you,
Ritesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From thomas.maxwell at nasa.gov  Thu Dec 23 11:43:04 2010
From: thomas.maxwell at nasa.gov (Maxwell, Thomas P. (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP])
Date: Thu, 23 Dec 2010 10:43:04 -0600
Subject: [vtkusers] vtkImageData  point extraction
Message-ID: 


Is there a VTK filter that will take as input a vtkImageData and a list of (unstructured) points and then compute (as output) the image values at the specified point locations?

Thanks,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From top.grzechu at gmail.com  Thu Dec 23 12:09:16 2010
From: top.grzechu at gmail.com (Grzegorz Toporek)
Date: Thu, 23 Dec 2010 18:09:16 +0100
Subject: [vtkusers] What is Data Type returned by
	vtkDataObject::GetDataObjectType method?
In-Reply-To: 
References: 
Message-ID: 

Dear all,

>
> when I read DICOM files, ones via vtkDICOMImageReader (all DICOMs from
> directory) and second time by using vtkDataSetReader (a .vtk file with the
> same data, that has been read and saved with ITK) I got different Data Type
> from vtkDataObject::GetDataObjectType method.
>
> What does it mean that Data Type is 1 or 6? How can I change one Data Type
> into another? The problem is, my volume is not rendering correctly for Data
> Type 6 (vtkDICOMImageReader).
>
> I use following code to get information about my data:
>
> public void getImageDataInformation(vtkImageData object){
>         //show information about data
>         dataType = object.GetDataObjectType();
>         String scalarType = object.GetScalarTypeAsString();
>         //vtkInformation outInfo = new vtkInformation();
>         // if 1 - grayscale if 3 RGB, HSV, HSI etc
>         numberOfScalarComponents    = object.GetNumberOfScalarComponents();
>         dim                         = object.GetDimensions();
>         scalarTypeMax               = object.GetScalarTypeMax();
>         scalarTypeMin               = object.GetScalarTypeMin();
>         spacing                     = object.GetSpacing();
>         dataRange                   = object.GetScalarRange();
>
>         StringBuffer buffer = new StringBuffer();
>         buffer.append("Number of components :
> ").append(numberOfScalarComponents);
>         buffer.append("\n");
>         buffer.append("Data dimentions:
> ").append(dim[0]).append("x").append(dim[1]).append("x").append(dim[2]);
>         buffer.append("\n");
>         buffer.append("Data type : ").append(dataType);
>         buffer.append("\n");
>         buffer.append("Data spacing :
> ").append(spacing[0]).append(spacing[1]).append(spacing[2]);
>         buffer.append("\n");
>         buffer.append("Scalar type: ").append(scalarType);
>         buffer.append("\n");
>         buffer.append("Data sclar min : ").append(scalarTypeMin).append("
> and max: ").append(scalarTypeMax);
>         buffer.append("\n");
>         buffer.append("Image range:
> ").append(dataRange[0]).append("-").append(dataRange[1]);
>         buffer.append("\n");
>
>         if (debug){
>             log.append(buffer.toString());
>             log.setCaretPosition(log.getDocument().getLength());
>             System.out.println(buffer.toString());
>         }
>     }
>
> The output is:
>
> 1) for DICOMs
>
> Number of components : 1
> Data dimentions: 512x512x220
> Data type : 6
> Data spacing : 0.3906250.3906251.0
> Scalar type: unsigned short
> Data sclar min : 0.0 and max: 65535.0
> Image range: 0.0-65535.0
>
> 2) for .vtk file
>
> Number of components : 1
> Data dimentions: 512x512x220
> Data type : 1
> Data spacing : 0.3906250.3906251.0
> Scalar type: unsigned short
> Data sclar min : 0.0 and max: 65535.0
> Image range: 0.0-65535.0
>
> Could you please give me some feedbacks?
>
>
> Regards,
> Grzegorz
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From jamitch at sandia.gov  Thu Dec 23 15:27:43 2010
From: jamitch at sandia.gov (Mitchell, John A)
Date: Thu, 23 Dec 2010 13:27:43 -0700
Subject: [vtkusers] vtkPlane functions
Message-ID: <74004B6E4BD2E644AC4D89FD20D26233905A0B160B@ES03SNLNT.srn.sandia.gov>

I'm wondering if the following functions on vtkPlane could promise not to change the input data by making them 'const'?

static int      IntersectWithLine (double p1[3], double p2[3], double n[3], double p0[3], double &t, double x[3])
int     IntersectWithLine (double p1[3], double p2[3], double &t, double x[3])

PROPOSED ADDITIONS:
static int      IntersectWithLine (const double p1[3], const double p2[3], const double n[3], const double p0[3], double &t, double x[3])
int     IntersectWithLine (const double p1[3], const double p2[3], double &t, double x[3])


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From jamitch at sandia.gov  Thu Dec 23 15:43:33 2010
From: jamitch at sandia.gov (Mitchell, John A)
Date: Thu, 23 Dec 2010 13:43:33 -0700
Subject: [vtkusers] vtkXMLPUnstructuredGridWriter::SetFileName - do not
	include "."
Message-ID: <74004B6E4BD2E644AC4D89FD20D26233905A0B1610@ES03SNLNT.srn.sandia.gov>

Hello,

I have an application code that runs parallel calculations (multiple parts) and writes a vtk file(s) for each time step.

There appears to be an issue with having a period "."  within the name of the file given to the writer vtkXMLPUnstructuredGridWriter --  See below.      A work around for us has been to replace the "." with "_".

       vtkSmartPointer w = vtkSmartPointer::New();
       w->SetNumberOfPieces(numProcs);
        w->SetStartPiece(rank);
        w->SetEndPiece(rank);
        w->SetFileName(_fileName);  // where  _filename = "Compression_2x1x1.gold".

Then, this code was called once for each timestep:

       vtkSmartPointer g = ...
        writer->SetFileName(name.c_str()); // where name = "Compression_2x1x1.gold_t0.pvtu", "Compression_2x1x1.gold_t1.pvtu", etc
        writer ->SetInput(g);
        writer ->Write();

The result was the creation of the following files:
Compression_2x1x1_0.vtu
Compression_2x1x1.gold_t0.pvtu
Compression_2x1x1.gold_t1.pvtu
Compression_2x1x1.gold_t2.pvtu
Compression_2x1x1.gold_t3.pvtu
Compression_2x1x1.gold_t4.pvtu
Compression_2x1x1.gold_t5.pvtu

The single vtu file contained only the data from the last call to write(). Each pvtu file pointed to the same vtu file (e.g., each pvtu file contained "").

Regards,
john


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From liangxi1986317 at hotmail.com  Thu Dec 23 18:05:11 2010
From: liangxi1986317 at hotmail.com (Xi LIANG)
Date: Fri, 24 Dec 2010 07:05:11 +0800
Subject: [vtkusers] Howdy What's up
Message-ID: 

What's up, this is very fascinating! As the hottest diet supplement on the market, we take a closer look at 
http://www.nowheal.com !! giving you an in depth analysis...

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From basalt76 at gmail.com  Fri Dec 24 00:56:25 2010
From: basalt76 at gmail.com (=?EUC-KR?B?wMzH9sO2?=)
Date: Fri, 24 Dec 2010 14:56:25 +0900
Subject: [vtkusers] Version differences related with opacity
Message-ID: 

Dear Sir/Madam,

I created a isosurface using vtkMarchingContourFilter, and put opacity under
1.0.
The image looks abnormal in vtk 5.2.1.

But if I use vtk 5.6.0, it gets normal.

Do you know any differences related with this phenomenon* *between these two
version ?

Even though I used depth peeling or depth sorting in vtk 5.2.1, it didn't
get better.

I attached two images in vkt 5.2.1 and vtk 5.6.0.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: before_depthSorting.JPG
Type: image/jpeg
Size: 67442 bytes
Desc: not available
URL: 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: VTK5-6.JPG
Type: image/jpeg
Size: 55797 bytes
Desc: not available
URL: 

From nclemeur at gmail.com  Fri Dec 24 02:11:31 2010
From: nclemeur at gmail.com (nclemeur)
Date: Thu, 23 Dec 2010 23:11:31 -0800 (PST)
Subject: [vtkusers] Chart: coordinate conversions
Message-ID: <1293174691349-3317405.post@n5.nabble.com>


Hello,

Is there an easy way to convert the coordinate contained in a
vtkContextMouseEvent into the world coordinate for a vtkChartXY. I have
tried using the static method 
vtkInteractorObserver::ComputeDisplayToWorld(...) which seemd to be the
recommended way for normal 3D object. But it does not seems to work (ie the
value are not really the ones I am expecting).

Cheers,

Nicolas
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Chart-coordinate-conversions-tp3317405p3317405.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From nclemeur at gmail.com  Fri Dec 24 02:29:52 2010
From: nclemeur at gmail.com (nclemeur)
Date: Thu, 23 Dec 2010 23:29:52 -0800 (PST)
Subject: [vtkusers] Chart: coordinate conversions
In-Reply-To: <1293174691349-3317405.post@n5.nabble.com>
References: <1293174691349-3317405.post@n5.nabble.com>
Message-ID: <1293175792364-3317411.post@n5.nabble.com>


Well it seems I have found a solution that seems to work. I just need to use
vtkTransform2D available in the vtkChartXY on each "plot corner".

Cheers

Nicolas
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Chart-coordinate-conversions-tp3317405p3317411.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From ritesh.haria at gmail.com  Fri Dec 24 06:14:08 2010
From: ritesh.haria at gmail.com (Ritesh Haria)
Date: Fri, 24 Dec 2010 16:44:08 +0530
Subject: [vtkusers] window level in c# and vtk
Message-ID: 

Hi Dave,

Referring to your post regarding vtkImageViewe2 and Window Level
Url:
http://vtk.1045678.n5.nabble.com/vtkImageViewe2-and-Window-Level-td2844233.html

We are trying to achieve window and level using vtk and wrappers for vtk in
c#.net using vtkwindowsformcontrol
But we are only able to achieve zoom on right click not the window and
level.

Would you be able to help me out in this case
Thanking you in advance
Ritesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From ritesh.haria at gmail.com  Fri Dec 24 06:23:21 2010
From: ritesh.haria at gmail.com (Ritesh)
Date: Fri, 24 Dec 2010 03:23:21 -0800 (PST)
Subject: [vtkusers] vtkImageViewe2 and Window Level
In-Reply-To: 
References: <20100917195035.GA14050@griensu.com>
	
	
Message-ID: <1293189801437-3317573.post@n5.nabble.com>


Hi Dave,

Referring to your post regarding vtkImageViewe2 and Window Level
Url:
http://vtk.1045678.n5.nabble.com/vtkImageViewe2-and-Window-Level-td2844233.html

We are trying to achieve window and level using vtk and wrappers for vtk in
c#.net using vtkwindowsformcontrol
But we are only able to achieve zoom on right click not the window and
level.

Would you be able to help me out in this case?
Also can you provide a supporting source code
Thanking you in advance
Ritesh
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/vtkImageViewe2-and-Window-Level-tp2844233p3317573.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From marcus.hanwell at kitware.com  Fri Dec 24 11:41:27 2010
From: marcus.hanwell at kitware.com (Marcus D. Hanwell)
Date: Fri, 24 Dec 2010 11:41:27 -0500
Subject: [vtkusers] Chart: coordinate conversions
In-Reply-To: <1293174691349-3317405.post@n5.nabble.com>
References: <1293174691349-3317405.post@n5.nabble.com>
Message-ID: 

On Fri, Dec 24, 2010 at 2:11 AM, nclemeur  wrote:
>
> Hello,
>
> Is there an easy way to convert the coordinate contained in a
> vtkContextMouseEvent into the world coordinate for a vtkChartXY. I have
> tried using the static method
> vtkInteractorObserver::ComputeDisplayToWorld(...) which seemd to be the
> recommended way for normal 3D object. But it does not seems to work (ie the
> value are not really the ones I am expecting).
>
I am not clear about which world coordinates you mean - pixel
coordinates in screen space? The vtkContextMouseEvent object contains
the item position (Pos), then the Scene and Screen positions, see,

http://www.vtk.org/doc/nightly/html/classvtkContextMouseEvent.html

It also contains the last position of each of the above. You can of
course use the 2D transforms, but in many cases there is no need.

Marcus


From david.gobbi at gmail.com  Fri Dec 24 16:51:59 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Fri, 24 Dec 2010 14:51:59 -0700
Subject: [vtkusers] vtkImageData point extraction
In-Reply-To: 
References: 
Message-ID: 

Hi Tom,

I think you want vtkProbeFilter.  It takes two inputs, one input for
volumetric data and another input for a set of points whose scalars
will be interpolated from the first input.

probeFilter->SetSourceConnection()
probeFilter->SetInputConnection()

Is this what you were looking for?

   David


On Thu, Dec 23, 2010 at 9:43 AM, Maxwell, Thomas P.
(GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP] 
wrote:
>
> Is there a VTK filter that will take as input a vtkImageData and a list of
> (unstructured) points and then compute (as output) the image values at the
> specified point locations?
>
> Thanks,
> Tom


From kjafari at rad.hfh.edu  Sat Dec 25 20:38:16 2010
From: kjafari at rad.hfh.edu (Jafari, Kourosh)
Date: Sat, 25 Dec 2010 20:38:16 -0500
Subject: [vtkusers] vtkImageData point extraction
In-Reply-To: 
References: 
Message-ID: <6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F8768@RISMAIL1.rad.hfh.edu>

Hi David,

I have similar a question. I have a 3D image volume and would like to sample it on a structured grid. Here is how I use it:

 static int dims[3]={100,100,100};
 vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
 sgrid->SetDimensions(dims);

....

 probe->SetInput(sgrid);
 probe->SetSource(connector->GetOutput());
 probe->SpatialMatchOn();

 vtkImageData *imageP = vtkImageData::New();
 imageP->DeepCopy(probe->GetImageDataOutput());


The type of connector->GetOutput() is vtkImageData which is the volume I'd like to sample. I later display imageP. There is no compilation error but it crashes when I run it. If I exchange the inputs of SetInput and SetSource, it does not crash but it does not do anything either. What am I missing?

Thanks!!
Kourosh


________________________________________
From: vtkusers-bounces at vtk.org [vtkusers-bounces at vtk.org] On Behalf Of David Gobbi [david.gobbi at gmail.com]
Sent: Friday, December 24, 2010 4:51 PM
To: Maxwell, Thomas P. (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP]
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] vtkImageData point extraction

Hi Tom,

I think you want vtkProbeFilter.  It takes two inputs, one input for
volumetric data and another input for a set of points whose scalars
will be interpolated from the first input.

probeFilter->SetSourceConnection()
probeFilter->SetInputConnection()

Is this what you were looking for?

   David


On Thu, Dec 23, 2010 at 9:43 AM, Maxwell, Thomas P.
(GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP] 
wrote:
>
> Is there a VTK filter that will take as input a vtkImageData and a list of
> (unstructured) points and then compute (as output) the image values at the
> specified point locations?
>
> Thanks,
> Tom
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

From kjafari at rad.hfh.edu  Sun Dec 26 11:10:17 2010
From: kjafari at rad.hfh.edu (Jafari, Kourosh)
Date: Sun, 26 Dec 2010 11:10:17 -0500
Subject: [vtkusers] Can we manually place landmarks using vtkSplineWidget?
Message-ID: <6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F8769@RISMAIL1.rad.hfh.edu>

Dear all,

I am using vtkSplineWidget in the XY plane to manually draw a boundary around an object. It works fine but the way I use it a fixed number handles are already in the plane and I just have to move them to their correct locations. But I would like to manually place an arbitrary number of handles in the plane in arbitrary locations. Is there a way to do that using vtkSplineWidget or I just have to use something else?

Thanks!
Kourosh


From l.vanmiegroet at ulg.ac.be  Sun Dec 26 11:13:42 2010
From: l.vanmiegroet at ulg.ac.be (l.vanmiegroet at ulg.ac.be)
Date: Sun, 26 Dec 2010 17:13:42 +0100 (CET)
Subject: [vtkusers] get value at x y z
Message-ID: <323656105.43193.1293380022740.JavaMail.root@serv225.segi.ulg.ac.be>

Hi all, 


I searched for two hours how to simply obtain the value at a point coordinates x,y,z from a polydata ?

I found the evaluation for implicit function but how to do the same from a polydata ?

Cheers
Laurent.


From l.vanmiegroet at ulg.ac.be  Sun Dec 26 11:16:56 2010
From: l.vanmiegroet at ulg.ac.be (l.vanmiegroet at ulg.ac.be)
Date: Sun, 26 Dec 2010 17:16:56 +0100 (CET)
Subject: [vtkusers] get value at x y z (interpolate)
Message-ID: <392721004.43199.1293380216136.JavaMail.root@serv225.segi.ulg.ac.be>

Hi all, 


I searched for two hours how to simply obtain the value at a point coordinates x,y,z from a polydata ?

I found the evaluation for implicit function but how to do the same from a polydata ?

Cheers
Laurent.


From sebastien.jourdain at kitware.com  Sun Dec 26 11:47:50 2010
From: sebastien.jourdain at kitware.com (Sebastien Jourdain)
Date: Sun, 26 Dec 2010 17:47:50 +0100
Subject: [vtkusers] test if vtkImageData is blank
In-Reply-To: 
References: 
Message-ID: 

If you have a scalar range on the data array and if the min/max are
equal to 0, you are done...

Seb

On Mon, Dec 20, 2010 at 6:15 PM, Jonathan Morra  wrote:
> Is there a way to quickly tell if a vtkImageData?is blank (contains all
> 0's)? ?I can't iterate the pixels cause I'm in Java and that's too slow.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


From jonmorra at gmail.com  Sun Dec 26 12:27:12 2010
From: jonmorra at gmail.com (Jonathan Morra)
Date: Sun, 26 Dec 2010 09:27:12 -0800
Subject: [vtkusers] test if vtkImageData is blank
In-Reply-To: 
References: 
	
Message-ID: 

This would appear to work, but after
calling .SetScalarComponentFromDouble(x, y, z, 0, 1) the
image.GetScalarRange() still returns [0, 0] which, I would assume, it
shouldn't.  Am I doing something wrong?

On Sun, Dec 26, 2010 at 8:47 AM, Sebastien Jourdain <
sebastien.jourdain at kitware.com> wrote:

> If you have a scalar range on the data array and if the min/max are
> equal to 0, you are done...
>
> Seb
>
> On Mon, Dec 20, 2010 at 6:15 PM, Jonathan Morra 
> wrote:
> > Is there a way to quickly tell if a vtkImageData is blank (contains all
> > 0's)?  I can't iterate the pixels cause I'm in Java and that's too slow.
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From sebastien.jourdain at kitware.com  Sun Dec 26 12:49:36 2010
From: sebastien.jourdain at kitware.com (Sebastien Jourdain)
Date: Sun, 26 Dec 2010 18:49:36 +0100
Subject: [vtkusers] test if vtkImageData is blank
In-Reply-To: 
References: 
	
	
Message-ID: 

I have no idea on the expected behavior... And I'm not much familiar
with imageData...

Sorry,

Seb

On Sun, Dec 26, 2010 at 6:27 PM, Jonathan Morra  wrote:
> This would appear to work, but after
> calling?.SetScalarComponentFromDouble(x, y, z, 0, 1) the
> image.GetScalarRange() still returns [0, 0] which, I would assume, it
> shouldn't. ?Am I doing something wrong?
>
> On Sun, Dec 26, 2010 at 8:47 AM, Sebastien Jourdain
>  wrote:
>>
>> If you have a scalar range on the data array and if the min/max are
>> equal to 0, you are done...
>>
>> Seb
>>
>> On Mon, Dec 20, 2010 at 6:15 PM, Jonathan Morra 
>> wrote:
>> > Is there a way to quickly tell if a vtkImageData?is blank (contains all
>> > 0's)? ?I can't iterate the pixels cause I'm in Java and that's too slow.
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >
>> >
>
>


From karthik.krishnan at kitware.com  Sun Dec 26 13:15:09 2010
From: karthik.krishnan at kitware.com (Karthik Krishnan)
Date: Sun, 26 Dec 2010 23:45:09 +0530
Subject: [vtkusers] test if vtkImageData is blank
In-Reply-To: 
References: 
	
	
	
Message-ID: 

GetScalarRange will re-compute the scalar range only if the image has been
modified. It has time stamps internally to avoid re-computing the scalar
range during every call to GetScalarRange().

The method SetScalarComponentFromDouble does not change the MTime of the
image for efficiency.

Invoke Modified() on the image and then invoke GetScalarRange() and you
should see it update.


--
karthik



On Sun, Dec 26, 2010 at 11:19 PM, Sebastien Jourdain <
sebastien.jourdain at kitware.com> wrote:

> I have no idea on the expected behavior... And I'm not much familiar
> with imageData...
>
> Sorry,
>
> Seb
>
> On Sun, Dec 26, 2010 at 6:27 PM, Jonathan Morra 
> wrote:
> > This would appear to work, but after
> > calling .SetScalarComponentFromDouble(x, y, z, 0, 1) the
> > image.GetScalarRange() still returns [0, 0] which, I would assume, it
> > shouldn't.  Am I doing something wrong?
> >
> > On Sun, Dec 26, 2010 at 8:47 AM, Sebastien Jourdain
> >  wrote:
> >>
> >> If you have a scalar range on the data array and if the min/max are
> >> equal to 0, you are done...
> >>
> >> Seb
> >>
> >> On Mon, Dec 20, 2010 at 6:15 PM, Jonathan Morra 
> >> wrote:
> >> > Is there a way to quickly tell if a vtkImageData is blank (contains
> all
> >> > 0's)?  I can't iterate the pixels cause I'm in Java and that's too
> slow.
> >> > _______________________________________________
> >> > Powered by www.kitware.com
> >> >
> >> > Visit other Kitware open-source projects at
> >> > http://www.kitware.com/opensource/opensource.html
> >> >
> >> > Please keep messages on-topic and check the VTK FAQ at:
> >> > http://www.vtk.org/Wiki/VTK_FAQ
> >> >
> >> > Follow this link to subscribe/unsubscribe:
> >> > http://www.vtk.org/mailman/listinfo/vtkusers
> >> >
> >> >
> >
> >
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From jonmorra at gmail.com  Sun Dec 26 14:08:22 2010
From: jonmorra at gmail.com (Jonathan Morra)
Date: Sun, 26 Dec 2010 11:08:22 -0800
Subject: [vtkusers] test if vtkImageData is blank
In-Reply-To: 
References: 
	
	
	
	
Message-ID: 

I tried this, and after invoking Modified() on the image data, the scalar
range is still [0, 0].

On Sun, Dec 26, 2010 at 10:15 AM, Karthik Krishnan <
karthik.krishnan at kitware.com> wrote:

> GetScalarRange will re-compute the scalar range only if the image has been
> modified. It has time stamps internally to avoid re-computing the scalar
> range during every call to GetScalarRange().
>
> The method SetScalarComponentFromDouble does not change the MTime of the
> image for efficiency.
>
> Invoke Modified() on the image and then invoke GetScalarRange() and you
> should see it update.
>
>
> --
> karthik
>
>
>
>
> On Sun, Dec 26, 2010 at 11:19 PM, Sebastien Jourdain <
> sebastien.jourdain at kitware.com> wrote:
>
>> I have no idea on the expected behavior... And I'm not much familiar
>> with imageData...
>>
>> Sorry,
>>
>> Seb
>>
>> On Sun, Dec 26, 2010 at 6:27 PM, Jonathan Morra 
>> wrote:
>> > This would appear to work, but after
>> > calling .SetScalarComponentFromDouble(x, y, z, 0, 1) the
>> > image.GetScalarRange() still returns [0, 0] which, I would assume, it
>> > shouldn't.  Am I doing something wrong?
>> >
>> > On Sun, Dec 26, 2010 at 8:47 AM, Sebastien Jourdain
>> >  wrote:
>> >>
>> >> If you have a scalar range on the data array and if the min/max are
>> >> equal to 0, you are done...
>> >>
>> >> Seb
>> >>
>> >> On Mon, Dec 20, 2010 at 6:15 PM, Jonathan Morra 
>> >> wrote:
>> >> > Is there a way to quickly tell if a vtkImageData is blank (contains
>> all
>> >> > 0's)?  I can't iterate the pixels cause I'm in Java and that's too
>> slow.
>> >> > _______________________________________________
>> >> > Powered by www.kitware.com
>> >> >
>> >> > Visit other Kitware open-source projects at
>> >> > http://www.kitware.com/opensource/opensource.html
>> >> >
>> >> > Please keep messages on-topic and check the VTK FAQ at:
>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>> >> >
>> >> > Follow this link to subscribe/unsubscribe:
>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >> >
>> >> >
>> >
>> >
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From david.gobbi at gmail.com  Sun Dec 26 14:36:00 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Sun, 26 Dec 2010 12:36:00 -0700
Subject: [vtkusers] test if vtkImageData is blank
In-Reply-To: 
References: 
	
	
	
	
	
Message-ID: 

Hi Jonathan,

You have to go one level deeper with the Modified() call.
Here is the recipe, both modified calls are necessary:

image.Modified()
image.GetPointData().GetScalars().Modified()
range = image.GetScalarRange()

This is because both vtkImageData and vtkDataArray have
their own timestamps.

 - David



On Sun, Dec 26, 2010 at 12:08 PM, Jonathan Morra  wrote:
> I tried this, and after invoking Modified() on the image data, the scalar
> range is still [0, 0].
>
> On Sun, Dec 26, 2010 at 10:15 AM, Karthik Krishnan
>  wrote:
>>
>> GetScalarRange will re-compute the scalar range only if the image has been
>> modified. It has time stamps internally to avoid re-computing the scalar
>> range during every call to GetScalarRange().
>>
>> The method SetScalarComponentFromDouble does not change the MTime of the
>> image for efficiency.
>>
>> Invoke Modified() on the image and then invoke GetScalarRange() and you
>> should see it update.
>>
>>
>> --
>> karthik
>>
>>
>>
>> On Sun, Dec 26, 2010 at 11:19 PM, Sebastien Jourdain
>>  wrote:
>>>
>>> I have no idea on the expected behavior... And I'm not much familiar
>>> with imageData...
>>>
>>> Sorry,
>>>
>>> Seb
>>>
>>> On Sun, Dec 26, 2010 at 6:27 PM, Jonathan Morra 
>>> wrote:
>>> > This would appear to work, but after
>>> > calling?.SetScalarComponentFromDouble(x, y, z, 0, 1) the
>>> > image.GetScalarRange() still returns [0, 0] which, I would assume, it
>>> > shouldn't. ?Am I doing something wrong?
>>> >
>>> > On Sun, Dec 26, 2010 at 8:47 AM, Sebastien Jourdain
>>> >  wrote:
>>> >>
>>> >> If you have a scalar range on the data array and if the min/max are
>>> >> equal to 0, you are done...
>>> >>
>>> >> Seb
>>> >>
>>> >> On Mon, Dec 20, 2010 at 6:15 PM, Jonathan Morra 
>>> >> wrote:
>>> >> > Is there a way to quickly tell if a vtkImageData?is blank (contains
>>> >> > all
>>> >> > 0's)? ?I can't iterate the pixels cause I'm in Java and that's too
>>> >> > slow.
>>> >> > _______________________________________________
>>> >> > Powered by www.kitware.com
>>> >> >
>>> >> > Visit other Kitware open-source projects at
>>> >> > http://www.kitware.com/opensource/opensource.html
>>> >> >
>>> >> > Please keep messages on-topic and check the VTK FAQ at:
>>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>>> >> >
>>> >> > Follow this link to subscribe/unsubscribe:
>>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>>> >> >
>>> >> >
>>> >
>>> >
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


From jonmorra at gmail.com  Sun Dec 26 16:34:47 2010
From: jonmorra at gmail.com (Jonathan Morra)
Date: Sun, 26 Dec 2010 13:34:47 -0800
Subject: [vtkusers] test if vtkImageData is blank
In-Reply-To: 
References: 
	
	
	
	
	
	
Message-ID: 

Great, that works perfectly, thanks.

On Sun, Dec 26, 2010 at 11:36 AM, David Gobbi  wrote:

> Hi Jonathan,
>
> You have to go one level deeper with the Modified() call.
> Here is the recipe, both modified calls are necessary:
>
> image.Modified()
> image.GetPointData().GetScalars().Modified()
> range = image.GetScalarRange()
>
> This is because both vtkImageData and vtkDataArray have
> their own timestamps.
>
>  - David
>
>
>
> On Sun, Dec 26, 2010 at 12:08 PM, Jonathan Morra 
> wrote:
> > I tried this, and after invoking Modified() on the image data, the scalar
> > range is still [0, 0].
> >
> > On Sun, Dec 26, 2010 at 10:15 AM, Karthik Krishnan
> >  wrote:
> >>
> >> GetScalarRange will re-compute the scalar range only if the image has
> been
> >> modified. It has time stamps internally to avoid re-computing the scalar
> >> range during every call to GetScalarRange().
> >>
> >> The method SetScalarComponentFromDouble does not change the MTime of the
> >> image for efficiency.
> >>
> >> Invoke Modified() on the image and then invoke GetScalarRange() and you
> >> should see it update.
> >>
> >>
> >> --
> >> karthik
> >>
> >>
> >>
> >> On Sun, Dec 26, 2010 at 11:19 PM, Sebastien Jourdain
> >>  wrote:
> >>>
> >>> I have no idea on the expected behavior... And I'm not much familiar
> >>> with imageData...
> >>>
> >>> Sorry,
> >>>
> >>> Seb
> >>>
> >>> On Sun, Dec 26, 2010 at 6:27 PM, Jonathan Morra 
> >>> wrote:
> >>> > This would appear to work, but after
> >>> > calling .SetScalarComponentFromDouble(x, y, z, 0, 1) the
> >>> > image.GetScalarRange() still returns [0, 0] which, I would assume, it
> >>> > shouldn't.  Am I doing something wrong?
> >>> >
> >>> > On Sun, Dec 26, 2010 at 8:47 AM, Sebastien Jourdain
> >>> >  wrote:
> >>> >>
> >>> >> If you have a scalar range on the data array and if the min/max are
> >>> >> equal to 0, you are done...
> >>> >>
> >>> >> Seb
> >>> >>
> >>> >> On Mon, Dec 20, 2010 at 6:15 PM, Jonathan Morra  >
> >>> >> wrote:
> >>> >> > Is there a way to quickly tell if a vtkImageData is blank
> (contains
> >>> >> > all
> >>> >> > 0's)?  I can't iterate the pixels cause I'm in Java and that's too
> >>> >> > slow.
> >>> >> > _______________________________________________
> >>> >> > Powered by www.kitware.com
> >>> >> >
> >>> >> > Visit other Kitware open-source projects at
> >>> >> > http://www.kitware.com/opensource/opensource.html
> >>> >> >
> >>> >> > Please keep messages on-topic and check the VTK FAQ at:
> >>> >> > http://www.vtk.org/Wiki/VTK_FAQ
> >>> >> >
> >>> >> > Follow this link to subscribe/unsubscribe:
> >>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
> >>> >> >
> >>> >> >
> >>> >
> >>> >
> >>> _______________________________________________
> >>> Powered by www.kitware.com
> >>>
> >>> Visit other Kitware open-source projects at
> >>> http://www.kitware.com/opensource/opensource.html
> >>>
> >>> Please keep messages on-topic and check the VTK FAQ at:
> >>> http://www.vtk.org/Wiki/VTK_FAQ
> >>>
> >>> Follow this link to subscribe/unsubscribe:
> >>> http://www.vtk.org/mailman/listinfo/vtkusers
> >>
> >
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From daviddoria at gmail.com  Sun Dec 26 18:59:53 2010
From: daviddoria at gmail.com (David Doria)
Date: Sun, 26 Dec 2010 17:59:53 -0600
Subject: [vtkusers] get value at x y z (interpolate)
In-Reply-To: <392721004.43199.1293380216136.JavaMail.root@serv225.segi.ulg.ac.be>
References: <392721004.43199.1293380216136.JavaMail.root@serv225.segi.ulg.ac.be>
Message-ID: 

On Sun, Dec 26, 2010 at 10:16 AM,   wrote:
> Hi all,
>
>
> I searched for two hours how to simply obtain the value at a point coordinates x,y,z from a polydata ?
>
> I found the evaluation for implicit function but how to do the same from a polydata ?
>
> Cheers
> Laurent.

Since a polydata explicitly defines points, it only makes sense to
query the data associated with them by index. If you want to find a
point in your polydata that is closest to a particular (x,y,z), check
out vtkPointLocator. There are some examples here:
http://www.vtk.org/Wiki/VTK/Examples/Cxx#Data_Structures

David


From nclemeur at gmail.com  Sun Dec 26 20:43:21 2010
From: nclemeur at gmail.com (nclemeur)
Date: Sun, 26 Dec 2010 17:43:21 -0800 (PST)
Subject: [vtkusers] Chart: coordinate conversions
In-Reply-To: 
References: <1293174691349-3317405.post@n5.nabble.com>
	
Message-ID: <1293414201697-3319011.post@n5.nabble.com>



Marcus D. Hanwell-2 wrote:
> 
> I am not clear about which world coordinates you mean - pixel
> coordinates in screen space? The vtkContextMouseEvent object contains
> the item position (Pos), then the Scene and Screen positions, see,
> 
> http://www.vtk.org/doc/nightly/html/classvtkContextMouseEvent.html
> 
> It also contains the last position of each of the above. You can of
> course use the 2D transforms, but in many cases there is no need.
> 

Sorry I should have been more clear, what I was after was not really
coordinates, but I was after the "real value" in the plot (the one of
interest by the end-user). I am not really sure what's the name for that (I
though it was world coordinates). I am actually, displaying the x,y "value"
in the status bar of my wxWidgets application when the mouse is moving. I
don't think these values are available directly in the vtkContextMouseEvent
object (at least I could not find them when breaking in that function). I
guess this similar to what I was posting at:

http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp3297279p3298834.html
http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp3297279p3298834.html 

I am trying to add a bit of interactivity within my chart window and I am
not really sure that the API allow to do that yet. But I am still in the
process of discovering it (so far I had to modify the vtkChartXY to make
vtkChartXYPrivate protected instead of private, this is not really the way I
want to do it, but I don't think I have access to this data elsewhere).

Cheers

Nicolas



-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Chart-coordinate-conversions-tp3317405p3319011.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From l.vanmiegroet at ulg.ac.be  Mon Dec 27 04:21:30 2010
From: l.vanmiegroet at ulg.ac.be (l.vanmiegroet at ulg.ac.be)
Date: Mon, 27 Dec 2010 10:21:30 +0100 (CET)
Subject: [vtkusers] get value at x y z (interpolate)
In-Reply-To: 
Message-ID: <1055785244.44680.1293441690080.JavaMail.root@serv225.segi.ulg.ac.be>

Hi David, 

I do not want the closest point, i really need an interpolated values at given coordinates. Not the closest point.
VTK uses some interpolation between points when displaying scalar values, so how can i obtain a scalar values at any x-y-z. 

I have a polydata, but what are the steps from this polydata to be able to query a value at any x-y-z. 
The vtkcountourfilter is interoplating values to create the iso surface, so it is possible.
Laurent


----- Mail original -----
De: "David Doria" 
?: "l vanmiegroet" 
Cc: "vtkusers" 
Envoy?: Lundi 27 D?cembre 2010 00:59:53
Objet: Re: [vtkusers] get value at x y z (interpolate)

On Sun, Dec 26, 2010 at 10:16 AM,  wrote:
> Hi all,
>
>
> I searched for two hours how to simply obtain the value at a point
> coordinates x,y,z from a polydata ?
>
> I found the evaluation for implicit function but how to do the same
> from a polydata ?
>
> Cheers
> Laurent.

Since a polydata explicitly defines points, it only makes sense to
query the data associated with them by index. If you want to find a
point in your polydata that is closest to a particular (x,y,z), check
out vtkPointLocator. There are some examples here:
http://www.vtk.org/Wiki/VTK/Examples/Cxx#Data_Structures

David


From John.Fraser at icr.ac.uk  Mon Dec 27 09:29:01 2010
From: John.Fraser at icr.ac.uk (John Fraser)
Date: Mon, 27 Dec 2010 14:29:01 +0000
Subject: [vtkusers] get value at x y z (interpolate)
Message-ID: <4D18A2AD0200003F0000F7A0@viking.icr.ac.uk>

Not sure if this helps or not, I use vtkTupleInterpolator for
interpolation of (x,y) and it works fine, e.g.
 
...
interpolator.AddTuple(cps, factor);
...
interpolator.InterpolateTuple(value, factor);


>>>  12/27/10 9:22 AM >>>
Hi David, 

I do not want the closest point, i really need an interpolated values at
given coordinates. Not the closest point.
VTK uses some interpolation between points when displaying scalar
values, so how can i obtain a scalar values at any x-y-z. 

I have a polydata, but what are the steps from this polydata to be able
to query a value at any x-y-z. 
The vtkcountourfilter is interoplating values to create the iso surface,
so it is possible.
Laurent


----- Mail original -----
De: "David Doria" 
?: "l vanmiegroet" 
Cc: "vtkusers" 
Envoy?: Lundi 27 D?cembre 2010 00:59:53
Objet: Re: [vtkusers] get value at x y z (interpolate)

On Sun, Dec 26, 2010 at 10:16 AM,  wrote:
> Hi all,
>
>
> I searched for two hours how to simply obtain the value at a point
> coordinates x,y,z from a polydata ?
>
> I found the evaluation for implicit function but how to do the same
> from a polydata ?
>
> Cheers
> Laurent.

Since a polydata explicitly defines points, it only makes sense to
query the data associated with them by index. If you want to find a
point in your polydata that is closest to a particular (x,y,z), check
out vtkPointLocator. There are some examples here:
http://www.vtk.org/Wiki/VTK/Examples/Cxx#Data_Structures

David
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addressee only.  If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer and network.


From daviddoria at gmail.com  Mon Dec 27 09:38:44 2010
From: daviddoria at gmail.com (David Doria)
Date: Mon, 27 Dec 2010 08:38:44 -0600
Subject: [vtkusers] get value at x y z (interpolate)
In-Reply-To: <4D18A2AD0200003F0000F7A0@viking.icr.ac.uk>
References: <4D18A2AD0200003F0000F7A0@viking.icr.ac.uk>
Message-ID: 

On Mon, Dec 27, 2010 at 8:29 AM, John Fraser  wrote:
> Not sure if this helps or not, I use vtkTupleInterpolator for
> interpolation of (x,y) and it works fine, e.g.
>
> ...
> interpolator.AddTuple(cps, factor);
> ...
> interpolator.InterpolateTuple(value, factor);

Laurent,

As far as I know in VTK you have to have "structured" data to do any
interpolation (where polydata is "unstructured").

Take a look at these:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ShepardMethod
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/CardinalSpline

They should convert your polydata into a structured data set that you
can then perform interpolation on.

David


From marcus.hanwell at kitware.com  Mon Dec 27 12:37:17 2010
From: marcus.hanwell at kitware.com (Marcus D. Hanwell)
Date: Mon, 27 Dec 2010 12:37:17 -0500
Subject: [vtkusers] Chart: coordinate conversions
In-Reply-To: <1293414201697-3319011.post@n5.nabble.com>
References: <1293174691349-3317405.post@n5.nabble.com>
	
	<1293414201697-3319011.post@n5.nabble.com>
Message-ID: 

On Sun, Dec 26, 2010 at 8:43 PM, nclemeur  wrote:
>
>
> Marcus D. Hanwell-2 wrote:
>>
>> I am not clear about which world coordinates you mean - pixel
>> coordinates in screen space? The vtkContextMouseEvent object contains
>> the item position (Pos), then the Scene and Screen positions, see,
>>
>> http://www.vtk.org/doc/nightly/html/classvtkContextMouseEvent.html
>>
>> It also contains the last position of each of the above. You can of
>> course use the 2D transforms, but in many cases there is no need.
>>
>
> Sorry I should have been more clear, what I was after was not really
> coordinates, but I was after the "real value" in the plot (the one of
> interest by the end-user). I am not really sure what's the name for that (I
> though it was world coordinates). I am actually, displaying the x,y "value"
> in the status bar of my wxWidgets application when the mouse is moving. I
> don't think these values are available directly in the vtkContextMouseEvent
> object (at least I could not find them when breaking in that function). I
> guess this similar to what I was posting at:

They are available to the plot items in their paint event, Pos is
always the transformed position, but not to anything else.
>
> http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp3297279p3298834.html
> http://vtk.1045678.n5.nabble.com/vtkChartXY-picking-tp3297279p3298834.html
>
> I am trying to add a bit of interactivity within my chart window and I am
> not really sure that the API allow to do that yet. But I am still in the
> process of discovering it (so far I had to modify the vtkChartXY to make
> vtkChartXYPrivate protected instead of private, this is not really the way I
> want to do it, but I don't think I have access to this data elsewhere).

I could certainly add accessors for the vtkTransform2D objects, or the
entire vtkContextTransform object for each of the corners. I have been
looking at this class with a critical eye as adding the support for
multiple plot corners (feature required by ParaView) has made the code
significantly more complex.

It would not be a problem to add a little API to get at the objects you need.

Marcus


From igorznt at gmail.com  Mon Dec 27 14:40:26 2010
From: igorznt at gmail.com (igorznt)
Date: Mon, 27 Dec 2010 11:40:26 -0800 (PST)
Subject: [vtkusers] Cutting a polygon
Message-ID: <1293478826832-3319653.post@n5.nabble.com>


I have a polydata, and I want to cut it with a plane and see the inside part
filled with ist color. Im sending 2 images and the vtp file im using. the
first one is without cut, and second is with cut.  You can see the cylinder
and the implant in the first, but in the second, you can see the cylinder
cutted and a i line that i putted to show where the implant should be. I
have already tryed this
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/CapClip . I tested it with
simple polygons and it works for cutting, but with others, like the vtp i
sent, it dindt work. Nothing is displayed. For coloring, if  i cut a tube,
and 2 parts of it is cutted, it join both and create a new area. Does anyone
knows how to help.

Here's my code.

#implant.vtp file was sent with mail. It looks perfectly when i don't cut it
#When i cut, i would like to show the part cutted filled with its color
path = os.path.join(constant.RESOURCES_DIR, "implant.vtp")
reader = vtk.vtkXMLPolyDataReader()
reader.SetFileName(path)
reader.Update()

mapper = vtk.vtkPolyDataMapper()
mapper.SetResolveCoincidentTopologyToPolygonOffset()

#Using cut and dont using extract, i could see a cylinder border, but
#the implant, i couldnt see anyway. I dont know if it is because of the
# implant polydata, and if im cutting the right way
cutter = vtk.vtkCutter()
cutter.SetCutFunction(planeCutter) #Plane cutter is a vtk plane
cutter.GenerateCutScalarsOn()
cutter.SetInputConnection(reader.GetOutputPort())
cutter.Update()

extract = vtk.vtkExtractPolyDataGeometry()
extract.SetInputConnection(cutter.GetOutputPort())
extract.ExtractBoundaryCellsOn()
extract.SetImplicitFunction(planeCutter)

mapper.SetInputConnection(extract.GetOutputPort())
mapper.GlobalImmediateModeRenderingOn()   

actor = vtk.vtkActor()
actor.PickableOn()
actor.SetMapper(mapper)

actor.GetProperty().SetColor(self.implantColor)
renderer.AddActor(actor)
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Cutting-a-polygon-tp3319653p3319653.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From david.gobbi at gmail.com  Mon Dec 27 16:36:30 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Mon, 27 Dec 2010 16:36:30 -0500
Subject: [vtkusers] get value at x y z (interpolate)
In-Reply-To: 
References: <4D18A2AD0200003F0000F7A0@viking.icr.ac.uk>
	
Message-ID: 

On Mon, Dec 27, 2010 at 9:38 AM, David Doria  wrote:
> On Mon, Dec 27, 2010 at 8:29 AM, John Fraser  wrote:
>> Not sure if this helps or not, I use vtkTupleInterpolator for
>> interpolation of (x,y) and it works fine, e.g.
>>
>> ...
>> interpolator.AddTuple(cps, factor);
>> ...
>> interpolator.InterpolateTuple(value, factor);
>
> Laurent,
>
> As far as I know in VTK you have to have "structured" data to do any
> interpolation (where polydata is "unstructured").
>
> Take a look at these:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ShepardMethod
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/CardinalSpline
>
> They should convert your polydata into a structured data set that you
> can then perform interpolation on.

VTK can interpolate any data that has cells, but interpolating data
from 2D cells (i.e. polygons, triangles) can be tricky.  The
general-purpose filter for doing interpolation is vtkProbeFilter which
takes two inputs: one input for the data to be interpolated, and
another input that has the points at which you do the interpolation.

There is also a low-level method for doing interpolation: all
vtkDataSets have a FindCell(x,y,z,...) method that can return a cell
(i.e. polygon, FEM element, etc) and the interpolation weights to
apply to each point that makes up the cell.

  David


From taijinian at gmail.com  Mon Dec 27 19:40:24 2010
From: taijinian at gmail.com (Jenya Burstein)
Date: Mon, 27 Dec 2010 16:40:24 -0800
Subject: [vtkusers] Problem setting custom cursor to QVTKWidget
Message-ID: 

I am  working on an application that uses both VTK and Qt.  The application
has a view containing an vtkScalarBarWidget, and a custom cursor that is set
through Qt.

An issue exists on the Macintosh whereby when a user moves their mouse
cursor into the vtkScalarBarWidget, the cursor changes to an arrow cursor.
 When the user moves the cursor outside of that vtkScalarBarWidget, the
cursor remains as an arrow and does not reset itself back to the custom
cursor applied to the view.  On Windows the cursor will change back to the
desired custom cursor.

What is someone supposed to do to effect the proper cursor behavior for the
Macintosh platform?

Thank you,
Jenya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From nclemeur at gmail.com  Mon Dec 27 23:30:22 2010
From: nclemeur at gmail.com (nclemeur)
Date: Mon, 27 Dec 2010 20:30:22 -0800 (PST)
Subject: [vtkusers] Chart: coordinate conversions
In-Reply-To: 
References: <1293174691349-3317405.post@n5.nabble.com>
	
	<1293414201697-3319011.post@n5.nabble.com>
	
Message-ID: <1293510622031-3319956.post@n5.nabble.com>



Marcus D. Hanwell-2 wrote:
> 
> 
> I could certainly add accessors for the vtkTransform2D objects, or the
> entire vtkContextTransform object for each of the corners. I have been
> looking at this class with a critical eye as adding the support for
> multiple plot corners (feature required by ParaView) has made the code
> significantly more complex.
> 
> It would not be a problem to add a little API to get at the objects you
> need.
> 

I would definitely appreciate that and I am ready to help, but I am not
really sure where to start. Just let me know if I can do anything.

In the meantime, I have some more information about the (small) problem I
have found mentioned in this post:

http://vtk.1045678.n5.nabble.com/Question-on-Viewports-vtkChartXY-SetGeometry-in-example-TestMultipleChartRenderers-cxx-tp3284622p3295269.html

It seems that the grid lines been drawn outside the chart area is not linked
to the multiple charts in the same view, but to the logarithmic scale. I
have reproduced the problem in the TestLinePlotInteraction by adding the
lines below after the creation of the chart:

chart->GetAxis(0)->SetLogScale(true);
chart->GetAxis(1)->SetLogScale(true);

A screenshot illustrating the problem is below:

http://vtk.1045678.n5.nabble.com/file/n3319956/LinePlotInteraction.png 

Cheers


Nicolas





-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Chart-coordinate-conversions-tp3317405p3319956.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From david.gobbi at gmail.com  Tue Dec 28 02:45:54 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Tue, 28 Dec 2010 02:45:54 -0500
Subject: [vtkusers] vtkImageData point extraction
In-Reply-To: <6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F8768@RISMAIL1.rad.hfh.edu>
References: 
	<6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F8768@RISMAIL1.rad.hfh.edu>
Message-ID: 

Hi Kourosh,

Don't use SpatialMatchOn() until you first have it working properly
with SpatialMatchOff().  Also, don't forget to do probe->Update()
before you use the probe filter's output.

If sgrid->SetDimensions(dims) the only thing that you did to set up
the structured grid, then that isn't enough.  The structured grid
needs you to set the points (I've never used vtkStructuredGrid,
myself, so I can't provide an example, but I'm sure that it takes a
few more steps to create the data).

  David


On Sat, Dec 25, 2010 at 8:38 PM, Jafari, Kourosh  wrote:
> Hi David,
>
> I have similar a question. I have a 3D image volume and would like to sample it on a structured grid. Here is how I use it:
>
> ?static int dims[3]={100,100,100};
> ?vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
> ?sgrid->SetDimensions(dims);
>
> ....
>
> ?probe->SetInput(sgrid);
> ?probe->SetSource(connector->GetOutput());
> ?probe->SpatialMatchOn();
>
> ?vtkImageData *imageP = vtkImageData::New();
> ?imageP->DeepCopy(probe->GetImageDataOutput());
>
>
> The type of connector->GetOutput() is vtkImageData which is the volume I'd like to sample. I later display imageP. There is no compilation error but it crashes when I run it. If I exchange the inputs of SetInput and SetSource, it does not crash but it does not do anything either. What am I missing?
>
> Thanks!!
> Kourosh
>
>
> ________________________________________
> From: vtkusers-bounces at vtk.org [vtkusers-bounces at vtk.org] On Behalf Of David Gobbi [david.gobbi at gmail.com]
> Sent: Friday, December 24, 2010 4:51 PM
> To: Maxwell, Thomas P. (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP]
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] vtkImageData point extraction
>
> Hi Tom,
>
> I think you want vtkProbeFilter. ?It takes two inputs, one input for
> volumetric data and another input for a set of points whose scalars
> will be interpolated from the first input.
>
> probeFilter->SetSourceConnection()
> probeFilter->SetInputConnection()
>
> Is this what you were looking for?
>
> ? David
>
>
> On Thu, Dec 23, 2010 at 9:43 AM, Maxwell, Thomas P.
> (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP] 
> wrote:
>>
>> Is there a VTK filter that will take as input a vtkImageData and a list of
>> (unstructured) points and then compute (as output) the image values at the
>> specified point locations?
>>
>> Thanks,
>> Tom
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers


From kjafari at rad.hfh.edu  Tue Dec 28 09:31:47 2010
From: kjafari at rad.hfh.edu (Jafari, Kourosh)
Date: Tue, 28 Dec 2010 09:31:47 -0500
Subject: [vtkusers] vtkImageData point extraction
In-Reply-To: 
References: 
Message-ID: <6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F877A@RISMAIL1.rad.hfh.edu>

Thanks David,

I had actually set up the points of the structured grid. I had replaced it with "..." in the e-mail to make it brief. I applied your suggestions but still it crashes. Following is the actual code (the structured grid here is just an example to test the code). Are you sure SetInput is for points in which we want to resample and SetSource is the volume? Actually, when I exchange their inputs the program does not crash but give the error message:

ERROR: In ..\..\vtk-5.6.0\Filtering\vtkStreamingDemandDrivenPipeline.cxx, line 879
vtkStreamingDemandDrivenPipeline (03CF52C8): The update extent specified in the information for output port 0 on algorithm vtkTrivialProducer(0259FD08) is 0 249 0 249 0 249, which is outside the whole extent 0 99 0 99 0 99.

Thanks  a lot,
Kourosh

----------------------------------------------------------
The actual code that causes the program to crash:

 vtkProbeFilter* probe = vtkProbeFilter::New();
 // Create the structured grid
 int i, j, k, kOffset, jOffset, offset;
 float x[3], v[3], rMin=0, rMax=3.0, deltaRad, deltaZ;
 float radius, theta;
 static int dims[3]={100,100,100};
 vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
 sgrid->SetDimensions(dims);
 vtkFloatArray *vectors = vtkFloatArray::New();
    vectors->SetNumberOfComponents(3);
    vectors->SetNumberOfTuples(dims[0]*dims[1]*dims[2]);
    vtkPoints *points = vtkPoints::New();
 points->Allocate(dims[0]*dims[1]*dims[2]);
 deltaZ = 2.0 / (dims[2]-1);
 deltaRad = (rMax-rMin) / (dims[1]-1);
 v[2]=0.0;
 for ( k=0; kInsertPoint(offset,x);
    vectors->InsertTuple(offset,v);
   }
  }
 }
 sgrid->SetPoints(points);
    points->Delete();
 sgrid->GetPointData()->SetVectors(vectors);
    vectors->Delete();

 probe->SetInput(sgrid);
 probe->SetSource(connector->GetOutput());
 probe->SpatialMatchOff();
 probe->Update();
 vtkImageData *imageP = vtkImageData::New();
 imageP->DeepCopy(probe->GetImageDataOutput());













________________________________________
From: David Gobbi [david.gobbi at gmail.com]
Sent: Tuesday, December 28, 2010 2:45 AM
To: Jafari, Kourosh
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] vtkImageData point extraction

Hi Kourosh,

Don't use SpatialMatchOn() until you first have it working properly
with SpatialMatchOff().  Also, don't forget to do probe->Update()
before you use the probe filter's output.

If sgrid->SetDimensions(dims) the only thing that you did to set up
the structured grid, then that isn't enough.  The structured grid
needs you to set the points (I've never used vtkStructuredGrid,
myself, so I can't provide an example, but I'm sure that it takes a
few more steps to create the data).

  David


On Sat, Dec 25, 2010 at 8:38 PM, Jafari, Kourosh  wrote:
> Hi David,
>
> I have similar a question. I have a 3D image volume and would like to sample it on a structured grid. Here is how I use it:
>
>  static int dims[3]={100,100,100};
>  vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
>  sgrid->SetDimensions(dims);
>
> ....
>
>  probe->SetInput(sgrid);
>  probe->SetSource(connector->GetOutput());
>  probe->SpatialMatchOn();
>
>  vtkImageData *imageP = vtkImageData::New();
>  imageP->DeepCopy(probe->GetImageDataOutput());
>
>
> The type of connector->GetOutput() is vtkImageData which is the volume I'd like to sample. I later display imageP. There is no compilation error but it crashes when I run it. If I exchange the inputs of SetInput and SetSource, it does not crash but it does not do anything either. What am I missing?
>
> Thanks!!
> Kourosh
>
>
> ________________________________________
> From: vtkusers-bounces at vtk.org [vtkusers-bounces at vtk.org] On Behalf Of David Gobbi [david.gobbi at gmail.com]
> Sent: Friday, December 24, 2010 4:51 PM
> To: Maxwell, Thomas P. (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP]
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] vtkImageData point extraction
>
> Hi Tom,
>
> I think you want vtkProbeFilter.  It takes two inputs, one input for
> volumetric data and another input for a set of points whose scalars
> will be interpolated from the first input.
>
> probeFilter->SetSourceConnection()
> probeFilter->SetInputConnection()
>
> Is this what you were looking for?
>
>   David
>
>
> On Thu, Dec 23, 2010 at 9:43 AM, Maxwell, Thomas P.
> (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP] 
> wrote:
>>
>> Is there a VTK filter that will take as input a vtkImageData and a list of
>> (unstructured) points and then compute (as output) the image values at the
>> specified point locations?
>>
>> Thanks,
>> Tom
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

From david.gobbi at gmail.com  Tue Dec 28 12:53:58 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Tue, 28 Dec 2010 12:53:58 -0500
Subject: [vtkusers] vtkImageData point extraction
In-Reply-To: <6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F877A@RISMAIL1.rad.hfh.edu>
References: 
	<6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F877A@RISMAIL1.rad.hfh.edu>
Message-ID: 

Hi Karoush,

You, it looks like I did have the Source and Input switched in my last email.
The "outside the whole extent" error is a bit surprising to me, because the
vtkProbeFilter is supposed to automatically set the UpdateExtent to be
exactly the same as the WholeExtent.  So this error might be coming from
some earlier filter in the pipeline.

One thing you can check is that GetBounds() on your image data returns a
bounds that is at least as large as GetBounds() on your structured grid.
I'm just making a guess here, but the Spacing and Origin of your image
data might not be correct.  You should print them out (after calling Update,
of course) just to be sure.

  David


On Tue, Dec 28, 2010 at 9:31 AM, Jafari, Kourosh  wrote:
> Thanks David,
>
> I had actually set up the points of the structured grid. I had replaced it with "..." in the e-mail to make it brief. I applied your suggestions but still it crashes. Following is the actual code (the structured grid here is just an example to test the code). Are you sure SetInput is for points in which we want to resample and SetSource is the volume? Actually, when I exchange their inputs the program does not crash but give the error message:
>
> ERROR: In ..\..\vtk-5.6.0\Filtering\vtkStreamingDemandDrivenPipeline.cxx, line 879
> vtkStreamingDemandDrivenPipeline (03CF52C8): The update extent specified in the information for output port 0 on algorithm vtkTrivialProducer(0259FD08) is 0 249 0 249 0 249, which is outside the whole extent 0 99 0 99 0 99.
>
> Thanks ?a lot,
> Kourosh
>
> ----------------------------------------------------------
> The actual code that causes the program to crash:
>
> ?vtkProbeFilter* probe = vtkProbeFilter::New();
> ?// Create the structured grid
> ?int i, j, k, kOffset, jOffset, offset;
> ?float x[3], v[3], rMin=0, rMax=3.0, deltaRad, deltaZ;
> ?float radius, theta;
> ?static int dims[3]={100,100,100};
> ?vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
> ?sgrid->SetDimensions(dims);
> ?vtkFloatArray *vectors = vtkFloatArray::New();
> ? ?vectors->SetNumberOfComponents(3);
> ? ?vectors->SetNumberOfTuples(dims[0]*dims[1]*dims[2]);
> ? ?vtkPoints *points = vtkPoints::New();
> ?points->Allocate(dims[0]*dims[1]*dims[2]);
> ?deltaZ = 2.0 / (dims[2]-1);
> ?deltaRad = (rMax-rMin) / (dims[1]-1);
> ?v[2]=0.0;
> ?for ( k=0; k ?{
> ?x[2] = (-1.0 + k*deltaZ)*10;
> ?kOffset = k * dims[0] * dims[1];
> ?for (j=0; j ?{
> ? radius = rMin + j*deltaRad;
> ? jOffset = j * dims[0];
> ? for (i=0; i ? {
> ? ?v[0] = -x[1];
> ? ?v[1] = x[0];
> ? ?v[2] = 2;
> ? ?x[0]=i;x[1]=j;x[2]=k;
> ? ?offset = i + jOffset + kOffset;
> ? ?points->InsertPoint(offset,x);
> ? ?vectors->InsertTuple(offset,v);
> ? }
> ?}
> ?}
> ?sgrid->SetPoints(points);
> ? ?points->Delete();
> ?sgrid->GetPointData()->SetVectors(vectors);
> ? ?vectors->Delete();
>
> ?probe->SetInput(sgrid);
> ?probe->SetSource(connector->GetOutput());
> ?probe->SpatialMatchOff();
> ?probe->Update();
> ?vtkImageData *imageP = vtkImageData::New();
> ?imageP->DeepCopy(probe->GetImageDataOutput());
>
>
>
>
>
>
>
>
>
>
>
>
>
> ________________________________________
> From: David Gobbi [david.gobbi at gmail.com]
> Sent: Tuesday, December 28, 2010 2:45 AM
> To: Jafari, Kourosh
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] vtkImageData point extraction
>
> Hi Kourosh,
>
> Don't use SpatialMatchOn() until you first have it working properly
> with SpatialMatchOff(). ?Also, don't forget to do probe->Update()
> before you use the probe filter's output.
>
> If sgrid->SetDimensions(dims) the only thing that you did to set up
> the structured grid, then that isn't enough. ?The structured grid
> needs you to set the points (I've never used vtkStructuredGrid,
> myself, so I can't provide an example, but I'm sure that it takes a
> few more steps to create the data).
>
> ?David
>
>
> On Sat, Dec 25, 2010 at 8:38 PM, Jafari, Kourosh  wrote:
>> Hi David,
>>
>> I have similar a question. I have a 3D image volume and would like to sample it on a structured grid. Here is how I use it:
>>
>> ?static int dims[3]={100,100,100};
>> ?vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
>> ?sgrid->SetDimensions(dims);
>>
>> ....
>>
>> ?probe->SetInput(sgrid);
>> ?probe->SetSource(connector->GetOutput());
>> ?probe->SpatialMatchOn();
>>
>> ?vtkImageData *imageP = vtkImageData::New();
>> ?imageP->DeepCopy(probe->GetImageDataOutput());
>>
>>
>> The type of connector->GetOutput() is vtkImageData which is the volume I'd like to sample. I later display imageP. There is no compilation error but it crashes when I run it. If I exchange the inputs of SetInput and SetSource, it does not crash but it does not do anything either. What am I missing?
>>
>> Thanks!!
>> Kourosh
>>
>>
>> ________________________________________
>> From: vtkusers-bounces at vtk.org [vtkusers-bounces at vtk.org] On Behalf Of David Gobbi [david.gobbi at gmail.com]
>> Sent: Friday, December 24, 2010 4:51 PM
>> To: Maxwell, Thomas P. (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP]
>> Cc: vtkusers at vtk.org
>> Subject: Re: [vtkusers] vtkImageData point extraction
>>
>> Hi Tom,
>>
>> I think you want vtkProbeFilter. ?It takes two inputs, one input for
>> volumetric data and another input for a set of points whose scalars
>> will be interpolated from the first input.
>>
>> probeFilter->SetSourceConnection()
>> probeFilter->SetInputConnection()
>>
>> Is this what you were looking for?
>>
>> ? David
>>
>>
>> On Thu, Dec 23, 2010 at 9:43 AM, Maxwell, Thomas P.
>> (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP] 
>> wrote:
>>>
>>> Is there a VTK filter that will take as input a vtkImageData and a list of
>>> (unstructured) points and then compute (as output) the image values at the
>>> specified point locations?
>>>
>>> Thanks,
>>> Tom
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers


From igorznt at gmail.com  Tue Dec 28 13:21:28 2010
From: igorznt at gmail.com (igorznt)
Date: Tue, 28 Dec 2010 10:21:28 -0800 (PST)
Subject: [vtkusers] Cutting a polygon
In-Reply-To: <1293478826832-3319653.post@n5.nabble.com>
References: <1293478826832-3319653.post@n5.nabble.com>
Message-ID: <1293560488325-3320541.post@n5.nabble.com>


I forgot to send the files. I'm sending the vtp file and the 2 images. 

Not cutting
http://vtk.1045678.n5.nabble.com/file/n3320541/without_cut.png 

Cutting
http://vtk.1045678.n5.nabble.com/file/n3320541/cutting.png 
Vtp File
http://vtk.1045678.n5.nabble.com/file/n3320541/implant.vtp implant.vtp 
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Cutting-a-polygon-tp3319653p3320541.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From webmaster at insightsoftwareconsortium.org  Tue Dec 28 13:36:12 2010
From: webmaster at insightsoftwareconsortium.org (Insight Journal)
Date: Tue, 28 Dec 2010 13:36:12 -0500
Subject: [vtkusers] The Insight Journal-New Submission
Message-ID: <201012281836.oBSIaC7M011610@insight-journal.org>

Hello,
A new submission has been added to the Insight Journal.

Title: MPI Read Write
Author(s):Hobbs K.
Abstract: 
This paper tests MPI in the Insight Journal testing environment.

Download and Review the paper at: http://www.insight-journal.org/browse/publication/785

Generated by the Insight Journal
You are receiving this email because you asked to be informed by the Insight Journal for new submissions.
                    
To change your email preference go to http://www.insight-journal.org .


From taijinian at gmail.com  Tue Dec 28 16:40:30 2010
From: taijinian at gmail.com (Jenya Burstein)
Date: Tue, 28 Dec 2010 13:40:30 -0800
Subject: [vtkusers] using strings for axis tick labels.
Message-ID: 

Hello,

Is there a way to use strings for axis tick labels both in vtkChartXY based
plots as well as with vtkCubeAxesActor?

Best Regards,
Jenya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From emonson at cs.duke.edu  Tue Dec 28 17:19:10 2010
From: emonson at cs.duke.edu (Eric E. Monson)
Date: Tue, 28 Dec 2010 17:19:10 -0500
Subject: [vtkusers] using strings for axis tick labels.
In-Reply-To: 
References: 
Message-ID: <9F8DF4E4-052E-4D2C-ADD2-8B4608FF76AD@cs.duke.edu>

Hey Jenya,

I don't see a way to do it with vtkCubeAxesActor (although I've never used it myself), but with vtkChartXY you can access the axes with chart->GetAxis(int index) and set the tick labels with strings through a vtkStringArray and axis->SetTickLabels(vtkStringArray *). To get the axis to not set the tick positions automatically you'll have to use axis->SetBehavior(vtkAxis::CUSTOM) and axis->SetTickPositions(vtkDoubleArray *) along with the tick labels.

-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Dec 28, 2010, at 4:40 PM, Jenya Burstein wrote:

> Hello,
>  
> Is there a way to use strings for axis tick labels both in vtkChartXY based plots as well as with vtkCubeAxesActor?
>  
> Best Regards,
> Jenya
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



From taijinian at gmail.com  Tue Dec 28 17:47:58 2010
From: taijinian at gmail.com (Jenya Burstein)
Date: Tue, 28 Dec 2010 14:47:58 -0800
Subject: [vtkusers] using strings for axis tick labels.
In-Reply-To: <9F8DF4E4-052E-4D2C-ADD2-8B4608FF76AD@cs.duke.edu>
References: 
	<9F8DF4E4-052E-4D2C-ADD2-8B4608FF76AD@cs.duke.edu>
Message-ID: 

Thanks Eric,

I got it working with vtkChartXY.

Jenya

On Tue, Dec 28, 2010 at 2:19 PM, Eric E. Monson  wrote:

> way to do it with vtkCubeAxesActor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From vtkusersneedhelp at yahoo.fr  Wed Dec 29 03:58:57 2010
From: vtkusersneedhelp at yahoo.fr (Fireman Fireman)
Date: Wed, 29 Dec 2010 08:58:57 +0000 (GMT)
Subject: [vtkusers] Volume rendering Bug when spacing between slices is 0
Message-ID: <442500.28330.qm@web24817.mail.ird.yahoo.com>

Hello,
?
I have a question regarding volume rendering with gpu based volume ray casting and . 

When I use ?the GPURenderDemo example (provided with VTK 5.6.1),the rendering gives an assertion failure
?
Assertion '"check: positive_low_bounds" && lowBounds[2]>= 0.0"'
?
And??when implementing volume rendering with the vtkFixedPointVolumeRayCastMapper there 's no volume rendred (no crash just a black window)
?
I looked at the original images and it seems that spacing between slices is 0 
?
spacing[0] == 0.679688
spacing[1] == 0.679688
spacing[2] == 0
?
?
Please let me know if you have run into this .

How can I avoid this problem ?
?
Thank you in advance



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From ghw at accutrol.com  Wed Dec 29 14:04:00 2010
From: ghw at accutrol.com (Hamilton Woods)
Date: Wed, 29 Dec 2010 11:04:00 -0800 (PST)
Subject: [vtkusers] Problem with reading files
In-Reply-To: 
References: <1281105213646-2266699.post@n5.nabble.com>
	
	
	<1281267306342-2267934.post@n5.nabble.com>
	
	<1281301038017-2268266.post@n5.nabble.com>
	
Message-ID: <1293649440279-3321683.post@n5.nabble.com>


> I see your problem from your other email last week.You installed vtk.
> If you install you can not switch between debug and release. If you do
> not install VTK but build all (for both debug and release) you can
> safely switch between debug and release. When you build an application
> set the VTK_DIR in cmake-gui to the location of your VTK build folder.

> Perhaps someone (possibly me) should fix the wiki to give better advice.

Well, where is the better advice?  Just kidding.  I find this mailing list
to 
be indispensable (I can't imagine using VTK without it!).

I have built VTK from source using Visual Studio 2005 on the Windows XP 
Pro operating system.  I built for release and then debug.  Then I used 
CMake to create a Visual Studio project from the DumpXMLFile example.  
I built DumpXMLFile for release.  It worked.  Then I built DumpXMLFile for 
debug.  When I ran the executable, it produces the exception "Unhandled 
exception at 0x78484f3f in DumpXMLFile.exe: 0xC0000005: Access 
violation reading location 0x99999997."

As is suggested in the previous post, I made sure that VTK_DIR was set 
to the location of your VTK build folder in cmake-gui.  I even attempted 
to modify VTK_DIR so that it pointed directly to the VTK debug folder, 
but I could not generate DumpXMLFile with that setting.

I could probably move past this problem because I do not need to 
determine the data file extension, but I am concerned that I will run into 
this problem somewhere else.  Therefore, I would like to understand 
how to use VTK in debug mode and release mode.

Thanks for your help,
Hamilton Woods


-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-reading-files-tp2266699p3321683.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From drescherjm at gmail.com  Wed Dec 29 14:06:38 2010
From: drescherjm at gmail.com (John Drescher)
Date: Wed, 29 Dec 2010 14:06:38 -0500
Subject: [vtkusers] Problem with reading files
In-Reply-To: <1293649440279-3321683.post@n5.nabble.com>
References: <1281105213646-2266699.post@n5.nabble.com>
	
	
	<1281267306342-2267934.post@n5.nabble.com>
	
	<1281301038017-2268266.post@n5.nabble.com>
	
	<1293649440279-3321683.post@n5.nabble.com>
Message-ID: 

On Wed, Dec 29, 2010 at 2:04 PM, Hamilton Woods  wrote:
>
>> I see your problem from your other email last week.You installed vtk.
>> If you install you can not switch between debug and release. If you do
>> not install VTK but build all (for both debug and release) you can
>> safely switch between debug and release. When you build an application
>> set the VTK_DIR in cmake-gui to the location of your VTK build folder.
>
>> Perhaps someone (possibly me) should fix the wiki to give better advice.
>
> Well, where is the better advice? ?Just kidding. ?I find this mailing list
> to
> be indispensable (I can't imagine using VTK without it!).
>
> I have built VTK from source using Visual Studio 2005 on the Windows XP
> Pro operating system. ?I built for release and then debug. ?Then I used
> CMake to create a Visual Studio project from the DumpXMLFile example.
> I built DumpXMLFile for release. ?It worked. ?Then I built DumpXMLFile for
> debug. ?When I ran the executable, it produces the exception "Unhandled
> exception at 0x78484f3f in DumpXMLFile.exe: 0xC0000005: Access
> violation reading location 0x99999997."
>
> As is suggested in the previous post, I made sure that VTK_DIR was set
> to the location of your VTK build folder in cmake-gui. ?I even attempted
> to modify VTK_DIR so that it pointed directly to the VTK debug folder,
> but I could not generate DumpXMLFile with that setting.
>
> I could probably move past this problem because I do not need to
> determine the data file extension, but I am concerned that I will run into
> this problem somewhere else. ?Therefore, I would like to understand
> how to use VTK in debug mode and release mode.
>

Did you delete the installed location of VTK?

John


From ghw at accutrol.com  Wed Dec 29 14:24:30 2010
From: ghw at accutrol.com (Hamilton Woods)
Date: Wed, 29 Dec 2010 11:24:30 -0800 (PST)
Subject: [vtkusers] Problem with reading files
In-Reply-To: 
References: <1281105213646-2266699.post@n5.nabble.com>
	
	
	<1281267306342-2267934.post@n5.nabble.com>
	
	<1281301038017-2268266.post@n5.nabble.com>
	
	<1293649440279-3321683.post@n5.nabble.com>
	
Message-ID: <1293650670903-3321706.post@n5.nabble.com>


I did not make that clear.  I uninstalled VTK before I ran CMake to 
generate the VTK project.  When I did, the VTK folder disappeared.  
I rebooted the computer.  I am not aware of anything else to check.

Thanks,
Hamilton Woods

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-reading-files-tp2266699p3321706.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From l.vanmiegroet at ulg.ac.be  Wed Dec 29 14:27:27 2010
From: l.vanmiegroet at ulg.ac.be (l.vanmiegroet at ulg.ac.be)
Date: Wed, 29 Dec 2010 20:27:27 +0100 (CET)
Subject: [vtkusers] get value at x y z (interpolate)
In-Reply-To: 
Message-ID: <1696272442.53954.1293650847912.JavaMail.root@serv225.segi.ulg.ac.be>

Hi, i made a mistake as i do not have any values in my polydata so the interpolateTuple does not work and shepardmethod too.

In fact, i want to reconstruct a surface by building it level set value.

I use this : 
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filters/SurfaceFromUnorganizedPointsWithPostProc
or would also like to use this 
http://www.insight-journal.org/browse/publication/718

>From SurfaceFromUnorganizedPointsWithPostProc a contouring is used and it seems that vtkSurfaceReconstructionFilter creates a grid and assign values.

How could i get the values from vtkSurfaceReconstructionFilter that are used by the vtkContourFilter?

I want to determine myself where is the zero level, not by using vtkContourFilter so i need all scalar values on a grid or for any x,y,z.

Any ideas ?

----- Mail original -----
De: "David Gobbi" 
?: "vtkusers" 
Envoy?: Lundi 27 D?cembre 2010 22:36:30
Objet: Re: [vtkusers] get value at x y z (interpolate)

On Mon, Dec 27, 2010 at 9:38 AM, David Doria 
wrote:
> On Mon, Dec 27, 2010 at 8:29 AM, John Fraser 
> wrote:
>> Not sure if this helps or not, I use vtkTupleInterpolator for
>> interpolation of (x,y) and it works fine, e.g.
>>
>> ...
>> interpolator.AddTuple(cps, factor);
>> ... interpolator.InterpolateTuple(value, factor);
>
> Laurent,
>
> As far as I know in VTK you have to have "structured" data to do any
> interpolation (where polydata is "unstructured").
>
> Take a look at these:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ShepardMethod
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/CardinalSpline
>
> They should convert your polydata into a structured data set that you
> can then perform interpolation on.

VTK can interpolate any data that has cells, but interpolating data
from 2D cells (i.e. polygons, triangles) can be tricky. The
general-purpose filter for doing interpolation is vtkProbeFilter which
takes two inputs: one input for the data to be interpolated, and
another input that has the points at which you do the interpolation.

There is also a low-level method for doing interpolation: all
vtkDataSets have a FindCell(x,y,z,...) method that can return a cell
(i.e. polygon, FEM element, etc) and the interpolation weights to
apply to each point that makes up the cell.

David
_______________________________________________ Powered by
www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


From drescherjm at gmail.com  Wed Dec 29 14:28:19 2010
From: drescherjm at gmail.com (John Drescher)
Date: Wed, 29 Dec 2010 14:28:19 -0500
Subject: [vtkusers] Problem with reading files
In-Reply-To: <1293650670903-3321706.post@n5.nabble.com>
References: <1281105213646-2266699.post@n5.nabble.com>
	
	
	<1281267306342-2267934.post@n5.nabble.com>
	
	<1281301038017-2268266.post@n5.nabble.com>
	
	<1293649440279-3321683.post@n5.nabble.com>
	
	<1293650670903-3321706.post@n5.nabble.com>
Message-ID: 

> I did not make that clear. ?I uninstalled VTK before I ran CMake to
> generate the VTK project. ?When I did, the VTK folder disappeared.
> I rebooted the computer. ?I am not aware of anything else to check.
>

Possibly later today or tomorrow, I can try that example myself. What
version of VTK are you using?

John


From ghw at accutrol.com  Wed Dec 29 15:08:46 2010
From: ghw at accutrol.com (Hamilton Woods)
Date: Wed, 29 Dec 2010 12:08:46 -0800 (PST)
Subject: [vtkusers] Problem with reading files
In-Reply-To: 
References: 
	
	<1281267306342-2267934.post@n5.nabble.com>
	
	<1281301038017-2268266.post@n5.nabble.com>
	
	<1293649440279-3321683.post@n5.nabble.com>
	
	<1293650670903-3321706.post@n5.nabble.com>
	
Message-ID: <1293653326502-3321766.post@n5.nabble.com>


VTK version 5.6.1

Hamilton Woods
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-reading-files-tp2266699p3321766.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From ghw at accutrol.com  Wed Dec 29 17:48:35 2010
From: ghw at accutrol.com (Hamilton Woods)
Date: Wed, 29 Dec 2010 14:48:35 -0800 (PST)
Subject: [vtkusers] get value at x y z (interpolate)
In-Reply-To: <1696272442.53954.1293650847912.JavaMail.root@serv225.segi.ulg.ac.be>
References: <392721004.43199.1293380216136.JavaMail.root@serv225.segi.ulg.ac.be>
	
	
	<1696272442.53954.1293650847912.JavaMail.root@serv225.segi.ulg.ac.be>
Message-ID: <1293662915794-3321913.post@n5.nabble.com>


Which post am I really replying to?  Perhaps the original one.  I am 
working my way up to attempting to interpolate scalar values at an 
arbitrary x-y-z point.

I wrote a Python script that calls the ParaView engine to interpolate 
scalar values in a 3-D flowfield using a Plot Over Line filter.  This 
could have been done using the Probe Location filter for each point 
along the line segment.

I am now being directed to convert this to C++ (actually they want 
it done in MATLAB, but they may be OK with using the MEX interface 
to call a C++ program), so I thought I would use VTK.  I am just 
learning how to use CMake, so I haven't gotten to the interpolation 
part of the problem yet.  I suspect that I would have tried something 
like a vtkProbeFilter (Graphics folder) for each point along a line 
segment.  The responses that I am seeing to the original post make 
me wonder if this is more challenging than I had thought.

Also, my understanding is that interpolation in VTK is available for 
structured and unstructured grids.

I hope this is not beating a dead horse.  Can anyone shed some 
light on how to do the equivalent of the ParaView Plot Over Line or 
Probe Location filter using VTK directly?

Thanks for your help,
Hamilton Woods

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/get-value-at-x-y-z-interpolate-tp3318741p3321913.html
Sent from the VTK - Users mailing list archive at Nabble.com.


From ali.mahmoud.habib at gmail.com  Thu Dec 30 08:47:06 2010
From: ali.mahmoud.habib at gmail.com (Ali Habib)
Date: Thu, 30 Dec 2010 15:47:06 +0200
Subject: [vtkusers] enhance the performance
Message-ID: 

Hi all,

I use vtkmarching cube to create iso surface , its performance became so so
bad for large datasets of  DICOM files, and this not accepted
I tired a lot to enhance the performance but without any success

any suggestion please
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From dominik at itis.ethz.ch  Thu Dec 30 09:20:12 2010
From: dominik at itis.ethz.ch (Dominik Szczerba)
Date: Thu, 30 Dec 2010 15:20:12 +0100
Subject: [vtkusers] high order vtkBoxWidget?
Message-ID: 

Hi,

I need something very much like vtkBoxWidget but with arbitrary amount of
control points (1...N nodes on the box edges along with the corner nodes).
Are such widgets present in VTK? If not, anyone has some pointers where to
start implementing one?

Thanks
Dominik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From jaspar.marc at gmail.com  Thu Dec 30 10:41:14 2010
From: jaspar.marc at gmail.com (Marc Jaspar)
Date: Thu, 30 Dec 2010 10:41:14 -0500
Subject: [vtkusers] Missing files
Message-ID: 

I bought a new system (64 bit, Windows & Visual Studio 2010), downloaded
VTK, built and compiled it (no problem) and try to run a sample program.
Multiple errors occurred due to two missing files:

#include 
#include 

I searched all created directories and no luck.
On my previous system, I had no problems.  Can anyone help on this one?

Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From dave.partyka at kitware.com  Thu Dec 30 10:46:24 2010
From: dave.partyka at kitware.com (Dave Partyka)
Date: Thu, 30 Dec 2010 10:46:24 -0500
Subject: [vtkusers] Missing files
In-Reply-To: 
References: 
Message-ID: 

Did you successfully build VTK and is your example properly pointing to VTK?
The vtkstd directory should be in the root of your VTK build tree.

On Thu, Dec 30, 2010 at 10:41 AM, Marc Jaspar  wrote:

> I bought a new system (64 bit, Windows & Visual Studio 2010), downloaded
> VTK, built and compiled it (no problem) and try to run a sample program.
> Multiple errors occurred due to two missing files:
>
> #include 
> #include 
>
> I searched all created directories and no luck.
> On my previous system, I had no problems.  Can anyone help on this one?
>
> Thanks in advance
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From prashanth.dumpuri at gmail.com  Thu Dec 30 12:10:21 2010
From: prashanth.dumpuri at gmail.com (Prashanth)
Date: Thu, 30 Dec 2010 11:10:21 -0600
Subject: [vtkusers] tetrahedral mesh generators using vtk
Message-ID: 

All,
   Can someone point me to a robust tetrahedral mesh generator that runs on
a Windows Machine (preferably using VTK)? I have tried the one in ITK
sandbox but Windows does not seem to like it. vtkDelaunay3D and a non-zero
alpha generates tetrahedrons with poor aspect ratios.
Thanks
Prashanth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From marcus.hanwell at kitware.com  Thu Dec 30 13:10:31 2010
From: marcus.hanwell at kitware.com (Marcus D. Hanwell)
Date: Thu, 30 Dec 2010 13:10:31 -0500
Subject: [vtkusers] Chart: coordinate conversions
In-Reply-To: <1293510622031-3319956.post@n5.nabble.com>
References: <1293174691349-3317405.post@n5.nabble.com>
	
	<1293414201697-3319011.post@n5.nabble.com>
	
	<1293510622031-3319956.post@n5.nabble.com>
Message-ID: 

On Mon, Dec 27, 2010 at 11:30 PM, nclemeur  wrote:
>
>
> Marcus D. Hanwell-2 wrote:
>>
>>
>> I could certainly add accessors for the vtkTransform2D objects, or the
>> entire vtkContextTransform object for each of the corners. I have been
>> looking at this class with a critical eye as adding the support for
>> multiple plot corners (feature required by ParaView) has made the code
>> significantly more complex.
>>
>> It would not be a problem to add a little API to get at the objects you
>> need.
>>
>
> I would definitely appreciate that and I am ready to help, but I am not
> really sure where to start. Just let me know if I can do anything.
>
> In the meantime, I have some more information about the (small) problem I
> have found mentioned in this post:
>
> http://vtk.1045678.n5.nabble.com/Question-on-Viewports-vtkChartXY-SetGeometry-in-example-TestMultipleChartRenderers-cxx-tp3284622p3295269.html
>
> It seems that the grid lines been drawn outside the chart area is not linked
> to the multiple charts in the same view, but to the logarithmic scale. I
> have reproduced the problem in the TestLinePlotInteraction by adding the
> lines below after the creation of the chart:
>
> chart->GetAxis(0)->SetLogScale(true);
> chart->GetAxis(1)->SetLogScale(true);
>
> A screenshot illustrating the problem is below:
>
> http://vtk.1045678.n5.nabble.com/file/n3319956/LinePlotInteraction.png
>
Ah, that is some new contributed code. I will see about getting a
regression test in and ensuring it does not draw outside the axis'
range. Thanks for narrowing down the issue.

Marcus


From ramon.j.moral at usace.army.mil  Thu Dec 30 13:13:08 2010
From: ramon.j.moral at usace.army.mil (Ramon J. Moral)
Date: Thu, 30 Dec 2010 12:13:08 -0600
Subject: [vtkusers] EXC_BAD_ACCESS While Running Application Compiled with
 VTK 5.6.0 on MacOS 10.6.3
Message-ID: 

Hello,

I am very new to this group.  I read a message in the archives with the same
subject as this message.
I am having the same problem.  I am trying to run the VTK the animoltion
example from macresearch.org.
My trace back goes to the iostream header at line 77:

  static ios_base::Init __ioinit;

I have tried everything.  I even rebuilt vtk using the 10.5 SDK.  Ever since
I have loaded the latest Xcode all my VTK installation have broke.
At home I had vtk setup to where I was using it with PyDev...now it does not
work.  I hope as more people run into this problem, some clever person will
find the solution.

Cheers,


Ramon J. Moral, Ph.D.
mailto:ramon.j.moral at usace.army.mil
CEERD-GM-I         
SIPRNet:ramon.j.moral at army.smil.mil
USACE ERDC         
PH:601-634-3295    
3909 Halls Ferry Road, Vicksburg, MS 39180 USA       MOBILE:601-415-4318

*THE CONTENTS OF THIS MESSAGE ARE UNCLASSIFIED

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From kyle at cronangraf.com  Thu Dec 30 16:34:40 2010
From: kyle at cronangraf.com (Kyle Cronan)
Date: Thu, 30 Dec 2010 15:34:40 -0600
Subject: [vtkusers] vtkUnsignedCharArray from python
Message-ID: 

Hi all,

The python wrapper doesn't seem to give any way to convert a
vtkUnsignedCharArray (such as returned by an image output object that
is set to output into memory) into a python string.  Am I right about
that?

It would maybe work if there was something like ExportToVoidPointer
that did the memory allocation for you.  I took a look at the python
wrapper generator but it was beyond me how that all works.  Is there
an easy fix?  In the mean time I will write to a temp file and just
read that back in.

Thanks,
Kyle
-- 
Cronan Graf Corporation
2215 S. St. Louis Ave
Chicago, IL? 60623
(312) 504-3279


From drescherjm at gmail.com  Thu Dec 30 18:24:54 2010
From: drescherjm at gmail.com (John Drescher)
Date: Thu, 30 Dec 2010 18:24:54 -0500
Subject: [vtkusers]  Problem with reading files
In-Reply-To: 
References: 
	
	<1281267306342-2267934.post@n5.nabble.com>
	
	<1281301038017-2268266.post@n5.nabble.com>
	
	<1293649440279-3321683.post@n5.nabble.com>
	
	<1293650670903-3321706.post@n5.nabble.com>
	
	<1293653326502-3321766.post@n5.nabble.com>
	
Message-ID: 

On Wed, Dec 29, 2010 at 3:08 PM, Hamilton Woods  wrote:
>
> VTK version 5.6.1
>

I just tried the DumpXMLFile example and it worked without any problem
at all in debug and release.


X:\32bit\VC.80\Libraries\vtk-5.6.1\bin\debug>DumpXMLFile.exe
Usage: DumpXMLFile.exe XMLFile1 XMLFile2 ...

X:\32bit\VC.80\Libraries\vtk-5.6.1\bin\debug>DumpXMLFile.exe
e:\Images\vtkdata\Data\blow.vtk
------------------------
e:\Images\vtkdata\Data\blow.vtk
?contains a
vtkUnstructuredGrid that has 1057 cells and 687 points.
? ? ? ?Cell type vtkTriangle occurs 928 times.
? ? ? ?Cell type vtkQuad occurs 129 times.
?contains point data with 2 arrays.
? ? ? ?Array 0 is named displacement0
? ? ? ?Array 1 is named thickness0
?contains cell data with 0 arrays.
?contains field data with 0 arrays.

X:\32bit\VC.80\Libraries\vtk-5.6.1\bin\debug>cd ..

X:\32bit\VC.80\Libraries\vtk-5.6.1\bin>cd release

X:\32bit\VC.80\Libraries\vtk-5.6.1\bin\release>DumpXMLFile.exe
e:\Images\vtkdata\Data\blow.vtk
------------------------
e:\Images\vtkdata\Data\blow.vtk
?contains a
vtkUnstructuredGrid that has 1057 cells and 687 points.
? ? ? ?Cell type vtkTriangle occurs 928 times.
? ? ? ?Cell type vtkQuad occurs 129 times.
?contains point data with 2 arrays.
? ? ? ?Array 0 is named displacement0
? ? ? ?Array 1 is named thickness0
?contains cell data with 0 arrays.
?contains field data with 0 arrays.

Here are the steps I did to get VTK up and running:

1. Extract VTK into a new source folder.
I chose x:\CMakeBased\Libraries\VTK-5.6.1

2. Open the cmake-gui program

3. Select the source folder from step 1.
4. Select a build folder
I chose x:\32bit\vc.80\Libraries\VTK-5.6.1

5. Then click configure and set the compiler version to Visual Studio 2005
I chose to build the 32 bit version for this example.

6. Then configure.
I disabled BUILD_TESTING, left BUILD_SHARED_LIBS disabled and then
enabled BUILD_EXAMPLES. These options are all available if both the
groped and advanced boxes are checked.

7. Then click generate.
This step will take a few minutes.

8. Then open a Visual Studio 2005 command prompt. And change directory
to the build folder.
For me this was
cd x:\32bit\vc.80\Libraries\VTK-5.6.1

9. Then build vtk.
The simplest way is to type vcbuild inside the build folder. I did
that and about 1 hour later it had finished building the 400+ projects
and configurations.

After this I changed directory to the bin folder and ran the examples
and they worked. In my example above I choose an image from the
vtkdata images that can be downloaded on the same page as the source
code.

John



-- 
John M. Drescher


From david.gobbi at gmail.com  Thu Dec 30 18:47:18 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Thu, 30 Dec 2010 23:47:18 +0000
Subject: [vtkusers] vtkUnsignedCharArray from python
In-Reply-To: 
References: 
Message-ID: 

Hi Kyle,

The VTK data arrays support the python "buffer" protocol, which can be
used to get raw access to the array.  If you have numpy, you can do
the following:

a = numpy.fromstring(image.GetPointData().GetScalars(), 'uint8')

Also, in python 2.6, you can get "raw" access to the data like this:

b = buffer(image.GetPointData().GetScalars())

You can use str(b) to convert the buffer to a string, but for most
purposes you should be able to use the buffer directly without
conversion to a string.

  David


On Thu, Dec 30, 2010 at 9:34 PM, Kyle Cronan  wrote:
> Hi all,
>
> The python wrapper doesn't seem to give any way to convert a
> vtkUnsignedCharArray (such as returned by an image output object that
> is set to output into memory) into a python string. ?Am I right about
> that?
>
> It would maybe work if there was something like ExportToVoidPointer
> that did the memory allocation for you. ?I took a look at the python
> wrapper generator but it was beyond me how that all works. ?Is there
> an easy fix? ?In the mean time I will write to a temp file and just
> read that back in.
>
> Thanks,
> Kyle
> --
> Cronan Graf Corporation
> 2215 S. St. Louis Ave
> Chicago, IL? 60623
> (312) 504-3279
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>


From kjafari at rad.hfh.edu  Fri Dec 31 13:04:30 2010
From: kjafari at rad.hfh.edu (Jafari, Kourosh)
Date: Fri, 31 Dec 2010 13:04:30 -0500
Subject: [vtkusers] vtkImageData point extraction
In-Reply-To: 
References: 
Message-ID: <6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F8789@RISMAIL1.rad.hfh.edu>

Hi David,

You were right in your original e-mail about Source and Input for vtkProbeFilter. The error in my code was coming from displaying the output. To summarize, as you said, this is how we should use vtkProbeFilter:

probeFilter->SetSourceConnection()
probeFilter->SetInputConnection()

In my code, the source is an image with vtkImageData type and the points are in a vtkStructuredGrid. In the following test code, I have manually generated an image since for some reason the code did not work with my loaded image, which still I have to figure out why. I have now problem with displaying the output of the probe. Ideally, I want the output to be in vtkImageData type in order to easily display it. But it is fine if I display it using any other method. Unfortunately, probe->GetImageDataOutput() whose output is supposed to be of type vtkImageData did not work. I have tried different methods to display the output but they all failed. I can, however, print the interpolated values. The probe->GetOutput() is of type vtkDataSet. How do I display it as an image?

Thanks a lot!
Kourosh


P.S. 

The test code:

 // Manually create an image of type vtkImageData
 vtkImageData *image2 = vtkImageData::New();
 image2->SetScalarTypeToDouble();
 image2->SetNumberOfScalarComponents(1);
 image2->SetExtent(0, 9, 0, 9, 0, 9);
 unsigned int GridSize = 10;
 for ( unsigned int x = 0; x < GridSize; x++ )
 {
  for ( unsigned int y = 0; y < GridSize; y++ )
  {
   for ( unsigned int z = 0; z < GridSize; z++ )
   {
    double val = vtkMath::Random(0.0, 1.0)*100;
    image2->SetScalarComponentFromDouble(x,y,z,0,val);
   }
  }
 }

 // Create a structured grid and insert the points at which I would like to interpolate the image.
 int i, j, k, kOffset, jOffset, offset;
 float x[3], v[3], rMin=0, rMax=3.0, deltaRad, deltaZ;
 float radius, theta;
 static int dims[3]={10,10,1};
 vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
                    sgrid->SetDimensions(dims);
 vtkPoints *points = vtkPoints::New();
            points->Allocate(dims[0]*dims[1]*dims[2]);
 deltaZ = 2.0 / (dims[2]-1);
 deltaRad = (rMax-rMin) / (dims[1]-1);
 v[2]=0.0;
 for ( k=0; kInsertPoint(offset,x);
   }
  }
 }
 sgrid->SetPoints(points);
    points->Delete();

    // Interpolate the image at points specified by the structured grid using vtkProbeFilter
 vtkProbeFilter* probe = vtkProbeFilter::New();
 probe->SetInput(sgrid);
 probe->SetSource(image2);
 probe->SpatialMatchOn();
 probe->Update();

 // I can print the interpolated values:
 vtkDataArray* data = probe->GetOutput()->GetPointData()->GetScalars();
 vtkDoubleArray* doubleData = vtkDoubleArray::SafeDownCast (data);
 cout << doubleData->GetNumberOfTuples()<< endl;
 for(int i = 0; i < doubleData->GetNumberOfTuples(); i++)
 {
  double val = doubleData->GetValue(i);
  cout << "Interpolation using ProbeFilter ";
  cout << "doubleData->GetValue(" << i << "): " << val << endl;
 }


________________________________________
From: David Gobbi [david.gobbi at gmail.com]
Sent: Tuesday, December 28, 2010 12:53 PM
To: Jafari, Kourosh
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] vtkImageData point extraction

Hi Karoush,

You, it looks like I did have the Source and Input switched in my last email.
The "outside the whole extent" error is a bit surprising to me, because the
vtkProbeFilter is supposed to automatically set the UpdateExtent to be
exactly the same as the WholeExtent.  So this error might be coming from
some earlier filter in the pipeline.

One thing you can check is that GetBounds() on your image data returns a
bounds that is at least as large as GetBounds() on your structured grid.
I'm just making a guess here, but the Spacing and Origin of your image
data might not be correct.  You should print them out (after calling Update,
of course) just to be sure.

  David


On Tue, Dec 28, 2010 at 9:31 AM, Jafari, Kourosh  wrote:
> Thanks David,
>
> I had actually set up the points of the structured grid. I had replaced it with "..." in the e-mail to make it brief. I applied your suggestions but still it crashes. Following is the actual code (the structured grid here is just an example to test the code). Are you sure SetInput is for points in which we want to resample and SetSource is the volume? Actually, when I exchange their inputs the program does not crash but give the error message:
>
> ERROR: In ..\..\vtk-5.6.0\Filtering\vtkStreamingDemandDrivenPipeline.cxx, line 879
> vtkStreamingDemandDrivenPipeline (03CF52C8): The update extent specified in the information for output port 0 on algorithm vtkTrivialProducer(0259FD08) is 0 249 0 249 0 249, which is outside the whole extent 0 99 0 99 0 99.
>
> Thanks  a lot,
> Kourosh
>
> ----------------------------------------------------------
> The actual code that causes the program to crash:
>
>  vtkProbeFilter* probe = vtkProbeFilter::New();
>  // Create the structured grid
>  int i, j, k, kOffset, jOffset, offset;
>  float x[3], v[3], rMin=0, rMax=3.0, deltaRad, deltaZ;
>  float radius, theta;
>  static int dims[3]={100,100,100};
>  vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
>  sgrid->SetDimensions(dims);
>  vtkFloatArray *vectors = vtkFloatArray::New();
>    vectors->SetNumberOfComponents(3);
>    vectors->SetNumberOfTuples(dims[0]*dims[1]*dims[2]);
>    vtkPoints *points = vtkPoints::New();
>  points->Allocate(dims[0]*dims[1]*dims[2]);
>  deltaZ = 2.0 / (dims[2]-1);
>  deltaRad = (rMax-rMin) / (dims[1]-1);
>  v[2]=0.0;
>  for ( k=0; k  {
>  x[2] = (-1.0 + k*deltaZ)*10;
>  kOffset = k * dims[0] * dims[1];
>  for (j=0; j  {
>   radius = rMin + j*deltaRad;
>   jOffset = j * dims[0];
>   for (i=0; i   {
>    v[0] = -x[1];
>    v[1] = x[0];
>    v[2] = 2;
>    x[0]=i;x[1]=j;x[2]=k;
>    offset = i + jOffset + kOffset;
>    points->InsertPoint(offset,x);
>    vectors->InsertTuple(offset,v);
>   }
>  }
>  }
>  sgrid->SetPoints(points);
>    points->Delete();
>  sgrid->GetPointData()->SetVectors(vectors);
>    vectors->Delete();
>
>  probe->SetInput(sgrid);
>  probe->SetSource(connector->GetOutput());
>  probe->SpatialMatchOff();
>  probe->Update();
>  vtkImageData *imageP = vtkImageData::New();
>  imageP->DeepCopy(probe->GetImageDataOutput());
>
>
>
>
>
>
>
>
>
>
>
>
>
> ________________________________________
> From: David Gobbi [david.gobbi at gmail.com]
> Sent: Tuesday, December 28, 2010 2:45 AM
> To: Jafari, Kourosh
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] vtkImageData point extraction
>
> Hi Kourosh,
>
> Don't use SpatialMatchOn() until you first have it working properly
> with SpatialMatchOff().  Also, don't forget to do probe->Update()
> before you use the probe filter's output.
>
> If sgrid->SetDimensions(dims) the only thing that you did to set up
> the structured grid, then that isn't enough.  The structured grid
> needs you to set the points (I've never used vtkStructuredGrid,
> myself, so I can't provide an example, but I'm sure that it takes a
> few more steps to create the data).
>
>  David
>
>
> On Sat, Dec 25, 2010 at 8:38 PM, Jafari, Kourosh  wrote:
>> Hi David,
>>
>> I have similar a question. I have a 3D image volume and would like to sample it on a structured grid. Here is how I use it:
>>
>>  static int dims[3]={100,100,100};
>>  vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
>>  sgrid->SetDimensions(dims);
>>
>> ....
>>
>>  probe->SetInput(sgrid);
>>  probe->SetSource(connector->GetOutput());
>>  probe->SpatialMatchOn();
>>
>>  vtkImageData *imageP = vtkImageData::New();
>>  imageP->DeepCopy(probe->GetImageDataOutput());
>>
>>
>> The type of connector->GetOutput() is vtkImageData which is the volume I'd like to sample. I later display imageP. There is no compilation error but it crashes when I run it. If I exchange the inputs of SetInput and SetSource, it does not crash but it does not do anything either. What am I missing?
>>
>> Thanks!!
>> Kourosh
>>
>>
>> ________________________________________
>> From: vtkusers-bounces at vtk.org [vtkusers-bounces at vtk.org] On Behalf Of David Gobbi [david.gobbi at gmail.com]
>> Sent: Friday, December 24, 2010 4:51 PM
>> To: Maxwell, Thomas P. (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP]
>> Cc: vtkusers at vtk.org
>> Subject: Re: [vtkusers] vtkImageData point extraction
>>
>> Hi Tom,
>>
>> I think you want vtkProbeFilter.  It takes two inputs, one input for
>> volumetric data and another input for a set of points whose scalars
>> will be interpolated from the first input.
>>
>> probeFilter->SetSourceConnection()
>> probeFilter->SetInputConnection()
>>
>> Is this what you were looking for?
>>
>>   David
>>
>>
>> On Thu, Dec 23, 2010 at 9:43 AM, Maxwell, Thomas P.
>> (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP] 
>> wrote:
>>>
>>> Is there a VTK filter that will take as input a vtkImageData and a list of
>>> (unstructured) points and then compute (as output) the image values at the
>>> specified point locations?
>>>
>>> Thanks,
>>> Tom
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers

From david.gobbi at gmail.com  Fri Dec 31 13:37:28 2010
From: david.gobbi at gmail.com (David Gobbi)
Date: Fri, 31 Dec 2010 18:37:28 +0000
Subject: [vtkusers] vtkImageData point extraction
In-Reply-To: <6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F8789@RISMAIL1.rad.hfh.edu>
References: 
	<6F5DBCB091F9B346BA7EF3A5444D7A0B4D0C7F8789@RISMAIL1.rad.hfh.edu>
Message-ID: 

Hi Kourosh,

The GetImageDataOutput() method does not do conversion.  It will
return NULL unless the data is already image data.

I'm not sure what you mean when you say "display the output as an
image".  The output is a set of points.  Do you want draw small circle
in the image at each point location?  Or draw a polygon in the image
for each polygon in the data set?

Polydata-to-image conversion is non-specific.  There are several ways
to do it, depending on what a person wants to achieve.

  David


On Fri, Dec 31, 2010 at 6:04 PM, Jafari, Kourosh  wrote:
> Hi David,
>
> You were right in your original e-mail about Source and Input for vtkProbeFilter. The error in my code was coming from displaying the output. To summarize, as you said, this is how we should use vtkProbeFilter:
>
> probeFilter->SetSourceConnection()
> probeFilter->SetInputConnection()
>
> In my code, the source is an image with vtkImageData type and the points are in a vtkStructuredGrid. In the following test code, I have manually generated an image since for some reason the code did not work with my loaded image, which still I have to figure out why. I have now problem with displaying the output of the probe. Ideally, I want the output to be in vtkImageData type in order to easily display it. But it is fine if I display it using any other method. Unfortunately, probe->GetImageDataOutput() whose output is supposed to be of type vtkImageData did not work. I have tried different methods to display the output but they all failed. I can, however, print the interpolated values. The probe->GetOutput() is of type vtkDataSet. How do I display it as an image?
>
> Thanks a lot!
> Kourosh
>
>
> P.S.
>
> The test code:
>
> ?// Manually create an image of type vtkImageData
> ?vtkImageData *image2 = vtkImageData::New();
> ?image2->SetScalarTypeToDouble();
> ?image2->SetNumberOfScalarComponents(1);
> ?image2->SetExtent(0, 9, 0, 9, 0, 9);
> ?unsigned int GridSize = 10;
> ?for ( unsigned int x = 0; x < GridSize; x++ )
> ?{
> ?for ( unsigned int y = 0; y < GridSize; y++ )
> ?{
> ? for ( unsigned int z = 0; z < GridSize; z++ )
> ? {
> ? ?double val = vtkMath::Random(0.0, 1.0)*100;
> ? ?image2->SetScalarComponentFromDouble(x,y,z,0,val);
> ? }
> ?}
> ?}
>
> ?// Create a structured grid and insert the points at which I would like to interpolate the image.
> ?int i, j, k, kOffset, jOffset, offset;
> ?float x[3], v[3], rMin=0, rMax=3.0, deltaRad, deltaZ;
> ?float radius, theta;
> ?static int dims[3]={10,10,1};
> ?vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
> ? ? ? ? ? ? ? ? ? ?sgrid->SetDimensions(dims);
> ?vtkPoints *points = vtkPoints::New();
> ? ? ? ? ? ?points->Allocate(dims[0]*dims[1]*dims[2]);
> ?deltaZ = 2.0 / (dims[2]-1);
> ?deltaRad = (rMax-rMin) / (dims[1]-1);
> ?v[2]=0.0;
> ?for ( k=0; k ?{
> ?x[2] = (-1.0 + k*deltaZ)*10;
> ?kOffset = k * dims[0] * dims[1];
> ?for (j=0; j ?{
> ? radius = rMin + j*deltaRad;
> ? jOffset = j * dims[0];
> ? for (i=0; i ? {
> ? ?x[0]=i/2;x[1]=j/2;x[2]=k/2;
> ? ?offset = i + jOffset + kOffset;
> ? ?points->InsertPoint(offset,x);
> ? }
> ?}
> ?}
> ?sgrid->SetPoints(points);
> ? ?points->Delete();
>
> ? ?// Interpolate the image at points specified by the structured grid using vtkProbeFilter
> ?vtkProbeFilter* probe = vtkProbeFilter::New();
> ?probe->SetInput(sgrid);
> ?probe->SetSource(image2);
> ?probe->SpatialMatchOn();
> ?probe->Update();
>
> ?// I can print the interpolated values:
> ?vtkDataArray* data = probe->GetOutput()->GetPointData()->GetScalars();
> ?vtkDoubleArray* doubleData = vtkDoubleArray::SafeDownCast (data);
> ?cout << doubleData->GetNumberOfTuples()<< endl;
> ?for(int i = 0; i < doubleData->GetNumberOfTuples(); i++)
> ?{
> ?double val = doubleData->GetValue(i);
> ?cout << "Interpolation using ProbeFilter ";
> ?cout << "doubleData->GetValue(" << i << "): " << val << endl;
> ?}
>
>
> ________________________________________
> From: David Gobbi [david.gobbi at gmail.com]
> Sent: Tuesday, December 28, 2010 12:53 PM
> To: Jafari, Kourosh
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] vtkImageData point extraction
>
> Hi Karoush,
>
> You, it looks like I did have the Source and Input switched in my last email.
> The "outside the whole extent" error is a bit surprising to me, because the
> vtkProbeFilter is supposed to automatically set the UpdateExtent to be
> exactly the same as the WholeExtent. ?So this error might be coming from
> some earlier filter in the pipeline.
>
> One thing you can check is that GetBounds() on your image data returns a
> bounds that is at least as large as GetBounds() on your structured grid.
> I'm just making a guess here, but the Spacing and Origin of your image
> data might not be correct. ?You should print them out (after calling Update,
> of course) just to be sure.
>
> ?David
>
>
> On Tue, Dec 28, 2010 at 9:31 AM, Jafari, Kourosh  wrote:
>> Thanks David,
>>
>> I had actually set up the points of the structured grid. I had replaced it with "..." in the e-mail to make it brief. I applied your suggestions but still it crashes. Following is the actual code (the structured grid here is just an example to test the code). Are you sure SetInput is for points in which we want to resample and SetSource is the volume? Actually, when I exchange their inputs the program does not crash but give the error message:
>>
>> ERROR: In ..\..\vtk-5.6.0\Filtering\vtkStreamingDemandDrivenPipeline.cxx, line 879
>> vtkStreamingDemandDrivenPipeline (03CF52C8): The update extent specified in the information for output port 0 on algorithm vtkTrivialProducer(0259FD08) is 0 249 0 249 0 249, which is outside the whole extent 0 99 0 99 0 99.
>>
>> Thanks ?a lot,
>> Kourosh
>>
>> ----------------------------------------------------------
>> The actual code that causes the program to crash:
>>
>> ?vtkProbeFilter* probe = vtkProbeFilter::New();
>> ?// Create the structured grid
>> ?int i, j, k, kOffset, jOffset, offset;
>> ?float x[3], v[3], rMin=0, rMax=3.0, deltaRad, deltaZ;
>> ?float radius, theta;
>> ?static int dims[3]={100,100,100};
>> ?vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
>> ?sgrid->SetDimensions(dims);
>> ?vtkFloatArray *vectors = vtkFloatArray::New();
>> ? ?vectors->SetNumberOfComponents(3);
>> ? ?vectors->SetNumberOfTuples(dims[0]*dims[1]*dims[2]);
>> ? ?vtkPoints *points = vtkPoints::New();
>> ?points->Allocate(dims[0]*dims[1]*dims[2]);
>> ?deltaZ = 2.0 / (dims[2]-1);
>> ?deltaRad = (rMax-rMin) / (dims[1]-1);
>> ?v[2]=0.0;
>> ?for ( k=0; k> ?{
>> ?x[2] = (-1.0 + k*deltaZ)*10;
>> ?kOffset = k * dims[0] * dims[1];
>> ?for (j=0; j> ?{
>> ? radius = rMin + j*deltaRad;
>> ? jOffset = j * dims[0];
>> ? for (i=0; i> ? {
>> ? ?v[0] = -x[1];
>> ? ?v[1] = x[0];
>> ? ?v[2] = 2;
>> ? ?x[0]=i;x[1]=j;x[2]=k;
>> ? ?offset = i + jOffset + kOffset;
>> ? ?points->InsertPoint(offset,x);
>> ? ?vectors->InsertTuple(offset,v);
>> ? }
>> ?}
>> ?}
>> ?sgrid->SetPoints(points);
>> ? ?points->Delete();
>> ?sgrid->GetPointData()->SetVectors(vectors);
>> ? ?vectors->Delete();
>>
>> ?probe->SetInput(sgrid);
>> ?probe->SetSource(connector->GetOutput());
>> ?probe->SpatialMatchOff();
>> ?probe->Update();
>> ?vtkImageData *imageP = vtkImageData::New();
>> ?imageP->DeepCopy(probe->GetImageDataOutput());
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ________________________________________
>> From: David Gobbi [david.gobbi at gmail.com]
>> Sent: Tuesday, December 28, 2010 2:45 AM
>> To: Jafari, Kourosh
>> Cc: vtkusers at vtk.org
>> Subject: Re: [vtkusers] vtkImageData point extraction
>>
>> Hi Kourosh,
>>
>> Don't use SpatialMatchOn() until you first have it working properly
>> with SpatialMatchOff(). ?Also, don't forget to do probe->Update()
>> before you use the probe filter's output.
>>
>> If sgrid->SetDimensions(dims) the only thing that you did to set up
>> the structured grid, then that isn't enough. ?The structured grid
>> needs you to set the points (I've never used vtkStructuredGrid,
>> myself, so I can't provide an example, but I'm sure that it takes a
>> few more steps to create the data).
>>
>> ?David
>>
>>
>> On Sat, Dec 25, 2010 at 8:38 PM, Jafari, Kourosh  wrote:
>>> Hi David,
>>>
>>> I have similar a question. I have a 3D image volume and would like to sample it on a structured grid. Here is how I use it:
>>>
>>> ?static int dims[3]={100,100,100};
>>> ?vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
>>> ?sgrid->SetDimensions(dims);
>>>
>>> ....
>>>
>>> ?probe->SetInput(sgrid);
>>> ?probe->SetSource(connector->GetOutput());
>>> ?probe->SpatialMatchOn();
>>>
>>> ?vtkImageData *imageP = vtkImageData::New();
>>> ?imageP->DeepCopy(probe->GetImageDataOutput());
>>>
>>>
>>> The type of connector->GetOutput() is vtkImageData which is the volume I'd like to sample. I later display imageP. There is no compilation error but it crashes when I run it. If I exchange the inputs of SetInput and SetSource, it does not crash but it does not do anything either. What am I missing?
>>>
>>> Thanks!!
>>> Kourosh
>>>
>>>
>>> ________________________________________
>>> From: vtkusers-bounces at vtk.org [vtkusers-bounces at vtk.org] On Behalf Of David Gobbi [david.gobbi at gmail.com]
>>> Sent: Friday, December 24, 2010 4:51 PM
>>> To: Maxwell, Thomas P. (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP]
>>> Cc: vtkusers at vtk.org
>>> Subject: Re: [vtkusers] vtkImageData point extraction
>>>
>>> Hi Tom,
>>>
>>> I think you want vtkProbeFilter. ?It takes two inputs, one input for
>>> volumetric data and another input for a set of points whose scalars
>>> will be interpolated from the first input.
>>>
>>> probeFilter->SetSourceConnection()
>>> probeFilter->SetInputConnection()
>>>
>>> Is this what you were looking for?
>>>
>>> ? David
>>>
>>>
>>> On Thu, Dec 23, 2010 at 9:43 AM, Maxwell, Thomas P.
>>> (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP] 
>>> wrote:
>>>>
>>>> Is there a VTK filter that will take as input a vtkImageData and a list of
>>>> (unstructured) points and then compute (as output) the image values at the
>>>> specified point locations?
>>>>
>>>> Thanks,
>>>> Tom
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers