[vtkusers] vtkusers Digest, Vol 76, Issue 5
Gordon Stevenson
gordon.stevenson at lmh.ox.ac.uk
Thu Aug 5 09:03:41 EDT 2010
On 8/4/10, vtkusers-request at vtk.org <vtkusers-request at vtk.org> 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. Re: Qt/VTK error (Andr? Prins)
> 2. Possible bug in vtkCursor2D::SetModelBounds (John Drescher)
> 3. VTK problems with Java on Gentoo Linux (Knut Krause)
> 4. Problem with vtkMarchingCubes (Zeike Taylor)
> 5. Re: GUI integration (egk865 at yahoo.com)
> 6. Re: Qt/VTK error (Prathamesh Kulkarni)
> 7. vtkClipClosedSurface with vtkBoxWidget problem (naresh)
> 8. 2D API- Image Drawing (Krishna Katamneni)
> 9. Detect points inside or outside a space (Alex Southern)
> 10. Re: Qt/VTK error (Jothy)
> 11. Re: GUI integration (nclemeur)
> 12. Re: GUI integration (nclemeur)
> 13. Re: Detect points inside or outside a space (Alex Southern)
> 14. Re: GUI integration (nclemeur)
> 15. Re: GUI integration (nclemeur)
> 16. PolyData-Simplification after vtkContourFilter
> (Samala, Ravi (GE Global Research, non-GE))
> 17. linear transformation for part of vtkpolydata (Ali Abd El Latif)
> 18. Re: extract subset (Eric E. Monson)
> 19. Re: Problem with vtkMarchingCubes (Karthik Krishnan)
> 20. Re: extract subset (Bill Lorensen)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 3 Aug 2010 12:53:17 -0400
> From: Andr? Prins <a.h.prins at gmail.com>
> Subject: Re: [vtkusers] Qt/VTK error
> To: Jothy <jothybasu at gmail.com>, vtkusers at vtk.org
> Message-ID:
> <AANLkTikEXqUkcsj00nCf5Liepcie+BUo+bWsygHdv4kF at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi Jothy,
>
> I don't know if it is possible to control the event-loop in
> QVTKWidget.The QVTKWidget should probably use the Qt eventloop, with
> QApplication::exec().
>
> Probably something like:
>
> QApplication app;
> ...
> ui->show();
> app.exec();
>
> Regards,
> Andre
>
> On Tue, Aug 3, 2010 at 11:22 AM, Jothy <jothybasu at gmail.com> wrote:
>> Hi all,
>>
>> what's wrong here?
>>
>> ui->qvtkWidget->GetInteractor()->Initialize();
>>
>> ui->qvtkWidget->GetRenderWindow()->Render();
>>
>> checkerWidget->On();
>>
>> ui->qvtkWidget->GetInteractor()->Start();
>>
>>
>> throws "QVTKInteractor (0x3652ba8): QVTKInteractor cannot control the
>> event
>> loop." in Qt Creator.
>>
>>
>> Thanks,
>>
>> Jothy
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check 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: 2
> Date: Tue, 3 Aug 2010 15:11:18 -0400
> From: John Drescher <drescherjm at gmail.com>
> Subject: [vtkusers] Possible bug in vtkCursor2D::SetModelBounds
> To: VTK <vtkusers at vtk.org>
> Message-ID:
> <AANLkTikpLQGA_5baQKrvABFGpsAGcHLFQWduddpc3G53 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Besides the comment being wrong. I believe the line
>
> this->ModelBounds[4] = ymin; this->ModelBounds[5] = ymax;
>
> is wrong. I think it should be:
>
> this->ModelBounds[4] = zmin; this->ModelBounds[5] = zmax;
>
>
> http://vtk.org/gitweb?p=VTK.git;a=blob_plain;f=Graphics/vtkCursor2D.cxx;hb=HEAD
>
> //---------------------------------------------------------------------------
> // Set the boundary of the 3D cursor.
> void vtkCursor2D::SetModelBounds(double xmin, double xmax, double
> ymin, double ymax,
> double zmin, double zmax)
> {
> if ( xmin != this->ModelBounds[0] || xmax != this->ModelBounds[1] ||
> ymin != this->ModelBounds[2] || ymax != this->ModelBounds[3] ||
> zmin != this->ModelBounds[4] || zmax != this->ModelBounds[5] )
> {
> this->Modified();
>
> this->ModelBounds[0] = xmin; this->ModelBounds[1] = xmax;
> this->ModelBounds[2] = ymin; this->ModelBounds[3] = ymax;
> this->ModelBounds[4] = ymin; this->ModelBounds[5] = ymax;
>
> for (int i=0; i<3; i++)
> {
> if ( this->ModelBounds[2*i] > this->ModelBounds[2*i+1] )
> {
> this->ModelBounds[2*i] = this->ModelBounds[2*i+1];
> }
> }
> }
> }
>
> --
> John M. Drescher
>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 4 Aug 2010 01:12:48 +0200
> From: Knut Krause <knut.krause at lagom.de>
> Subject: [vtkusers] VTK problems with Java on Gentoo Linux
> To: vtkusers at vtk.org
> Message-ID: <201008040112.48738.knut.krause at lagom.de>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi there,
>
> I just tried to run a little code example on my linux system and during the
> render process the application always crashes. I will include the Code and
> the
> error as a pastebin link. Got anyone an idea what's going wrong here?
> Java JRE is Sun Java 1.6.0.20 VTK version is 5.6.0. I compiled both from
> source. This is and amd64 system.
>
> Regards
>
>
> Knut
>
> Code: http://paste.pocoo.org/show/245526/
> Error: http://paste.pocoo.org/show/245527/
>
>
> ------------------------------
>
> Message: 4
> Date: Wed, 4 Aug 2010 09:59:24 +1000
> From: Zeike Taylor <ztaylor at itee.uq.edu.au>
> Subject: [vtkusers] Problem with vtkMarchingCubes
> To: <vtkusers at vtk.org>
> Message-ID:
> <9FA6584B45DAE846987C7BE52FB2EE92BAC919 at UQEXMB4.soe.uq.edu.au>
> Content-Type: text/plain; charset="US-ASCII"
>
> Hello,
>
> I'm having trouble with vtkMarchingCubes, and I think it is to do with
> the anisotropic voxel sizes (0.9375x0.9375x4mm) of my images. I'm using
> nifti images, which I import using vtkImageImport. The marching cubes
> algorithm extracts a surface well enough and it can be seen to be
> "approximately" correct, however the z-coords are squashed. If I
> multiply each z-coord by 4 and redraw, the mesh looks roughly as it
> should. However, this is no good as the facets are now stretched in the
> z-dir'n, making them unsuitable for the subsequent application.
>
> My (partial) pipeline is as follows:
>
> // Load nifti img
> nifti_image *im = nifti_image_read(imgName,true);
>
> // Set up vtk image data
> vtkImageImport* importer = vtkImageImport::New();
> importer->SetImportVoidPointer((void*)im->data);
> importer->SetDataScalarTypeToFloat();
> importer->SetDataExtent(0, im->nx-1, 0, im->ny-1, 0, im->nz-1);
> importer->SetWholeExtent(0, im->nx-1, 0, im->ny-1, 0, im->nz-1);
> vtkImageData* imData = importer->GetOutput();
> imData->SetScalarTypeToFloat();
> imData->SetExtent(0, im->nx-1, 0, im->ny-1, 0, im->nz-1);
> imData->SetSpacing(im->dx, im->dy, im->dz);
>
> // Apply the Marching Cubes algorithm
> vtkMarchingCubes* surfaceExtractor = vtkMarchingCubes::New();
> surfaceExtractor->SetValue(0, isoVal);
> surfaceExtractor->SetInput((vtkDataObject*)imData);
> vtkPolyData* surface = surfaceExtractor->GetOutput();
> surfaceExtractor->Update();
>
> The image dimensions and spacing seem to transfer properly to imData:
> i.e. the vals returned by imData->GetDimensions() and
> imData->GetSpacing() are correct, but it's as if vtkMarchingCubes
> ignores them. I also tried resampling with isotropic voxels using
> vtkImageResample, with no luck.
>
> Any advice welcome.
> Thanks,
> Zeike
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 3 Aug 2010 18:51:01 -0700 (PDT)
> From: "egk865 at yahoo.com" <egk865 at yahoo.com>
> Subject: Re: [vtkusers] GUI integration
> To: vtkusers at vtk.org
> Message-ID: <636017.59076.qm at web53308.mail.re2.yahoo.com>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Nicolas,
>
> I have been using the Java wrappers on a project for almost a year now
> and I think they're great. I personally think VTK is the best 3D
> graphics library available for the Java platform.
>
> Any memory problems seem to have been solved with the 5.6
> release. I have been able to run long running batch programs for days
> without memory leaks. A new class (see vtkJavaGarbageCollector.java
> within Wrapping/Java/vtk) was written to provide automatic garbage
> collection of VTK objects, though sometimes I've found that I needed
> to explicitly call Delete on some objects to ensure they got deleted
> (haven't yet investigated why). I don't think it's any more work now
> dealing with memory management in Java than it would be in C++.
>
> For GUI programs, an AWT widget is provided which can be integrated
> with swing programs. See vtkPanel.java, vtkCanvas.java, and
> vtkRenderWindowPanel.java within Wrapping/Java/vtk. (I usually use
> vtkRenderWindowPanel since that contains the most functionality. It's
> missing mousewheel support however, but that can easily be added). See
> also
> http://java.sun.com/developer/technicalArticles/GUI/mixing_components/index.html
> for useful information about mixing heavyweight and lightweight
> components. I've found though that crashes often occurred if things
> weren't done properly, especially related to picking. Such crashes can
> be difficult to debug since often the entire virtual machine crashes
> without leaving any stack trace. I've found reading through the code
> in these 3 classes very helpful in understanding how best to use them.
>
> Another advantage I've found in using Java is that I was able to
> easily distribute my application by making use of Java Web Start. This
> made it easy to provide updates to users on mac, windows and linux
> platforms (which I needed to support). Making a new release usually
> meant simply updating a single jar file on the server, and users on
> all 3 platforms would instantly get the new version. The jar files
> containing the native VTK libraries would usually never needed to be
> touched, unless I needed to update VTK.
>
> Eli
>
>
> --- On Mon, 8/2/10, nclemeur <nclemeur at gmail.com> wrote:
>
>> From: nclemeur <nclemeur at gmail.com>
>> Subject: Re: [vtkusers] GUI integration
>> To: vtkusers at vtk.org
>> Date: Monday, August 2, 2010, 6:58 AM
>>
>>
>>
>> > I know you said you're familiar with Java and
>> wxWidgets, but another
>> > possibility is Qt with c++. There are a few examples
>> to get you going
>> > here:
>> >
>>
>> Yes, thank you for the hint. It looks like the Qt options
>> is quite popular.
>> But it is not really an option for me. I would really
>> appreciate some
>> comments from people using the java and/or python wrapping
>> (or maybe from
>> people that I have stopped used these wrapper?). Are these
>> wrappers working
>> well enough for a relatively simple useage? Anything to
>> stay away from? Any
>> good reason to choose python rather than java (other than
>> language
>> preferences) or even C++ with wxWidgets?
>>
>> I am pretty sure there would be quite a lot of people
>> interested by this
>> topic, so please don't hesitate to comment, even if is
>> simply to say "it is
>> (not) working".
>>
>> Cheers
>>
>> Nicolas
>>
>> --
>> View this message in context:
>> http://vtk.1045678.n5.nabble.com/GUI-integration-tp2260958p2261598.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
>>
>
>
>
>
>
> ------------------------------
>
> Message: 6
> Date: Tue, 3 Aug 2010 22:14:03 -0500
> From: Prathamesh Kulkarni <prathameshmkulkarni at gmail.com>
> Subject: Re: [vtkusers] Qt/VTK error
> To: jothybasu at gmail.com
> Cc: VTK Mailing List <vtkusers at vtk.org>
> Message-ID:
> <AANLkTimGasijmG63MvEpWjX5_5FDL9kO_-w=DjTzTgX7 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Have you done this prior to your posted code?:
>
> UI*->QVTKWidget->GetRenderWindow()->AddRenderer(vtkRenderer*);
> UI*->QVTKWidget->GetRenderWindow()->SetInteractor(UI*->QVTKWidget->GetInteractor());
>
> and also,
> vtkWidget->ProcessEventsOn();
>
>
> Prathamesh
>
> Message: 3
> Date: Tue, 3 Aug 2010 16:22:00 +0100
> From: Jothy <jothybasu at gmail.com>
> Subject: [vtkusers] Qt/VTK error
> To: VTK Mailing List <vtkusers at vtk.org>
> Message-ID:
> <AANLkTinHUzGOuZS6r0qmYF2dO3AkUzvBaYcBXbjv0GCe at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi all,
>
> what's wrong here?
>
> *ui->qvtkWidget->GetInteractor()->Initialize();*
>
> *ui->qvtkWidget->GetRenderWindow()->Render();*
>
> *checkerWidget->On();*
>
> *ui->qvtkWidget->GetInteractor()->Start();
>
> throws "*QVTKInteractor (0x3652ba8): QVTKInteractor cannot control the
> event loop." in Qt Creator.
>
> Thanks,
>
> Jothy
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20100803/449fd90c/attachment.html
>>
>
> ------------------------------
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://www.vtk.org/pipermail/vtkusers/attachments/20100803/04b536c2/attachment-0001.htm>
>
> ------------------------------
>
> Message: 7
> Date: Wed, 4 Aug 2010 09:34:36 +0530
> From: "naresh" <naresh at winner.co.in>
> Subject: [vtkusers] vtkClipClosedSurface with vtkBoxWidget problem
> To: <vtkusers at vtk.org>
> Cc: vtk-developers at vtk.org, david.gobbi at gmail.com
> Message-ID: <9CA22B3FE4D448BCB8A2B75523CD722A at wcs70d73309111>
> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
>
> Hi
>
> I am trying to split cone with vtkClipClosedSurface with vtkBoxWidget. I am
> trying to split with Box X min and X Max plane direction in two parts as red
> and blue.
>
> But only one part is visible at time. I check code lot of times but did not
> get anything .
>
> I attached code please anyone can tell me what's problem in code ?
>
> Naresh
> -------------- next part --------------
> An embedded and charset-unspecified text was scrubbed...
> Name: Cone2.cxx
> URL:
> <http://www.vtk.org/pipermail/vtkusers/attachments/20100804/4097b830/attachment.txt>
>
> ------------------------------
>
> Message: 8
> Date: Wed, 4 Aug 2010 12:29:41 +0530
> From: Krishna Katamneni <krishna.katamneni at gmail.com>
> Subject: [vtkusers] 2D API- Image Drawing
> To: vtkusers at vtk.org
> Message-ID:
> <AANLkTiky=ZDE8muEo=pT7XHdaBP0JqtGaic4Cfj59r1+ at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear All
> I have several 2D images with different dimensions, origins and
> resolutions.
> I want to draw them using 2D API (class vtkImageItem) etc and also want the
> images to be drawn in windows screen coordinates.
>
> I'm also confused with parameters for DrawImage method in the 2D API(are
> these screen coordinates or should be in-terms of image dimensions).
> When using this method, all my images are upside down.
> .
> For example , my window size is 600x400
>
> and have many 2D images( details of few examples are given below)
>
> Image Details
>
> Resolution
> Dimensions Origin
>
> 1. 0.1 x 0.1 x 1 930 x 700 x
> 1 -78.3 x 0 x 0
> 2. 0.2 x 0.2 x 1 1560 x 750 x
> 1 -78.3 x 0 x 0
> 3. 0.5 x 0.2 x 1 3100 x 1560 x
> 1 -100 x 20 x 0
> 4. 0.1 x 0.2 x 1 360 x 180 x
> 1 -14.3 x 0 x 0
>
> and also would like my image to be to fit to the available window size(I can
> resize my window dynamically).
>
> I think we should be able to create 2D Transform that handles all these
> cases in one go, but I'm not sure how to achieve it using vtkTransform2D.
>
> Could anybody help me how to handle these situations?
>
> Thanks in advance.
> --
> Best Regards
> Krishna
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://www.vtk.org/pipermail/vtkusers/attachments/20100804/3324c1bd/attachment-0001.htm>
>
> ------------------------------
>
> Message: 9
> Date: Wed, 04 Aug 2010 12:03:43 +0300
> From: Alex Southern <mrapsouthern at gmail.com>
> Subject: [vtkusers] Detect points inside or outside a space
> To: vtkusers at vtk.org
> Message-ID: <4C592CEF.50407 at gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
>
> I've been avoiding using VTK to do this, but it seems that it may be
> relatively simple to do rather coding it from scratch.
>
> Basically, Id like to draw a volume in something like Google Sketchup
> use one of the free converters to generate a VTK file. Id then like to
> read that file into my own app (no problems here), and then define a
> cuboid container, around the volume of interest, which contains a 3D
> equally spaced grid of points (e.g 10 million), I then want to be able
> to interrogate each point to find out if it is inside or outside the volume.
>
> The millions of points do not need to be visualized from an interaction
> point of view. So I suspect the points should be defined using
> vtkPoints? But how do I interrogate these to find out if they are inside
> or outside the volume.
>
> The user could supply co-ordinates of a point that is definitely inside
> the volume, if necessary.
>
> I have put up a temporary link to a typical volume of interest as a vtk
> file (Complex3D.vtk), this was drawn in sketchup.
>
> http://www.tml.tkk.fi/~aps/ <http://www.tml.tkk.fi/%7Eaps/>
>
> Any examples or nudges in the right direction would be greatly appreciated.
>
> Thanks
> Alex
>
>
> ------------------------------
>
> Message: 10
> Date: Wed, 4 Aug 2010 10:10:29 +0100
> From: Jothy <jothybasu at gmail.com>
> Subject: Re: [vtkusers] Qt/VTK error
> To: Prathamesh Kulkarni <prathameshmkulkarni at gmail.com>
> Cc: VTK Mailing List <vtkusers at vtk.org>
> Message-ID:
> <AANLkTinH86gQpCoYUB00NODS=uiPpF3B9cnfjVpZH4A- at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Yes, I have done the following
>
> UI*->QVTKWidget->GetRenderWindow()->AddRenderer(vtkRenderer*);
> UI*->QVTKWidget->GetRenderWindow()->SetInteractor(UI*->QVTKWidget->GetInteractor());
>
> but, what is this vtkWidget - is that the qvtkWidget?
>
> Thanks,
>
> Jothy
>
>
> On Wed, Aug 4, 2010 at 4:14 AM, Prathamesh Kulkarni <
> prathameshmkulkarni at gmail.com> wrote:
>
>> Have you done this prior to your posted code?:
>>
>> UI*->QVTKWidget->GetRenderWindow()->AddRenderer(vtkRenderer*);
>>
>> UI*->QVTKWidget->GetRenderWindow()->SetInteractor(UI*->QVTKWidget->GetInteractor());
>>
>> and also,
>> vtkWidget->ProcessEventsOn();
>>
>>
>> Prathamesh
>>
>> Message: 3
>> Date: Tue, 3 Aug 2010 16:22:00 +0100
>> From: Jothy <jothybasu at gmail.com>
>> Subject: [vtkusers] Qt/VTK error
>> To: VTK Mailing List <vtkusers at vtk.org>
>> Message-ID:
>> <AANLkTinHUzGOuZS6r0qmYF2dO3AkUzvBaYcBXbjv0GCe at mail.gmail.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>>
>> Hi all,
>>
>> what's wrong here?
>>
>> *ui->qvtkWidget->GetInteractor()->Initialize();*
>>
>> *ui->qvtkWidget->GetRenderWindow()->Render();*
>>
>> *checkerWidget->On();*
>>
>> *ui->qvtkWidget->GetInteractor()->Start();
>>
>> throws "*QVTKInteractor (0x3652ba8): QVTKInteractor cannot control the
>> event loop." in Qt Creator.
>>
>> Thanks,
>>
>> Jothy
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <
>> http://www.vtk.org/pipermail/vtkusers/attachments/20100803/449fd90c/attachment.html
>> >
>>
>> ------------------------------
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://www.vtk.org/pipermail/vtkusers/attachments/20100804/f3f7f083/attachment-0001.htm>
>
> ------------------------------
>
> Message: 11
> Date: Wed, 4 Aug 2010 04:05:14 -0700 (PDT)
> From: nclemeur <nclemeur at gmail.com>
> Subject: Re: [vtkusers] GUI integration
> To: vtkusers at vtk.org
> Message-ID: <1280919914219-2263922.post at n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
>
> Jim Peterson wrote:
>>
>> I just finished getting the Java DLL's created and tested running on
>> Windows XP using the Visual Studio 2008 Express cmake builder option.
>> ...
>> So assuming you have a somewhat mainstream Windows platform to build the
>> necessary vtk shared libraries and Java wrappers upon, I would say the
>> Java front end is a very workable solution.
>>
>
> Hello Jim,
>
> Thank you for the encouragments, I have already played a bit with the java
> wrapper, and I had some examples running (Using VC++ 2008 Express). The
> wrapper Api looks quite easy to relate with the equivalent C++ so that is
> really good. I got a bit scared when I saw a few threads about memory
> issues. But this seems to be solved in the latest version. I also observed a
> bit a flickering when resizing the frame, but I haven't look at that... All
> that made me a bit wondering if Java was something I could contemplate to
> use. It seems that it is a good solution (see post by Elvis in the same
> thread).
>
> Thanks a again,
>
> Nicolas
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/GUI-integration-tp2260958p2263922.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 12
> Date: Wed, 4 Aug 2010 04:06:48 -0700 (PDT)
> From: nclemeur <nclemeur at gmail.com>
> Subject: Re: [vtkusers] GUI integration
> To: vtkusers at vtk.org
> Message-ID: <1280920008597-2263924.post at n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
>
> nclemeur wrote:
>>
>> to use. It seems that it is a good solution (see post by Elvis in the
>> same thread).
>>
>
> Oops sorry should have been "(post by Eli)"
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/GUI-integration-tp2260958p2263924.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 13
> Date: Wed, 04 Aug 2010 14:07:18 +0300
> From: Alex Southern <mrapsouthern at gmail.com>
> Subject: Re: [vtkusers] Detect points inside or outside a space
> To: vtkusers at vtk.org
> Message-ID: <4C5949E6.1070805 at gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Actually I just found this example that appears to do part of the job...
>
> http://www.vtk.org/Wiki/VTK/Examples/PolyData/PointInsideObject
>
> Thanks anyway.
> Alex
>
> On 4.8.2010 12:03, Alex Southern wrote:
>> Hi,
>>
>> I've been avoiding using VTK to do this, but it seems that it may be
>> relatively simple to do rather coding it from scratch.
>>
>> Basically, Id like to draw a volume in something like Google Sketchup
>> use one of the free converters to generate a VTK file. Id then like to
>> read that file into my own app (no problems here), and then define a
>> cuboid container, around the volume of interest, which contains a 3D
>> equally spaced grid of points (e.g 10 million), I then want to be able
>> to interrogate each point to find out if it is inside or outside the
>> volume.
>>
>> The millions of points do not need to be visualized from an
>> interaction point of view. So I suspect the points should be defined
>> using vtkPoints? But how do I interrogate these to find out if they
>> are inside or outside the volume.
>>
>> The user could supply co-ordinates of a point that is definitely
>> inside the volume, if necessary.
>>
>> I have put up a temporary link to a typical volume of interest as a
>> vtk file (Complex3D.vtk), this was drawn in sketchup.
>>
>> http://www.tml.tkk.fi/~aps/ <http://www.tml.tkk.fi/%7Eaps/>
>>
>> Any examples or nudges in the right direction would be greatly
>> appreciated.
>>
>> Thanks
>> Alex
>
>
>
> ------------------------------
>
> Message: 14
> Date: Wed, 4 Aug 2010 04:25:37 -0700 (PDT)
> From: nclemeur <nclemeur at gmail.com>
> Subject: Re: [vtkusers] GUI integration
> To: vtkusers at vtk.org
> Message-ID: <1280921137564-2263940.post at n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
>
> >From a performance, reliability and productivity standpoint, using Qt with
> C++ is the best way to quickly develop apps with VTK. Its quite
> straightforward and simple.
>
>
>>
>> Yes I agree that you can't beat the performance of that solution. I am not
>> completely convinced in term of productivity, but I don't know Qt at all,
>> so can't really judge here. But I am not really sure I want at this stage
>> to embark in including a new (big) library (in top of vtk which is quite
>> new for me too).
>>
>>
>> Elvis Dowson wrote:
>>>
>>> Having said that, if you must explore an option using Java or Python,
>>> perhaps you could try creating a quick prototype using
>>>
>>> - java wrappings, and using Eclipse + SWF (Standard Widget Framework) for
>>> the GUI part, since SWF allows you to create native looking apps, using
>>> Java, rather than using Swing for the GUI library. I don't know if Swing
>>> is supported for the VTK OpenGL rendering context, perhaps someone else
>>> could comment on that.
>>>
>>
>> I have been playing a bit with Swing + vtk and it seems quite a good
>> solution so far (a bit a flickering on resizing the frame that need to be
>> solved at some stage). I am not really sure about the OpenGL rendering
>> context. I guess we are talking about Linux here? I haven't seen many
>> reference to that problem. I kind of remember you can disable opengl in
>> vtk on Linux (or maybe I am wrong and just confusing opengl with graphic
>> hardware acceleration, or are they the same?... I am bit novice here
>> obviously).
>>
>>
>> Elvis Dowson wrote:
>>>
>>> - python, with wxPython (which internally wraps wxWidgets). You'll also
>>> have to install the PyOpenGL wrappers. I haven't played extensively with
>>> VTK with python, but have done so with another tooling framework, and
>>> from a language and usability perspective, its very nice. The python
>>> language is quite clean, and easy to use. A lot of engineers working with
>>> scientific visualization use a combination of C++ and python. A tool
>>> called SWIG (Simple Wrapper Interface Generator) is used to generate the
>>> python bindings for a given C++ class. I think it does it for java as
>>> well.
>>>
>>
>> Yes I would really like to explore a bit the Python world, but it is
>> really a matter of finding some time. Also, starting in a new language
>> with a new library (vtk) and 2 wrappers in middle, might be asking for
>> problems :-). I have been using Swig for java wrapping and it is great.
>>
>>
>> Elvis Dowson wrote:
>>>
>>> For the last option, using C++ with wxWidgets, I would say don't even
>>> bother, because I don't think wxWidgets are all that great. You would
>>> gain much in terms of overall application framework support using Qt and
>>> its extensive library support, than using wxWidgets just for the GUI
>>> part, since Qt includes stuff for both the GUI plus a whole lot of
>>> functionality for developing actual apps.
>>>
>>
>> Well, I guess there is definetely one merit to wxWidgets for me: I know a
>> bit the environment (build system, examples, documentation,...). I can't
>> really compare with Qt, but I found wxWidgets reasonnably good. I has also
>> quite a bit of functionnality aside from the GUI parts. Anyway this
>> certainly not my intention to start a comparison between QT and wx.
>>
>> Thank you very much for your time!
>>
>> Cheers
>>
>> Nicolas
>>
>> Best regards,
>>
>> Elvis
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check 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/GUI-integration-tp2260958p2263940.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 15
> Date: Wed, 4 Aug 2010 04:36:41 -0700 (PDT)
> From: nclemeur <nclemeur at gmail.com>
> Subject: Re: [vtkusers] GUI integration
> To: vtkusers at vtk.org
> Message-ID: <1280921801629-2263953.post at n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hello Eli,
>
> Thank you very much for your post. I was hoping for someone to step in and
> reassure me that Java was a workable solution, and you did it. That's great.
> I did not think about the java web start, but it is true that it is nice
> advantage too... I'll have a look at the classes you mentionned. I have
> already playing a bit with that solution and it is indeed quite straight
> forward to setup and use. I still have some stuff I need to explore:
>
> - Anyone notice some flickering on the JFrame resize (this is on the simple
> cone example).
>
> - Can I add vtk objects from the C++ layer and display it in Java by sending
> a reference to the vtkRenderer(Window) to the C++ layer? Obviously, I would
> need then to manage the memory of these objects my-self. I am thinking of
> doing it this way to keep a maximum of my vtk programming in C++:
> 1. so that I can easily switch to another GUI layer in case of problems
> 2. because I have anyway to interact with an existing C++ library that
> contain most of the data to draw the vtk objects.
>
>
> Again, thank you very much for your post, I really appreciate it.
>
> Cheers
>
> Nicolas
>
>
>
> Bugzilla from egk865 at yahoo.com wrote:
>>
>> Hi Nicolas,
>>
>> I have been using the Java wrappers on a project for almost a year now
>> and I think they're great. I personally think VTK is the best 3D
>> graphics library available for the Java platform.
>>
>> Any memory problems seem to have been solved with the 5.6
>> release. I have been able to run long running batch programs for days
>> without memory leaks. A new class (see vtkJavaGarbageCollector.java
>> within Wrapping/Java/vtk) was written to provide automatic garbage
>> collection of VTK objects, though sometimes I've found that I needed
>> to explicitly call Delete on some objects to ensure they got deleted
>> (haven't yet investigated why). I don't think it's any more work now
>> dealing with memory management in Java than it would be in C++.
>>
>> For GUI programs, an AWT widget is provided which can be integrated
>> with swing programs. See vtkPanel.java, vtkCanvas.java, and
>> vtkRenderWindowPanel.java within Wrapping/Java/vtk. (I usually use
>> vtkRenderWindowPanel since that contains the most functionality. It's
>> missing mousewheel support however, but that can easily be added). See
>> also
>> http://java.sun.com/developer/technicalArticles/GUI/mixing_components/index.html
>> for useful information about mixing heavyweight and lightweight
>> components. I've found though that crashes often occurred if things
>> weren't done properly, especially related to picking. Such crashes can
>> be difficult to debug since often the entire virtual machine crashes
>> without leaving any stack trace. I've found reading through the code
>> in these 3 classes very helpful in understanding how best to use them.
>>
>> Another advantage I've found in using Java is that I was able to
>> easily distribute my application by making use of Java Web Start. This
>> made it easy to provide updates to users on mac, windows and linux
>> platforms (which I needed to support). Making a new release usually
>> meant simply updating a single jar file on the server, and users on
>> all 3 platforms would instantly get the new version. The jar files
>> containing the native VTK libraries would usually never needed to be
>> touched, unless I needed to update VTK.
>>
>> Eli
>>
>>
>> --- On Mon, 8/2/10, nclemeur <nclemeur at gmail.com> wrote:
>>
>>> From: nclemeur <nclemeur at gmail.com>
>>> Subject: Re: [vtkusers] GUI integration
>>> To: vtkusers at vtk.org
>>> Date: Monday, August 2, 2010, 6:58 AM
>>>
>>>
>>>
>>> > I know you said you're familiar with Java and
>>> wxWidgets, but another
>>> > possibility is Qt with c++. There are a few examples
>>> to get you going
>>> > here:
>>> >
>>>
>>> Yes, thank you for the hint. It looks like the Qt options
>>> is quite popular.
>>> But it is not really an option for me. I would really
>>> appreciate some
>>> comments from people using the java and/or python wrapping
>>> (or maybe from
>>> people that I have stopped used these wrapper?). Are these
>>> wrappers working
>>> well enough for a relatively simple useage? Anything to
>>> stay away from? Any
>>> good reason to choose python rather than java (other than
>>> language
>>> preferences) or even C++ with wxWidgets?
>>>
>>> I am pretty sure there would be quite a lot of people
>>> interested by this
>>> topic, so please don't hesitate to comment, even if is
>>> simply to say "it is
>>> (not) working".
>>>
>>> Cheers
>>>
>>> Nicolas
>>>
>>> --
>>> View this message in context:
>>> http://vtk.1045678.n5.nabble.com/GUI-integration-tp2260958p2261598.html
>>> Sent from the VTK - Users mailing list archive at
>>> Nabble.com.
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/GUI-integration-tp2260958p2263953.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 16
> Date: Wed, 4 Aug 2010 17:19:45 +0530
> From: "Samala, Ravi (GE Global Research, non-GE)" <Ravi.Samala at ge.com>
> Subject: [vtkusers] PolyData-Simplification after vtkContourFilter
> To: <vtkusers at vtk.org>
> Message-ID:
> <0CF9DBF0E4F71940855862769B08550C04955634 at BANMLVEM05.e2k.ad.ge.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Hello,
>
> I am running into a similar problem as posted in the archived email:
> http://www.vtk.org/pipermail/vtkusers/2008-October/097684.html
>
> Was anyone able to solve this?
>
> Thanks in advance,
> Ravi.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://www.vtk.org/pipermail/vtkusers/attachments/20100804/11658def/attachment-0001.htm>
>
> ------------------------------
>
> Message: 17
> Date: Wed, 4 Aug 2010 05:04:51 -0700 (PDT)
> From: Ali Abd El Latif <ali.mahmoud.habib at gmail.com>
> Subject: [vtkusers] linear transformation for part of vtkpolydata
> To: vtkusers at vtk.org
> Message-ID: <1280923491460-2263980.post at n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi,
>
> I need to apply linear transformation , do you have any suggestion how to
> do that
> I want to select apart in soft tissue and linear transform it without
> separate it from the whole vtkpolydata ,
>
> this will do deformation, any suggestion will be highlly appretiated
>
>
> Best regards
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/linear-transformation-for-part-of-vtkpolydata-tp2263980p2263980.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 18
> Date: Wed, 4 Aug 2010 09:26:54 -0400
> From: "Eric E. Monson" <emonson at cs.duke.edu>
> Subject: Re: [vtkusers] extract subset
> To: Ula Popov <ula.popov at gmail.com>
> Cc: vtkusers at vtk.org
> Message-ID: <41373175-CD7D-4562-BC27-50DF18B0D2D4 at cs.duke.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Hello Ula,
>
> The ParaView "Extract Subset" filter uses the vtkPVExtractVOI class:
>
> http://www.paraview.org/ParaView3/Doc/Nightly/html/classvtkPVExtractVOI.html
>
> I haven't used it, but in the documentation it says, "vtkPVExtractVOI is a
> wrapper around vtkExtractVOI, vtkExtractGrid and vtkExtractRectilinearGrid.
> It choose the right filter depending on input and passes the necessary
> parameters."
>
> So, I think you could use the vtkExtractVOI class from VTK if you're working
> on vtkImageData:
>
> http://www.vtk.org/doc/nightly/html/classvtkExtractVOI.html
>
> There are a couple examples and tests listed on that page that may help you
> get started.
>
> -Eric
>
> ------------------------------------------------------
> Eric E Monson
> Duke Visualization Technology Group
>
>
> On Aug 3, 2010, at 12:57 AM, Ula Popov wrote:
>
>> Hello all,
>>
>> I know that there is a filter in paraview "extract subset".
>> I need to implement its functionality.
>>
>> vtkSmartPointer<vtkXMLImageDataReader> reader =
>> vtkSmartPointer<vtkXMLImageDataReader>::New();
>> reader->SetFileName(filename);
>> reader->Update();
>> vtkImageData* grid = reader->GetOutput();
>>
>> What function should I use? Can I apply it on image data (grid)?
>>
>> Thank you,
>> Ula
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check 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: 19
> Date: Wed, 4 Aug 2010 19:10:16 +0530
> From: Karthik Krishnan <karthik.krishnan at kitware.com>
> Subject: Re: [vtkusers] Problem with vtkMarchingCubes
> To: Zeike Taylor <ztaylor at itee.uq.edu.au>
> Cc: vtkusers at vtk.org
> Message-ID:
> <AANLkTimyy-0CLcgEnJZ0PYufO55UiMGC4UhS6CDrL9Zf at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> The snippet you have below is not going to work :
>
> vtkImageData* imData = importer->GetOutput();
> imData->SetSpacing(im->dx, im->dy, im->dz);
> surfaceExtractor->SetInput((vtkDataObject*)imData);
>
> What's going to happen is that the downstream filter (marching cubes) is
> going to update the upstream filter (importer) which is going to overwrite
> the spacing (defaults to 1 in vtkImageImport) set on its output. You can't
> modify the output of a pipeline like that without disconnecting it (via
> ShallowCopy)..
>
> Try this instead...
>
> importer->SetDataSpacing(im->dx, im->dy, im->dz);
> vtkImageData* imData = importer->GetOutput();
> surfaceExtractor->SetInput((vtkDataObject*)imData);
>
> --
> karthik
>
> On Wed, Aug 4, 2010 at 5:29 AM, Zeike Taylor <ztaylor at itee.uq.edu.au> wrote:
>
>> Hello,
>>
>> I'm having trouble with vtkMarchingCubes, and I think it is to do with
>> the anisotropic voxel sizes (0.9375x0.9375x4mm) of my images. I'm using
>> nifti images, which I import using vtkImageImport. The marching cubes
>> algorithm extracts a surface well enough and it can be seen to be
>> "approximately" correct, however the z-coords are squashed. If I
>> multiply each z-coord by 4 and redraw, the mesh looks roughly as it
>> should. However, this is no good as the facets are now stretched in the
>> z-dir'n, making them unsuitable for the subsequent application.
>>
>> My (partial) pipeline is as follows:
>>
>> // Load nifti img
>> nifti_image *im = nifti_image_read(imgName,true);
>>
>> // Set up vtk image data
>> vtkImageImport* importer = vtkImageImport::New();
>> importer->SetImportVoidPointer((void*)im->data);
>> importer->SetDataScalarTypeToFloat();
>> importer->SetDataExtent(0, im->nx-1, 0, im->ny-1, 0, im->nz-1);
>> importer->SetWholeExtent(0, im->nx-1, 0, im->ny-1, 0, im->nz-1);
>> vtkImageData* imData = importer->GetOutput();
>> imData->SetScalarTypeToFloat();
>> imData->SetExtent(0, im->nx-1, 0, im->ny-1, 0, im->nz-1);
>> imData->SetSpacing(im->dx, im->dy, im->dz);
>>
>> // Apply the Marching Cubes algorithm
>> vtkMarchingCubes* surfaceExtractor = vtkMarchingCubes::New();
>> surfaceExtractor->SetValue(0, isoVal);
>> surfaceExtractor->SetInput((vtkDataObject*)imData);
>> vtkPolyData* surface = surfaceExtractor->GetOutput();
>> surfaceExtractor->Update();
>>
>> The image dimensions and spacing seem to transfer properly to imData:
>> i.e. the vals returned by imData->GetDimensions() and
>> imData->GetSpacing() are correct, but it's as if vtkMarchingCubes
>> ignores them. I also tried resampling with isotropic voxels using
>> vtkImageResample, with no luck.
>>
>> Any advice welcome.
>> Thanks,
>> Zeike
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check 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/20100804/1923b912/attachment-0001.htm>
>
> ------------------------------
>
> Message: 20
> Date: Wed, 4 Aug 2010 10:11:32 -0400
> From: Bill Lorensen <bill.lorensen at gmail.com>
> Subject: Re: [vtkusers] extract subset
> To: "Eric E. Monson" <emonson at cs.duke.edu>
> Cc: Ula Popov <ula.popov at gmail.com>, vtkusers at vtk.org
> Message-ID:
> <AANLkTimWHfRvzAb+eKhvN62WR+_Ns8+Z7aiZ6q8Ymiu5 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Here is an example:
> http://www.vtk.org/Wiki/VTK/Examples/ImageData/vtkExtractVOI
>
> On Wed, Aug 4, 2010 at 9:26 AM, Eric E. Monson <emonson at cs.duke.edu> wrote:
>> Hello Ula,
>>
>> The ParaView "Extract Subset" filter uses the vtkPVExtractVOI class:
>>
>> http://www.paraview.org/ParaView3/Doc/Nightly/html/classvtkPVExtractVOI.html
>>
>> I haven't used it, but in the documentation it says, "vtkPVExtractVOI is a
>> wrapper around vtkExtractVOI, vtkExtractGrid and
>> vtkExtractRectilinearGrid. It choose the right filter depending on input
>> and passes the necessary parameters."
>>
>> So, I think you could use the vtkExtractVOI class from VTK if you're
>> working on vtkImageData:
>>
>> http://www.vtk.org/doc/nightly/html/classvtkExtractVOI.html
>>
>> There are a couple examples and tests listed on that page that may help
>> you get started.
>>
>> -Eric
>>
>> ------------------------------------------------------
>> Eric E Monson
>> Duke Visualization Technology Group
>>
>>
>> On Aug 3, 2010, at 12:57 AM, Ula Popov wrote:
>>
>>> Hello all,
>>>
>>> I know that there is a filter in paraview "extract subset".
>>> I need to implement its functionality.
>>>
>>> ? ? ? vtkSmartPointer<vtkXMLImageDataReader> reader =
>>> vtkSmartPointer<vtkXMLImageDataReader>::New();
>>> ? ? ? reader->SetFileName(filename);
>>> ? ? ? reader->Update();
>>> ? ? ? vtkImageData* grid = reader->GetOutput();
>>>
>>> What function should I use? Can I apply it on image data (grid)?
>>>
>>> Thank you,
>>> Ula
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check 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
>>
>
>
> ------------------------------
>
> _______________________________________________
> vtkusers mailing list
> vtkusers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> End of vtkusers Digest, Vol 76, Issue 5
> ***************************************
>
--
Sent from my mobile device
More information about the vtkusers
mailing list