From tamim.boubou at gmail.com Sun Sep 2 06:22:45 2018 From: tamim.boubou at gmail.com (Tamim) Date: Sun, 2 Sep 2018 03:22:45 -0700 (MST) Subject: [vtkusers] hide vtkBoxWidget2 handles Message-ID: <1535883765512-0.post@n5.nabble.com> I have a vtkboxWidget2, all I want to do is to hide the handles of two opposite sides (any 2 circles of the same color in the attached photo). I've looked but didn't find a way to do so, I can either hide or show all handles without the ability of specifying a certain one. is there a way to do so ? Thanks a lot.... -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mdud67 at gmail.com Sun Sep 2 18:10:59 2018 From: mdud67 at gmail.com (phil Ne) Date: Sun, 2 Sep 2018 15:10:59 -0700 (MST) Subject: [vtkusers] rotation with vtktransform behavior Message-ID: <1535926259081-0.post@n5.nabble.com> Hi VTK Users, I have a picutre with marked points and need to rotate both objects in the same direction. I use the following code: /vtkTransform *transform*= new vtkTransform(); vtkImageReslice reslice = new vtkImageReslice(); reslice.SetResliceTransform(*transform*) vtkActor pointsActor = new vtkActor(); pointsActor.SetUserTransform(*transform*) *transform*.RotateZ(45);/ It works but i recognize that the image reslice rotates to the right and the point actor to the left. How can I avoid this behavior? Please advise. Thanks for your help phil -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From simon.esneault at gmail.com Mon Sep 3 04:10:42 2018 From: simon.esneault at gmail.com (Simon Esneault) Date: Mon, 3 Sep 2018 10:10:42 +0200 Subject: [vtkusers] Volume rendering produces rough surface at clipping plane In-Reply-To: References: Message-ID: +1 for this feature, this will be of great help for us too ! The same "rough" effect is visible along the faces of the bounding box of the volume, will this improvement works when we use the SetCroppingRegionPlanes( ... ) method of the GPUVolumeMapper, ie without using clipping planes but "CroppingRegionPlanes" ? Thanks ! Simon Le mer. 29 ao?t 2018 ? 15:52, Andras Lasso a ?crit : > This is awesome! Thanks a lot for implementing this. It will greatly > improve clipped volume visualization. > > > > Andras > > > > *From:* Sankhesh Jhaveri > *Sent:* Wednesday, August 29, 2018 9:49 AM > *To:* Andras Lasso > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Volume rendering produces rough surface at > clipping plane > > > > Hi Andras, > > !4627 > > implements a mode in vtkVolumeProperty that lets you use custom intensity > values for voxels in the clipped space when computing gradients at the clip > face. > > Best, > Sankhesh > > ? > > > > On Fri, Nov 3, 2017 at 10:48 AM Andras Lasso wrote: > > Hi all, > > > > I?m working on visualizing cardiac images using volume rendering. I need > to cut into the volume to see surfaces inside the heart, which works quite > well by using clipping planes of the volume mapper. The only problem is > that that surface at the cut plane looks very rough, which makes it > difficult to distinguish from actual endocardial surfaces. If I ?cut? the > volume by setting voxel values outside the clipping box to ?empty? (-1000 = > air intensity value) then the cut surface looks nice ? smooth and flat. See > example for both cutting method in the attached files. > > > > Is there a way to change volume renderer to get smooth cut surfaces (the > same look as we get by setting outside voxels to ?empty? values)? > > > > Andras > > > > --- > > > > See full resolution images and more examples here: > > https://1drv.ms/f/s!Arm_AFxB9yqHsOsClG_QsMx-4sh8rg > > > > > CT volume can be downloaded from here: > > http://slicer.kitware.com/midas3/download/item/292309/CTA-cardio.nrrd > > > > > ________________________ > > Andras Lasso, PhD > > Senior Research Engineer, Associate Director (Engineering) > > Laboratory for Percutaneous Surgery > > School of Computing, Queen's University > > Kingston, ON, 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 > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > -- > Sankhesh Jhaveri > *Sr. Research & Development Engineer* | Kitware > > | (518) 881-4417 > > ? > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -- ------------------------------------------------------------------ Simon Esneault Rennes, France ------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From skemobob at gmail.com Mon Sep 3 04:21:05 2018 From: skemobob at gmail.com (=?UTF-8?B?0KHQu9Cw0LLQsCDQoNC10YjQtdGC0L3QuNC60L7Qsg==?=) Date: Mon, 3 Sep 2018 11:21:05 +0300 Subject: [vtkusers] Structure grid visualization inside paraview Message-ID: Hello,everyone! Can someone help me with this problem. I'm doing a plugin for paraview which read data from array. I'm trying to use structured grid.Paraview read data right but didn't visualize anything. [image: props.png] The code looks like this: vtkInformation *outInfo = outputVector->GetInformationObject(0); vtkStructuredGrid *output = vtkStructuredGrid::SafeDownCast( outInfo->Get(vtkDataObject::DATA_OBJECT())); vtkStructuredGrid *output = vtkStructuredGrid::SafeDownCast( outInfo->Get(vtkDataObject::DATA_OBJECT())); double x[3]; vtkPoints *newPoints; vtkCellArray *newVerts; newPoints = vtkPoints::New(); // Set the desired precision for the points in the output. if(this->OutputPointsPrecision == vtkAlgorithm::DOUBLE_PRECISION) { newPoints->SetDataType(VTK_DOUBLE); } else { newPoints->SetDataType(VTK_FLOAT); } vtkSmartPointer points = vtkSmartPointer::New(); this->NumberOfPoints =firstzone[0]->data.at(0).array.size(); newPoints->Allocate(NumberOfPoints); newVerts = vtkCellArray::New(); newVerts->Allocate(newVerts->EstimateSize(1,NumberOfPoints)); newVerts->InsertNextCell(NumberOfPoints); if (this->Distribution == VTK_POINT_UNIFORM ) { // only produce points on the surface of the sphere for (unsigned int i=0; idata.at(0).array.at(i); x[1] = firstzone[0]->data.at(1).array.at(i); x[2] = firstzone[0]->data.at(2).array.at(i); newVerts->InsertCellPoint(newPoints->InsertNextPoint(x)); } } else { // uniform distribution throughout the sphere volume for (unsigned int i=0; iNumberOfPoints;++i ) { x[0] = firstzone[0]->data.at(0).array.at(i); x[1] = firstzone[0]->data.at(1).array.at(i); x[2] = firstzone[0]->data.at(2).array.at(i); newVerts->InsertCellPoint(newPoints->InsertNextPoint(x)); } } //Get uniqe number of points std::set uX; std::set uY; std::set uZ; for(size_t i=0;idata.at(0).array.size();++i){ uX.insert(firstzone[0]->data.at(0).array.at(i)); } for(size_t i=0;idata.at(1).array.size();++i){ uY.insert(firstzone[0]->data.at(1).array.at(i)); } for(size_t i=0;idata.at(2).array.size();++i){ uZ.insert(firstzone[0]->data.at(2).array.at(i)); } std::cout<SetDimensions(uZ.size(),uY.size(),uX.size()); std::cout<<"Dimensions set"<SetPoints(newPoints); std::cout<<"Points set"<Delete(); newVerts->Delete(); -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: props.png Type: image/png Size: 29429 bytes Desc: not available URL: From ftpronk at engits.com Mon Sep 3 05:53:09 2018 From: ftpronk at engits.com (Fcs) Date: Mon, 3 Sep 2018 02:53:09 -0700 (MST) Subject: [vtkusers] Create many instances of vtkContourWidget In-Reply-To: References: Message-ID: <1535968389182-0.post@n5.nabble.com> Hello, I tested your code on Ubuntu 16.04 using VTK 6.3, and everything seems to be working correctly. The window closes as expected using the close button or by hitting "q". So this seems to be a bug related to the VTK version / operating system combo you are using. Kind regards. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sankhesh.jhaveri at kitware.com Mon Sep 3 08:08:29 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Mon, 3 Sep 2018 08:08:29 -0400 Subject: [vtkusers] Volume rendering produces rough surface at clipping plane In-Reply-To: References: Message-ID: Hi Simon, This MR just implements the flag for clipping but it should be simple to extend it to cropping as well. Thanks, Sankhesh ? On Mon, Sep 3, 2018 at 4:11 AM Simon Esneault wrote: > +1 for this feature, this will be of great help for us too ! > > The same "rough" effect is visible along the faces of the bounding box of > the volume, will this improvement works when we use the > SetCroppingRegionPlanes( ... ) method of the GPUVolumeMapper, ie without > using clipping planes but "CroppingRegionPlanes" ? > > Thanks ! > Simon > > Le mer. 29 ao?t 2018 ? 15:52, Andras Lasso a ?crit : > >> This is awesome! Thanks a lot for implementing this. It will greatly >> improve clipped volume visualization. >> >> >> >> Andras >> >> >> >> *From:* Sankhesh Jhaveri >> *Sent:* Wednesday, August 29, 2018 9:49 AM >> *To:* Andras Lasso >> *Cc:* vtkusers at vtk.org >> *Subject:* Re: [vtkusers] Volume rendering produces rough surface at >> clipping plane >> >> >> >> Hi Andras, >> >> !4627 >> >> implements a mode in vtkVolumeProperty that lets you use custom >> intensity values for voxels in the clipped space when computing gradients >> at the clip face. >> >> Best, >> Sankhesh >> >> ? >> >> >> >> On Fri, Nov 3, 2017 at 10:48 AM Andras Lasso wrote: >> >> Hi all, >> >> >> >> I?m working on visualizing cardiac images using volume rendering. I need >> to cut into the volume to see surfaces inside the heart, which works quite >> well by using clipping planes of the volume mapper. The only problem is >> that that surface at the cut plane looks very rough, which makes it >> difficult to distinguish from actual endocardial surfaces. If I ?cut? the >> volume by setting voxel values outside the clipping box to ?empty? (-1000 = >> air intensity value) then the cut surface looks nice ? smooth and flat. See >> example for both cutting method in the attached files. >> >> >> >> Is there a way to change volume renderer to get smooth cut surfaces (the >> same look as we get by setting outside voxels to ?empty? values)? >> >> >> >> Andras >> >> >> >> --- >> >> >> >> See full resolution images and more examples here: >> >> https://1drv.ms/f/s!Arm_AFxB9yqHsOsClG_QsMx-4sh8rg >> >> >> >> >> CT volume can be downloaded from here: >> >> http://slicer.kitware.com/midas3/download/item/292309/CTA-cardio.nrrd >> >> >> >> >> ________________________ >> >> Andras Lasso, PhD >> >> Senior Research Engineer, Associate Director (Engineering) >> >> Laboratory for Percutaneous Surgery >> >> School of Computing, Queen's University >> >> Kingston, ON, 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 >> >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> >> -- >> Sankhesh Jhaveri >> *Sr. Research & Development Engineer* | Kitware >> >> | (518) 881-4417 >> >> ? >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> > https://public.kitware.com/mailman/listinfo/vtkusers >> > > > -- > ------------------------------------------------------------------ > Simon Esneault > Rennes, France > ------------------------------------------------------------------ > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From pkorir at ebi.ac.uk Mon Sep 3 12:24:07 2018 From: pkorir at ebi.ac.uk (Paul Korir) Date: Mon, 03 Sep 2018 10:24:07 -0600 Subject: [vtkusers] Your Paul Korir Statement Message-ID: <104950554667819584.557AFEB9AD84FD71@vtk.org> Dear Customer, Please see attached Thank you and have a wonderful day! ---------------------------------------- Paul Korir Office: 923.574.7341 T/Free: 1.871.640.5987 EMAIL:pkorir at ebi.ac.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: DOC56659.pdf Type: application/pdf Size: 1813 bytes Desc: not available URL: From rickfrank at me.com Mon Sep 3 17:44:11 2018 From: rickfrank at me.com (Richard Frank) Date: Mon, 03 Sep 2018 17:44:11 -0400 Subject: [vtkusers] Vtk.js and scroll wheel click Message-ID: <844423E0-8C57-4F8C-8655-2F7BB9B6DC22@me.com> Hi I want to use scroll wheel down for Pan in my interactor instead of a modifier key. What?s the best way to do this? I don?t see how to get it in an interactor style and if I add a PanManipulator it seems to take over all the mouse handling. What?s the relationship between an interactor and a manipulator? Thanks Rick Frank From sebastien.jourdain at kitware.com Mon Sep 3 21:29:13 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 3 Sep 2018 19:29:13 -0600 Subject: [vtkusers] Vtk.js and scroll wheel click In-Reply-To: <844423E0-8C57-4F8C-8655-2F7BB9B6DC22@me.com> References: <844423E0-8C57-4F8C-8655-2F7BB9B6DC22@me.com> Message-ID: Hi Rick, The style itself will handle all events the way you want but you will have to define all the interactions. The manipulators on the other hand use a manipulator style in which you can plug a bunch of manipulators to handle specific part (button/modifier/action). In your case, you may have to implement a panManipulator that only deals with the mouse wheel/pinch. You can look at the zoom one which has an option to support the mouse wheel. HTH, Seb On Mon, Sep 3, 2018 at 3:44 PM Richard Frank via vtkusers < vtkusers at public.kitware.com> wrote: > Hi > > I want to use scroll wheel down for Pan in my interactor instead of a > modifier key. What?s the best way to do this? I don?t see how to get it in > an interactor style and if I add a PanManipulator it seems to take over all > the mouse handling. > > What?s the relationship between an interactor and a manipulator? > > Thanks > > Rick Frank > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Mon Sep 3 22:28:19 2018 From: rickfrank at me.com (Richard Frank) Date: Mon, 03 Sep 2018 22:28:19 -0400 Subject: [vtkusers] Vtk.js and scroll wheel click In-Reply-To: References: <844423E0-8C57-4F8C-8655-2F7BB9B6DC22@me.com> Message-ID: > > In your case, you may have to implement a panManipulator that only deals with the mouse wheel/pinch. Do you mean a interactorStyle - hasA - Pan Manipulator? I tried that and when I add the manipulator it seems to take over all the events?..I don?t get the left or right button - when I created the pan manipulator I only assigned it center button (2) > You can look at the zoom one which has an option to support the mouse wheel. Do you mean a zoom Manipulator? I?ll experiment and post some code if I can?t get it working?. Thanks Rick > > HTH, > > Seb > > On Mon, Sep 3, 2018 at 3:44 PM Richard Frank via vtkusers > wrote: > Hi > > I want to use scroll wheel down for Pan in my interactor instead of a modifier key. What?s the best way to do this? I don?t see how to get it in an interactor style and if I add a PanManipulator it seems to take over all the mouse handling. > > What?s the relationship between an interactor and a manipulator? > > Thanks > > Rick Frank > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Mon Sep 3 23:18:16 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 3 Sep 2018 21:18:16 -0600 Subject: [vtkusers] Vtk.js and scroll wheel click In-Reply-To: References: <844423E0-8C57-4F8C-8655-2F7BB9B6DC22@me.com> Message-ID: When you register a manipulator you need to specify when it should be applied, button (1,2,3), modifier (alt, shift, control). If you don't specify anything that will be the left button with no modifier. Moreover, you can provide those flags to skip drag or scroll (scrollEnabled: true, dragEnabled: false) Since that manipulator is only focusing on mouse drag, you will need to create another one that do something base on the scroll like here: https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js#L70-L90 You have that example that allow you to dynamically design the user interaction style https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Style/InteractorStyleManipulator/example/index.js https://kitware.github.io/vtk-js/examples/InteractorStyleManipulator.html On Mon, Sep 3, 2018 at 8:28 PM Richard Frank wrote: > > > > In your case, you may have to implement a panManipulator that only deals > with the mouse wheel/pinch. > > > Do you mean a interactorStyle - hasA - Pan Manipulator? > > I tried that and when I add the manipulator it seems to take over all the > events?..I don?t get the left or right button - when I created the pan > manipulator I only > assigned it center button (2) > > > You can look at the zoom one which has an option to support the mouse > wheel. > > > Do you mean a zoom Manipulator? > > I?ll experiment and post some code if I can?t get it working?. > > Thanks > > Rick > > > HTH, > > Seb > > On Mon, Sep 3, 2018 at 3:44 PM Richard Frank via vtkusers < > vtkusers at public.kitware.com> wrote: > >> Hi >> >> I want to use scroll wheel down for Pan in my interactor instead of a >> modifier key. What?s the best way to do this? I don?t see how to get it in >> an interactor style and if I add a PanManipulator it seems to take over all >> the mouse handling. >> >> What?s the relationship between an interactor and a manipulator? >> >> Thanks >> >> Rick Frank >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Tue Sep 4 09:29:07 2018 From: rickfrank at me.com (Richard Frank) Date: Tue, 04 Sep 2018 09:29:07 -0400 Subject: [vtkusers] Vtk.js and scroll wheel click In-Reply-To: References: <844423E0-8C57-4F8C-8655-2F7BB9B6DC22@me.com> Message-ID: <7194AD7D-B6A3-4F15-B21C-6F9B0AB31AA5@me.com> Thanks. Question - I have this interactor style https://github.com/DominionSoftware/VTKPlugin/lib/ohifInteractorStyleSlice.js Which handles zooming by dollying the camera... The superclass has States.IS_PAN: So it would seem that if I can get a center button drag event it would be simpler than creating a manipulator as a special case. The wheel also handles slice navigation. The ?usual? ( for better or worse ) way of panning on these medical slices is by holding down the wheel ( albeit without spinning it ) and dragging. So....in my mind it would be the simplest path to handle States.IS_PAN by getting a center button event here and passing it to the super class. Is there a browser or other event snafu that prevents the center button drag coming through directly to the interactor? The superclass handles pan with a left drag and modifier combination, while we would like to use center button drag.... Thanks, Rick Sent from my iPad > On Sep 3, 2018, at 11:18 PM, Sebastien Jourdain wrote: > > When you register a manipulator you need to specify when it should be applied, button (1,2,3), modifier (alt, shift, control). If you don't specify anything that will be the left button with no modifier. > Moreover, you can provide those flags to skip drag or scroll (scrollEnabled: true, dragEnabled: false) > > Since that manipulator is only focusing on mouse drag, you will need to create another one that do something base on the scroll like here: > https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js#L70-L90 > > You have that example that allow you to dynamically design the user interaction style > https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Style/InteractorStyleManipulator/example/index.js > > https://kitware.github.io/vtk-js/examples/InteractorStyleManipulator.html > > > > >> On Mon, Sep 3, 2018 at 8:28 PM Richard Frank wrote: >> >> >>> >>> In your case, you may have to implement a panManipulator that only deals with the mouse wheel/pinch. >> >> Do you mean a interactorStyle - hasA - Pan Manipulator? >> >> I tried that and when I add the manipulator it seems to take over all the events?..I don?t get the left or right button - when I created the pan manipulator I only >> assigned it center button (2) >> >> >>> You can look at the zoom one which has an option to support the mouse wheel. >> >> Do you mean a zoom Manipulator? >> >> I?ll experiment and post some code if I can?t get it working?. >> >> Thanks >> >> Rick >> >>> >>> HTH, >>> >>> Seb >>> >>>> On Mon, Sep 3, 2018 at 3:44 PM Richard Frank via vtkusers wrote: >>>> Hi >>>> >>>> I want to use scroll wheel down for Pan in my interactor instead of a modifier key. What?s the best way to do this? I don?t see how to get it in an interactor style and if I add a PanManipulator it seems to take over all the mouse handling. >>>> >>>> What?s the relationship between an interactor and a manipulator? >>>> >>>> Thanks >>>> >>>> Rick Frank >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Tue Sep 4 09:44:25 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Tue, 4 Sep 2018 07:44:25 -0600 Subject: [vtkusers] Vtk.js and scroll wheel click In-Reply-To: <7194AD7D-B6A3-4F15-B21C-6F9B0AB31AA5@me.com> References: <844423E0-8C57-4F8C-8655-2F7BB9B6DC22@me.com> <7194AD7D-B6A3-4F15-B21C-6F9B0AB31AA5@me.com> Message-ID: Hi Rick, Sorry I miss understood what you meant. In your case you just need to use button: 1 for the pan manipulator like in Glance. Seb > On Sep 4, 2018, at 07:29, Richard Frank wrote: > > Thanks. > > Question - I have this interactor style > https://github.com/DominionSoftware/VTKPlugin/lib/ohifInteractorStyleSlice.js > > Which handles zooming by dollying the camera... > > The superclass has States.IS_PAN: > > So it would seem that if I can get a center button drag event it would be simpler than creating a manipulator as a special case. > > The wheel also handles slice navigation. > > The ?usual? ( for better or worse ) way of panning on these medical slices is by holding down the wheel ( albeit without spinning it ) and dragging. > > So....in my mind it would be the simplest path to handle States.IS_PAN by getting a center button event here and passing it to the super class. > > Is there a browser or other event snafu that prevents the center button drag coming through directly to the interactor? > > The superclass handles pan with a left drag and modifier combination, while we would like to use center button drag.... > > > Thanks, > > Rick > > Sent from my iPad > >> On Sep 3, 2018, at 11:18 PM, Sebastien Jourdain wrote: >> >> When you register a manipulator you need to specify when it should be applied, button (1,2,3), modifier (alt, shift, control). If you don't specify anything that will be the left button with no modifier. >> Moreover, you can provide those flags to skip drag or scroll (scrollEnabled: true, dragEnabled: false) >> >> Since that manipulator is only focusing on mouse drag, you will need to create another one that do something base on the scroll like here: >> https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js#L70-L90 >> >> You have that example that allow you to dynamically design the user interaction style >> https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Style/InteractorStyleManipulator/example/index.js >> >> https://kitware.github.io/vtk-js/examples/InteractorStyleManipulator.html >> >> >> >> >>> On Mon, Sep 3, 2018 at 8:28 PM Richard Frank wrote: >>> >>> >>>> >>>> In your case, you may have to implement a panManipulator that only deals with the mouse wheel/pinch. >>> >>> Do you mean a interactorStyle - hasA - Pan Manipulator? >>> >>> I tried that and when I add the manipulator it seems to take over all the events?..I don?t get the left or right button - when I created the pan manipulator I only >>> assigned it center button (2) >>> >>> >>>> You can look at the zoom one which has an option to support the mouse wheel. >>> >>> Do you mean a zoom Manipulator? >>> >>> I?ll experiment and post some code if I can?t get it working?. >>> >>> Thanks >>> >>> Rick >>> >>>> >>>> HTH, >>>> >>>> Seb >>>> >>>>> On Mon, Sep 3, 2018 at 3:44 PM Richard Frank via vtkusers wrote: >>>>> Hi >>>>> >>>>> I want to use scroll wheel down for Pan in my interactor instead of a modifier key. What?s the best way to do this? I don?t see how to get it in an interactor style and if I add a PanManipulator it seems to take over all the mouse handling. >>>>> >>>>> What?s the relationship between an interactor and a manipulator? >>>>> >>>>> Thanks >>>>> >>>>> Rick Frank >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> https://public.kitware.com/mailman/listinfo/vtkusers >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From minpu.code at gmail.com Tue Sep 4 21:03:47 2018 From: minpu.code at gmail.com (pnt1614) Date: Tue, 4 Sep 2018 18:03:47 -0700 (MST) Subject: [vtkusers] How to enable the stencil buffer? Message-ID: <1536109427072-0.post@n5.nabble.com> I can do a clipping and fill a hole using the stencil buffer in OpenGL, so is there anyway to enable and use the stencil buffer in VTK? I have checked some examples about vtkImageStencil but how to enable stencil tests when rendering objects? Is there anybody experienced this problem? Please, help me. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From siyang1982 at msn.com Wed Sep 5 04:32:03 2018 From: siyang1982 at msn.com (lifelife) Date: Wed, 5 Sep 2018 01:32:03 -0700 (MST) Subject: [vtkusers] Can I get any angle of slice? Message-ID: <1536136323829-0.post@n5.nabble.com> In example , the vtkImageMapper only can get I/J/K slice, any idea to get rotated slice (Chamfer)? I wanner use it in MPR, which need get any angle of slice. I searched the doc and forum, didn't get the answer. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From pkorir at ebi.ac.uk Wed Sep 5 09:05:28 2018 From: pkorir at ebi.ac.uk (Paul Korir) Date: Wed, 5 Sep 2018 14:05:28 +0100 Subject: [vtkusers] Your Paul Korir Statement - Request to VTK Users List Admin to delete spamming user In-Reply-To: <104950554667819584.557AFEB9AD84FD71@vtk.org> References: <104950554667819584.557AFEB9AD84FD71@vtk.org> Message-ID: The message below purports to be from me. However, it's from irma.cisneros at sacilsc.com, who has exposed a bug in how mailman parses message headers (the 'from' field, in particular). Could some admin please remove 'irma.cisneros at sacilsc.com' from the list of VTK users as they are misrepresenting me? Thanks. Paul K. Korir, PhD Scientific Programmer EMBL-EBI 01223494422 On 03/09/2018 17:24, Paul Korir wrote: > Dear Customer, > > > > Please see attached > > Thank you and have a wonderful day! > > ---------------------------------------- > > Paul Korir > Office: 923.574.7341 > T/Free: 1.871.640.5987 > EMAIL:pkorir at ebi.ac.uk > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From utkarsh.ayachit at kitware.com Wed Sep 5 11:50:28 2018 From: utkarsh.ayachit at kitware.com (Utkarsh Ayachit) Date: Wed, 5 Sep 2018 11:50:28 -0400 Subject: [vtkusers] Your Paul Korir Statement - Request to VTK Users List Admin to delete spamming user In-Reply-To: References: <104950554667819584.557AFEB9AD84FD71@vtk.org> Message-ID: Thanks, Paul. I've forwarded the email to our sysadmins. They should be able to block that sender. On Wed, Sep 5, 2018 at 9:05 AM Paul Korir wrote: > The message below purports to be from me. However, it's from > irma.cisneros at sacilsc.com, who has exposed a bug in how mailman parses > message headers (the 'from' field, in particular). > > Could some admin please remove 'irma.cisneros at sacilsc.com' from the list > of VTK users as they are misrepresenting me? > > Thanks. > > Paul K. Korir, PhD > Scientific Programmer > EMBL-EBI > 01223494422 > > On 03/09/2018 17:24, Paul Korir > wrote: > > Dear Customer, > > > > Please see attached > > Thank you and have a wonderful day! > > ---------------------------------------- > > Paul Korir > Office: 923.574.7341 > T/Free: 1.871.640.5987EMAIL:pkorir at ebi.ac.uk > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe:https://public.kitware.com/mailman/listinfo/vtkusers > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From minpu.code at gmail.com Wed Sep 5 21:47:19 2018 From: minpu.code at gmail.com (pnt1614) Date: Wed, 5 Sep 2018 18:47:19 -0700 (MST) Subject: [vtkusers] How to simulate a key press event in MFC program? Message-ID: <1536198439497-0.post@n5.nabble.com> I am using VTK and some VTK widgets in my MFC program. When an user closing the main window, I want to simulate a key press event when the user clicks 'Q' key. How can I do that? Is there anybody experienced this problem? Please, help me. Thanks in advance. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mey1k at naver.com Thu Sep 6 05:32:14 2018 From: mey1k at naver.com (minjun) Date: Thu, 6 Sep 2018 02:32:14 -0700 (MST) Subject: [vtkusers] mesh morphing, move Message-ID: <1536226334405-0.post@n5.nabble.com> i'm sad i'm trying various methods to modify the selected area. I got the normal value of each pointer in the selected area. So I tried to modify the mesh with the normal value of each pointer. However, there was a crossing and a mesh break. and I tried to recreate the mesh after deleting the selected points, but it did not work properly. I want to know how to modify the selected area. thank you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From allison.vacanti at kitware.com Thu Sep 6 10:33:29 2018 From: allison.vacanti at kitware.com (Allie Vacanti) Date: Thu, 6 Sep 2018 10:33:29 -0400 Subject: [vtkusers] How to enable the stencil buffer? In-Reply-To: <1536109427072-0.post@n5.nabble.com> References: <1536109427072-0.post@n5.nabble.com> Message-ID: Stencil masks aren't used often in VTK, though the LabeledContourMapper will use them, see: https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OpenGL2/vtkOpenGLLabeledContourMapper.cxx#L130 Using them requires enabling stencil buffers via the RenderWindow API and writing a new OpenGL mapper or renderpass to setup the GL state. There is not an existing general way to render arbitrary actors into a stencil buffer that I am aware of. On Tue, Sep 4, 2018 at 9:03 PM, pnt1614 wrote: > I can do a clipping and fill a hole using the stencil buffer in OpenGL, so > is > there anyway to enable and use the stencil buffer in VTK? I have checked > some examples about vtkImageStencil but how to enable stencil tests when > rendering objects? > > Is there anybody experienced this problem? Please, help me. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Thu Sep 6 11:34:33 2018 From: rickfrank at me.com (Richard Frank) Date: Thu, 06 Sep 2018 15:34:33 +0000 (GMT) Subject: [vtkusers] vtk.js questions Message-ID: <6011e4bb-511c-4641-abc7-54cdbff4ff03@me.com> Hi, * What is a vtkCornerAnnotation best used for (docs link is broken) ? * The TextLabel example seems broken (nothing shows on either Linux or Windows) * My standalone version of the?spheres and labels? https://github.com/DominionSoftware/textactor.git puts the text in a separate canvas, not overlaid, not sure why? (?).... The base question is, what should one use for text in an MPR view for things like Patient Name, Slice Number, etc....? Thanks Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Thu Sep 6 12:46:59 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 6 Sep 2018 10:46:59 -0600 Subject: [vtkusers] vtk.js questions In-Reply-To: <6011e4bb-511c-4641-abc7-54cdbff4ff03@me.com> References: <6011e4bb-511c-4641-abc7-54cdbff4ff03@me.com> Message-ID: Hi Rick, 1) Corner annotation link issue has been resolved. And in case of similar issue, the menu on the left is always right since it is generated which is not the case for the welcome page and a typo was indeed present. But that page just present the menu in a more compact way. 3) Did you play with z-index also be-aware that if you have a high dpi screen the openGL canvas will be bigger than the size reported by the browser for the container size... For the text when possible I would use plain HTML/SVG overlay instead of making a canvas. HTH, Seb On Thu, Sep 6, 2018 at 10:35 AM Richard Frank via vtkusers < vtkusers at public.kitware.com> wrote: > Hi, > > * What is a vtkCornerAnnotation best used for (docs link is broken) ? > * The TextLabel example seems broken (nothing shows on either Linux or > Windows) > * My standalone version of the spheres and labels > https://github.com/DominionSoftware/textactor.git > > puts the text in a separate canvas, not overlaid, not sure why (?).... > > The base question is, what should one use for text in an MPR view for > things like Patient Name, > Slice Number, etc....? > > Thanks > > Rick > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From meakcey at gmail.com Thu Sep 6 13:24:58 2018 From: meakcey at gmail.com (meakcey) Date: Thu, 6 Sep 2018 10:24:58 -0700 (MST) Subject: [vtkusers] Failed to load library QVTKWidgetPlugin.dll Message-ID: <1536254698916-0.post@n5.nabble.com> Hi I am having a problem to integrate QVTKWidgetPlugin into Qt. I have compiled VTK with MSVC 2014 x64 with settings below VTK_Group_Qt ON VTK_QT_VERSION 5 VTK_BUILD_QT_DESIGNER_PLUGIN ON Module_vtkGUISupportQtOpenGL ON Module_vtkGUISupportQt ON Module_vtkRenderingQt ON Module_vtkViewsQt ON I have copied QVTKWidgetPlugin.dll to C:\Qt\Tools\QtCreator\bin\plugins\designer but there is no widget is shown on tool menu. When I checked Tools>Form Editor>About Qt Designer Plugins I see QVTTKWidgetPlugin could not be loaded with message below: "Cannot load library C:\Qt\Tools\QtCreator\bin\plugins\designer\QVTKWidgetPlugin.dll: Unknown error 0x000000c1" I have set environment variable to QT_DEBUG_PLUGINS=1 and then started a sample app but there is no output related with QVTKWidgetPlugin. How can I get the reason of the problem? Thanks -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mey1k at naver.com Thu Sep 6 19:34:39 2018 From: mey1k at naver.com (minjun) Date: Thu, 6 Sep 2018 16:34:39 -0700 (MST) Subject: [vtkusers] Failed to load library QVTKWidgetPlugin.dll In-Reply-To: <1536254698916-0.post@n5.nabble.com> References: <1536254698916-0.post@n5.nabble.com> Message-ID: <1536276879442-0.post@n5.nabble.com> hi, it is QVTKWidget bug you should use release mede dll file. then you can show QVTKWidget in toolbox -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From minpu.code at gmail.com Thu Sep 6 20:51:58 2018 From: minpu.code at gmail.com (pnt1614) Date: Thu, 6 Sep 2018 17:51:58 -0700 (MST) Subject: [vtkusers] How to enable the stencil buffer? In-Reply-To: References: <1536109427072-0.post@n5.nabble.com> Message-ID: <1536281518628-0.post@n5.nabble.com> Thank for the reply, I try it. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From f.s.farimani at gmail.com Thu Sep 6 20:58:16 2018 From: f.s.farimani at gmail.com (Foad Sojoodi Farimani) Date: Fri, 7 Sep 2018 02:58:16 +0200 Subject: [vtkusers] ParaView Python script causes non responding Visualization Toolkit - Win32OpenGL on Windows Message-ID: Dear VTK users, As I have reported here in details, I am trying to figure ParaView Python scripting on Windows out. The issue is that it causes a non responding VTK Visualization Toolkit - Win32OpenGL . I was wondering if you could help me know: 1. is this really a conflict between 64bit Python and 32bit VTK as reported here . 2. If yes how I might be able to solve it? 3. if no what else could cause such an issue? I would appreciate if you could help me with the above questions. Thanks in advance and looking forwards to hearing back. Best, Foad -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Thu Sep 6 22:10:24 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 6 Sep 2018 22:10:24 -0400 Subject: [vtkusers] ParaView Python script causes non responding Visualization Toolkit - Win32OpenGL on Windows In-Reply-To: References: Message-ID: Foad, This mailing list is for VTK issues only. You have already found and posted about this topic to the forums for ParaView issues, so I will not refer you to them here. Thanks, Cory On Thu, Sep 6, 2018 at 8:58 PM Foad Sojoodi Farimani wrote: > > Dear VTK users, > > As I have reported here in details, I am trying to figure ParaView Python scripting on Windows out. The issue is that it causes a non responding VTK Visualization Toolkit - Win32OpenGL . I was wondering if you could help me know: > > is this really a conflict between 64bit Python and 32bit VTK as reported here. > If yes how I might be able to solve it? > if no what else could cause such an issue? > > I would appreciate if you could help me with the above questions. Thanks in advance and looking forwards to hearing back. > > Best, > Foad > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen Staff R&D Engineer Kitware, Inc. From berti_krueger at hotmail.com Fri Sep 7 05:11:45 2018 From: berti_krueger at hotmail.com (=?iso-8859-1?Q?Berti_Kr=FCger?=) Date: Fri, 7 Sep 2018 09:11:45 +0000 Subject: [vtkusers] Nonrectangular selection of points (vertices) or cells (triangles) on a mesh surface (paraview like) Message-ID: Hello everyone. In my project i have a standard 3D STL triangle surface mesh where i need to select all vertices which lie inside a region (polygon) defined by a closed polyline created by an user interaction using the vtkContourWidget: [cid:6bce5125-0cf4-43a0-962c-cc9dd5a593f1] [cid:dc6cff08-ee3c-4c70-bea2-9e44a8578c05] Paraview has a similiar feature called "select points with polygon" or "select cells with polygon": [cid:4238abb5-92ec-41d2-a435-867a45d1a7cb] At the end of the process i want to create a polygon mesh which has the shape of the vtkContourWidget polygon selection contour line and which lies like a sticker or texture on the the given stl mesh surface. If anybody can help me with ideas / suggestions / hints / pointers on how to accomplish this with vtk i would be glad. Thank you very much in advance, Berti -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: selection1.png Type: image/png Size: 968853 bytes Desc: selection1.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: selection2.png Type: image/png Size: 983210 bytes Desc: selection2.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: paraview.png Type: image/png Size: 295118 bytes Desc: paraview.png URL: From dave.demarle at kitware.com Fri Sep 7 08:38:43 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 7 Sep 2018 08:38:43 -0400 Subject: [vtkusers] Nonrectangular selection of points (vertices) or cells (triangles) on a mesh surface (paraview like) In-Reply-To: References: Message-ID: Hello, The VTK level implementation behind ParaView's polygon selection feature is exercised/demonstrated by Rendering/Core/Testing/Cxx/TestPolygonSelection.cxx. You can follow that to see how a VTK enabled app can make a non rectangular selection. With that selection you might either extract a subset surface offset it a bit and change the appearance, or use the preserve topology feature of selection to make a shallow copy of the original mesh with a new array that identifies the selected primitives, and use that array as input to the coloration of the whole to modify its appearance. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: selection1.png Type: image/png Size: 968853 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: selection2.png Type: image/png Size: 983210 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: paraview.png Type: image/png Size: 295118 bytes Desc: not available URL: From scbiradar at gmail.com Fri Sep 7 08:50:09 2018 From: scbiradar at gmail.com (Santosh Biradar) Date: Fri, 7 Sep 2018 18:20:09 +0530 Subject: [vtkusers] Timers in wxPython VTK application Message-ID: Hi VTKers, I am working on a windows wxPython VTK application . VTK version is 6.3.0 I am trying to add repeating timer(s) to the renderwindowinteractor. Now, I notice that the wxVTKRenderWindowInteractor class does not have provision to specify the timer duration and always sets timer duration as the default 10 ms. I was able to add the duration as below (in the try except block): def CreateTimer(self, obj, evt): """ Creates a timer. """ self._timer = EventTimer(self) try: # From the docs # These methods are used to communicate information about the currently firing CreateTimerEvent or DestroyTimerEvent.The caller of CreateTimerEvent sets up TimerEventId, TimerEventType and TimerEventDuration. duration = self._Iren.GetTimerEventDuration() except: duration = 10 self._timer.Start(duration, True) This works for me if I have a single timer. I want to know if there is provision to create multiple interactor timers simultaneously. If I have multiple timers with potentially different durations, how do I know in my observer for TimerEvent, that the event is invoked from which timer. As seen below, the timer Id is not passed in the Notify method of the wxTimer subclass used in this module. def Notify(self,*args,**kwargs): """ The timer has expired. """ self.iren.TimerEvent() I would assume this could be an issue for Qt applications as well. Thanks, Santosh -------------- next part -------------- An HTML attachment was scrubbed... URL: From Andx_roo at live.com Fri Sep 7 19:05:36 2018 From: Andx_roo at live.com (Andaharoo) Date: Fri, 7 Sep 2018 16:05:36 -0700 (MST) Subject: [vtkusers] Vector Field From Image Glyph3d Message-ID: <1536361536197-0.post@n5.nabble.com> I'm trying to use the glyph3d filter to make a vector field from a 3 component image. Let's call the components r, g, and b. I want r to correspond with x, g with y, and b with z. Unfortunately I cannot figure out how to do this with glyph3d after looking at all the examples and an hour of googling. It seems like it was meant to do this but all the settings make it too confusing. Currently it appears as though it only considers the first component for the direction and x and -x directions are the only ways the arrows will point. (see image) In this test image you can see the arrows won't point up in green (y). They just disappear? vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName("testing.png"); reader->Update(); // Shift and ccast to have a float image -127.5 to 127.5 for negative direction vtkSmartPointer shiftScale = vtkSmartPointer::New(); shiftScale->SetInputData(reader->GetOutput()); shiftScale->SetOutputScalarTypeToFloat(); shiftScale->SetShift(-127.5); shiftScale->Update(); vtkSmartPointer glyphSource = vtkSmartPointer::New(); glyphSource->Update(); vtkSmartPointer glyphFilter = vtkSmartPointer::New(); glyphFilter->SetSourceConnection(glyphSource->GetOutputPort()); glyphFilter->SetScaleFactor(0.006); // Scale a bit because arrows are far too big glyphFilter->SetInputData(shiftScale->GetOutput()); glyphFilter->Update(); -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rasoul.sharifian1 at gmail.com Sun Sep 9 06:32:39 2018 From: rasoul.sharifian1 at gmail.com (Rasoul Sharifian) Date: Sun, 9 Sep 2018 15:02:39 +0430 Subject: [vtkusers] Reformat images in different orientations by ActiViz.Net Message-ID: Hi every one, I want to use ActiViz.net to reformat and deiplay dicom series in axial, coronal and sagittal views. I did this job in cpp by ImageSlicing.cpp example. But now I want to have the results in c#. Do you have any suggestion??? Thanks so much -------------- next part -------------- An HTML attachment was scrubbed... URL: From minpu.code at gmail.com Sun Sep 9 21:11:12 2018 From: minpu.code at gmail.com (pnt1614) Date: Sun, 9 Sep 2018 18:11:12 -0700 (MST) Subject: [vtkusers] How to build a "Stratified Sampling" project? Message-ID: <1536541872622-0.post@n5.nabble.com> I am using CMake 3.11.4, VTK 8.1.1, Visual studio 2015 on Windows 10 64 bits and I try to build the "Stratified Sampling" project (http://www.vtkjournal.org/browse/publication/719). It looks like there is a difference between the current VTK version (8.1.1) and the old VTK version used to make this project, there are the following errors. 1. Old syntax 2. Missing file (error.h) 3. vtkHybrid.lib I can solve the first problem and skip the error.h file but I do not where to find the vtkHybrid.lib. I have searched the VTK versions 6.3 but there is no such library named vtkHybrid.lib. The CMakeLists.txt's content is: cmake_minimum_required(VERSION 2.6) Project(StratifiedSampling) ENABLE_TESTING() FIND_PACKAGE(VTK REQUIRED) INCLUDE(${VTK_USE_FILE}) SET(BUILD_PARAVIEW_PLUGIN OFF CACHE BOOL "Build Paraview plugin?") SET(sources boxbox.cpp diffuse.cc edgeflip.cc faceflip.cc filter.cc ICP.cc KDtree.cc lmsmooth.cc pointsample.cpp remove.cc reorder_verts.cc sample.cpp stratify.cpp subdiv.cc tribox.cpp TriMesh.cc TriMesh_bounding.cc TriMesh_connectivity.cc TriMesh_curvature.cc TriMesh_grid.cc TriMesh_normals.cc TriMesh_pointareas.cc TriMesh_stats.cc TriMesh_tstrips.cc) if(BUILD_PARAVIEW_PLUGIN) FIND_PACKAGE(ParaView REQUIRED) INCLUDE(${PARAVIEW_USE_FILE}) INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ../) ADD_PARAVIEW_PLUGIN(StratifiedSamplingPlugin "1.0" SERVER_MANAGER_XML vtkStratifiedSampling.xml SERVER_MANAGER_SOURCES vtkStratifiedSampling.cxx SERVER_SOURCES boxbox.cpp diffuse.cc edgeflip.cc faceflip.cc filter.cc ICP.cc KDtree.cc lmsmooth.cc pointsample.cpp remove.cc reorder_verts.cc sample.cpp stratify.cpp subdiv.cc tribox.cpp TriMesh.cc TriMesh_bounding.cc TriMesh_connectivity.cc TriMesh_curvature.cc TriMesh_grid.cc TriMesh_normals.cc TriMesh_pointareas.cc TriMesh_stats.cc TriMesh_tstrips.cc ) endif(BUILD_PARAVIEW_PLUGIN) ADD_EXECUTABLE(StratifiedSampling vtkStratifiedSampling.cxx main.cpp ${sources} ) TARGET_LINK_LIBRARIES(StratifiedSampling vtkHybrid) ############## ADD_EXECUTABLE(Test Test.cxx vtkStratifiedSampling.cxx ${sources}) TARGET_LINK_LIBRARIES(Test vtkHybrid) ADD_TEST(StratifiedSamplingTest Test) So how can I build this project and use the vtkStratiedSampling class in my own project?. Is there anyone experienced this problem? Please, help me. Thank you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bill.lorensen at gmail.com Sun Sep 9 21:21:31 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 9 Sep 2018 18:21:31 -0700 Subject: [vtkusers] How to build a "Stratified Sampling" project? In-Reply-To: <1536541872622-0.post@n5.nabble.com> References: <1536541872622-0.post@n5.nabble.com> Message-ID: VtkHybrid is gone. Instead of naming vtk libraries , use ${VTK_LIBRARIES}. On Sun, Sep 9, 2018, 6:11 PM pnt1614 wrote: > I am using CMake 3.11.4, VTK 8.1.1, Visual studio 2015 on Windows 10 64 > bits > and I try to build the "Stratified Sampling" project > (http://www.vtkjournal.org/browse/publication/719). It looks like there > is a > difference between the current VTK version (8.1.1) and the old VTK version > used to make this project, there are the following errors. > > 1. Old syntax > 2. Missing file (error.h) > 3. vtkHybrid.lib > > I can solve the first problem and skip the error.h file but I do not where > to find the vtkHybrid.lib. I have searched the VTK versions 6.3 but there > is > no such library named vtkHybrid.lib. > > The CMakeLists.txt's content is: > > cmake_minimum_required(VERSION 2.6) > > Project(StratifiedSampling) > ENABLE_TESTING() > > FIND_PACKAGE(VTK REQUIRED) > INCLUDE(${VTK_USE_FILE}) > > > SET(BUILD_PARAVIEW_PLUGIN OFF CACHE BOOL "Build Paraview plugin?") > > SET(sources boxbox.cpp > diffuse.cc > edgeflip.cc > faceflip.cc > filter.cc > ICP.cc > KDtree.cc > lmsmooth.cc > pointsample.cpp > remove.cc > reorder_verts.cc > sample.cpp > stratify.cpp > subdiv.cc > tribox.cpp > TriMesh.cc > TriMesh_bounding.cc > TriMesh_connectivity.cc > TriMesh_curvature.cc > TriMesh_grid.cc > TriMesh_normals.cc > TriMesh_pointareas.cc > TriMesh_stats.cc > TriMesh_tstrips.cc) > > if(BUILD_PARAVIEW_PLUGIN) > FIND_PACKAGE(ParaView REQUIRED) > INCLUDE(${PARAVIEW_USE_FILE}) > > INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ../) > > ADD_PARAVIEW_PLUGIN(StratifiedSamplingPlugin "1.0" > SERVER_MANAGER_XML vtkStratifiedSampling.xml > SERVER_MANAGER_SOURCES vtkStratifiedSampling.cxx > SERVER_SOURCES boxbox.cpp diffuse.cc edgeflip.cc faceflip.cc filter.cc > ICP.cc KDtree.cc lmsmooth.cc pointsample.cpp remove.cc reorder_verts.cc > sample.cpp stratify.cpp subdiv.cc tribox.cpp TriMesh.cc TriMesh_bounding.cc > TriMesh_connectivity.cc TriMesh_curvature.cc TriMesh_grid.cc > TriMesh_normals.cc TriMesh_pointareas.cc TriMesh_stats.cc > TriMesh_tstrips.cc > ) > > endif(BUILD_PARAVIEW_PLUGIN) > > ADD_EXECUTABLE(StratifiedSampling vtkStratifiedSampling.cxx main.cpp > ${sources} > ) > > TARGET_LINK_LIBRARIES(StratifiedSampling vtkHybrid) > > ############## > ADD_EXECUTABLE(Test Test.cxx vtkStratifiedSampling.cxx > ${sources}) > TARGET_LINK_LIBRARIES(Test vtkHybrid) > > ADD_TEST(StratifiedSamplingTest Test) > > So how can I build this project and use the vtkStratiedSampling class in my > own project?. Is there anyone experienced this problem? Please, help me. > > Thank you. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From minpu.code at gmail.com Sun Sep 9 22:46:18 2018 From: minpu.code at gmail.com (pnt1614) Date: Sun, 9 Sep 2018 19:46:18 -0700 (MST) Subject: [vtkusers] How to build a "Stratified Sampling" project? In-Reply-To: References: <1536541872622-0.post@n5.nabble.com> Message-ID: <1536547578972-0.post@n5.nabble.com> Thank for the reply. I do not know anything about CMake so what do you mean "Instead of naming vtk libraries , use ${VTK_LIBRARIES}"? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From minpu.code at gmail.com Sun Sep 9 22:50:09 2018 From: minpu.code at gmail.com (pnt1614) Date: Sun, 9 Sep 2018 19:50:09 -0700 (MST) Subject: [vtkusers] How to build VTK 8.1.1 with "Module_PoissonReconstruction"? Message-ID: <1536547809574-0.post@n5.nabble.com> I am using CMake 3.11.4, Visual stuio 2015 on Windows 10 64 bits. I want to build VTK 8.1.1 with the "Module_PoissionReconstruction" but there is error message related to the hash_map. (Severity Code Description Project File Line Suppression State Error C2338 is deprecated and will be REMOVED. Please use . You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning. PoissonReconstruction C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\hash_map 17) I have googled and tried to define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS but it does not work. How do I solve this problem?. Thank you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bill.lorensen at gmail.com Sun Sep 9 23:54:08 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 9 Sep 2018 20:54:08 -0700 Subject: [vtkusers] How to build a "Stratified Sampling" project? In-Reply-To: <1536547578972-0.post@n5.nabble.com> References: <1536541872622-0.post@n5.nabble.com> <1536547578972-0.post@n5.nabble.com> Message-ID: TARGET_LINK_LIBRARIES(StratifiedSampling ${VTK_LIBRARIES}) On Sun, Sep 9, 2018 at 7:46 PM pnt1614 wrote: > > Thank for the reply. I do not know anything about CMake so what do you mean > "Instead of naming vtk libraries , use ${VTK_LIBRARIES}"? > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers -- Unpaid intern in BillsParadise at noware dot com From minpu.code at gmail.com Mon Sep 10 00:12:08 2018 From: minpu.code at gmail.com (pnt1614) Date: Sun, 9 Sep 2018 21:12:08 -0700 (MST) Subject: [vtkusers] How to build a "Stratified Sampling" project? In-Reply-To: References: <1536541872622-0.post@n5.nabble.com> <1536547578972-0.post@n5.nabble.com> Message-ID: <1536552728787-0.post@n5.nabble.com> Thank for the reply. I do as I said but I also have to remove vtkHybrid.lib to build the StratifiedSampling project and it works. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From minpu.code at gmail.com Mon Sep 10 03:32:23 2018 From: minpu.code at gmail.com (pnt1614) Date: Mon, 10 Sep 2018 00:32:23 -0700 (MST) Subject: [vtkusers] PowerCrust and PoissonReconstruction compile problems In-Reply-To: <1505824524919-0.post@n5.nabble.com> References: <1505505354230-0.post@n5.nabble.com> <20170918114718.GB19877@megas.kitware.com> <1505802749909-0.post@n5.nabble.com> <1505824524919-0.post@n5.nabble.com> Message-ID: <1536564743564-0.post@n5.nabble.com> @Daniel: I have the same problem as you and I have one more problem with hash_map in the visual studio, but I am using Visual studio 2015 on Windows 10 64 bits. Could you tell me briefly how you solved your problem? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rasoul.sharifian1 at gmail.com Mon Sep 10 05:08:56 2018 From: rasoul.sharifian1 at gmail.com (Rasoul Sharifian) Date: Mon, 10 Sep 2018 13:38:56 +0430 Subject: [vtkusers] How to make Sagittal and coronal views by axial ones in ActiViz.net Message-ID: Hi every one, I want to make and display sagittal and coronal views in ActiViz. I did this in cpp but now I want to show that in C# UI so I want to do this in ActiViz. Any suggestion would be appreciated -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Mon Sep 10 11:41:36 2018 From: david.m.groppe at gmail.com (David Groppe) Date: Mon, 10 Sep 2018 11:41:36 -0400 Subject: [vtkusers] Extracting single slices from vtkNIFTIImageReader Message-ID: Hi, I am working with 3D nifti files in VTK and reading them with the vtkNIFTIImageReader class ( https://www.vtk.org/doc/nightly/html/classvtkNIFTIImageReader.html). I would like to extract single 2D slices from the nifti file without plotting the slice in a render window (i.e., without using vtkImageViewer2). Is that possible with vtkNIFTIImageReader? If so, how? much thanks, -David -------------- next part -------------- An HTML attachment was scrubbed... URL: From joachim.pouderoux at kitware.com Mon Sep 10 15:35:18 2018 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Mon, 10 Sep 2018 15:35:18 -0400 Subject: [vtkusers] Hide backface Silhouettes returned by vtkPolyDataSilhouette In-Reply-To: <1486131093934-5742041.post@n5.nabble.com> References: <1486131093934-5742041.post@n5.nabble.com> Message-ID: Hi, Try by forcing the mesh to be considered as opaque: actor->ForceOpaqueOn(); Best, * Joachim Pouderoux*, Ph.D. *Technical Lead - Scientific Visualization Team* *Kitware SAS * Le ven. 3 f?vr. 2017 ? 10:11, Geeta via vtkusers a ?crit : > Hi > > > I have used "vtkPolyDataSilhouette" for Polydata and this returns the > Silhouettes of whole polydata . > > I want to show only for the front side and hide / remove Silhouettes of the > backfaces. > > Can anyone help? > > > > > > > Even if the poly data is Transparent I want to show the Silhouettes which > are shown when poly data is opaque. no Silhouettes from back faces. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Hide-backface-Silhouettes-returned-by-vtkPolyDataSilhouette-tp5742041.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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Andx_roo at live.com Mon Sep 10 17:08:59 2018 From: Andx_roo at live.com (Andaharoo) Date: Mon, 10 Sep 2018 14:08:59 -0700 (MST) Subject: [vtkusers] Extracting single slices from vtkNIFTIImageReader In-Reply-To: References: Message-ID: <1536613739830-0.post@n5.nabble.com> If you would like to not use vtkImageViewer2 you can slice the image yourself with vtkImageReslice to get a 2d image. Then give it to the regular 2d vtkImageViewer or just write it out. You just need to set the reslice axes origin and reslice axes direction cosines. Here's an example of doing it in the XY, YZ, and XZ directions. // Reslice the image vtkSmartPointer reslicer = vtkSmartPointer::New(); reslicer->SetInputData(input3dImage); reslicer->SetInterpolationModeToNearestNeighbor(); reslicer->SetOutputDimensionality(2); reslicer->SetOutputSpacing(spacing); // XY if (direction == SLICE_ORIENTATION_XY) reslicer->SetResliceAxesOrigin(0, 0, slice * spacing[2]); // YZ else if (direction == SLICE_ORIENTATION_YZ) { reslicer->SetResliceAxesOrigin(slice * spacing[0], 0, (dim[2] - 1) * spacing[2]); reslicer->SetResliceAxesDirectionCosines( 0, 0, 1, 0, 1, 0, -1, 0, 0); } // XZ else { reslicer->SetResliceAxesOrigin(0, slice * spacing[1], (dim[2] - 1) * spacing[2]); reslicer->SetResliceAxesDirectionCosines( 0, 0, 1, -1, 0, 0, 0, 1, 0); } reslicer->Update(); -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From tobias.hofmann at itwm.fraunhofer.de Tue Sep 11 10:00:47 2018 From: tobias.hofmann at itwm.fraunhofer.de (tobias12345) Date: Tue, 11 Sep 2018 07:00:47 -0700 (MST) Subject: [vtkusers] Build VTK with MinGW Message-ID: <1536674447472-0.post@n5.nabble.com> Hello everybody, I am trying to build VTK 8.1.1 with MinGW 4.9.4 on Windows. I use the CMake-GUI, set OPENGL_gl_LIBRARY="C:\Windows\System32\opengl32.dll" OPENGL_glu_LIBRARY ="C:\Windows\System32\glu32.dll" then configure, generate and make. The build fails at 42% while linking the executable "vtkProbeOpenGLVersion.exe" with many undefined reference errors as e.g. ../../lib/libvtkRenderingOpenGL2-8.1.a(vtkOpenGLCamera.cxx.obj):vtkOpenGLCamera.cxx:(.text+0xbd0): undefined reference to `__imp___glewBindFramebuffer' ../../lib/libvtkRenderingOpenGL2-8.1.a(vtkOpenGLPointGaussianMapper.cxx.obj):vtkOpenGLPointGaussianMapper.cxx:(.text+0x53b): undefined reference to `__imp___glewBlendFuncSeparate' ../../lib/libvtkRenderingOpenGL2-8.1.a(vtkOpenGLPolyDataMapper.cxx.obj):vtkOpenGLPolyDataMapper.cxx:(.text+0xf1d): undefined reference to `__imp___glewDrawRangeElements' ../../lib/libvtkRenderingOpenGL2-8.1.a(vtkOpenGLPolyDataMapper2D.cxx.obj):vtkOpenGLPolyDataMapper2D.cxx:(.text+0x46ba): undefined reference to `__imp___glewDrawRangeElements' ../../lib/libvtkRenderingOpenGL2-8.1.a(vtkOpenGLPolyDataMapper2D.cxx.obj):vtkOpenGLPolyDataMapper2D.cxx:(.text+0x48d9): undefined reference to `__imp___glewDrawRangeElements' ../../lib/libvtkRenderingOpenGL2-8.1.a(vtkOpenGLPolyDataMapper2D.cxx.obj):vtkOpenGLPolyDataMapper2D.cxx:(.text+0x499f): undefined reference to `__imp___glewDrawRangeElements' ../../lib/libvtkRenderingOpenGL2-8.1.a(vtkOpenGLPolyDataMapper2D.cxx.obj):vtkOpenGLPolyDataMapper2D.cxx:(.text+0x4a6e): undefined reference to `__imp___glewDrawRangeElements and hundreds more. Anyone got an idea why? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From andrew.slaughter at inl.gov Tue Sep 11 12:10:22 2018 From: andrew.slaughter at inl.gov (Andrew E. Slaughter) Date: Tue, 11 Sep 2018 16:10:22 +0000 Subject: [vtkusers] VTKPythonAlgorithm Assistance Message-ID: I am using VTK7.1 on MacOS High Sierra, installed via miniconda to create a tool for reading Exodus files. I would like to create a VTKPythonAlgorithm object to create an interface to common operations and plug into the proper VTK pipeline. I am having trouble getting variable data to be mapped. The attached script demonstrates the problem. When using the VTKPythonAlgorithm the call to vtkPolyDataMapper::SetColorArray doesn't seem to trigger the proper mapping. I would appreciate assistance getting this problem corrected. Thanks, Andrew -------------- next part -------------- A non-text attachment was scrubbed... Name: mug_blocks_out.e Type: application/octet-stream Size: 1928660 bytes Desc: mug_blocks_out.e URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: exodus_algorithm.py Type: text/x-python-script Size: 2705 bytes Desc: exodus_algorithm.py URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: with_algorithm.png Type: image/png Size: 4891 bytes Desc: with_algorithm.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: without_algorithm.png Type: image/png Size: 5739 bytes Desc: without_algorithm.png URL: From rickfrank at me.com Tue Sep 11 18:41:47 2018 From: rickfrank at me.com (Rick Frank) Date: Tue, 11 Sep 2018 18:41:47 -0400 Subject: [vtkusers] vtkVolumeController initial state Message-ID: <8c59bf53-e75b-9017-9228-62946c63ffe5@me.com> Hi, I'm doing: ?this.controllerWidget = vtk.Interaction.UI.vtkVolumeController.newInstance({ ??????????? size: [400, 150], ??????????? rescaleColorMap: true, ??????????? expanded: false ??????? }); but the controller comes up expanded. Is this the correct way? Rick From utkarsh.ayachit at kitware.com Tue Sep 11 20:29:15 2018 From: utkarsh.ayachit at kitware.com (Utkarsh Ayachit) Date: Tue, 11 Sep 2018 20:29:15 -0400 Subject: [vtkusers] VTKPythonAlgorithm Assistance In-Reply-To: References: Message-ID: You;re simply missing a call to `reader0.UpdateInformation()` in your VTKPythonAlgorithm subclass. You're doing that correctly when directly using the vtkExodusIIReader. Utkarsh On Tue, Sep 11, 2018 at 12:11 PM Andrew E. Slaughter wrote: > > I am using VTK7.1 on MacOS High Sierra, installed via miniconda to create a tool for reading Exodus files. I would like to create a VTKPythonAlgorithm object to create an interface to common operations and plug into the proper VTK pipeline. I am having trouble getting variable data to be mapped. The attached script demonstrates the problem. > > When using the VTKPythonAlgorithm the call to vtkPolyDataMapper::SetColorArray doesn't seem to trigger the proper mapping. > > I would appreciate assistance getting this problem corrected. > > Thanks, > > Andrew_______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From lasso at queensu.ca Tue Sep 11 21:03:52 2018 From: lasso at queensu.ca (Andras Lasso) Date: Wed, 12 Sep 2018 01:03:52 +0000 Subject: [vtkusers] vtkVolumeController initial state In-Reply-To: <8c59bf53-e75b-9017-9228-62946c63ffe5@me.com> References: <8c59bf53-e75b-9017-9228-62946c63ffe5@me.com> Message-ID: Hi all, I know that there are some common concepts behind VTK and VTK.js but they seem to be two different software. I am interested in discussions related to VTK but for now I don't plan to follow VTK.js communication. Would it be possible to set up some informal rules, create a separate mailing list, or switch to a forum engine so that I can filter out VTK.js discussions? Thanks, Andras -----Original Message----- From: vtkusers On Behalf Of Rick Frank via vtkusers Sent: Tuesday, September 11, 2018 6:42 PM To: vtkusers at public.kitware.com Subject: [vtkusers] vtkVolumeController initial state Hi, I'm doing: ?this.controllerWidget = vtk.Interaction.UI.vtkVolumeController.newInstance({ ??????????? size: [400, 150], ??????????? rescaleColorMap: true, ??????????? expanded: false ??????? }); but the controller comes up expanded. Is this the correct way? Rick _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C985ce29f9d47490efda708d6184043c1%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636723061625435722&sdata=DAeJFEvNnxuAfIOAdyZVT3YV%2BDfqdiRPMePAfZ6UI2M%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C985ce29f9d47490efda708d6184043c1%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636723061625435722&sdata=2Q1WlBprFYubQpKFEudVFe0JwQr%2FItxKG%2BIIyUlXaXM%3D&reserved=0 Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C985ce29f9d47490efda708d6184043c1%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636723061625435722&sdata=lZopUw6ze104dSU9pFl9IN%2FtYYSNteSRe5QgfodiVZ0%3D&reserved=0 Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C985ce29f9d47490efda708d6184043c1%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636723061625435722&sdata=yCDb7vQNNUlariIqxcQ%2F353zucTT7ofrcoLF4qVCUzw%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C985ce29f9d47490efda708d6184043c1%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636723061625435722&sdata=cL3Yd8zYTvtQNepsj2qcrUFM2vB1tWlW1PfSkb9SPb4%3D&reserved=0 From berti_krueger at hotmail.com Wed Sep 12 01:47:25 2018 From: berti_krueger at hotmail.com (=?iso-8859-1?Q?Berti_Kr=FCger?=) Date: Wed, 12 Sep 2018 05:47:25 +0000 Subject: [vtkusers] Build VTK with MinGW In-Reply-To: <1536674447472-0.post@n5.nabble.com> References: <1536674447472-0.post@n5.nabble.com> Message-ID: Am Di, 11. Sep, 2018 um 4:00 NACHMITTAGS schrieb tobias12345 : __imp___glewBindFramebuffer Hi Tobias. I am not in any way an expert on vtk (still a vtk beginner myself) but from the compiler / linker errors you have posted, vtk seems to use the glew library internaly for enabling the opengl extensions in Windows and the linkage with the glew library seems not to be working correctly in your build environment. This is often a problem when trying to link the glew library statically to a project without using the appropriate compiler flags. At least in linux the option -DGLEW_STATIC has to be added to the CXX_DEFINES so that glew gets linked statically in projects you want to be build statically. So maybe you are trying to build vtk statically (.lib) and not dynamically (dlls) under mingw which results in the linker trying to link glew statically too but without the appropriate flags for glew to do so. So one thing you could try is to build vtk dynamically or if you have done so, build it statically. It could also be that you have to install the glew libraries manually first before building vtk (i don't know) or that they are already installed in another version in your mingw installation and that the linker gets confused in which version to take. I am normally developing under linux but a short time ago, i had to compile a Windows version of one of my vtk projects and i had problems myself building vtk under Windows with mingw. What solved all of my problems was installing msys2 (https://www.msys2.org/), getting a linux-like environment under windows with all the necessesary tools (mingw, cmake, etc.) and just building everythink like in linux. This still works like a charm and the executables produced with mingw in the msys2 environment are independent of msys2, have no external dependencies or whatsoever and can be used in every Windows installation. Cheers Berti -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Wed Sep 12 06:31:42 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Wed, 12 Sep 2018 19:31:42 +0900 Subject: [vtkusers] How to build VTK 8.1.1 with "Module_PoissonReconstruction"? In-Reply-To: <1536547809574-0.post@n5.nabble.com> References: <1536547809574-0.post@n5.nabble.com> Message-ID: Hi, I've tried adding /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to CMAKE_CXX_FLAGS using CMake GUI and I have been able to build PoissonReconstruction module successfully. Regards 2018?9?10?(?) 11:50 pnt1614 : > > I am using CMake 3.11.4, Visual stuio 2015 on Windows 10 64 bits. I want to > build VTK 8.1.1 with the "Module_PoissionReconstruction" but there is error > message related to the hash_map. > > (Severity Code Description Project File Line Suppression State > Error C2338 is deprecated and will be REMOVED. Please use > . You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to > acknowledge that you have received this warning. PoissonReconstruction > C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\hash_map 17) > > I have googled and tried to define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS > but it does not work. How do I solve this problem?. > > Thank you. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From ftpronk at engits.com Wed Sep 12 07:36:38 2018 From: ftpronk at engits.com (Fcs) Date: Wed, 12 Sep 2018 04:36:38 -0700 (MST) Subject: [vtkusers] Build VTK with MinGW In-Reply-To: <1536674447472-0.post@n5.nabble.com> References: <1536674447472-0.post@n5.nabble.com> Message-ID: <1536752198899-0.post@n5.nabble.com> Hello Tobias, I think the problem you are having is that you are trying to mix two programs compiled with different toolchains. Programs compiled with MinGW are NOT compatible/linkable with programs compiled with the MSVC toolchain. If you look at "C:\Windows\System32\opengl32.dll", it depends on MSVCRT.dll which is the C standard library for Visual C++ (MSVC). You have two choices: - Either you stick with MinGW, and you compile all your dependencies with it (VTK, Qt, python, OpenGL..) so that the linking works - Or you stick with the MSVC toolchain, and compile all your dependencies with it (or download them, as the most common libraries are readily installable with MSVC compatibility), which will allow you to also link to system libraries / system OpenGL. >From experience, the second option is by far the easiest, especially if you start doing funky things.. If you choose to go down the MinGW route (good luck..), the Khronos group has some instructions on their website for OpenGL support with MinGW: https://www.khronos.org/opengl/wiki/MinGW If you feel adventurous, their is an experimental third option, using the excellent clang toolchain. Apparently it has (partial?) MSVC compatibility, which would allow you to compile and link your code with libraries compiled with MSVC. Kind regards, Francois. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From meakcey at gmail.com Wed Sep 12 09:24:45 2018 From: meakcey at gmail.com (meakcey) Date: Wed, 12 Sep 2018 06:24:45 -0700 (MST) Subject: [vtkusers] Qt VTK OpenGL Not Supported problem Message-ID: <1536758685414-0.post@n5.nabble.com> Hi I am trying to embed QVTKOpenGLWidget into Qt Widget application but I am having such a strange error when I run the application in release mode. I added QOpenGLWidget to ui and promoted that to custom class inherited from QVTKOpenGLWidget. When I run it I am getting error below: ERROR: In C:\Program Files\VTK\source\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 785 vtkGenericOpenGLRenderWindow (000002BF9664D7F0): GLEW could not be initialized. QOpenGLFramebufferObject: Framebuffer incomplete attachment. versionFunctions: Not supported on OpenGL ES I am not trying to build that with OpenGL ES actually but I think Qt is trying to run. If I start the release .exe outside of the Qt it is running without any problem. What could be the root cause of the problem? Thanks -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From chinander at gmail.com Wed Sep 12 10:18:23 2018 From: chinander at gmail.com (Mike Chinander) Date: Wed, 12 Sep 2018 09:18:23 -0500 Subject: [vtkusers] Qt VTK OpenGL Not Supported problem In-Reply-To: <1536758685414-0.post@n5.nabble.com> References: <1536758685414-0.post@n5.nabble.com> Message-ID: Add this before you create your QApplication object: QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat ()); This is described in the QVTKOpenGLWidget documentation: https://www.vtk.org/doc/nightly/html/classQVTKOpenGLWidget.html#details On Wed, Sep 12, 2018 at 8:24 AM meakcey wrote: > Hi > I am trying to embed QVTKOpenGLWidget into Qt Widget application but I am > having such a strange error when I run the application in release mode. > I added QOpenGLWidget to ui and promoted that to custom class inherited > from > QVTKOpenGLWidget. > > When I run it I am getting error below: > > ERROR: In C:\Program > Files\VTK\source\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 785 > vtkGenericOpenGLRenderWindow (000002BF9664D7F0): GLEW could not be > initialized. > QOpenGLFramebufferObject: Framebuffer incomplete attachment. > versionFunctions: Not supported on OpenGL ES > > I am not trying to build that with OpenGL ES actually but I think Qt is > trying to run. > If I start the release .exe outside of the Qt it is running without any > problem. > What could be the root cause of the problem? > > Thanks > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From meakcey at gmail.com Thu Sep 13 07:21:44 2018 From: meakcey at gmail.com (meakcey) Date: Thu, 13 Sep 2018 04:21:44 -0700 (MST) Subject: [vtkusers] Qt VTK OpenGL Not Supported problem In-Reply-To: References: <1536758685414-0.post@n5.nabble.com> Message-ID: <1536837704825-0.post@n5.nabble.com> I could not implement your suggestion I have tried something like that on main.cpp #include "mainwindow.h" #include #include #include int main(int argc, char *argv[]) { QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat()); QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } But that did not work. When I looked at the system environment settings of Qt, I have seen there is a variable like QT_OPENGL = angle I have changed that to "desktop" and it worked. Thank you -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From newcfd at yahoo.com Thu Sep 13 10:12:30 2018 From: newcfd at yahoo.com (newcfd) Date: Thu, 13 Sep 2018 07:12:30 -0700 (MST) Subject: [vtkusers] rotating around x axis only Message-ID: <1536847950694-0.post@n5.nabble.com> I would like to rotate scenes around X axis only when mouse left button is pressed. I inheritated vtkInteractorStyleTrackballCamera to catch Rotating. Do I need to add a transformation matrix to the camera to rotating around x axis only? Any easy way to do it? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From allison.vacanti at kitware.com Thu Sep 13 10:21:36 2018 From: allison.vacanti at kitware.com (Allie Vacanti) Date: Thu, 13 Sep 2018 10:21:36 -0400 Subject: [vtkusers] Build VTK with MinGW In-Reply-To: <1536752198899-0.post@n5.nabble.com> References: <1536674447472-0.post@n5.nabble.com> <1536752198899-0.post@n5.nabble.com> Message-ID: It's also worth pointing out that VTK does not officially support the MinGW compilers. After you resolve this issue, there will likely be many more problems to fix before you have a working build. The supported compilers on the Windows platform are currently MSVC 2013 or later. On Wed, Sep 12, 2018 at 7:36 AM, Fcs wrote: > Hello Tobias, > > I think the problem you are having is that you are trying to mix two > programs compiled with different toolchains. Programs compiled with MinGW > are NOT compatible/linkable with programs compiled with the MSVC toolchain. > If you look at "C:\Windows\System32\opengl32.dll", it depends on > MSVCRT.dll > which is the C standard library for Visual C++ (MSVC). > > You have two choices: > - Either you stick with MinGW, and you compile all your dependencies with > it (VTK, Qt, python, OpenGL..) so that the linking works > - Or you stick with the MSVC toolchain, and compile all your dependencies > with it (or download them, as the most common libraries are readily > installable with MSVC compatibility), which will allow you to also link to > system libraries / system OpenGL. > > From experience, the second option is by far the easiest, especially if you > start doing funky things.. > > If you choose to go down the MinGW route (good luck..), the Khronos group > has some instructions on their website for OpenGL support with MinGW: > https://www.khronos.org/opengl/wiki/MinGW > > If you feel adventurous, their is an experimental third option, using the > excellent clang toolchain. Apparently it has (partial?) MSVC compatibility, > which would allow you to compile and link your code with libraries compiled > with MSVC. > > Kind regards, > > Francois. > > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Thu Sep 13 13:02:46 2018 From: rickfrank at me.com (Rick Frank) Date: Thu, 13 Sep 2018 13:02:46 -0400 Subject: [vtkusers] vtkInteractorStyleImage.js and center mouse down Message-ID: <43d65f41-ddca-7fa5-444c-f1141d2dab98@me.com> Hi, I'm using vtkInteractorStyleImage and notice that I don't have access to a center mouse down (for Pan)... but the Manipulators have center mouse down... Manipulators seems to be a new thing in the vtk.js How do they relate to the interactors? Is there a way to get a center mouse down in my interactorStyleImage subclass Rick From sebastien.jourdain at kitware.com Thu Sep 13 13:21:23 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 13 Sep 2018 10:21:23 -0700 Subject: [vtkusers] vtkInteractorStyleImage.js and center mouse down In-Reply-To: <43d65f41-ddca-7fa5-444c-f1141d2dab98@me.com> References: <43d65f41-ddca-7fa5-444c-f1141d2dab98@me.com> Message-ID: The manipulator infrastructure come from ParaView and has never been pushed to VTK on the c++ side. Anyhow, we have a ManipulatorStyle on which we register a bunch of manipulators to custom build our style binding (pan on left-button, rotate on left-button+Alt, ...). That's the high level concept. So either you provide a XXXXStyle that should handle everything or use a ManipulatorStyle on which you register manipulators... On Thu, Sep 13, 2018 at 10:02 AM Rick Frank via vtkusers < vtkusers at public.kitware.com> wrote: > Hi, > > I'm using vtkInteractorStyleImage and notice that I don't have access to > a center mouse down (for Pan)... > > > but the Manipulators have center mouse down... > > > Manipulators seems to be a new thing in the vtk.js > > > How do they relate to the interactors? Is there a way to get a center > mouse down in my interactorStyleImage subclass > > > Rick > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu Sep 13 13:29:19 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 13 Sep 2018 13:29:19 -0400 Subject: [vtkusers] vtkVolumeController initial state In-Reply-To: References: <8c59bf53-e75b-9017-9228-62946c63ffe5@me.com> Message-ID: We will be transitioning the users and developers mailing lists to a combined discourse area over the next couple of months. It will have a dedicated web area and some finer control on subscriptions and delivery mechanisms. That should help everyone to focus on the specific topics that they have interest in. hth David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Sep 11, 2018 at 9:03 PM Andras Lasso wrote: > Hi all, > > I know that there are some common concepts behind VTK and VTK.js but they > seem to be two different software. I am interested in discussions related > to VTK but for now I don't plan to follow VTK.js communication. > > Would it be possible to set up some informal rules, create a separate > mailing list, or switch to a forum engine so that I can filter out VTK.js > discussions? > > Thanks, > Andras > > -----Original Message----- > From: vtkusers On Behalf Of Rick > Frank via vtkusers > Sent: Tuesday, September 11, 2018 6:42 PM > To: vtkusers at public.kitware.com > Subject: [vtkusers] vtkVolumeController initial state > > > > Hi, > > > I'm doing: > > this.controllerWidget = > vtk.Interaction.UI.vtkVolumeController.newInstance({ > size: [400, 150], > rescaleColorMap: true, > expanded: false > }); > > but the controller comes up expanded. > > Is this the correct way? > > Rick > > _______________________________________________ > Powered by > https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C985ce29f9d47490efda708d6184043c1%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636723061625435722&sdata=DAeJFEvNnxuAfIOAdyZVT3YV%2BDfqdiRPMePAfZ6UI2M%3D&reserved=0 > > Visit other Kitware open-source projects at > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C985ce29f9d47490efda708d6184043c1%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636723061625435722&sdata=2Q1WlBprFYubQpKFEudVFe0JwQr%2FItxKG%2BIIyUlXaXM%3D&reserved=0 > > Please keep messages on-topic and check the VTK FAQ at: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C985ce29f9d47490efda708d6184043c1%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636723061625435722&sdata=lZopUw6ze104dSU9pFl9IN%2FtYYSNteSRe5QgfodiVZ0%3D&reserved=0 > > Search the list archives at: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C985ce29f9d47490efda708d6184043c1%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636723061625435722&sdata=yCDb7vQNNUlariIqxcQ%2F353zucTT7ofrcoLF4qVCUzw%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C985ce29f9d47490efda708d6184043c1%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636723061625435722&sdata=cL3Yd8zYTvtQNepsj2qcrUFM2vB1tWlW1PfSkb9SPb4%3D&reserved=0 > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Thu Sep 13 14:00:21 2018 From: rickfrank at me.com (Rick Frank) Date: Thu, 13 Sep 2018 14:00:21 -0400 Subject: [vtkusers] vtkInteractorStyleImage.js and center mouse down In-Reply-To: References: <43d65f41-ddca-7fa5-444c-f1141d2dab98@me.com> Message-ID: For the time being I have a subclass of vtkInteractorStyleTrackballCamera which is a crib of vtkInteractorStyleSlice for handing slice views.... I can get: ?publicAPI.handleRightButtonPress = (callData) => { ??????? const pos = callData.position; ??????? model.previousPosition = pos; ??????? publicAPI.startDolly(); ??? }; to override RightButton but there doesn't seem to be a ?publicAPI.handleCenterButtonPress = (callData) => { ???? .... ??? }; .... Am I missing something on how to get the center button? I can get the wheel.... Thanks Rick On 09/13/2018 01:21 PM, Sebastien Jourdain wrote: > The manipulator infrastructure come from ParaView and has never been > pushed to VTK on the c++ side. > Anyhow, we have a ManipulatorStyle on which we register a bunch of > manipulators to custom build our style binding (pan on left-button, > rotate on left-button+Alt, ...). > That's the high level concept. > > So either you provide a XXXXStyle that should handle everything or use > a ManipulatorStyle on which you register manipulators... > > > > On Thu, Sep 13, 2018 at 10:02 AM Rick Frank via vtkusers > > wrote: > > Hi, > > I'm using vtkInteractorStyleImage and notice that I don't have > access to > a center mouse down (for Pan)... > > > but the Manipulators have center mouse down... > > > Manipulators seems to be a new thing in the vtk.js > > > How do they relate to the interactors? Is there a way to get a center > mouse down in my interactorStyleImage subclass > > > Rick > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Thu Sep 13 14:12:35 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 13 Sep 2018 11:12:35 -0700 Subject: [vtkusers] vtkInteractorStyleImage.js and center mouse down In-Reply-To: References: <43d65f41-ddca-7fa5-444c-f1141d2dab98@me.com> Message-ID: I think it is named MiddleButton. You can find the full list here: https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/RenderWindowInteractor/index.js#L28-L56 On Thu, Sep 13, 2018 at 11:00 AM Rick Frank wrote: > For the time being I have a subclass of vtkInteractorStyleTrackballCamera > which is a crib of vtkInteractorStyleSlice for handing slice views.... > > > I can get: > > publicAPI.handleRightButtonPress = (callData) => { > const pos = callData.position; > model.previousPosition = pos; > publicAPI.startDolly(); > }; > > to override RightButton > > but there doesn't seem to be a > > publicAPI.handleCenterButtonPress = (callData) => { > .... > }; > > > .... > > Am I missing something on how to get the center button? I can get the > wheel.... > > > Thanks > > Rick > > > On 09/13/2018 01:21 PM, Sebastien Jourdain wrote: > > The manipulator infrastructure come from ParaView and has never been > pushed to VTK on the c++ side. > Anyhow, we have a ManipulatorStyle on which we register a bunch of > manipulators to custom build our style binding (pan on left-button, rotate > on left-button+Alt, ...). > That's the high level concept. > > So either you provide a XXXXStyle that should handle everything or use a > ManipulatorStyle on which you register manipulators... > > > > On Thu, Sep 13, 2018 at 10:02 AM Rick Frank via vtkusers < > vtkusers at public.kitware.com> wrote: > >> Hi, >> >> I'm using vtkInteractorStyleImage and notice that I don't have access to >> a center mouse down (for Pan)... >> >> >> but the Manipulators have center mouse down... >> >> >> Manipulators seems to be a new thing in the vtk.js >> >> >> How do they relate to the interactors? Is there a way to get a center >> mouse down in my interactorStyleImage subclass >> >> >> Rick >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Thu Sep 13 14:17:37 2018 From: rickfrank at me.com (Rick Frank) Date: Thu, 13 Sep 2018 14:17:37 -0400 Subject: [vtkusers] vtkInteractorStyleImage.js and center mouse down In-Reply-To: References: <43d65f41-ddca-7fa5-444c-f1141d2dab98@me.com> Message-ID: That'll do it! Thanks! Rick On 09/13/2018 02:12 PM, Sebastien Jourdain wrote: > I think it is named MiddleButton. You can find the full list here: > https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/RenderWindowInteractor/index.js#L28-L56 > > On Thu, Sep 13, 2018 at 11:00 AM Rick Frank > wrote: > > For the time being I have a subclass of > vtkInteractorStyleTrackballCamera which is a crib of > vtkInteractorStyleSlice for handing slice views.... > > > I can get: > > ?publicAPI.handleRightButtonPress = (callData) => { > ??????? const pos = callData.position; > ??????? model.previousPosition = pos; > ??????? publicAPI.startDolly(); > ??? }; > > to override RightButton > > but there doesn't seem to be a > > ?publicAPI.handleCenterButtonPress = (callData) => { > ???? .... > ??? }; > > > .... > > Am I missing something on how to get the center button? I can get > the wheel.... > > > Thanks > > Rick > > > On 09/13/2018 01:21 PM, Sebastien Jourdain wrote: >> The manipulator infrastructure come from ParaView and has never >> been pushed to VTK on the c++ side. >> Anyhow, we have a ManipulatorStyle on which we register a bunch >> of manipulators to custom build our style binding (pan on >> left-button, rotate on left-button+Alt, ...). >> That's the high level concept. >> >> So either you provide a XXXXStyle that should handle everything >> or use a ManipulatorStyle on which you register manipulators... >> >> >> >> On Thu, Sep 13, 2018 at 10:02 AM Rick Frank via vtkusers >> > > wrote: >> >> Hi, >> >> I'm using vtkInteractorStyleImage and notice that I don't >> have access to >> a center mouse down (for Pan)... >> >> >> but the Manipulators have center mouse down... >> >> >> Manipulators seems to be a new thing in the vtk.js >> >> >> How do they relate to the interactors? Is there a way to get >> a center >> mouse down in my interactorStyleImage subclass >> >> >> Rick >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: >> http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Fri Sep 14 17:06:26 2018 From: rickfrank at me.com (Rick Frank) Date: Fri, 14 Sep 2018 17:06:26 -0400 Subject: [vtkusers] vtkInteractorStyleImage.js and center mouse down In-Reply-To: References: <43d65f41-ddca-7fa5-444c-f1141d2dab98@me.com> Message-ID: Thanks. This event list seems to be missing const START_INTERACTION_EVENT = { type: 'StartInteractionEvent' }; const INTERACTION_EVENT = { type: 'InteractionEvent' }; const END_INTERACTION_EVENT = { type: 'EndInteractionEvent' }; and so function vtkInteractorObserver::subscribeToEvents() {) doesn't get them. I think this is a bug, or am I missing something? I'm trying to create an interactor observer and I can get the interaction events.... Thanks Rick On 09/13/2018 02:12 PM, Sebastien Jourdain wrote: > I think it is named MiddleButton. You can find the full list here: > https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/RenderWindowInteractor/index.js#L28-L56 > > On Thu, Sep 13, 2018 at 11:00 AM Rick Frank > wrote: > > For the time being I have a subclass of > vtkInteractorStyleTrackballCamera which is a crib of > vtkInteractorStyleSlice for handing slice views.... > > > I can get: > > ?publicAPI.handleRightButtonPress = (callData) => { > ??????? const pos = callData.position; > ??????? model.previousPosition = pos; > ??????? publicAPI.startDolly(); > ??? }; > > to override RightButton > > but there doesn't seem to be a > > ?publicAPI.handleCenterButtonPress = (callData) => { > ???? .... > ??? }; > > > .... > > Am I missing something on how to get the center button? I can get > the wheel.... > > > Thanks > > Rick > > > On 09/13/2018 01:21 PM, Sebastien Jourdain wrote: >> The manipulator infrastructure come from ParaView and has never >> been pushed to VTK on the c++ side. >> Anyhow, we have a ManipulatorStyle on which we register a bunch >> of manipulators to custom build our style binding (pan on >> left-button, rotate on left-button+Alt, ...). >> That's the high level concept. >> >> So either you provide a XXXXStyle that should handle everything >> or use a ManipulatorStyle on which you register manipulators... >> >> >> >> On Thu, Sep 13, 2018 at 10:02 AM Rick Frank via vtkusers >> > > wrote: >> >> Hi, >> >> I'm using vtkInteractorStyleImage and notice that I don't >> have access to >> a center mouse down (for Pan)... >> >> >> but the Manipulators have center mouse down... >> >> >> Manipulators seems to be a new thing in the vtk.js >> >> >> How do they relate to the interactors? Is there a way to get >> a center >> mouse down in my interactorStyleImage subclass >> >> >> Rick >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: >> http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Fri Sep 14 17:14:16 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Fri, 14 Sep 2018 14:14:16 -0700 Subject: [vtkusers] vtkInteractorStyleImage.js and center mouse down In-Reply-To: References: <43d65f41-ddca-7fa5-444c-f1141d2dab98@me.com> Message-ID: Your interactorObserver only need to implement handleStartInteractionEvent, handleInteractionEvent, handleEndInteractionEvent. They will automatically be linked. Look at any other InteractorStyle implementation if need be. Seb On Fri, Sep 14, 2018 at 2:06 PM Rick Frank wrote: > Thanks. > > > This event list seems to be missing > > > const START_INTERACTION_EVENT = { type: 'StartInteractionEvent' }; > const INTERACTION_EVENT = { type: 'InteractionEvent' }; > const END_INTERACTION_EVENT = { type: 'EndInteractionEvent' }; > > and so function vtkInteractorObserver::subscribeToEvents() {) > > doesn't get them. > > I think this is a bug, or am I missing something? > > I'm trying to create an interactor observer and I can get the interaction > events.... > > > Thanks > > Rick > > > On 09/13/2018 02:12 PM, Sebastien Jourdain wrote: > > I think it is named MiddleButton. You can find the full list here: > > https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/RenderWindowInteractor/index.js#L28-L56 > > On Thu, Sep 13, 2018 at 11:00 AM Rick Frank wrote: > >> For the time being I have a subclass of vtkInteractorStyleTrackballCamera >> which is a crib of vtkInteractorStyleSlice for handing slice views.... >> >> >> I can get: >> >> publicAPI.handleRightButtonPress = (callData) => { >> const pos = callData.position; >> model.previousPosition = pos; >> publicAPI.startDolly(); >> }; >> >> to override RightButton >> >> but there doesn't seem to be a >> >> publicAPI.handleCenterButtonPress = (callData) => { >> .... >> }; >> >> >> .... >> >> Am I missing something on how to get the center button? I can get the >> wheel.... >> >> >> Thanks >> >> Rick >> >> >> On 09/13/2018 01:21 PM, Sebastien Jourdain wrote: >> >> The manipulator infrastructure come from ParaView and has never been >> pushed to VTK on the c++ side. >> Anyhow, we have a ManipulatorStyle on which we register a bunch of >> manipulators to custom build our style binding (pan on left-button, rotate >> on left-button+Alt, ...). >> That's the high level concept. >> >> So either you provide a XXXXStyle that should handle everything or use a >> ManipulatorStyle on which you register manipulators... >> >> >> >> On Thu, Sep 13, 2018 at 10:02 AM Rick Frank via vtkusers < >> vtkusers at public.kitware.com> wrote: >> >>> Hi, >>> >>> I'm using vtkInteractorStyleImage and notice that I don't have access to >>> a center mouse down (for Pan)... >>> >>> >>> but the Manipulators have center mouse down... >>> >>> >>> Manipulators seems to be a new thing in the vtk.js >>> >>> >>> How do they relate to the interactors? Is there a way to get a center >>> mouse down in my interactorStyleImage subclass >>> >>> >>> Rick >>> >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://public.kitware.com/mailman/listinfo/vtkusers >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Fri Sep 14 17:29:56 2018 From: rickfrank at me.com (Rick Frank) Date: Fri, 14 Sep 2018 17:29:56 -0400 Subject: [vtkusers] vtkInteractorStyleImage.js and center mouse down In-Reply-To: References: <43d65f41-ddca-7fa5-444c-f1141d2dab98@me.com> Message-ID: <0bc8b060-fd82-4941-b26c-b756677b9324@me.com> The interactor styles Invoke the events..... ? case States.IS_PAN: ??????? publicAPI.handleMousePan(renderer, pos); ??????? publicAPI.invokeInteractionEvent({ type: 'InteractionEvent' }); ??????? break; etc but I can't find an example of a receiver (observer) of the InteractionEvent.... somewhere that implements handleInteractionEvent.... I searched vtk.js for handleInteractionEvent and didn't find anything... ? Thanks Rick On 09/14/2018 05:14 PM, Sebastien Jourdain wrote: > Your interactorObserver only need to implement > handleStartInteractionEvent, handleInteractionEvent, > handleEndInteractionEvent. > They will automatically be linked. > > Look at any other InteractorStyle implementation if need be. > > Seb > > On Fri, Sep 14, 2018 at 2:06 PM Rick Frank > wrote: > > Thanks. > > > This event list seems to be missing > > > const START_INTERACTION_EVENT = { type: 'StartInteractionEvent' }; > const INTERACTION_EVENT = { type: 'InteractionEvent' }; > const END_INTERACTION_EVENT = { type: 'EndInteractionEvent' }; > > > and so function vtkInteractorObserver::subscribeToEvents() {) > > doesn't get them. > > I think this is a bug, or am I missing something? > > I'm trying to create an interactor observer and I can get the > interaction events.... > > > Thanks > > Rick > > > On 09/13/2018 02:12 PM, Sebastien Jourdain wrote: >> I think it is named MiddleButton. You can find the full list here: >> https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/RenderWindowInteractor/index.js#L28-L56 >> >> On Thu, Sep 13, 2018 at 11:00 AM Rick Frank > > wrote: >> >> For the time being I have a subclass of >> vtkInteractorStyleTrackballCamera which is a crib of >> vtkInteractorStyleSlice for handing slice views.... >> >> >> I can get: >> >> ?publicAPI.handleRightButtonPress = (callData) => { >> ??????? const pos = callData.position; >> ??????? model.previousPosition = pos; >> ??????? publicAPI.startDolly(); >> ??? }; >> >> to override RightButton >> >> but there doesn't seem to be a >> >> ?publicAPI.handleCenterButtonPress = (callData) => { >> ???? .... >> ??? }; >> >> >> .... >> >> Am I missing something on how to get the center button? I can >> get the wheel.... >> >> >> Thanks >> >> Rick >> >> >> On 09/13/2018 01:21 PM, Sebastien Jourdain wrote: >>> The manipulator infrastructure come from ParaView and has >>> never been pushed to VTK on the c++ side. >>> Anyhow, we have a ManipulatorStyle on which we register a >>> bunch of manipulators to custom build our style binding (pan >>> on left-button, rotate on left-button+Alt, ...). >>> That's the high level concept. >>> >>> So either you provide a XXXXStyle that should handle >>> everything or use a ManipulatorStyle on which you register >>> manipulators... >>> >>> >>> >>> On Thu, Sep 13, 2018 at 10:02 AM Rick Frank via vtkusers >>> >> > wrote: >>> >>> Hi, >>> >>> I'm using vtkInteractorStyleImage and notice that I >>> don't have access to >>> a center mouse down (for Pan)... >>> >>> >>> but the Manipulators have center mouse down... >>> >>> >>> Manipulators seems to be a new thing in the vtk.js >>> >>> >>> How do they relate to the interactors? Is there a way to >>> get a center >>> mouse down in my interactorStyleImage subclass >>> >>> >>> Rick >>> >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: >>> http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://public.kitware.com/mailman/listinfo/vtkusers >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Fri Sep 14 17:34:19 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Fri, 14 Sep 2018 14:34:19 -0700 Subject: [vtkusers] vtkInteractorStyleImage.js and center mouse down In-Reply-To: <0bc8b060-fd82-4941-b26c-b756677b9324@me.com> References: <43d65f41-ddca-7fa5-444c-f1141d2dab98@me.com> <0bc8b060-fd82-4941-b26c-b756677b9324@me.com> Message-ID: I guess the question is what do you want to do with handleInteractionEvent ? It is true that no code is using it, but mostly because there is not much usage of it right now. Usually we care of a mousePress or else. On Fri, Sep 14, 2018 at 2:29 PM Rick Frank wrote: > The interactor styles Invoke the events..... > > > case States.IS_PAN: > publicAPI.handleMousePan(renderer, pos); > publicAPI.invokeInteractionEvent({ type: 'InteractionEvent' }); > break; > > > etc > > > but I can't find an example of a receiver (observer) of the > InteractionEvent.... > > > somewhere that implements handleInteractionEvent.... > > I searched vtk.js for handleInteractionEvent and didn't find anything... > > ? > > Thanks > > > Rick > > > > > > On 09/14/2018 05:14 PM, Sebastien Jourdain wrote: > > Your interactorObserver only need to implement > handleStartInteractionEvent, handleInteractionEvent, > handleEndInteractionEvent. > They will automatically be linked. > > Look at any other InteractorStyle implementation if need be. > > Seb > > On Fri, Sep 14, 2018 at 2:06 PM Rick Frank wrote: > >> Thanks. >> >> >> This event list seems to be missing >> >> >> const START_INTERACTION_EVENT = { type: 'StartInteractionEvent' }; >> const INTERACTION_EVENT = { type: 'InteractionEvent' }; >> const END_INTERACTION_EVENT = { type: 'EndInteractionEvent' }; >> >> and so function vtkInteractorObserver::subscribeToEvents() {) >> >> doesn't get them. >> >> I think this is a bug, or am I missing something? >> >> I'm trying to create an interactor observer and I can get the interaction >> events.... >> >> >> Thanks >> >> Rick >> >> >> On 09/13/2018 02:12 PM, Sebastien Jourdain wrote: >> >> I think it is named MiddleButton. You can find the full list here: >> >> https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/RenderWindowInteractor/index.js#L28-L56 >> >> On Thu, Sep 13, 2018 at 11:00 AM Rick Frank wrote: >> >>> For the time being I have a subclass of >>> vtkInteractorStyleTrackballCamera which is a crib of >>> vtkInteractorStyleSlice for handing slice views.... >>> >>> >>> I can get: >>> >>> publicAPI.handleRightButtonPress = (callData) => { >>> const pos = callData.position; >>> model.previousPosition = pos; >>> publicAPI.startDolly(); >>> }; >>> >>> to override RightButton >>> >>> but there doesn't seem to be a >>> >>> publicAPI.handleCenterButtonPress = (callData) => { >>> .... >>> }; >>> >>> >>> .... >>> >>> Am I missing something on how to get the center button? I can get the >>> wheel.... >>> >>> >>> Thanks >>> >>> Rick >>> >>> >>> On 09/13/2018 01:21 PM, Sebastien Jourdain wrote: >>> >>> The manipulator infrastructure come from ParaView and has never been >>> pushed to VTK on the c++ side. >>> Anyhow, we have a ManipulatorStyle on which we register a bunch of >>> manipulators to custom build our style binding (pan on left-button, rotate >>> on left-button+Alt, ...). >>> That's the high level concept. >>> >>> So either you provide a XXXXStyle that should handle everything or use a >>> ManipulatorStyle on which you register manipulators... >>> >>> >>> >>> On Thu, Sep 13, 2018 at 10:02 AM Rick Frank via vtkusers < >>> vtkusers at public.kitware.com> wrote: >>> >>>> Hi, >>>> >>>> I'm using vtkInteractorStyleImage and notice that I don't have access >>>> to >>>> a center mouse down (for Pan)... >>>> >>>> >>>> but the Manipulators have center mouse down... >>>> >>>> >>>> Manipulators seems to be a new thing in the vtk.js >>>> >>>> >>>> How do they relate to the interactors? Is there a way to get a center >>>> mouse down in my interactorStyleImage subclass >>>> >>>> >>>> Rick >>>> >>>> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://public.kitware.com/mailman/listinfo/vtkusers >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Fri Sep 14 17:51:16 2018 From: rickfrank at me.com (Rick Frank) Date: Fri, 14 Sep 2018 17:51:16 -0400 Subject: [vtkusers] vtkInteractorStyleImage.js and center mouse down In-Reply-To: References: <43d65f41-ddca-7fa5-444c-f1141d2dab98@me.com> <0bc8b060-fd82-4941-b26c-b756677b9324@me.com> Message-ID: <56241116-5564-b9ad-2184-5021745c6028@me.com> It's a UI decoupling? model - view kind of thing.... in our interactorStyleSlice subclass, we want to update the slice number on the UI. This means setting the text in the div element, which we don't want to expose directly in the interactor. So, when the observer gets the interaction event on a mouse wheel, it then brokers to the UI to update the current slice by fetching the current slice from the data model.... I was able to fix it by adding .................... 'Move3D', ? 'StartInteractionEvent', ? 'InteractionEvent', ? 'EndInteractionEvent', to the end of the events and then calling viewportData.pluginData.observer? = VTKUtils.ohifInteractorObserver.newInstance(); ?viewportData.pluginData.observer.setInteractor(ourSliceInteractorStyle); ?viewportData.pluginData.observer.setEnabled(1); and now my observer gets the events. I can push that change and do a pull request if you think that's the correct fix. Thanks Rick On 09/14/2018 05:34 PM, Sebastien Jourdain wrote: > I guess the question is what do you want to do with > handleInteractionEvent ? > > It is true that no code is using it, but mostly because there is not > much usage of it right now. Usually we care of a mousePress or else. > > On Fri, Sep 14, 2018 at 2:29 PM Rick Frank > wrote: > > The interactor styles Invoke the events..... > > > ? case States.IS_PAN: > ??????? publicAPI.handleMousePan(renderer, pos); > ??????? publicAPI.invokeInteractionEvent({ type: > 'InteractionEvent' }); > ??????? break; > > > etc > > > but I can't find an example of a receiver (observer) of the > InteractionEvent.... > > > somewhere that implements handleInteractionEvent.... > > I searched vtk.js for handleInteractionEvent and didn't find > anything... > > ? > > Thanks > > > Rick > > > > > > On 09/14/2018 05:14 PM, Sebastien Jourdain wrote: >> Your interactorObserver only need to implement >> handleStartInteractionEvent, handleInteractionEvent, >> handleEndInteractionEvent. >> They will automatically be linked. >> >> Look at any other InteractorStyle implementation if need be. >> >> Seb >> >> On Fri, Sep 14, 2018 at 2:06 PM Rick Frank > > wrote: >> >> Thanks. >> >> >> This event list seems to be missing >> >> >> const START_INTERACTION_EVENT = { type: >> 'StartInteractionEvent' }; >> const INTERACTION_EVENT = { type: 'InteractionEvent' }; >> const END_INTERACTION_EVENT = { type: 'EndInteractionEvent' }; >> >> >> and so function vtkInteractorObserver::subscribeToEvents() {) >> >> doesn't get them. >> >> I think this is a bug, or am I missing something? >> >> I'm trying to create an interactor observer and I can get the >> interaction events.... >> >> >> Thanks >> >> Rick >> >> >> On 09/13/2018 02:12 PM, Sebastien Jourdain wrote: >>> I think it is named MiddleButton. You can find the full list >>> here: >>> https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/RenderWindowInteractor/index.js#L28-L56 >>> >>> On Thu, Sep 13, 2018 at 11:00 AM Rick Frank >>> > wrote: >>> >>> For the time being I have a subclass of >>> vtkInteractorStyleTrackballCamera which is a crib of >>> vtkInteractorStyleSlice for handing slice views.... >>> >>> >>> I can get: >>> >>> ?publicAPI.handleRightButtonPress = (callData) => { >>> ??????? const pos = callData.position; >>> ??????? model.previousPosition = pos; >>> ??????? publicAPI.startDolly(); >>> ??? }; >>> >>> to override RightButton >>> >>> but there doesn't seem to be a >>> >>> ?publicAPI.handleCenterButtonPress = (callData) => { >>> ???? .... >>> ??? }; >>> >>> >>> .... >>> >>> Am I missing something on how to get the center button? >>> I can get the wheel.... >>> >>> >>> Thanks >>> >>> Rick >>> >>> >>> On 09/13/2018 01:21 PM, Sebastien Jourdain wrote: >>>> The manipulator infrastructure come from ParaView and >>>> has never been pushed to VTK on the c++ side. >>>> Anyhow, we have a ManipulatorStyle on which we register >>>> a bunch of manipulators to custom build our style >>>> binding (pan on left-button, rotate on left-button+Alt, >>>> ...). >>>> That's the high level concept. >>>> >>>> So either you provide a XXXXStyle that should handle >>>> everything or use a ManipulatorStyle on which you >>>> register manipulators... >>>> >>>> >>>> >>>> On Thu, Sep 13, 2018 at 10:02 AM Rick Frank via >>>> vtkusers >>> > wrote: >>>> >>>> Hi, >>>> >>>> I'm using vtkInteractorStyleImage and notice that I >>>> don't have access to >>>> a center mouse down (for Pan)... >>>> >>>> >>>> but the Manipulators have center mouse down... >>>> >>>> >>>> Manipulators seems to be a new thing in the vtk.js >>>> >>>> >>>> How do they relate to the interactors? Is there a >>>> way to get a center >>>> mouse down in my interactorStyleImage subclass >>>> >>>> >>>> Rick >>>> >>>> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ >>>> at: http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: >>>> http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://public.kitware.com/mailman/listinfo/vtkusers >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Fri Sep 14 18:03:01 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Fri, 14 Sep 2018 15:03:01 -0700 Subject: [vtkusers] vtkInteractorStyleImage.js and center mouse down In-Reply-To: <56241116-5564-b9ad-2184-5021745c6028@me.com> References: <43d65f41-ddca-7fa5-444c-f1141d2dab98@me.com> <0bc8b060-fd82-4941-b26c-b756677b9324@me.com> <56241116-5564-b9ad-2184-5021745c6028@me.com> Message-ID: If indeed that list is missing those event, please do a PR. Thx! Seb On Fri, Sep 14, 2018 at 2:59 PM Rick Frank wrote: > > It's a UI decoupling model - view kind of thing.... > > in our interactorStyleSlice subclass, we want to update the slice number > on the UI. > > This means setting the text in the div element, which we don't want to > expose directly in the interactor. > > So, when the observer gets the interaction event on a mouse wheel, it then > brokers to the UI to update the current slice by fetching the current slice > from the data model.... > > I was able to fix it by adding > > .................... > > 'Move3D', > 'StartInteractionEvent', > 'InteractionEvent', > 'EndInteractionEvent', > > to the end of the events and then calling > > viewportData.pluginData.observer = > VTKUtils.ohifInteractorObserver.newInstance(); > viewportData.pluginData.observer.setInteractor(ourSliceInteractorStyle); > viewportData.pluginData.observer.setEnabled(1); > > > and now my observer gets the events. > > I can push that change and do a pull request if you think that's the > correct fix. > > > Thanks > > Rick > > > > > On 09/14/2018 05:34 PM, Sebastien Jourdain wrote: > > I guess the question is what do you want to do with handleInteractionEvent > ? > > It is true that no code is using it, but mostly because there is not much > usage of it right now. Usually we care of a mousePress or else. > > On Fri, Sep 14, 2018 at 2:29 PM Rick Frank wrote: > >> The interactor styles Invoke the events..... >> >> >> case States.IS_PAN: >> publicAPI.handleMousePan(renderer, pos); >> publicAPI.invokeInteractionEvent({ type: 'InteractionEvent' }); >> break; >> >> >> etc >> >> >> but I can't find an example of a receiver (observer) of the >> InteractionEvent.... >> >> >> somewhere that implements handleInteractionEvent.... >> >> I searched vtk.js for handleInteractionEvent and didn't find anything... >> >> ? >> >> Thanks >> >> >> Rick >> >> >> >> >> >> On 09/14/2018 05:14 PM, Sebastien Jourdain wrote: >> >> Your interactorObserver only need to implement >> handleStartInteractionEvent, handleInteractionEvent, >> handleEndInteractionEvent. >> They will automatically be linked. >> >> Look at any other InteractorStyle implementation if need be. >> >> Seb >> >> On Fri, Sep 14, 2018 at 2:06 PM Rick Frank wrote: >> >>> Thanks. >>> >>> >>> This event list seems to be missing >>> >>> >>> const START_INTERACTION_EVENT = { type: 'StartInteractionEvent' }; >>> const INTERACTION_EVENT = { type: 'InteractionEvent' }; >>> const END_INTERACTION_EVENT = { type: 'EndInteractionEvent' }; >>> >>> and so function vtkInteractorObserver::subscribeToEvents() {) >>> >>> doesn't get them. >>> >>> I think this is a bug, or am I missing something? >>> >>> I'm trying to create an interactor observer and I can get the >>> interaction events.... >>> >>> >>> Thanks >>> >>> Rick >>> >>> >>> On 09/13/2018 02:12 PM, Sebastien Jourdain wrote: >>> >>> I think it is named MiddleButton. You can find the full list here: >>> >>> https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/RenderWindowInteractor/index.js#L28-L56 >>> >>> On Thu, Sep 13, 2018 at 11:00 AM Rick Frank wrote: >>> >>>> For the time being I have a subclass of >>>> vtkInteractorStyleTrackballCamera which is a crib of >>>> vtkInteractorStyleSlice for handing slice views.... >>>> >>>> >>>> I can get: >>>> >>>> publicAPI.handleRightButtonPress = (callData) => { >>>> const pos = callData.position; >>>> model.previousPosition = pos; >>>> publicAPI.startDolly(); >>>> }; >>>> >>>> to override RightButton >>>> >>>> but there doesn't seem to be a >>>> >>>> publicAPI.handleCenterButtonPress = (callData) => { >>>> .... >>>> }; >>>> >>>> >>>> .... >>>> >>>> Am I missing something on how to get the center button? I can get the >>>> wheel.... >>>> >>>> >>>> Thanks >>>> >>>> Rick >>>> >>>> >>>> On 09/13/2018 01:21 PM, Sebastien Jourdain wrote: >>>> >>>> The manipulator infrastructure come from ParaView and has never been >>>> pushed to VTK on the c++ side. >>>> Anyhow, we have a ManipulatorStyle on which we register a bunch of >>>> manipulators to custom build our style binding (pan on left-button, rotate >>>> on left-button+Alt, ...). >>>> That's the high level concept. >>>> >>>> So either you provide a XXXXStyle that should handle everything or use >>>> a ManipulatorStyle on which you register manipulators... >>>> >>>> >>>> >>>> On Thu, Sep 13, 2018 at 10:02 AM Rick Frank via vtkusers < >>>> vtkusers at public.kitware.com> wrote: >>>> >>>>> Hi, >>>>> >>>>> I'm using vtkInteractorStyleImage and notice that I don't have access >>>>> to >>>>> a center mouse down (for Pan)... >>>>> >>>>> >>>>> but the Manipulators have center mouse down... >>>>> >>>>> >>>>> Manipulators seems to be a new thing in the vtk.js >>>>> >>>>> >>>>> How do they relate to the interactors? Is there a way to get a center >>>>> mouse down in my interactorStyleImage subclass >>>>> >>>>> >>>>> Rick >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> https://public.kitware.com/mailman/listinfo/vtkusers >>>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From berti_krueger at hotmail.com Sat Sep 15 01:33:51 2018 From: berti_krueger at hotmail.com (=?iso-8859-1?Q?Berti_Kr=FCger?=) Date: Sat, 15 Sep 2018 05:33:51 +0000 Subject: [vtkusers] Build VTK with MinGW In-Reply-To: References: <1536674447472-0.post@n5.nabble.com> <1536752198899-0.post@n5.nabble.com> Message-ID: That's why i was recommending him to install msys2. With msys2 you get a linux-like environment in Windows with the complete toolchain (bash, cmake, gcc, make, python, openjdk, tcl / tk, etc.) and all the libraries needed (including Qt). For the vtk build system it looks like it is running under linux. So when using the vtk build instructions for linux everything works out of the box. By simply copying my vtk / qt source project files from linux to windows and running qmake (for qt) i was able to get a Windows build of my program without any additional work. Depending on other factors your mileage may vary of course. The executable produced by this setup runs in a standard Windows environment without msys2 installed. But you are right of course, if you don't need to have a consistent runtime behaviour on all platforms you can simply use Visual Studio on Windows since it is free anyway and much better supported. Regards, Berti Am Do, 13. Sep, 2018 um 4:21 NACHMITTAGS schrieb Allie Vacanti : It's also worth pointing out that VTK does not officially support the MinGW compilers. After you resolve this issue, there will likely be many more problems to fix before you have a working build. The supported compilers on the Windows platform are currently MSVC 2013 or later. On Wed, Sep 12, 2018 at 7:36 AM, Fcs > wrote: Hello Tobias, I think the problem you are having is that you are trying to mix two programs compiled with different toolchains. Programs compiled with MinGW are NOT compatible/linkable with programs compiled with the MSVC toolchain. If you look at "C:\Windows\System32\opengl32.dll", it depends on MSVCRT.dll which is the C standard library for Visual C++ (MSVC). You have two choices: - Either you stick with MinGW, and you compile all your dependencies with it (VTK, Qt, python, OpenGL..) so that the linking works - Or you stick with the MSVC toolchain, and compile all your dependencies with it (or download them, as the most common libraries are readily installable with MSVC compatibility), which will allow you to also link to system libraries / system OpenGL. >From experience, the second option is by far the easiest, especially if you start doing funky things.. If you choose to go down the MinGW route (good luck..), the Khronos group has some instructions on their website for OpenGL support with MinGW: https://www.khronos.org/opengl/wiki/MinGW If you feel adventurous, their is an experimental third option, using the excellent clang toolchain. Apparently it has (partial?) MSVC compatibility, which would allow you to compile and link your code with libraries compiled with MSVC. Kind regards, Francois. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Sat Sep 15 08:06:11 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Sat, 15 Sep 2018 14:06:11 +0200 Subject: [vtkusers] Get a VTKRender to draw inside an external QWidget (ver5) (or QOpenGLWidget) In-Reply-To: References: <20F37270-017D-4AB1-832D-A1EE64F27115@sci.utah.edu> Message-ID: Den tors 22 feb. 2018 kl 21:42 skrev Martijn Koopman : > > Hi Steve, > > I believe what you're looking for is QVTKOpenGLWidget. > > It is a subclass of QOpenGLWidget. > > See https://www.vtk.org/doc/nightly/html/classQVTKOpenGLWidget.html I came across this thread while trying to find a QOpenGLWidget based VTK/PyQt5 widget. Just want to ask: The QVTKOpenGLWidget suggested here is not available from Python right? (since it's not a vtkObject). The OP asked about Python, and I'm sort of in the same boat. Elvis > > Regards, > Martijn > > > > > > Op 22 feb. 2018 21:10 schreef "Steve Petruzza" : >> >> Hi, >> >> I have a QOpenGLWidget that draws using gl calls. I would like to use a VTK render to draw inside the same canvas. >> >> I tried to use a QVTKRenderWindowInteractor passing the canvas as parent, but the canvas starts flickering and I cannot see any rendering. >> The same VTK render (using the same QVTKRenderWindowInteractor) works correctly in a separate vtkrenderwindow. >> >> Is there any simple way to just get the VTKRender to draw directly into the glRender loop of the canvas using the existing rendering window? >> Or any other suggestions. >> >> I am using VTK 8.1.0 and Qt 5.10 and this QVTKRenderWindowInteractor: https://gitlab.kitware.com/alextsui05/vtk/blob/e9e9ffcfbbad68343a0782a1d9024735b7649a46/Wrapping/Python/vtk/qt5/QVTKRenderWindowInteractor.py >> >> Thank you, >> Steve >> >> >> >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://vtk.org/mailman/listinfo/vtkusers From david.gobbi at gmail.com Sat Sep 15 09:58:39 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Sat, 15 Sep 2018 07:58:39 -0600 Subject: [vtkusers] Get a VTKRender to draw inside an external QWidget (ver5) (or QOpenGLWidget) In-Reply-To: References: <20F37270-017D-4AB1-832D-A1EE64F27115@sci.utah.edu> Message-ID: Hi Elvis, QVTKOpenGLWidget is not available in Python, it would have to be wrapped with sip (or shiboken) rather than with the stock VTK wrappers. The old QVTKWidget was, at one point, wrapped in Python as shown here: https://gitlab.kitware.com/vtk/vtk/commit/d487197 It's totally feasible to do something similar with QVTKOpenGLWidget, if someone wants to dedicate the time. - David On Sat, Sep 15, 2018 at 6:06 AM Elvis Stansvik wrote: > > I came across this thread while trying to find a QOpenGLWidget based > VTK/PyQt5 widget. > > Just want to ask: The QVTKOpenGLWidget suggested here is not available > from Python right? (since it's not a vtkObject). > > The OP asked about Python, and I'm sort of in the same boat. > > Elvis > > > > > Regards, > > Martijn > > > > > > > > > > > > Op 22 feb. 2018 21:10 schreef "Steve Petruzza" : > >> > >> Hi, > >> > >> I have a QOpenGLWidget that draws using gl calls. I would like to use a > VTK render to draw inside the same canvas. > >> > >> I tried to use a QVTKRenderWindowInteractor passing the canvas as > parent, but the canvas starts flickering and I cannot see any rendering. > >> The same VTK render (using the same QVTKRenderWindowInteractor) works > correctly in a separate vtkrenderwindow. > >> > >> Is there any simple way to just get the VTKRender to draw directly into > the glRender loop of the canvas using the existing rendering window? > >> Or any other suggestions. > >> > >> I am using VTK 8.1.0 and Qt 5.10 and this QVTKRenderWindowInteractor: > https://gitlab.kitware.com/alextsui05/vtk/blob/e9e9ffcfbbad68343a0782a1d9024735b7649a46/Wrapping/Python/vtk/qt5/QVTKRenderWindowInteractor.py > >> > >> Thank you, > >> Steve > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Sat Sep 15 10:16:34 2018 From: lasso at queensu.ca (Andras Lasso) Date: Sat, 15 Sep 2018 14:16:34 +0000 Subject: [vtkusers] Get a VTKRender to draw inside an external QWidget (ver5) (or QOpenGLWidget) In-Reply-To: References: <20F37270-017D-4AB1-832D-A1EE64F27115@sci.utah.edu> , Message-ID: <1923c2ef-041b-4e4a-ba01-69c3c55dc0ca@queensu.ca> The Qt OpenGL widget is Python-wrapped in CTK using PythonQt. The view widget has several improvements over the plain VTK widget, such as scheduleRender infrastructure to optimize calling of render() after changes in the VTK pipeline. http://www.commontk.org It is used in 3D Slicer, MITK, etc. Andras ________________________________ From: David Gobbi Sent: Saturday, September 15, 2018 9:58 AM To: Elvis Stansvik Cc: VTK Users Subject: Re: [vtkusers] Get a VTKRender to draw inside an external QWidget (ver5) (or QOpenGLWidget) Hi Elvis, QVTKOpenGLWidget is not available in Python, it would have to be wrapped with sip (or shiboken) rather than with the stock VTK wrappers. The old QVTKWidget was, at one point, wrapped in Python as shown here: https://gitlab.kitware.com/vtk/vtk/commit/d487197 It's totally feasible to do something similar with QVTKOpenGLWidget, if someone wants to dedicate the time. - David On Sat, Sep 15, 2018 at 6:06 AM Elvis Stansvik > wrote: I came across this thread while trying to find a QOpenGLWidget based VTK/PyQt5 widget. Just want to ask: The QVTKOpenGLWidget suggested here is not available from Python right? (since it's not a vtkObject). The OP asked about Python, and I'm sort of in the same boat. Elvis > > Regards, > Martijn > > > > > > Op 22 feb. 2018 21:10 schreef "Steve Petruzza" >: >> >> Hi, >> >> I have a QOpenGLWidget that draws using gl calls. I would like to use a VTK render to draw inside the same canvas. >> >> I tried to use a QVTKRenderWindowInteractor passing the canvas as parent, but the canvas starts flickering and I cannot see any rendering. >> The same VTK render (using the same QVTKRenderWindowInteractor) works correctly in a separate vtkrenderwindow. >> >> Is there any simple way to just get the VTKRender to draw directly into the glRender loop of the canvas using the existing rendering window? >> Or any other suggestions. >> >> I am using VTK 8.1.0 and Qt 5.10 and this QVTKRenderWindowInteractor: https://gitlab.kitware.com/alextsui05/vtk/blob/e9e9ffcfbbad68343a0782a1d9024735b7649a46/Wrapping/Python/vtk/qt5/QVTKRenderWindowInteractor.py >> >> Thank you, >> Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sat Sep 15 10:25:27 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Sat, 15 Sep 2018 08:25:27 -0600 Subject: [vtkusers] Get a VTKRender to draw inside an external QWidget (ver5) (or QOpenGLWidget) In-Reply-To: <1923c2ef-041b-4e4a-ba01-69c3c55dc0ca@queensu.ca> References: <20F37270-017D-4AB1-832D-A1EE64F27115@sci.utah.edu> <1923c2ef-041b-4e4a-ba01-69c3c55dc0ca@queensu.ca> Message-ID: Hi Andras, Would it be reasonable to add PythonQt support directly into the VTK build? David On Sat, Sep 15, 2018 at 8:16 AM Andras Lasso wrote: > The Qt OpenGL widget is Python-wrapped in CTK using PythonQt. The view > widget has several improvements over the plain VTK widget, such as > scheduleRender infrastructure to optimize calling of render() after changes > in the VTK pipeline. > > http://www.commontk.org > > It is used in 3D Slicer, MITK, etc. > > Andras > ------------------------------ > *From:* David Gobbi > *Sent:* Saturday, September 15, 2018 9:58 AM > *To:* Elvis Stansvik > *Cc:* VTK Users > *Subject:* Re: [vtkusers] Get a VTKRender to draw inside an external > QWidget (ver5) (or QOpenGLWidget) > > Hi Elvis, > > QVTKOpenGLWidget is not available in Python, it would have to be > wrapped with sip (or shiboken) rather than with the stock VTK wrappers. > > The old QVTKWidget was, at one point, wrapped in Python as shown here: > https://gitlab.kitware.com/vtk/vtk/commit/d487197 > > > > It's totally feasible to do something similar with QVTKOpenGLWidget, if > someone wants to dedicate the time. > > - David > > > On Sat, Sep 15, 2018 at 6:06 AM Elvis Stansvik < > elvis.stansvik at orexplore.com> wrote: > >> >> I came across this thread while trying to find a QOpenGLWidget based >> VTK/PyQt5 widget. >> >> Just want to ask: The QVTKOpenGLWidget suggested here is not available >> from Python right? (since it's not a vtkObject). >> >> The OP asked about Python, and I'm sort of in the same boat. >> >> Elvis >> >> > >> > Regards, >> > Martijn >> > >> > >> > >> > >> > >> > Op 22 feb. 2018 21:10 schreef "Steve Petruzza" > >: >> >> >> >> Hi, >> >> >> >> I have a QOpenGLWidget that draws using gl calls. I would like to use >> a VTK render to draw inside the same canvas. >> >> >> >> I tried to use a QVTKRenderWindowInteractor passing the canvas as >> parent, but the canvas starts flickering and I cannot see any rendering. >> >> The same VTK render (using the same QVTKRenderWindowInteractor) works >> correctly in a separate vtkrenderwindow. >> >> >> >> Is there any simple way to just get the VTKRender to draw directly >> into the glRender loop of the canvas using the existing rendering window? >> >> Or any other suggestions. >> >> >> >> I am using VTK 8.1.0 and Qt 5.10 and this QVTKRenderWindowInteractor: >> https://gitlab.kitware.com/alextsui05/vtk/blob/e9e9ffcfbbad68343a0782a1d9024735b7649a46/Wrapping/Python/vtk/qt5/QVTKRenderWindowInteractor.py >> >> >> >> >> Thank you, >> >> Steve >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Sat Sep 15 14:12:38 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Sat, 15 Sep 2018 20:12:38 +0200 Subject: [vtkusers] Get a VTKRender to draw inside an external QWidget (ver5) (or QOpenGLWidget) In-Reply-To: <1923c2ef-041b-4e4a-ba01-69c3c55dc0ca@queensu.ca> References: <20F37270-017D-4AB1-832D-A1EE64F27115@sci.utah.edu> <1923c2ef-041b-4e4a-ba01-69c3c55dc0ca@queensu.ca> Message-ID: Ah thanks. Sounds like something that would be useful in upstream VTK, so that QVTKOpenGL*Widget could be leveraged by PyQt (or PySide2?) developers. The old QVTKRenderWindowInteractor is less than ideal, and it would be good to have something "official", so that not everyone runs off and do their own thing (duplicated effort). Elvis Den l?r 15 sep. 2018 kl 16:16 skrev Andras Lasso : > > The Qt OpenGL widget is Python-wrapped in CTK using PythonQt. The view widget has several improvements over the plain VTK widget, such as scheduleRender infrastructure to optimize calling of render() after changes in the VTK pipeline. > > http://www.commontk.org > > It is used in 3D Slicer, MITK, etc. > > Andras > ________________________________ > From: David Gobbi > Sent: Saturday, September 15, 2018 9:58 AM > To: Elvis Stansvik > Cc: VTK Users > Subject: Re: [vtkusers] Get a VTKRender to draw inside an external QWidget (ver5) (or QOpenGLWidget) > > Hi Elvis, > > QVTKOpenGLWidget is not available in Python, it would have to be > wrapped with sip (or shiboken) rather than with the stock VTK wrappers. > > The old QVTKWidget was, at one point, wrapped in Python as shown here: > https://gitlab.kitware.com/vtk/vtk/commit/d487197 > > It's totally feasible to do something similar with QVTKOpenGLWidget, if > someone wants to dedicate the time. > > - David > > > On Sat, Sep 15, 2018 at 6:06 AM Elvis Stansvik wrote: >> >> >> I came across this thread while trying to find a QOpenGLWidget based >> VTK/PyQt5 widget. >> >> Just want to ask: The QVTKOpenGLWidget suggested here is not available >> from Python right? (since it's not a vtkObject). >> >> The OP asked about Python, and I'm sort of in the same boat. >> >> Elvis >> >> > >> > Regards, >> > Martijn >> > >> > >> > >> > >> > >> > Op 22 feb. 2018 21:10 schreef "Steve Petruzza" : >> >> >> >> Hi, >> >> >> >> I have a QOpenGLWidget that draws using gl calls. I would like to use a VTK render to draw inside the same canvas. >> >> >> >> I tried to use a QVTKRenderWindowInteractor passing the canvas as parent, but the canvas starts flickering and I cannot see any rendering. >> >> The same VTK render (using the same QVTKRenderWindowInteractor) works correctly in a separate vtkrenderwindow. >> >> >> >> Is there any simple way to just get the VTKRender to draw directly into the glRender loop of the canvas using the existing rendering window? >> >> Or any other suggestions. >> >> >> >> I am using VTK 8.1.0 and Qt 5.10 and this QVTKRenderWindowInteractor: https://gitlab.kitware.com/alextsui05/vtk/blob/e9e9ffcfbbad68343a0782a1d9024735b7649a46/Wrapping/Python/vtk/qt5/QVTKRenderWindowInteractor.py >> >> >> >> Thank you, >> >> Steve From andrea.gavana at gmail.com Sun Sep 16 01:15:03 2018 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Sun, 16 Sep 2018 07:15:03 +0200 Subject: [vtkusers] Grid/polygon intersection (polygon gridding) Message-ID: Dear VTK users, I?m a long-time sporadic user of VTK, and no expert at all. I have the following situation: 1. A 2D, regular (structured) grid of x, y coordinates 2. A series of 2D coordinates defining a polygon (which can be non-convex) I am trying to find a way to ?grid? this polygon, i.e., find all the coordinates of the points of the grid fully contained in the polygon and, for grid cells that partially intersect the polygon, to get the coordinates of the (potentially irregular) shape representing the intersection between the grid and the polygon. The aim of all this would then be to get all the 2D cells thus generated and extend them vertically to create an unstructured grid of polyhedrons. Does anyone know if there is any facility in VTK to accomplish something like this? Alternatively I could also start from a 3D structured grid (with only one tall cell in the vertical direction) and a single cell polyhedron representing the polygon (extended vertically by a tiny height so that it?s all contained in the 3D grid) or vice- versa, a thin 3D structured grid fully contained in a tall polyhedron representing the polygon in 3D. I imagine this would be a more difficult problem though... Any suggestion and hint would be more than appreciated. Thank you in advance. Andrea. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jstach at uni-osnabrueck.de Mon Sep 17 16:16:12 2018 From: jstach at uni-osnabrueck.de (=?utf-8?Q?Jaspar_L=C3=B6chte?=) Date: Mon, 17 Sep 2018 22:16:12 +0200 Subject: [vtkusers] In vtkCellPicker assertion from GetCellType fails Message-ID: <7C4D7624-85D4-4A97-AE21-8AEED4F0A5EE@uni-osnabrueck.de> Hello there! I use VTK 6.3 in a project for my thesis in an Qt desktop application. I am storing Pointclouds and do some manipulation, calculating hulls, etc. For the hulls I display some vtkLines in an extra vtkActor and wanted to create a possiblity to modify the polygon. Therfore i want to be able to move points AND want to pick lines and create a new Point on the line to be able to move that one to. So I wanted to use the vtkCellPicker to pick the lines (which works quite well so far ?). Since I needed a ContextMenu in Qt I manipulated the MouseEvents and use them allready in the Qt MainWindow. Like this: https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/EventQtSlotConnect In my Code I want to detect a vtkLine with this vtkCellPicker, like this: m_picker->Pick(x, y, 0, m_mainStyle->GetDefaultRenderer()); long l = m_cicker->GetCellId(); if(l > 0) { vtkSmartPointer actor = m_picker->GetActor(); long O = actor->GetMapper()->GetInput()->GetCellType(l); if(O == 3) { vtkSmartPointer line = vtkLine::SafeDownCast(actor->GetMapper()->GetInput()->GetCell(l)); vtkSmartPointer points = line->GetPoints(); double p[3]; if(points->GetNumberOfPoints() > 0) { for(int i = 0; i < points->GetNumberOfPoints(); i++) { points->GetPoint(i, p); std::cout << "(" << p[0] << ", " << p[1] << ", " << p[2] << ")" << std::endl; } } } } As I said ? this works pretty well, except for any random points, the CellPicker also picks vertices from the Pointcloud (CellType == 1) and on random points my program crashes, because of an assertion fail ? I found out that the call to vtkCellPicker::Pick() calls superclass vtkPicker::Pick() and there is a call to IntersectWithLine() from the CellPicker, in this function the call to IntersectActorWithLine() calls in line 414 this one int cellType = data->GetCellType(cellId); ? and here I get the assertion fail: viewer: /build/vtk6-YpT4yb/vtk6-6.2.0+dfsg1/Common/Core/vtkDataArrayTemplate.h:191: T vtkDataArrayTemplate::GetValue(vtkIdType) [with T = unsigned char; vtkIdType = long long int]: Assertion `id >= 0 && id < this->Size' failed. Refered to https://github.com/Kitware/VTK/blob/release-6.3/Rendering/Core/vtkCellPicker.cxx#L414 I really don?t know how to debug this, and why this happens. Any Ideas for me? If there is anything not clear - ask me, I can try to go more into detail, give more Code, or something like that. Thank you! Jaspar -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 874 bytes Desc: Message signed with OpenPGP URL: From mey1k at naver.com Mon Sep 17 20:54:57 2018 From: mey1k at naver.com (minjun) Date: Mon, 17 Sep 2018 17:54:57 -0700 (MST) Subject: [vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2 Message-ID: <1537232097587-0.post@n5.nabble.com> I want to have qvtkwidget as background and place a generic QWidget on top of it. However, when I place a generic qwidget, the widget looks like to stop or not work properly. I came to know through many searches that this is a opengl context problem. So some people advice me to use QWidget2 or QVTKOpenglWidget to solve this problem. Is this the right way? If you have any experience like this, I would like to get some advice. Thank you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From lasso at queensu.ca Mon Sep 17 22:42:35 2018 From: lasso at queensu.ca (Andras Lasso) Date: Tue, 18 Sep 2018 02:42:35 +0000 Subject: [vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2 In-Reply-To: <1537232097587-0.post@n5.nabble.com> References: <1537232097587-0.post@n5.nabble.com> Message-ID: You may try the recently added QVTKOpenGLNativeWidget instead. https://www.vtk.org/doc/nightly/html/classQVTKOpenGLNativeWidget.html Let us know if it works for this use case. Andras -----Original Message----- From: vtkusers On Behalf Of minjun Sent: Monday, September 17, 2018 8:55 PM To: vtkusers at vtk.org Subject: [vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2 I want to have qvtkwidget as background and place a generic QWidget on top of it. However, when I place a generic qwidget, the widget looks like to stop or not work properly. I came to know through many searches that this is a opengl context problem. So some people advice me to use QWidget2 or QVTKOpenglWidget to solve this problem. Is this the right way? If you have any experience like this, I would like to get some advice. Thank you. -- Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083872456&sdata=6B8JqvIzktn4XNu3v18rNcJyhxhZDYy26Gwof34s4xM%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083872456&sdata=AkgZvzAL7n8armZ8649xepsg%2Buj%2BMil3frU6J3S9bRs%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083872456&sdata=W2ZVY9Q66kNWrbfoaonUGqUcV3sOkJJ3SkSpt6S%2FkIQ%3D&reserved=0 Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083882461&sdata=5ykO5UWnOawjKVcuB4Y0gj4f1G1oCtrUNXI%2FWfTyP8U%3D&reserved=0 Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083882461&sdata=Fa0SmWYAebDG5IDvFcWpXrbRD3vFBysxPUJ2nMuh9Xs%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083882461&sdata=fY1lu2ueycUk5r1TNSq%2FP0W733wkfT4vKf99LPe4KzY%3D&reserved=0 From mey1k at naver.com Tue Sep 18 01:06:46 2018 From: mey1k at naver.com (minjun) Date: Mon, 17 Sep 2018 22:06:46 -0700 (MST) Subject: [vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2 In-Reply-To: References: <1537232097587-0.post@n5.nabble.com> Message-ID: <1537247206550-0.post@n5.nabble.com> Thank you. This seems to be worth trying. The vtk 8.0.0 I am currently using does not include QVTKopenglNativeWidget, so I can't test it easily. First, I will finish this project and try it. Thank you very much for your reply. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From leonid_dulman at yahoo.co.uk Tue Sep 18 01:27:50 2018 From: leonid_dulman at yahoo.co.uk (Leonid Dulman) Date: Tue, 18 Sep 2018 05:27:50 +0000 (UTC) Subject: [vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2 In-Reply-To: References: <1537232097587-0.post@n5.nabble.com> Message-ID: <1303824551.10752026.1537248470081@mail.yahoo.com> Hi to allI have problems to use?QVTKOpenglWidget ?vs?QVTKWidget2If somebody have a simple example how to use ?QVTKOpenglWidget instead of ?QVTKWidget2Thanks, Leonid From: Andras Lasso To: minjun ; "vtkusers at vtk.org" Sent: Tuesday, September 18, 2018 5:43 AM Subject: Re: [vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2 You may try the recently added QVTKOpenGLNativeWidget instead. https://www.vtk.org/doc/nightly/html/classQVTKOpenGLNativeWidget.html Let us know if it works for this use case. Andras -----Original Message----- From: vtkusers On Behalf Of minjun Sent: Monday, September 17, 2018 8:55 PM To: vtkusers at vtk.org Subject: [vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2 I want to have qvtkwidget as background and place a generic QWidget on top of it. However, when I place a generic qwidget, the widget looks like to stop or not work properly. I came to know through many searches that this is a opengl context problem. So some people advice me to use QWidget2 or QVTKOpenglWidget to solve this problem. Is this the right way? If you have any experience like this, I would like to get some advice. Thank you. -- Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083872456&sdata=6B8JqvIzktn4XNu3v18rNcJyhxhZDYy26Gwof34s4xM%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083872456&sdata=AkgZvzAL7n8armZ8649xepsg%2Buj%2BMil3frU6J3S9bRs%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083872456&sdata=W2ZVY9Q66kNWrbfoaonUGqUcV3sOkJJ3SkSpt6S%2FkIQ%3D&reserved=0 Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083882461&sdata=5ykO5UWnOawjKVcuB4Y0gj4f1G1oCtrUNXI%2FWfTyP8U%3D&reserved=0 Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083882461&sdata=Fa0SmWYAebDG5IDvFcWpXrbRD3vFBysxPUJ2nMuh9Xs%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083882461&sdata=fY1lu2ueycUk5r1TNSq%2FP0W733wkfT4vKf99LPe4KzY%3D&reserved=0 _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.westphal at kitware.com Tue Sep 18 04:10:26 2018 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Tue, 18 Sep 2018 10:10:26 +0200 Subject: [vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2 In-Reply-To: <1303824551.10752026.1537248470081@mail.yahoo.com> References: <1537232097587-0.post@n5.nabble.com> <1303824551.10752026.1537248470081@mail.yahoo.com> Message-ID: Hi Leonid, Hi Andras, QVTKWidget and QVTKWidget2 are deprecated and should not be used, at least not if you have any problem with them in your application. VTK < 9, QVTKOpenGLWidget should be used VTK >= 9, QVTKOpenGLWidget has been renamed QVTKOpenGLNativeWidget (so it is not recently added) and should be used when needing a native widget a new QVTKOpenGLWidget has been added and should be used for all other usecases. for QVTKOpenGL*Widget, you can find example in VTK/GUISupport/Qt/Testing/Cxx Best regards, *For reference, see the mail sent on 2018 Aug 23, "The new QVTKOpenGLWidget"* *Hello list,* *If you are working on a VTK/Qt application this information should interest you.* *Sometime ago, a new QVTKOpenGLWidget implementation has been added to VTK, while the old one has been moved to QVTKOpenGLSimpleWidget.* *The last fixes for this change have just been merged, so make sure to use VTK master to test this.* *1. Why is there a new widget and what does it do ?* *We have been having some issues reported for the old widget, and the old widget could not support quad buffer stereo rendering by design.* *Has it is a needed feature in ParaView, a reimplementation was necessary. This new widget fix most of the reported issues with the old widget as well as adding stereo support.* *2. Why keeping the old widget around then ?* *Due to Qt limitations, this new implementation does not support very well being a native widget.* *But native widget are sometimes mandatory, for example within QScrollArea and QMDIArea, so the QVTKOpenGLSimpleWidget should be used when in needs of VTK rendering in the contact of Qt native widget.* *Also it allows users to switch back to the old widget if necessary.* *3. I'm not sure what native widgets are, what should I do in my application ?* *Here are the different situation :* 1. *Your Qt application only uses a central QVTKOpenGLWidget for rendering:* 2. *-> Nothing to do, just build with last master and make sure all is working well* 3. *Your Qt application only uses QVTKOpenGLWidget within QScrollArea or QMDIArea, or manually set widgets to be native and you are not interested by stereo rendering.* 4. * -> Change all your QVTKOpenGLWidget to QVTKOpenGLSimpleWidget and you are good to go* 5. *Your application uses a non-native QVTKOpenGLWidget for rendering as well as native QVTKOpenGLWidget for rendering (eg: ParaView, with the central rendering widget and the color map editor rendering widget in scroll areas) : * 6. * -> Use QVTKOpenGLWidget for non-native widgets and QVTKOpenGLSimpleWidget for native ones. The later will never support stereo.* *4. I followed your recommendation but I see some strange stuff/bugs/rendering issues* *Even if this new class has been tested extensively and will be used in the next ParaView release, It may still contains some issues. Feel free to discuss them in this mailing list or on our gitlab .* *Best regards,* *Mathieu Westphal* Mathieu Westphal On Tue, Sep 18, 2018 at 7:27 AM, Leonid Dulman via vtkusers < vtkusers at public.kitware.com> wrote: > Hi to all > I have problems to use QVTKOpenglWidget vs QVTKWidget2 > If somebody have a simple example how to use QVTKOpenglWidget instead of > QVTKWidget2 > Thanks, Leonid > > > ------------------------------ > *From:* Andras Lasso > *To:* minjun ; "vtkusers at vtk.org" > *Sent:* Tuesday, September 18, 2018 5:43 AM > *Subject:* Re: [vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2 > > You may try the recently added QVTKOpenGLNativeWidget instead. > > https://www.vtk.org/doc/nightly/html/classQVTKOpenGLNativeWidget.html > > Let us know if it works for this use case. > > Andras > > -----Original Message----- > From: vtkusers On Behalf Of minjun > Sent: Monday, September 17, 2018 8:55 PM > To: vtkusers at vtk.org > Subject: [vtkusers] QVTKWidget vs QVTKOpenglWidget vs QVTKWidget2 > > I want to have qvtkwidget as background and place a generic QWidget on top > of it. > > However, when I place a generic qwidget, the widget looks like to stop or > not work properly. > > I came to know through many searches that this is a opengl context problem. > > So some people advice me to use QWidget2 or QVTKOpenglWidget to solve this > problem. > > Is this the right way? > > If you have any experience like this, I would like to get some advice. > Thank you. > > > > -- > Sent from: https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users- > f1224199.html&data=02%7C01%7Classo%40queensu.ca% > 7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636728289083872456&sdata=6B8JqvIzktn4XNu3v18rNcJyhxhZDY > y26Gwof34s4xM%3D&reserved=0 > _______________________________________________ > Powered by https://na01.safelinks.protection.outlook.com/?url= > www.kitware.com&data=02%7C01%7Classo%40queensu.ca% > 7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636728289083872456&sdata=AkgZvzAL7n8armZ8649xepsg%2Buj% > 2BMil3frU6J3S9bRs%3D&reserved=0 > > Visit other Kitware open-source projects at https://na01.safelinks. > protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com% > 2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca% > 7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636728289083872456&sdata=W2ZVY9Q66kNWrbfoaonUGqUcV3sOkJ > J3SkSpt6S%2FkIQ%3D&reserved=0 > > Please keep messages on-topic and check the VTK FAQ at: > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01% > 7Classo%40queensu.ca%7C997ba21511cb4be5f0f008d61d015eb6% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636728289083882461&sdata= > 5ykO5UWnOawjKVcuB4Y0gj4f1G1oCtrUNXI%2FWfTyP8U%3D&reserved=0 > > Search the list archives at: https://na01.safelinks. > protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org% > 2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca% > 7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636728289083882461&sdata=Fa0SmWYAebDG5IDvFcWpXrbRD3vFBy > sxPUJ2nMuh9Xs%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url= > https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo% > 2Fvtkusers&data=02%7C01%7Classo%40queensu.ca% > 7C997ba21511cb4be5f0f008d61d015eb6%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636728289083882461&sdata=fY1lu2ueycUk5r1TNSq% > 2FP0W733wkfT4vKf99LPe4KzY%3D&reserved=0 > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iamdpak at gmail.com Tue Sep 18 08:41:01 2018 From: iamdpak at gmail.com (vinmean) Date: Tue, 18 Sep 2018 05:41:01 -0700 (MST) Subject: [vtkusers] Strange rendering problem - renderwindow becomes black Message-ID: <1537274461008-0.post@n5.nabble.com> This rendering issue occurs randomly. The render window partially hides all the actors. I have attached a video link to the email. It shows the object that I rendered using vtk. In the video I try to interact with the window. I have also captured how the object should have looked like in the same video towards the end. Please let me know what kind of bug this is and how to fix it. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From iamdpak at gmail.com Tue Sep 18 09:41:00 2018 From: iamdpak at gmail.com (vinmean) Date: Tue, 18 Sep 2018 06:41:00 -0700 (MST) Subject: [vtkusers] Strange rendering problem - renderwindow becomes black In-Reply-To: <1537274461008-0.post@n5.nabble.com> References: <1537274461008-0.post@n5.nabble.com> Message-ID: <1537278060058-0.post@n5.nabble.com> I think I found the problem with my code. This happens after I set the user transform for the actors in the render window. I am probably setting a wrong user transform. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From srbn.ghosh99 at gmail.com Tue Sep 18 10:54:35 2018 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Tue, 18 Sep 2018 07:54:35 -0700 (MST) Subject: [vtkusers] Convert .vtk file to .defm file Message-ID: <1537282475784-0.post@n5.nabble.com> I have a sphere.vtk image file which I want to convert into sphere.defm file. Is there any way to do the conversion using VTK/ITK? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From anka at bic.mni.mcgill.ca Tue Sep 18 11:12:16 2018 From: anka at bic.mni.mcgill.ca (Anka Kochanowska) Date: Tue, 18 Sep 2018 11:12:16 -0400 Subject: [vtkusers] vtkTransform::Identity() where it gets wrong? Message-ID: void vtkTransform::Identity() { this->Concatenation->Identity(); this->Modified(); // support for the legacy hack in InternalUpdate if (this->Matrix->GetMTime() > this->MatrixUpdateMTime) { this->Matrix->Identity(); } } Modified() is called before the matrix is reset to Identity. Should it be called at the end? My code reacts to Modified event and promptly uses matrix that was not yet changed. I patch it by calling transform->Modified() after transform->Identity(); Anka -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Sep 18 12:12:00 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 18 Sep 2018 10:12:00 -0600 Subject: [vtkusers] vtkTransform::Identity() where it gets wrong? In-Reply-To: References: Message-ID: Thanks for the report. That vtkTransform code was actually written before ModifiedEvent even existed. I've submitted a patch: https://gitlab.kitware.com/vtk/vtk/merge_requests/4680 Be careful with how you use ModifiedEvent. The events in vtkCommand.h are handled synchronously, so if you have a callback bound to the ModifiedEvent for an object, then any code that modifies that object has to sit and wait until your callback finished running. The Modified() method was initially designed to do only one thing: change the object's timestamp. VTK was designed from the ground up to be a pull pipeline: the pipeline is meant to be driven by either user interaction (mouse, keyboard, I/O) or by timer events (e.g. for animation); the pipeline checks timestamps to see what has changed since the last time it executed. Driving actions from ModifiedEvent goes against this and will lead to less efficient code, and can cause instability depending on how your ModifiedEvent callback changes the pipeline state. I recommend using ModifiedEvent only for logging, debugging, or simple bookkeeping. I'll stop ranting now :) Thanks again for the bug report, - David On Tue, Sep 18, 2018 at 9:12 AM Anka Kochanowska wrote: > void vtkTransform::Identity() > > { > > this->Concatenation->Identity(); > > this->Modified(); > > > // support for the legacy hack in InternalUpdate > > if (this->Matrix->GetMTime() > this->MatrixUpdateMTime) > > { > > this->Matrix->Identity(); > > } > > } > > Modified() is called before the matrix is reset to Identity. > > Should it be called at the end? > > > My code reacts to Modified event and promptly uses matrix that was not yet changed. > > I patch it by calling transform->Modified() after transform->Identity(); > > > Anka > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anka at bic.mni.mcgill.ca Tue Sep 18 12:26:28 2018 From: anka at bic.mni.mcgill.ca (Anka Kochanowska) Date: Tue, 18 Sep 2018 12:26:28 -0400 Subject: [vtkusers] vtkTransform::Identity() where it gets wrong? In-Reply-To: References: Message-ID: Thanks! Anka On Tue, Sep 18, 2018 at 12:12 PM David Gobbi wrote: > Thanks for the report. That vtkTransform code was actually written before > ModifiedEvent even existed. > > I've submitted a patch: > https://gitlab.kitware.com/vtk/vtk/merge_requests/4680 > > Be careful with how you use ModifiedEvent. The events in vtkCommand.h are > handled synchronously, so if you have a callback bound to the ModifiedEvent > for an object, then any code that modifies that object has to sit and wait > until your callback finished running. > > The Modified() method was initially designed to do only one thing: change > the object's timestamp. VTK was designed from the ground up to be a pull > pipeline: the pipeline is meant to be driven by either user interaction > (mouse, keyboard, I/O) or by timer events (e.g. for animation); the > pipeline checks timestamps to see what has changed since the last time it > executed. Driving actions from ModifiedEvent goes against this and will > lead to less efficient code, and can cause instability depending on how > your ModifiedEvent callback changes the pipeline state. > > I recommend using ModifiedEvent only for logging, debugging, or simple > bookkeeping. I'll stop ranting now :) > > Thanks again for the bug report, > > - David > > > On Tue, Sep 18, 2018 at 9:12 AM Anka Kochanowska > wrote: > >> void vtkTransform::Identity() >> >> { >> >> this->Concatenation->Identity(); >> >> this->Modified(); >> >> >> // support for the legacy hack in InternalUpdate >> >> if (this->Matrix->GetMTime() > this->MatrixUpdateMTime) >> >> { >> >> this->Matrix->Identity(); >> >> } >> >> } >> >> Modified() is called before the matrix is reset to Identity. >> >> Should it be called at the end? >> >> >> My code reacts to Modified event and promptly uses matrix that was not yet changed. >> >> I patch it by calling transform->Modified() after transform->Identity(); >> >> >> Anka >> >> _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From srbn.ghosh99 at gmail.com Tue Sep 18 15:09:51 2018 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Tue, 18 Sep 2018 12:09:51 -0700 (MST) Subject: [vtkusers] Convert .vtk file to nifti file format Message-ID: <1537297791147-0.post@n5.nabble.com> Hi, I have a larger file in vtk format . I want to resize it. So I want to convert it into nifti format . Is there any way for the conversion? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From iamdpak at gmail.com Tue Sep 18 18:39:36 2018 From: iamdpak at gmail.com (vinmean) Date: Tue, 18 Sep 2018 15:39:36 -0700 (MST) Subject: [vtkusers] Strange rendering problem - renderwindow becomes black In-Reply-To: <1537278060058-0.post@n5.nabble.com> References: <1537274461008-0.post@n5.nabble.com> <1537278060058-0.post@n5.nabble.com> Message-ID: <1537310376517-0.post@n5.nabble.com> The problem is with some of the transformation matrices. But I don't see any thing wrong with the matrix as the same matrix works well with actors without textures. Below is one such matrix that gives me this issue. Eigen::Matrix4d tmat; tmat << 0.997911, -0.00378345, 0.0644943, 0.0259245, -0.0180899, 0.941987, 0.335162, 0.129426, 0.0620209, 0.335629, -0.93995, -0.772905, 0, 0, 0, 1; -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From lasso at queensu.ca Tue Sep 18 21:13:39 2018 From: lasso at queensu.ca (Andras Lasso) Date: Wed, 19 Sep 2018 01:13:39 +0000 Subject: [vtkusers] Strange rendering problem - renderwindow becomes black In-Reply-To: <1537310376517-0.post@n5.nabble.com> References: <1537274461008-0.post@n5.nabble.com> <1537278060058-0.post@n5.nabble.com>,<1537310376517-0.post@n5.nabble.com> Message-ID: Determinant of this matrix is negative, which means that you turn the model inside out. You can use vtkReverseSense or vtkPolyDataNormals (with auto-orientation enabled) to fix it. Andras ________________________________ From: vinmean Sent: Tuesday, September 18, 2018 6:39 PM To: vtkusers at vtk.org Subject: Re: [vtkusers] Strange rendering problem - renderwindow becomes black The problem is with some of the transformation matrices. But I don't see any thing wrong with the matrix as the same matrix works well with actors without textures. Below is one such matrix that gives me this issue. Eigen::Matrix4d tmat; tmat << 0.997911, -0.00378345, 0.0644943, 0.0259245, -0.0180899, 0.941987, 0.335162, 0.129426, 0.0620209, 0.335629, -0.93995, -0.772905, 0, 0, 0, 1; -- Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Classo%40queensu.ca%7C88d54845897f4bf2714c08d61db79ef5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636729071828430400&sdata=FjVCEvm0JWIHwbXQRgWtNdRpStJ3gU0%2BwDj0Sfjyetw%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C88d54845897f4bf2714c08d61db79ef5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636729071828430400&sdata=6mgDyX8naFmFC7JMMWReUbLp4M9jC1FyQjiEJ8qqCQA%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C88d54845897f4bf2714c08d61db79ef5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636729071828430400&sdata=fheKAHrKjeLtKRqmXJ0JFHm%2FhvaSa6QxWva9z%2FBUBfo%3D&reserved=0 Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C88d54845897f4bf2714c08d61db79ef5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636729071828430400&sdata=%2F2TsMf9XvU%2BCUbIQYMs9%2B2BwKkoO5fsaJ9%2BxW96krF4%3D&reserved=0 Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C88d54845897f4bf2714c08d61db79ef5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636729071828430400&sdata=7aTYn9vEv%2BFzwOxsv%2FsXXuHMD8n%2FtVJQiaYp%2BRpASC8%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C88d54845897f4bf2714c08d61db79ef5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636729071828430400&sdata=QTTo2%2B4PcNSgqxMNFczJnsrrDtdtxHU4u6QD57IG0yQ%3D&reserved=0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Wed Sep 19 14:53:34 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 19 Sep 2018 14:53:34 -0400 Subject: [vtkusers] In vtkCellPicker assertion from GetCellType fails In-Reply-To: <7C4D7624-85D4-4A97-AE21-8AEED4F0A5EE@uni-osnabrueck.de> References: <7C4D7624-85D4-4A97-AE21-8AEED4F0A5EE@uni-osnabrueck.de> Message-ID: You might try and bypass the problem by setting the actor for the point cloud to be non pickable. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, Sep 17, 2018 at 4:38 PM Jaspar L?chte wrote: > Hello there! > > I use VTK 6.3 in a project for my thesis in an Qt desktop application. > > I am storing Pointclouds and do some manipulation, calculating hulls, etc. > For the hulls I display some vtkLines in an extra vtkActor and wanted to > create a possiblity to modify the polygon. > > Therfore i want to be able to move points AND want to pick lines and > create a new Point on the line to be able to move that one to. > > So I wanted to use the vtkCellPicker to pick the lines (which works quite > well so far ?). > > Since I needed a ContextMenu in Qt I manipulated the MouseEvents and use > them allready in the Qt MainWindow. Like this: > https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/EventQtSlotConnect > > In my Code I want to detect a vtkLine with this vtkCellPicker, like this: > > m_picker->Pick(x, y, 0, m_mainStyle->GetDefaultRenderer()); > long l = m_cicker->GetCellId(); > if(l > 0) > { > vtkSmartPointer actor = m_picker->GetActor(); > long O = actor->GetMapper()->GetInput()->GetCellType(l); > > if(O == 3) > { > vtkSmartPointer line = > vtkLine::SafeDownCast(actor->GetMapper()->GetInput()->GetCell(l)); > vtkSmartPointer points = line->GetPoints(); > double p[3]; > if(points->GetNumberOfPoints() > 0) > { > for(int i = 0; i < points->GetNumberOfPoints(); i++) > { > points->GetPoint(i, p); > std::cout << "(" << p[0] << ", " << p[1] << ", " << p[2] << ")" << > std::endl; > } > } > } > } > > As I said ? this works pretty well, except for any random points, the > CellPicker also picks vertices from the Pointcloud (CellType == 1) and on > random points my program crashes, because of an assertion fail ? > > I found out that the call to vtkCellPicker::Pick() calls superclass vtkPicker::Pick() > and there is a call to IntersectWithLine() from the CellPicker, in this > function the call to IntersectActorWithLine() calls in line 414 this one > int cellType = data->GetCellType(cellId); ? and here I get the assertion > fail: > > viewer: > /build/vtk6-YpT4yb/vtk6-6.2.0+dfsg1/Common/Core/vtkDataArrayTemplate.h:191: > T vtkDataArrayTemplate::GetValue(vtkIdType) [with T = unsigned char; > vtkIdType = long long int]: Assertion `id >= 0 && id < this->Size' failed. > > Refered to > https://github.com/Kitware/VTK/blob/release-6.3/Rendering/Core/vtkCellPicker.cxx#L414 > > I really don?t know how to debug this, and why this happens. > > Any Ideas for me? > > If there is anything not clear - ask me, I can try to go more into detail, > give more Code, or something like that. > > Thank you! > > Jaspar > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chinander at gmail.com Thu Sep 20 10:02:38 2018 From: chinander at gmail.com (Mike Chinander) Date: Thu, 20 Sep 2018 09:02:38 -0500 Subject: [vtkusers] Qt VTK OpenGL Not Supported problem In-Reply-To: <1536837704825-0.post@n5.nabble.com> References: <1536758685414-0.post@n5.nabble.com> <1536837704825-0.post@n5.nabble.com> Message-ID: Yesterday, I encountered this QT_OPENGL issue when upgrading to the latest master (had been using VTK 8.1). The just-released QtCreator 4.7.1 no longer forces this to be 'angle' by default. http://blog.qt.io/blog/2018/09/20/qt-creator-4-7-1-released On Thu, Sep 13, 2018 at 6:21 AM meakcey wrote: > I could not implement your suggestion > I have tried something like that on main.cpp > > #include "mainwindow.h" > #include > > #include > #include > > int main(int argc, char *argv[]) > { > QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat()); > QApplication a(argc, argv); > MainWindow w; > w.show(); > return a.exec(); > } > > But that did not work. > > When I looked at the system environment settings of Qt, I have seen there > is > a variable like QT_OPENGL = angle > I have changed that to "desktop" and it worked. > > Thank you > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bebe0705 at colorado.edu Thu Sep 20 12:07:52 2018 From: bebe0705 at colorado.edu (BBerco) Date: Thu, 20 Sep 2018 09:07:52 -0700 (MST) Subject: [vtkusers] Selective, quiet linker failure to find libraries? Message-ID: <1537459672093-0.post@n5.nabble.com> I've encountered a strange behavior of VTK 8.1.1 on Ubuntu 18.04.1 LTS. Namely, even the simple examples such as that of GetMiscCellData on Bill Lorensen's website fail like so: 1. `cmake .. ` from build directory : no problem, VTK found, ${VTK_LIBRARIES} contains the list of all the libraries to be loaded 2. `make` : the build completes smoothly and the linker does not complain 3. `.\GetMiscCellData` fails, with the error message : [...] error while loading shared libraries: libvtkIOXMLParser-8.1.so.1 : cannot open shared object file: No such file or directory" What is extremely puzzling is that running ldd on the created executable shows that SOME of the VTK libraries were found (libvtkIOXML-8.1.so.1 for instance), while others were not (like libvtkIOXMLParser-8.1.so.1) . What is even more puzzling is that all these shared libraries exists in \usr\local\lib\ ! I have no idea what's going on. Any advice? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From david.gobbi at gmail.com Thu Sep 20 12:20:52 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 20 Sep 2018 10:20:52 -0600 Subject: [vtkusers] Selective, quiet linker failure to find libraries? In-Reply-To: <1537459672093-0.post@n5.nabble.com> References: <1537459672093-0.post@n5.nabble.com> Message-ID: Hi Ben, Linux doesn't see new libraries in /usr/local/lib until you run 'ldconfig'. - David On Thu, Sep 20, 2018 at 10:07 AM BBerco wrote: > I've encountered a strange behavior of VTK 8.1.1 on Ubuntu 18.04.1 LTS. > Namely, even the simple examples such as that of GetMiscCellData on Bill > Lorensen's website fail like so: > > 1. `cmake .. ` from build directory : no problem, VTK found, > ${VTK_LIBRARIES} contains the list of all the libraries to be loaded > 2. `make` : the build completes smoothly and the linker does not complain > 3. `.\GetMiscCellData` fails, with the error message : [...] error while > loading shared libraries: libvtkIOXMLParser-8.1.so.1 : cannot open shared > object file: No such file or directory" > > What is extremely puzzling is that running ldd on the created executable > shows that SOME of the VTK libraries were found (libvtkIOXML-8.1.so.1 for > instance), while others were not (like libvtkIOXMLParser-8.1.so.1) . What > is > even more puzzling is that all these shared libraries exists in > \usr\local\lib\ ! > > I have no idea what's going on. Any advice? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bebe0705 at colorado.edu Thu Sep 20 12:22:26 2018 From: bebe0705 at colorado.edu (BBerco) Date: Thu, 20 Sep 2018 09:22:26 -0700 (MST) Subject: [vtkusers] Selective, quiet linker failure to find libraries? In-Reply-To: References: <1537459672093-0.post@n5.nabble.com> Message-ID: <1537460546221-0.post@n5.nabble.com> You sir just saved my day ! Thanks ! -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Anthony.Iyoho at L3T.com Thu Sep 20 16:03:11 2018 From: Anthony.Iyoho at L3T.com (Anthony.Iyoho at L3T.com) Date: Thu, 20 Sep 2018 20:03:11 +0000 Subject: [vtkusers] Problems Installing Required VTK Components Message-ID: Hello, I'm trying to install the latest version of VTK (8.1.1) using Cmake 3.12.2 on Windows 10 (64 bit). The reason, a specific Java GUI that I'm trying to run requires VTK. I'm running into issues because the GUI requires 'vtkTransform', 'vtkJavaMemoryManagerImpl', 'vtkLinearTransorm','vtkAbstractTransform' and a few others, which I probably don't need to all name. However, when I run CMAKE to configure/generate, no dll is created for these particular required files. I get the following errors in the command window: Exception in thread "main" java.lang.UnsatisfiedLinkError: vtk.vtkTransform.GetClassName_0()Ljava/lang/String; at vtk.vtkTransform.GetClassName_0(Native Method) at vtk.vtkTransform.GetClassName(vtkTransform.java:12) at vtk.vtkJavaMemoryManagerImpl.registerJavaObject(vtkJavaMemoryManagerImpl.java:85) at vtk.vtkObjectBase.(vtkObjectBase.java:44) at vtk.vtkObject.(vtkObject.java:94) at vtk.vtkAbstractTransform.(vtkAbstractTransform.java:134) at vtk.vtkHomogeneousTransform.(vtkHomogeneousTransform.java:50) at vtk.vtkLinearTransform.(vtkLinearTransform.java:110) at vtk.vtkTransform.(vtkTransform.java:198) My question, is there some setting within CMAKE or in the VTK files to get these other files created? Thanks so much! ------------------------------------------- CONFIDENTIALITY NOTICE: This email and any attachments are for the sole use of the intended recipient and may contain material that is proprietary, confidential, privileged or otherwise legally protected or restricted under applicable government laws. Any review, disclosure, distributing or other use without expressed permission of the sender is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies without reading, printing, or saving.. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Thu Sep 20 16:12:10 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 20 Sep 2018 16:12:10 -0400 Subject: [vtkusers] Problems Installing Required VTK Components In-Reply-To: References: Message-ID: Those file will be embedded into other module level dll. So you won't find a vtkTransform.dll. Usually the error you are seeing is related to the fact that the vtk dlls files are not available in the system path of Windows. HTH, Seb On Thu, Sep 20, 2018 at 4:08 PM wrote: > Hello, > > > > I'm trying to install the latest version of VTK (8.1.1) using Cmake 3.12.2 > on Windows 10 (64 bit). The reason, a specific Java GUI that I'm trying to > run requires VTK. > > > > I'm running into issues because the GUI requires 'vtkTransform', > 'vtkJavaMemoryManagerImpl', 'vtkLinearTransorm','vtkAbstractTransform' and > a few others, which I probably don't need to all name. However, when I run > CMAKE to configure/generate, no dll is created for these particular > required files. > > > > I get the following errors in the command window: > > > > Exception in thread "main" java.lang.UnsatisfiedLinkError: > vtk.vtkTransform.GetClassName_0()Ljava/lang/String; > > at vtk.vtkTransform.GetClassName_0(Native Method) > > at vtk.vtkTransform.GetClassName(vtkTransform.java:12) > > at > vtk.vtkJavaMemoryManagerImpl.registerJavaObject(vtkJavaMemoryManagerImpl.java:85) > > at vtk.vtkObjectBase.(vtkObjectBase.java:44) > > at vtk.vtkObject.(vtkObject.java:94) > > at vtk.vtkAbstractTransform.(vtkAbstractTransform.java:134) > > at > vtk.vtkHomogeneousTransform.(vtkHomogeneousTransform.java:50) > > at vtk.vtkLinearTransform.(vtkLinearTransform.java:110) > > at vtk.vtkTransform.(vtkTransform.java:198) > > > > My question, is there some setting within CMAKE or in the VTK files to get > these other files created? > > > > Thanks so much! > > > > > ------------------------------------------- CONFIDENTIALITY NOTICE: This > email and any attachments are for the sole use of the intended recipient > and may contain material that is proprietary, confidential, privileged or > otherwise legally protected or restricted under applicable government laws. > Any review, disclosure, distributing or other use without expressed > permission of the sender is strictly prohibited. If you are not the > intended recipient, please contact the sender and delete all copies without > reading, printing, or saving.. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mey1k at naver.com Fri Sep 21 03:39:28 2018 From: mey1k at naver.com (minjun) Date: Fri, 21 Sep 2018 00:39:28 -0700 (MST) Subject: [vtkusers] QVTKWidget Good bye Message-ID: <1537515568459-0.post@n5.nabble.com> hi, I think many vtk beginners are having the same problem now. Below are the problems I have experienced and the solutions to them. Problem I want to have qvtkwidget as background and place a generic QWidget on top of it. However, when I place a generic qwidget, the widget looks like to stop or not work properly. I came to know through many searches that this is a opengl context problem. So some people advice me to use QWidget2 or QVTKOpenglWidget to solve this problem. Is this the right way? If you have any experience like this, I would like to get some advice. Thank you. Solution *** You may try the recently added QVTKOpenGLNativeWidget instead. https://www.vtk.org/doc/nightly/html/classQVTKOpenGLNativeWidget.html Let us know if it works for this use case. *** *** Second QVTKWidget and QVTKWidget2 are deprecated and should not be used, at least not if you have any problem with them in your application. VTK < 9, QVTKOpenGLWidget should be used VTK >= 9, QVTKOpenGLWidget has been renamed QVTKOpenGLNativeWidget (so it is not recently added) and should be used when needing a native widget a new QVTKOpenGLWidget has been added and should be used for all other usecases. for QVTKOpenGL*Widget, you can find example in VTK/GUISupport/Qt/Testing/Cxx Best regards, For reference, see the mail sent on 2018 Aug 23, "The new QVTKOpenGLWidget" Hello list, If you are working on a VTK/Qt application this information should interest you. Sometime ago, a new QVTKOpenGLWidget implementation has been added to VTK, while the old one has been moved to QVTKOpenGLSimpleWidget. The last fixes for this change have just been merged, so make sure to use VTK master to test this. 1. Why is there a new widget and what does it do ? We have been having some issues reported for the old widget, and the old widget could not support quad buffer stereo rendering by design. Has it is a needed feature in ParaView, a reimplementation was necessary. This new widget fix most of the reported issues with the old widget as well as adding stereo support. 2. Why keeping the old widget around then ? Due to Qt limitations, this new implementation does not support very well being a native widget. But native widget are sometimes mandatory, for example within QScrollArea and QMDIArea, so the QVTKOpenGLSimpleWidget should be used when in needs of VTK rendering in the contact of Qt native widget. Also it allows users to switch back to the old widget if necessary. 3. I'm not sure what native widgets are, what should I do in my application ? Here are the different situation : ? [hide part of quote] Your Qt application only uses a central QVTKOpenGLWidget for rendering: -> Nothing to do, just build with last master and make sure all is working well Your Qt application only uses QVTKOpenGLWidget within QScrollArea or QMDIArea, or manually set widgets to be native and you are not interested by stereo rendering. -> Change all your QVTKOpenGLWidget to QVTKOpenGLSimpleWidget and you are good to go Your application uses a non-native QVTKOpenGLWidget for rendering as well as native QVTKOpenGLWidget for rendering (eg: ParaView, with the central rendering widget and the color map editor rendering widget in scroll areas) : -> Use QVTKOpenGLWidget for non-native widgets and QVTKOpenGLSimpleWidget for native ones. The later will never support stereo. 4. I followed your recommendation but I see some strange stuff/bugs/rendering issues Even if this new class has been tested extensively and will be used in the next ParaView release, It may still contains some issues. Feel free to discuss them in this mailing list or on our gitlab. Best regards, *** *** https://stackoverflow.com/questions/46787783/vtk-examples-not-working-qvtkopenglwidget *** *** *** I am so grateful to those who gave me this answer. So I also post this message to help a little bit of someone's search time. thank you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From elvis.stansvik at orexplore.com Fri Sep 21 08:27:36 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 21 Sep 2018 14:27:36 +0200 Subject: [vtkusers] Anyone know when 9.0 is likely? Message-ID: Hi all, When is the 9.0 release planned for, anyone know (roughly)? Elvis From dave.demarle at kitware.com Fri Sep 21 09:03:21 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 21 Sep 2018 09:03:21 -0400 Subject: [vtkusers] Anyone know when 9.0 is likely? In-Reply-To: References: Message-ID: I'm going to put out an 8.2 from master next month after we get the ParaView release out the door. Now that Ben is back from his big big walk up the Appalachain Trail we can finish off the CMake refactoring he started early this year. That will become 9.0 and we'll put that out early next year. Is everybody OK with those plans? David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Sep 21, 2018 at 8:28 AM Elvis Stansvik wrote: > Hi all, > > When is the 9.0 release planned for, anyone know (roughly)? > > 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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjjmarc at gmail.com Fri Sep 21 10:55:00 2018 From: mjjmarc at gmail.com (Marc Jaspar) Date: Fri, 21 Sep 2018 10:55:00 -0400 Subject: [vtkusers] Good day Message-ID: I have been working with vtk version 5.10.1 and it works very well. I just downloaded vtk 8.1.1 and I am trying to program a simple cone or sphere and I seem to me missing required libraries. Could I get a listing of the basic required libs? I really don't want to include all of them in the directory. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Fri Sep 21 12:48:40 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 21 Sep 2018 18:48:40 +0200 Subject: [vtkusers] the New QVTKOpenGLWidget In-Reply-To: References: Message-ID: Den tors 23 aug. 2018 11:09Mathieu Westphal skrev: > Hello list, > > If you are working on a VTK/Qt application this information should > interest you. > Sometime ago, a new QVTKOpenGLWidget implementation has been added to VTK, > while the old one has been moved to QVTKOpenGLSimpleWidget. > The last fixes for this change have just been merged, so make sure to use > VTK master to test this. > > *1. Why is there a new widget and what does it do ?* > We have been having some issues reported for the old widget, and the old > widget could not support quad buffer stereo rendering by design. > Has it is a needed feature in ParaView, a reimplementation was necessary. > This new widget fix most of the reported issues with the old widget as well > as adding stereo support. > > *2. Why keeping the old widget around then ?* > Due to Qt limitations, this new implementation does not support very well > being a native widget. > But native widget are sometimes mandatory, for example within QScrollArea > and QMDIArea, so the > Do you know what other containers apart from QScrollArea will require native widget? Will QTabWidget? Asking because we are planning to possibly put one of our VTK views in a tab widget, but would really like to benefit from some of the improvements in the new VTK widget (respect for fractional device pixel ratio mostly). If tab widget will require native, then I should really brush up an old MR of mine that fixes fractional device pixel ratio in the "old" native widget. I should do this anyway of course, but now I've heard that 8.2 might be around the corner, making it more urgent to do that asap. Elvis QVTKOpenGLSimpleWidget should be used when in needs of VTK rendering in the > contact of Qt native widget. > > Also it allows users to switch back to the old widget if necessary. > > *3. I'm not sure what native widgets are, what should I do in my > application ?* > > Here are the different situation : > > 1. Your Qt application only uses a central QVTKOpenGLWidget for > rendering: > -> Nothing to do, just build with last master and make sure all is > working well > 2. Your Qt application only uses QVTKOpenGLWidget within QScrollArea > or QMDIArea, or manually set widgets to be native and you are not > interested by stereo rendering. > -> Change all your QVTKOpenGLWidget to QVTKOpenGLSimpleWidget and you > are good to go > 3. Your application uses a non-native QVTKOpenGLWidget for rendering > as well as native QVTKOpenGLWidget for rendering (eg: ParaView, with the > central rendering widget and the color map editor rendering widget in > scroll areas) : > -> Use QVTKOpenGLWidget for non-native widgets and > QVTKOpenGLSimpleWidget for native ones. The later will never support stereo. > > > *4. I followed your recommendation but I see some strange > stuff/bugs/rendering issues* > Even if this new class has been tested extensively and will be used in the > next ParaView release, It may still contains some issues. Feel free to > discuss them in this mailing list or on our gitlab > . > > Best regards, > > Mathieu Westphal > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmilano at gmail.com Fri Sep 21 15:05:49 2018 From: fmilano at gmail.com (Federico Milano) Date: Fri, 21 Sep 2018 16:05:49 -0300 Subject: [vtkusers] Translate a vtkCellLocator Message-ID: Hi. I would need to translate a vtkCellLocator, without rebuilding it entirely. I suppose that it should be possible to apply an offset to all the buckets in the octtree. Do you know if is it possible to do this (or to apply a translation to any other cell locator structure) with the tools provided by vtk? Thanks in advance! Federico -------------- next part -------------- An HTML attachment was scrubbed... URL: From kshahim at gmail.com Sat Sep 22 08:50:32 2018 From: kshahim at gmail.com (kamal shahim) Date: Sat, 22 Sep 2018 14:50:32 +0200 Subject: [vtkusers] VTK IOS Message-ID: <71B1934D-84B5-421A-838C-99058B9D2D2C@gmail.com> Hello all, i am trying to compile VTK on IOS, Cmake configuration and generation are fine, but when I apply ?make' command on the generated Makefile, i received theses errors: Complaining on the vtk-compile-tools... -- Build files have been written to: .../VTK-8.1.1 [ 23%] Performing build step for 'vtk-compile-tools' make[3]: *** No rule to make target `vtkCompileTools'. Stop. make[2]: *** [CompileTools/src/vtk-compile-tools-stamp/vtk-compile-tools-build] Error 2 make[1]: *** [CMakeFiles/vtk-compile-tools.dir/all] Error 2 make: *** [all] Error 2 I am testing it on Mac, with these Cmake configurations : I would appreciate your help, regards, kshahim -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2018-09-22 at 14.46.14.png Type: image/png Size: 56883 bytes Desc: not available URL: From kshahim at gmail.com Sat Sep 22 09:08:30 2018 From: kshahim at gmail.com (kamal shahim) Date: Sat, 22 Sep 2018 15:08:30 +0200 Subject: [vtkusers] VTK IOS References: <71B1934D-84B5-421A-838C-99058B9D2D2C@gmail.com> Message-ID: <673317BF-9941-4294-BD14-8A25116674C5@gmail.com> Hello all, i am trying to compile VTK on IOS, Cmake configuration and generation are fine, but when I apply ?make' command on the generated Makefile, i received theses errors: Complaining on the vtk-compile-tools... -- Build files have been written to: .../VTK-8.1.1 [ 23%] Performing build step for 'vtk-compile-tools' make[3]: *** No rule to make target `vtkCompileTools'. Stop. make[2]: *** [CompileTools/src/vtk-compile-tools-stamp/vtk-compile-tools-build] Error 2 make[1]: *** [CMakeFiles/vtk-compile-tools.dir/all] Error 2 make: *** [all] Error 2 I am testing it on Mac, with these Cmake configurations : I would appreciate your help, regards, kshahim -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2018-09-22 at 14.46.14.png Type: image/png Size: 56883 bytes Desc: not available URL: From berti_krueger at hotmail.com Sun Sep 23 00:29:27 2018 From: berti_krueger at hotmail.com (=?Windows-1252?Q?Berti_Kr=FCger?=) Date: Sun, 23 Sep 2018 04:29:27 +0000 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: , Message-ID: Hi all. I am very sorry to revive this ancient thread. But i thought that maybe it could help other vtk users in the future to have a compilable and working example of the final result. If someone thinks that this code could be useful as an vtk example then feel free to modify / correct / pimp / add this to the vtk examples on github. I adapted the 3D slicer vtk code Csaba has pointed me to and incorporated the hints from David and everything works like a charm: [cid:795e083b-ffaa-4d6b-8b3f-97deb637b01c] The whole procedure is incredibly simple. Basically the vtkPolyData of the mesh is converted via the vtkPolyDataToImageStencil filter to a vtkImageStencil and the rest of the whole magic is only done by the vtkImageStencil filter: // Convert stencil to image vtkNew stencil; stencil->SetInputData(binaryLabelMap); stencil->SetStencilConnection(polyDataToImageStencil->GetOutputPort()); stencil->ReverseStencilOn(); stencil->SetBackgroundValue(1); // General foreground value is 1 (background value because of reverse stencil) I would really like to know very roughly how the vtkImageStencil works internally without digging through all of the source code. Because it is really fast (some kind of rasterization maybe ?). If someone could drop me a line on how it works only in principle that would be really great. So thanks again to Bill, Csaba, David, Elvis and everyone else on this thread. Kind regards, Berti PS: Example code, CMakeLists and example STL mesh are attached ________________________________ Von: Csaba Pinter Gesendet: Montag, 11. Juni 2018 12:45 An: Berti Kr?ger Cc: vtkusers at vtk.org Betreff: RE: [vtkusers] Solid Voxelization with VTK Hi Berti, That code is under BSD-style license, so you?re free to do basically anything with it. This implementation is already pretty simple; just a concatenation of several VTK filters, so you can just give it a try by copy-pasting the relevant part of that function into your code and see if it works. If you?re interested in using the vtkSegmentation library, let me know though! Best, csaba From: Berti Kr?ger Sent: Monday, June 11, 2018 02:46 To: Csaba Pinter ; David Gobbi Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Solid Voxelization with VTK Hi Csaba, thank you very much for you answer and for offering your help. I already have looked at it and i think if no simpler option will come up, i will give it a try (hoping not to have to change too much to get it working with my pipeline since i am an absolute vtk beginner :-) ). How is this code licensed ? (i am only doing research work at the moment, the whole project i am working on is internal and just for testing and part of some larger work, it might be open sourced one day in the very far future but could even be not at all and it will never be used commercially). Regards Berti Am 05.06.2018 um 16:14 schrieb Csaba Pinter: Hi Berti, There is a pretty robust conversion algorithm implemented within 3D Slicer but using solely VTK: https://github.com/Slicer/Slicer/blob/master/Libs/vtkSegmentationCore/vtkClosedSurfaceToBinaryLabelmapConversionRule.cxx#L118 It consists of a short pipeline of standard VTK filters (some preprocessing then vtkPolyDataToImageStencil and vtkImageStencil). Let me know if you have any questions. csaba From: vtkusers On Behalf Of Berti Kr?ger Sent: Tuesday, June 5, 2018 03:26 To: David Gobbi Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Solid Voxelization with VTK Hi David, thank you very much for your help. I tried the example from your link. Unfortunately the result is same as using the vtkVoxelModeller: [Screenshot result voxelization] I get only a voxelization of the surface. The interior of the voxelized cone is still hollow and not filled with voxels (at least this is implied by the visualization). For the visualization i use Bill Lorensen's example code from here: https://lorensen.github.io/VTKExamples/site/Cxx/Medical/GenerateCubesFromLabels/ I have attached this small example which compiles with VTK 8.1 to show the issue. It basicly only consist of the example code from your link (https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataToImageData/) and the visualization code from the Bill Lorensen's example from the link above. I have not changed much. Any idea what is going wrong or what can i do get also voxelization of the interior (solid voxelization)? Thank you very much in advance. Regards Berti PolyDataToImageData - lorensen.github.io lorensen.github.io If VTK is not installed but compiled on your system, you will need to specify the path to your VTK build: GenerateCubesFromLabels - GitHub Pages lorensen.github.io Usage: GenerateCubesFromLabels FullHead.mhd StartLabel EndLabel where InputVolume is a meta file containing a 3 volume of discrete labels. ________________________________ Von: David Gobbi > Gesendet: Montag, 28. Mai 2018 23:13 An: Berti Kr?ger Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Solid Voxelization with VTK Hi Berti, If its a triangulated surface that you want to fill with voxels, use vtkPolyDataToImageStencil: https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataToImageData/ PolyDataToImageData - lorensen.github.io lorensen.github.io If VTK is not installed but compiled on your system, you will need to specify the path to your VTK build: If its a mesh of 3D elements and you want to sample the elements to create voxels, try vtkResampleToImage. - David On Mon, May 28, 2018 at 4:41 PM, Berti Kr?ger > wrote: Hello Everyone. For my Project i have to voxelize a 3D-Triangle-Mesh. I already found the vtkVoxelModeller which, while somewhat slow (only around 200 Triangles per second), works, but only voxelizes the outer shell where the mesh boundary triangles are. The inner part of the mesh stays hollow. Is there some way to get solid voxelization of 3D-Triangle-Meshes out of the box with VTK ? Thank you very much in advance, Berti -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 62429 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dragon.jpg Type: image/jpeg Size: 65894 bytes Desc: dragon.jpg URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CMakeLists.txt URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PolyDataToImageDataVisualizationSTL.cxx Type: text/x-c++src Size: 8205 bytes Desc: PolyDataToImageDataVisualizationSTL.cxx URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: spacefighter.stl Type: application/sla Size: 9084 bytes Desc: spacefighter.stl URL: From berti_krueger at hotmail.com Sun Sep 23 00:51:13 2018 From: berti_krueger at hotmail.com (=?iso-8859-1?Q?Berti_Kr=FCger?=) Date: Sun, 23 Sep 2018 04:51:13 +0000 Subject: [vtkusers] Nonrectangular selection of points (vertices) or cells (triangles) on a mesh surface (paraview like) In-Reply-To: References: , Message-ID: Thanks David for all the help and your hints. This really helped me a lot. The example code really showcases the ParaView's polygon selection feature as it is used in Paraview and how to extract the subset surface. Additionally with the vtkHardwareSelector i was also able to use the vtkContourWidget for drawing a polygon on the mesh and using the enclosed surface area for selection. I then reconstructed the enclosed surface by using the points of the polygon itself and the points of the original mesh which lie inside the surface area enclosed by the polygon with the vtkDelaunay2D filter. I then extruded the resulting vtkPolyData: [cid:6ce71f7e-74c7-47e8-bd94-b3a730c6619b] Can this be done easier / better? (So far i am content. But as i have read in other threads the vtkDelaunay2D filter has issues regarding stability and could hang.) The vtkHardwareSelector is damn fast but has limitations because of the way it works (e.g. it doesn't work with wireframe representation, opacity, multisampling, selects only the directly visible geometry etc.). Are there any alternatives to the vtkHardwareSelector for this kind of application? Thank you very much again for the effort. Kind regards, Berti ________________________________ Von: David E DeMarle Gesendet: Freitag, 7. September 2018 12:37 An: Berti Kr?ger Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Nonrectangular selection of points (vertices) or cells (triangles) on a mesh surface (paraview like) Hello, The VTK level implementation behind ParaView's polygon selection feature is exercised/demonstrated by Rendering/Core/Testing/Cxx/TestPolygonSelection.cxx. You can follow that to see how a VTK enabled app can make a non rectangular selection. With that selection you might either extract a subset surface offset it a bit and change the appearance, or use the preserve topology feature of selection to make a shallow copy of the original mesh with a new array that identifies the selected primitives, and use that array as input to the coloration of the whole to modify its appearance. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Sep 7, 2018 at 5:12 AM Berti Kr?ger > wrote: Hello everyone. In my project i have a standard 3D STL triangle surface mesh where i need to select all vertices which lie inside a region (polygon) defined by a closed polyline created by an user interaction using the vtkContourWidget: [cid:6bce5125-0cf4-43a0-962c-cc9dd5a593f1] [cid:dc6cff08-ee3c-4c70-bea2-9e44a8578c05] Paraview has a similiar feature called "select points with polygon" or "select cells with polygon": [cid:4238abb5-92ec-41d2-a435-867a45d1a7cb] At the end of the process i want to create a polygon mesh which has the shape of the vtkContourWidget polygon selection contour line and which lies like a sticker or texture on the the given stl mesh surface. If anybody can help me with ideas / suggestions / hints / pointers on how to accomplish this with vtk i would be glad. Thank you very much in advance, Berti _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: extrusion.jpg Type: image/jpeg Size: 238088 bytes Desc: extrusion.jpg URL: From rubendibattista at gmail.com Sun Sep 23 07:46:00 2018 From: rubendibattista at gmail.com (Ruben Di Battista) Date: Sun, 23 Sep 2018 04:46:00 -0700 Subject: [vtkusers] Contourf 2D plot using VTK primitives Message-ID: Hello, I?m collecting statistics from a vtkPolyData, they?re bi-variate pdfs, and I would like to plot them in a 2D contour plot. I would like to avoid to add additional dependencies in the project (as matplotlib-cpp for example) if possible? Is it possible to achieve something similar to the matplotlib contourf method in VTK? So what I would like to achieve is a filter that takes tabular data in input and renders them in a 2D `contourf` plot. Thanks in advance, _ -. .? |???? ', ; |?????? ?? |????????? RdB ,., |?????? .' '. |???? -' `? https://rdb.is -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Sun Sep 23 07:58:37 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Sun, 23 Sep 2018 20:58:37 +0900 Subject: [vtkusers] Translate a vtkCellLocator In-Reply-To: References: Message-ID: Hi, In order to translate a vtkCellLocator, you seem to translate only a bounding box of root octant. However this bounding box cannot be publicly accessible. So it is necessary to create a new class inheriting from a vtkCellLocator and provide access functions to get and set it directly. The following is a simple example. ----- #include #include #include #include #include #include class vtkMyCellLocator : public vtkCellLocator { public: static vtkMyCellLocator *New(); vtkSetVectorMacro(Bounds,double,6); vtkGetVectorMacro(Bounds,double,6); }; vtkStandardNewMacro(vtkMyCellLocator); int main(int, char *[]) { auto sphereSource = vtkSmartPointer::New(); sphereSource->Update(); // Create the tree auto cellLocator = vtkSmartPointer::New(); cellLocator->SetDataSet(sphereSource->GetOutput()); cellLocator->BuildLocator(); double translate[3] = {0.0, 0, 0}; auto transform = vtkSmartPointer::New(); transform->Translate(translate); auto transformFilter = vtkSmartPointer::New(); transformFilter->SetTransform(transform); transformFilter->SetInputConnection(sphereSource->GetOutputPort()); transformFilter->Update(); cellLocator->SetDataSet(transformFilter->GetOutput()); double bounds[6]; cellLocator->GetBounds(bounds); for (int i = 0; i < 3; ++i) { bounds[2*i] += translate[i]; bounds[2*i+1] += translate[i]; } cellLocator->SetBounds(bounds); double testPoint[3] = {2.0, 0.0, 0.0}; //Find the closest points to TestPoint double closestPoint[3];//the coordinates of the closest point will be returned here double closestPointDist2; //the squared distance to the closest point will be returned here vtkIdType cellId; //the cell id of the cell containing the closest point will be returned here int subId; //this is rarely used (in triangle strips only, I believe) cellLocator->FindClosestPoint(testPoint, closestPoint, cellId, subId, closestPointDist2); std::cout << "Coordinates of closest point: " << closestPoint[0] << " " << closestPoint[1] << " " << closestPoint[2] << std::endl; std::cout << "Squared distance to closest point: " << closestPointDist2 << std::endl; std::cout << "CellId: " << cellId << std::endl; return EXIT_SUCCESS; } ----- Regards, 2018?9?22?(?) 4:07 Federico Milano : > > Hi. I would need to translate a vtkCellLocator, without rebuilding it entirely. I suppose that it should be possible to apply an offset to all the buckets in the octtree. Do you know if is it possible to do this (or to apply a translation to any other cell locator structure) with the tools provided by vtk? > > Thanks in advance! > > Federico > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From zihan_zhuo at hotmail.com Sun Sep 23 10:24:48 2018 From: zihan_zhuo at hotmail.com (Zhuo Zihan) Date: Sun, 23 Sep 2018 14:24:48 +0000 Subject: [vtkusers] Set opacity of PLY models Message-ID: Dear all, I load a PLY model using vtkPLYReader. When apply SetOpacity(0.5), the PLY model disappeared. I try to create a default texture to the PLY model, but it not work. What's wrong with it? Thanks a lot! -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sun Sep 23 12:15:33 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 23 Sep 2018 10:15:33 -0600 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: Message-ID: Hi Berti, Thanks for the code, I'm sure that people will find it useful. The vtkImageStencilData class isn't described in much detail in the VTK documentation, but I can provide a brief description. The vtkImageStencilData object stores each raster-line of a binary image as a list of (begin, end) pairs. That is, each raster line has zero or more non-overlapping (begin, end) pairs. When vtkImageStencil operates on an image, it simply iterates through the (begin, end) pairs to figure out what parts of the image to copy. One way to think about this is that if the original binary image volume is stored as O(n^3) voxels, the vtkImageStencilData stores O(n^2) values. When a vtkImageStencilData is created, it allocates enough memory to store one (begin, end) pair per raster line, since this matches the most common use case (i.e. a mask that corresponds to a convex object). Thereafter it performs additional allocations as necessary. As for vtkPolyDataToImageStencil, it works by cutting your STL object along each XY plane to create polygons (zero or more polygons per slice), and then it rasterizes each polygon to create the (begin, end) pairs for each raster line. One comment about your code: it would be more efficient to use vtkImageStencilToImage instead of vtkImageStencil and vtkImageCast. The vtkImageStencilToImage filter requires only one input (the stencil), i.e. it doesn't require 'binaryLabelMap' as input. Also, you can set the data type of the image that it produces as output, so it doesn't have to be followed by a cast. Cheers, - David On Sat, Sep 22, 2018 at 10:29 PM Berti Kr?ger wrote: > Hi all. > > > I am very sorry to revive this ancient thread. > > > But i thought that maybe it could help other vtk users in the future to > have a compilable and working example of the final result. If someone > thinks that this code could be useful as an vtk example then feel free to > modify / correct / pimp / add this to the vtk examples on github. > > > I adapted the 3D slicer vtk code Csaba has pointed me to and incorporated > the hints from David and everything works like a charm: > > > > The whole procedure is incredibly simple. Basically the vtkPolyData of > the mesh is converted via the vtkPolyDataToImageStencil filter to a > vtkImageStencil and the rest of the whole magic is only done by the > vtkImageStencil filter: > > > *// Convert stencil to image* > *vtkNew stencil;* > *stencil->SetInputData(binaryLabelMap);* > *stencil->SetStencilConnection(polyDataToImageStencil->GetOutputPort());* > *stencil->ReverseStencilOn();* > *stencil->SetBackgroundValue(1); // General foreground value is 1 > (background value because of reverse **stencil)* > > I would really like to know very roughly how the vtkImageStencil works > internally without digging through all of the source code. Because it is > really fast (some kind of rasterization maybe ?). If someone could drop me > a line on how it works only in principle that would be really great. > > > So thanks again to Bill, Csaba, David, Elvis and everyone else on this > thread. > > > > Kind regards, > > > Berti > > > > PS: Example code, CMakeLists and example STL mesh are attached > > ------------------------------ > *Von:* Csaba Pinter > *Gesendet:* Montag, 11. Juni 2018 12:45 > *An:* Berti Kr?ger > *Cc:* vtkusers at vtk.org > *Betreff:* RE: [vtkusers] Solid Voxelization with VTK > > > Hi Berti, > > > > That code is under BSD-style license, so you?re free to do basically > anything with it. This implementation is already pretty simple; just a > concatenation of several VTK filters, so you can just give it a try by > copy-pasting the relevant part of that function into your code and see if > it works. If you?re interested in using the vtkSegmentation library, let me > know though! > > > > Best, > > csaba > > > > *From:* Berti Kr?ger > *Sent:* Monday, June 11, 2018 02:46 > *To:* Csaba Pinter ; David Gobbi < > david.gobbi at gmail.com> > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Solid Voxelization with VTK > > > > Hi Csaba, > > > > thank you very much for you answer and for offering your help. > > > > I already have looked at it and i think if no simpler option will come up, > i will give it a try (hoping not to have to change too much to get it > working with my pipeline since i am an absolute vtk beginner :-) ). > > > > How is this code licensed ? (i am only doing research work at the moment, > the whole project i am working on is internal and just for testing and part > of some larger work, it might be open sourced one day in the very far > future but could even be not at all and it will never be used > commercially). > > > > > > Regards > > > > Berti > > > > > > Am 05.06.2018 um 16:14 schrieb Csaba Pinter: > > Hi Berti, > > > > There is a pretty robust conversion algorithm implemented within 3D Slicer > but using solely VTK: > > > https://github.com/Slicer/Slicer/blob/master/Libs/vtkSegmentationCore/vtkClosedSurfaceToBinaryLabelmapConversionRule.cxx#L118 > > > It consists of a short pipeline of standard VTK filters (some > preprocessing then vtkPolyDataToImageStencil and vtkImageStencil). > > > > Let me know if you have any questions. > > > > csaba > > > > > > *From:* vtkusers > *On Behalf Of *Berti Kr?ger > *Sent:* Tuesday, June 5, 2018 03:26 > *To:* David Gobbi > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Solid Voxelization with VTK > > > > Hi David, > > > > thank you very much for your help. > > > > I tried the example from your link. Unfortunately the result is same as > using the vtkVoxelModeller: > > > > [image: Screenshot result voxelization] > I get only a voxelization of the surface. The interior of the voxelized > cone is still hollow and not filled with voxels (at least this is implied > by the visualization). > > > > For the visualization i use Bill Lorensen's example code from here: > > > https://lorensen.github.io/VTKExamples/site/Cxx/Medical/GenerateCubesFromLabels/ > > > > > > > I have attached this small example which compiles with VTK 8.1 to show the > issue. It basicly only consist of the example code from your link ( > https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataToImageData/ > ) > and the visualization code from the Bill Lorensen's example from the link > above. I have not changed much. > > > > Any idea what is going wrong or what can i do get also voxelization of the > interior (solid voxelization)? > > > > Thank you very much in advance. > > > > > > Regards > > > > Berti > > > > PolyDataToImageData - lorensen.github.io > > > lorensen.github.io > > If VTK is not installed but compiled on your system, you will need to > specify the path to your VTK build: > > > > > > GenerateCubesFromLabels - GitHub Pages > > > lorensen.github.io > > Usage: GenerateCubesFromLabels FullHead.mhd StartLabel EndLabel where > InputVolume is a meta file containing a 3 volume of discrete labels. > > > > > ------------------------------ > > *Von:* David Gobbi > *Gesendet:* Montag, 28. Mai 2018 23:13 > *An:* Berti Kr?ger > *Cc:* vtkusers at vtk.org > *Betreff:* Re: [vtkusers] Solid Voxelization with VTK > > > > Hi Berti, > > > > If its a triangulated surface that you want to fill with voxels, use > vtkPolyDataToImageStencil: > > > https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataToImageData/ > > > PolyDataToImageData - lorensen.github.io > > > lorensen.github.io > > If VTK is not installed but compiled on your system, you will need to > specify the path to your VTK build: > > > > > > If its a mesh of 3D elements and you want to sample the elements to create > voxels, try vtkResampleToImage. > > > > - David > > > > > > > > On Mon, May 28, 2018 at 4:41 PM, Berti Kr?ger > wrote: > > Hello Everyone. > > For my Project i have to voxelize a 3D-Triangle-Mesh. I already found the > vtkVoxelModeller which, while somewhat slow (only around 200 Triangles per > second), works, but only voxelizes the outer shell where the mesh boundary > triangles are. The inner part of the mesh stays hollow. > > Is there some way to get solid voxelization of 3D-Triangle-Meshes out of > the > box with VTK ? > > > Thank you very much in advance, > > Berti > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 62429 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dragon.jpg Type: image/jpeg Size: 65894 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 62429 bytes Desc: not available URL: From marcosaito at gmail.com Sun Sep 23 12:53:49 2018 From: marcosaito at gmail.com (Saitodepaula) Date: Sun, 23 Sep 2018 09:53:49 -0700 (MST) Subject: [vtkusers] Create many instances of vtkContourWidget In-Reply-To: <1535968389182-0.post@n5.nabble.com> References: <1535968389182-0.post@n5.nabble.com> Message-ID: <1537721629103-0.post@n5.nabble.com> Yes, it probably is related to the VKT release. I was using VTK 6.3 that comes with Anaconda 2 (Python 2.7). Porting my code to VTK 8.1 in C++ solved the issue. Thanks!I've also marked your answer on StackOverflow as the correct one. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrewkeeling at hotmail.com Sun Sep 23 14:24:28 2018 From: andrewkeeling at hotmail.com (andyjk) Date: Sun, 23 Sep 2018 11:24:28 -0700 (MST) Subject: [vtkusers] Reverse color in vtkScalarsToColors? In-Reply-To: <1480954434047-5741422.post@n5.nabble.com> References: <1480897993963-5741412.post@n5.nabble.com> <1480912401660-5741414.post@n5.nabble.com> <1480954434047-5741422.post@n5.nabble.com> Message-ID: <1537727068235-0.post@n5.nabble.com> I have a strange bug related to this. If I create a custom vtkLookupTable as suggested above, it all works - as long as I compile in ReleaseWithDebugInfo If I build with Release the software crashes when I try to use the custom look up table. Identical code. Windows with VS2017. The fact it works in RelWithDebug makes it hard to debug! Anyone have any ideas? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bill.lorensen at gmail.com Sun Sep 23 14:31:22 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 23 Sep 2018 11:31:22 -0700 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: Message-ID: Looks like I should add some examples! On Sun, Sep 23, 2018, 9:15 AM David Gobbi wrote: > Hi Berti, > > Thanks for the code, I'm sure that people will find it useful. The > vtkImageStencilData class isn't described in much detail in the VTK > documentation, but I can provide a brief description. > > The vtkImageStencilData object stores each raster-line of a binary image > as a list of (begin, end) pairs. That is, each raster line has zero or > more non-overlapping (begin, end) pairs. When vtkImageStencil operates on > an image, it simply iterates through the (begin, end) pairs to figure out > what parts of the image to copy. One way to think about this is that if > the original binary image volume is stored as O(n^3) voxels, the > vtkImageStencilData stores O(n^2) values. > > When a vtkImageStencilData is created, it allocates enough memory to store > one (begin, end) pair per raster line, since this matches the most common > use case (i.e. a mask that corresponds to a convex object). Thereafter it > performs additional allocations as necessary. > > As for vtkPolyDataToImageStencil, it works by cutting your STL object > along each XY plane to create polygons (zero or more polygons per slice), > and then it rasterizes each polygon to create the (begin, end) pairs for > each raster line. > > > One comment about your code: it would be more efficient to use > vtkImageStencilToImage instead of vtkImageStencil and vtkImageCast. The > vtkImageStencilToImage filter requires only one input (the stencil), i.e. > it doesn't require 'binaryLabelMap' as input. Also, you can set the data > type of the image that it produces as output, so it doesn't have to be > followed by a cast. > > Cheers, > - David > > On Sat, Sep 22, 2018 at 10:29 PM Berti Kr?ger > wrote: > >> Hi all. >> >> >> I am very sorry to revive this ancient thread. >> >> >> But i thought that maybe it could help other vtk users in the future to >> have a compilable and working example of the final result. If someone >> thinks that this code could be useful as an vtk example then feel free to >> modify / correct / pimp / add this to the vtk examples on github. >> >> >> I adapted the 3D slicer vtk code Csaba has pointed me to and incorporated >> the hints from David and everything works like a charm: >> >> >> >> The whole procedure is incredibly simple. Basically the vtkPolyData of >> the mesh is converted via the vtkPolyDataToImageStencil filter to a >> vtkImageStencil and the rest of the whole magic is only done by the >> vtkImageStencil filter: >> >> >> *// Convert stencil to image* >> *vtkNew stencil;* >> *stencil->SetInputData(binaryLabelMap);* >> *stencil->SetStencilConnection(polyDataToImageStencil->GetOutputPort());* >> *stencil->ReverseStencilOn();* >> *stencil->SetBackgroundValue(1); // General foreground value is 1 >> (background value because of reverse **stencil)* >> >> I would really like to know very roughly how the vtkImageStencil works >> internally without digging through all of the source code. Because it is >> really fast (some kind of rasterization maybe ?). If someone could drop me >> a line on how it works only in principle that would be really great. >> >> >> So thanks again to Bill, Csaba, David, Elvis and everyone else on this >> thread. >> >> >> >> Kind regards, >> >> >> Berti >> >> >> >> PS: Example code, CMakeLists and example STL mesh are attached >> >> ------------------------------ >> *Von:* Csaba Pinter >> *Gesendet:* Montag, 11. Juni 2018 12:45 >> *An:* Berti Kr?ger >> *Cc:* vtkusers at vtk.org >> *Betreff:* RE: [vtkusers] Solid Voxelization with VTK >> >> >> Hi Berti, >> >> >> >> That code is under BSD-style license, so you?re free to do basically >> anything with it. This implementation is already pretty simple; just a >> concatenation of several VTK filters, so you can just give it a try by >> copy-pasting the relevant part of that function into your code and see if >> it works. If you?re interested in using the vtkSegmentation library, let me >> know though! >> >> >> >> Best, >> >> csaba >> >> >> >> *From:* Berti Kr?ger >> *Sent:* Monday, June 11, 2018 02:46 >> *To:* Csaba Pinter ; David Gobbi < >> david.gobbi at gmail.com> >> *Cc:* vtkusers at vtk.org >> *Subject:* Re: [vtkusers] Solid Voxelization with VTK >> >> >> >> Hi Csaba, >> >> >> >> thank you very much for you answer and for offering your help. >> >> >> >> I already have looked at it and i think if no simpler option will come >> up, i will give it a try (hoping not to have to change too much to get it >> working with my pipeline since i am an absolute vtk beginner :-) ). >> >> >> >> How is this code licensed ? (i am only doing research work at the moment, >> the whole project i am working on is internal and just for testing and part >> of some larger work, it might be open sourced one day in the very far >> future but could even be not at all and it will never be used >> commercially). >> >> >> >> >> >> Regards >> >> >> >> Berti >> >> >> >> >> >> Am 05.06.2018 um 16:14 schrieb Csaba Pinter: >> >> Hi Berti, >> >> >> >> There is a pretty robust conversion algorithm implemented within 3D >> Slicer but using solely VTK: >> >> >> https://github.com/Slicer/Slicer/blob/master/Libs/vtkSegmentationCore/vtkClosedSurfaceToBinaryLabelmapConversionRule.cxx#L118 >> >> >> It consists of a short pipeline of standard VTK filters (some >> preprocessing then vtkPolyDataToImageStencil and vtkImageStencil). >> >> >> >> Let me know if you have any questions. >> >> >> >> csaba >> >> >> >> >> >> *From:* vtkusers >> *On Behalf Of *Berti Kr?ger >> *Sent:* Tuesday, June 5, 2018 03:26 >> *To:* David Gobbi >> *Cc:* vtkusers at vtk.org >> *Subject:* Re: [vtkusers] Solid Voxelization with VTK >> >> >> >> Hi David, >> >> >> >> thank you very much for your help. >> >> >> >> I tried the example from your link. Unfortunately the result is same as >> using the vtkVoxelModeller: >> >> >> >> [image: Screenshot result voxelization] >> I get only a voxelization of the surface. The interior of the voxelized >> cone is still hollow and not filled with voxels (at least this is implied >> by the visualization). >> >> >> >> For the visualization i use Bill Lorensen's example code from here: >> >> >> https://lorensen.github.io/VTKExamples/site/Cxx/Medical/GenerateCubesFromLabels/ >> >> >> >> >> >> >> I have attached this small example which compiles with VTK 8.1 to show >> the issue. It basicly only consist of the example code from your link ( >> https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataToImageData/ >> ) >> and the visualization code from the Bill Lorensen's example from the link >> above. I have not changed much. >> >> >> >> Any idea what is going wrong or what can i do get also voxelization of >> the interior (solid voxelization)? >> >> >> >> Thank you very much in advance. >> >> >> >> >> >> Regards >> >> >> >> Berti >> >> >> >> PolyDataToImageData - lorensen.github.io >> >> >> lorensen.github.io >> >> If VTK is not installed but compiled on your system, you will need to >> specify the path to your VTK build: >> >> >> >> >> >> GenerateCubesFromLabels - GitHub Pages >> >> >> lorensen.github.io >> >> Usage: GenerateCubesFromLabels FullHead.mhd StartLabel EndLabel where >> InputVolume is a meta file containing a 3 volume of discrete labels. >> >> >> >> >> ------------------------------ >> >> *Von:* David Gobbi >> *Gesendet:* Montag, 28. Mai 2018 23:13 >> *An:* Berti Kr?ger >> *Cc:* vtkusers at vtk.org >> *Betreff:* Re: [vtkusers] Solid Voxelization with VTK >> >> >> >> Hi Berti, >> >> >> >> If its a triangulated surface that you want to fill with voxels, use >> vtkPolyDataToImageStencil: >> >> >> https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataToImageData/ >> >> >> PolyDataToImageData - lorensen.github.io >> >> >> lorensen.github.io >> >> If VTK is not installed but compiled on your system, you will need to >> specify the path to your VTK build: >> >> >> >> >> >> If its a mesh of 3D elements and you want to sample the elements to >> create voxels, try vtkResampleToImage. >> >> >> >> - David >> >> >> >> >> >> >> >> On Mon, May 28, 2018 at 4:41 PM, Berti Kr?ger >> wrote: >> >> Hello Everyone. >> >> For my Project i have to voxelize a 3D-Triangle-Mesh. I already found the >> vtkVoxelModeller which, while somewhat slow (only around 200 Triangles per >> second), works, but only voxelizes the outer shell where the mesh boundary >> triangles are. The inner part of the mesh stays hollow. >> >> Is there some way to get solid voxelization of 3D-Triangle-Meshes out of >> the >> box with VTK ? >> >> >> Thank you very much in advance, >> >> Berti >> >> >> > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Sun Sep 23 16:07:12 2018 From: lasso at queensu.ca (Andras Lasso) Date: Sun, 23 Sep 2018 20:07:12 +0000 Subject: [vtkusers] Reverse color in vtkScalarsToColors? In-Reply-To: <1537727068235-0.post@n5.nabble.com> References: <1480897993963-5741412.post@n5.nabble.com> <1480912401660-5741414.post@n5.nabble.com> <1480954434047-5741422.post@n5.nabble.com> <1537727068235-0.post@n5.nabble.com> Message-ID: Most common root cause of different behavior in Release/Debug mode is that in Debug mode variables are initialized to 0, while in Release mode there is no value initialization. Try to use AppVerifier tool. It can often help the software crash in Debug or RelWithDebInfo mode that otherwise would just crash in Release mode. Andras -----Original Message----- From: vtkusers On Behalf Of andyjk Sent: Sunday, September 23, 2018 2:24 PM To: vtkusers at vtk.org Subject: Re: [vtkusers] Reverse color in vtkScalarsToColors? I have a strange bug related to this. If I create a custom vtkLookupTable as suggested above, it all works - as long as I compile in ReleaseWithDebugInfo If I build with Release the software crashes when I try to use the custom look up table. Identical code. Windows with VS2017. The fact it works in RelWithDebug makes it hard to debug! Anyone have any ideas? -- Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Classo%40queensu.ca%7Cf6bc45fe40694e37f3ae08d62181ce18%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636733238726404349&sdata=ScBS9pm2%2BoRwaJqGlyLUJQE7Q52BgpEi0IIB%2Fp4JRXo%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7Cf6bc45fe40694e37f3ae08d62181ce18%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636733238726404349&sdata=35cgI6JnYjWoOVVx5RsU4evbDuVqYmeQQiLBPoZiV4o%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7Cf6bc45fe40694e37f3ae08d62181ce18%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636733238726404349&sdata=v4XyrBSzVnaPiBib6T4WQ6bNtttk9FWUSIkGf%2B55yiU%3D&reserved=0 Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7Cf6bc45fe40694e37f3ae08d62181ce18%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636733238726404349&sdata=6tsI9fJuY7Yo0M34FaPyfYxgdkuc0GCkiTA2LyYrTIU%3D&reserved=0 Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cf6bc45fe40694e37f3ae08d62181ce18%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636733238726404349&sdata=Aswx6xkPEutnoJyHRRMwCuaepR5Fsv6rdo0fsgtCseg%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cf6bc45fe40694e37f3ae08d62181ce18%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636733238726404349&sdata=AAwitM2SMsghl%2BPazSbwZPj9%2BhVZ7OUMlPd4%2BALy5R0%3D&reserved=0 From rickfrank at me.com Sun Sep 23 17:16:19 2018 From: rickfrank at me.com (Richard Frank) Date: Sun, 23 Sep 2018 21:16:19 +0000 (GMT) Subject: [vtkusers] vtk.js volumeController transferFunctions Message-ID: Hi, Is there a way to modify the list of transfer functions in the volumeController? We'd like to at least add our own to the list... Thanks Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From berti_krueger at hotmail.com Sun Sep 23 23:05:00 2018 From: berti_krueger at hotmail.com (=?Windows-1252?Q?Berti_Kr=FCger?=) Date: Mon, 24 Sep 2018 03:05:00 +0000 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: , Message-ID: Hi David, thank you very much again for your great explanations (i looked at the vtkImageStencilData class description before writing the e-mail and as you have pointed out it is really missing some explanations on how it works internally) and of course your hints to improve the example code! As you have written, i changed my code from // Convert stencil to image vtkNew stencil; stencil->SetInputData(binaryLabelMap); stencil->SetStencilConnection(polyDataToImageStencil->GetOutputPort()); stencil->ReverseStencilOn(); stencil->SetBackgroundValue(1); // General foreground value is 1 (background value because of reverse stencil) // Save result to output vtkNew imageCast; imageCast->SetInputConnection(stencil->GetOutputPort()); imageCast->SetOutputScalarTypeToUnsignedChar(); imageCast->Update(); binaryLabelMap->ShallowCopy(imageCast->GetOutput()); To: // Convert stencil to image vtkNew imageStencilToImage; imageStencilToImage->SetInputConnection(polyDataToImageStencil->GetOutputPort()); imageStencilToImage->SetOutsideValue(0); imageStencilToImage->SetInsideValue(1); imageStencilToImage->Update(); // Save result to output binaryLabelMap->DeepCopy(imageStencilToImage->GetOutput()); which is really much shorter and better. I also found out that i can change the vtkImage initialization code from // fill the image with background voxels: vtkIdType count = voxelImage->GetNumberOfPoints(); for (vtkIdType i = 0; i < count; ++i) { voxelImage->GetPointData()->GetScalars()->SetTuple1(i, outval); } to simply: voxelImage->GetPointData()->GetScalars()->Fill(outval); I attached the improved version and the CMakeLists file. So far it works really great and is quite fast: [cid:c6c7244e-ff20-474f-a694-4c683d98b856] But one thing is that i still get problems with some kind of meshes (i guess meshes which are not closed or watertight): Alien Queen (minor problems): [cid:23b830f9-073a-45d1-bad1-dddd550e2d69] [cid:745f1387-542f-4562-8455-7e8b13d7ba62] Eiffel Tower (completely wrong): [cid:6c47ec8d-40cf-4b31-8183-62ff2a26a205][cid:b5391948-c2d3-4f6f-a54e-acd497194c10] Maybe this could be solved by rasterizing the mesh in different directions and doing some kind of majority voting if a voxel is set or not. I solved these cases by implementing a raycasting solution using a generalization of the point in polygon algorithm and // load STL file vtkNew reader; reader->SetFileName("eiffel_tower_small.stl"); reader->Update(); vtkNew pd; pd->DeepCopy(reader->GetOutput()); // compute bounds for stl mesh polydata double bounds[6]; pd->GetBounds(bounds); /* // Create the locator (obb tree) vtkNew obbTree; tree->SetDataSet(pd); tree->BuildLocator(); */ // Create the locator (modified bsp tree) vtkNew bspTree; bspTree->SetDataSet(pd); bspTree->BuildLocator(); constexpr int numSamples = 32; //#pragma omp parallel for // not for vtkModifiedBSPTree !! for(int x = 0; x < imageResolutionX; x++) { for(int y = 0; y < imageResolutionY; y++) { for(int z = 0; z < imageResolutionZ; z++) { // pick an arbitrary sampling direction vtkVector3f ray_direction(0.0, 0.0, 0.0); vtkVector3f ray_direction2(0.0, 0.0, 0.0); // find world space position of the voxel constexpr int X_MIN = 0; constexpr int Y_MIN = 2; constexpr int Z_MIN = 4; vtkVector3f ray_origin( bounds[X_MIN] + spacing[0] * x, bounds[Y_MIN] + spacing[1] * y, bounds[Z_MIN] + spacing[2] * z); // randomly sample 3D space by sending rays in randomized directions unsigned int numIntersections = 0; int id = 0; for (int j = 0; j < numSamples; ++j) { // compute the random direction. Convert from polar to // euclidean to get an even distribution float theta = 2 * M_PI * random(genenerator); float phi = acos(1 - 2 * random(generator)); ray_direction[0] = sin(phi) * cos(theta); ray_direction[1] = sin(phi) * sin(theta); ray_direction[2] = cos(phi); // check if the voxel is inside of the mesh. vtkNew intersectPoints; double lineP0[3] = {ray_origin[0], ray_origin[1], ray_origin[2]}; double lineP1[3] = {ray_origin[0] + ray_direction[0] * 10000.0, ray_origin[1] + ray_direction[1] * 10000.0, ray_origin[2] + ray_direction[2] * 10000.0}; //obbTree->IntersectWithLine(lineP0, lineP1, intersectPoints, NULL); bspTree->IntersectWithLine(lineP0, lineP1, 0.0001, intersectPoints, NULL); if (intersectPoints->GetNumberOfPoints() % 2 == 1) numIntersections++; } // save answer unsigned int index = x + y * imageResolutionX + z * imageResolutionX * imageResolutionY; float hitPercentage = static_cast(numIntersections) / static_cast(numSamples); if(hitPercentage >= 0.5) voxelImage[index] = inval; else voxelImage[index] = outval; } } } ________________________________ Von: David Gobbi Gesendet: Sonntag, 23. September 2018 16:15 An: Berti Kr?ger Cc: Csaba Pinter; VTK Users Betreff: Re: [vtkusers] Solid Voxelization with VTK Hi Berti, Thanks for the code, I'm sure that people will find it useful. The vtkImageStencilData class isn't described in much detail in the VTK documentation, but I can provide a brief description. The vtkImageStencilData object stores each raster-line of a binary image as a list of (begin, end) pairs. That is, each raster line has zero or more non-overlapping (begin, end) pairs. When vtkImageStencil operates on an image, it simply iterates through the (begin, end) pairs to figure out what parts of the image to copy. One way to think about this is that if the original binary image volume is stored as O(n^3) voxels, the vtkImageStencilData stores O(n^2) values. When a vtkImageStencilData is created, it allocates enough memory to store one (begin, end) pair per raster line, since this matches the most common use case (i.e. a mask that corresponds to a convex object). Thereafter it performs additional allocations as necessary. As for vtkPolyDataToImageStencil, it works by cutting your STL object along each XY plane to create polygons (zero or more polygons per slice), and then it rasterizes each polygon to create the (begin, end) pairs for each raster line. One comment about your code: it would be more efficient to use vtkImageStencilToImage instead of vtkImageStencil and vtkImageCast. The vtkImageStencilToImage filter requires only one input (the stencil), i.e. it doesn't require 'binaryLabelMap' as input. Also, you can set the data type of the image that it produces as output, so it doesn't have to be followed by a cast. Cheers, - David On Sat, Sep 22, 2018 at 10:29 PM Berti Kr?ger > wrote: Hi all. I am very sorry to revive this ancient thread. But i thought that maybe it could help other vtk users in the future to have a compilable and working example of the final result. If someone thinks that this code could be useful as an vtk example then feel free to modify / correct / pimp / add this to the vtk examples on github. I adapted the 3D slicer vtk code Csaba has pointed me to and incorporated the hints from David and everything works like a charm: [cid:795e083b-ffaa-4d6b-8b3f-97deb637b01c] The whole procedure is incredibly simple. Basically the vtkPolyData of the mesh is converted via the vtkPolyDataToImageStencil filter to a vtkImageStencil and the rest of the whole magic is only done by the vtkImageStencil filter: // Convert stencil to image vtkNew stencil; stencil->SetInputData(binaryLabelMap); stencil->SetStencilConnection(polyDataToImageStencil->GetOutputPort()); stencil->ReverseStencilOn(); stencil->SetBackgroundValue(1); // General foreground value is 1 (background value because of reverse stencil) I would really like to know very roughly how the vtkImageStencil works internally without digging through all of the source code. Because it is really fast (some kind of rasterization maybe ?). If someone could drop me a line on how it works only in principle that would be really great. So thanks again to Bill, Csaba, David, Elvis and everyone else on this thread. Kind regards, Berti PS: Example code, CMakeLists and example STL mesh are attached ________________________________ Von: Csaba Pinter > Gesendet: Montag, 11. Juni 2018 12:45 An: Berti Kr?ger Cc: vtkusers at vtk.org Betreff: RE: [vtkusers] Solid Voxelization with VTK Hi Berti, That code is under BSD-style license, so you?re free to do basically anything with it. This implementation is already pretty simple; just a concatenation of several VTK filters, so you can just give it a try by copy-pasting the relevant part of that function into your code and see if it works. If you?re interested in using the vtkSegmentation library, let me know though! Best, csaba From: Berti Kr?ger > Sent: Monday, June 11, 2018 02:46 To: Csaba Pinter >; David Gobbi > Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Solid Voxelization with VTK Hi Csaba, thank you very much for you answer and for offering your help. I already have looked at it and i think if no simpler option will come up, i will give it a try (hoping not to have to change too much to get it working with my pipeline since i am an absolute vtk beginner :-) ). How is this code licensed ? (i am only doing research work at the moment, the whole project i am working on is internal and just for testing and part of some larger work, it might be open sourced one day in the very far future but could even be not at all and it will never be used commercially). Regards Berti Am 05.06.2018 um 16:14 schrieb Csaba Pinter: Hi Berti, There is a pretty robust conversion algorithm implemented within 3D Slicer but using solely VTK: https://github.com/Slicer/Slicer/blob/master/Libs/vtkSegmentationCore/vtkClosedSurfaceToBinaryLabelmapConversionRule.cxx#L118 It consists of a short pipeline of standard VTK filters (some preprocessing then vtkPolyDataToImageStencil and vtkImageStencil). Let me know if you have any questions. csaba From: vtkusers On Behalf Of Berti Kr?ger Sent: Tuesday, June 5, 2018 03:26 To: David Gobbi Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Solid Voxelization with VTK Hi David, thank you very much for your help. I tried the example from your link. Unfortunately the result is same as using the vtkVoxelModeller: [Screenshot result voxelization] I get only a voxelization of the surface. The interior of the voxelized cone is still hollow and not filled with voxels (at least this is implied by the visualization). For the visualization i use Bill Lorensen's example code from here: https://lorensen.github.io/VTKExamples/site/Cxx/Medical/GenerateCubesFromLabels/ I have attached this small example which compiles with VTK 8.1 to show the issue. It basicly only consist of the example code from your link (https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataToImageData/) and the visualization code from the Bill Lorensen's example from the link above. I have not changed much. Any idea what is going wrong or what can i do get also voxelization of the interior (solid voxelization)? Thank you very much in advance. Regards Berti PolyDataToImageData - lorensen.github.io lorensen.github.io If VTK is not installed but compiled on your system, you will need to specify the path to your VTK build: GenerateCubesFromLabels - GitHub Pages lorensen.github.io Usage: GenerateCubesFromLabels FullHead.mhd StartLabel EndLabel where InputVolume is a meta file containing a 3 volume of discrete labels. ________________________________ Von: David Gobbi > Gesendet: Montag, 28. Mai 2018 23:13 An: Berti Kr?ger Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Solid Voxelization with VTK Hi Berti, If its a triangulated surface that you want to fill with voxels, use vtkPolyDataToImageStencil: https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataToImageData/ PolyDataToImageData - lorensen.github.io lorensen.github.io If VTK is not installed but compiled on your system, you will need to specify the path to your VTK build: If its a mesh of 3D elements and you want to sample the elements to create voxels, try vtkResampleToImage. - David On Mon, May 28, 2018 at 4:41 PM, Berti Kr?ger > wrote: Hello Everyone. For my Project i have to voxelize a 3D-Triangle-Mesh. I already found the vtkVoxelModeller which, while somewhat slow (only around 200 Triangles per second), works, but only voxelizes the outer shell where the mesh boundary triangles are. The inner part of the mesh stays hollow. Is there some way to get solid voxelization of 3D-Triangle-Meshes out of the box with VTK ? Thank you very much in advance, Berti -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_small.jpg Type: image/jpeg Size: 39385 bytes Desc: eiffel_tower_small.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_small_voxelization.jpg Type: image/jpeg Size: 36468 bytes Desc: eiffel_tower_small_voxelization.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: alienqueen.jpg Type: image/jpeg Size: 86457 bytes Desc: alienqueen.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: alienqueen_voxelization.jpg Type: image/jpeg Size: 65454 bytes Desc: alienqueen_voxelization.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: tentacle.jpg Type: image/jpeg Size: 67748 bytes Desc: tentacle.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PolyDataToImageDataVisualizationSTL.cxx Type: text/x-c++src Size: 7981 bytes Desc: PolyDataToImageDataVisualizationSTL.cxx URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CMakeLists.txt URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_small.stl Type: application/sla Size: 759184 bytes Desc: eiffel_tower_small.stl URL: From berti_krueger at hotmail.com Sun Sep 23 23:34:52 2018 From: berti_krueger at hotmail.com (=?utf-8?B?QmVydGkgS3LDvGdlcg==?=) Date: Mon, 24 Sep 2018 03:34:52 +0000 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: , Message-ID: ... Sorry, i accidently pushed the send button before finishing the e-mail ? (continued) This "robust voxelization" works always but is of course a lot slower: [cid:eac05315-05e2-4d27-838a-096e328e9bd3] [cid:5c567da7-b43e-4231-aec0-4d667e07b003] Using the vtkModifiedBSPTree instead of the vtkOBBTree the voxelization gets around 4 times faster. But the vtkModifiedBSPTree crashes when using OpenMP, so i am not able to use it with SMP, which gives the vtkOBBTree an advantage when using multiple threads: #pragma omp parallel for // crashs with vtkModifiedBSPTree, works with vtkOBBTree for(int x = 0; x < imageResolutionX; x++) ... [cid:e95dcabe-3ecd-4431-93f0-a1b847d5e7ab] [cid:51ed129f-5263-4220-8805-77c7a23b86f1] I was not able to get the vtkModifiedBspTree running with SMP. Is there something i can do here? The vtkModifiedBSPTree also starts to get memory hungry with larger meshes: [cid:3204c5ed-446a-4a88-a7dd-2d255efd1846] [cid:541b0f48-b9d4-49dd-9706-a72b73918370] Are there any alternative geometric datastructures in VTK for computing ray / line triangle / cell intersections? Thank you very much for all of your help. Cheers, Berti ________________________________ Von: David Gobbi Gesendet: Sonntag, 23. September 2018 16:15 An: Berti Kr?ger Cc: Csaba Pinter; VTK Users Betreff: Re: [vtkusers] Solid Voxelization with VTK Hi Berti, Thanks for the code, I'm sure that people will find it useful. The vtkImageStencilData class isn't described in much detail in the VTK documentation, but I can provide a brief description. The vtkImageStencilData object stores each raster-line of a binary image as a list of (begin, end) pairs. That is, each raster line has zero or more non-overlapping (begin, end) pairs. When vtkImageStencil operates on an image, it simply iterates through the (begin, end) pairs to figure out what parts of the image to copy. One way to think about this is that if the original binary image volume is stored as O(n^3) voxels, the vtkImageStencilData stores O(n^2) values. When a vtkImageStencilData is created, it allocates enough memory to store one (begin, end) pair per raster line, since this matches the most common use case (i.e. a mask that corresponds to a convex object). Thereafter it performs additional allocations as necessary. As for vtkPolyDataToImageStencil, it works by cutting your STL object along each XY plane to create polygons (zero or more polygons per slice), and then it rasterizes each polygon to create the (begin, end) pairs for each raster line. One comment about your code: it would be more efficient to use vtkImageStencilToImage instead of vtkImageStencil and vtkImageCast. The vtkImageStencilToImage filter requires only one input (the stencil), i.e. it doesn't require 'binaryLabelMap' as input. Also, you can set the data type of the image that it produces as output, so it doesn't have to be followed by a cast. Cheers, - David On Sat, Sep 22, 2018 at 10:29 PM Berti Kr?ger > wrote: Hi all. I am very sorry to revive this ancient thread. But i thought that maybe it could help other vtk users in the future to have a compilable and working example of the final result. If someone thinks that this code could be useful as an vtk example then feel free to modify / correct / pimp / add this to the vtk examples on github. I adapted the 3D slicer vtk code Csaba has pointed me to and incorporated the hints from David and everything works like a charm: [cid:795e083b-ffaa-4d6b-8b3f-97deb637b01c] The whole procedure is incredibly simple. Basically the vtkPolyData of the mesh is converted via the vtkPolyDataToImageStencil filter to a vtkImageStencil and the rest of the whole magic is only done by the vtkImageStencil filter: // Convert stencil to image vtkNew stencil; stencil->SetInputData(binaryLabelMap); stencil->SetStencilConnection(polyDataToImageStencil->GetOutputPort()); stencil->ReverseStencilOn(); stencil->SetBackgroundValue(1); // General foreground value is 1 (background value because of reverse stencil) I would really like to know very roughly how the vtkImageStencil works internally without digging through all of the source code. Because it is really fast (some kind of rasterization maybe ?). If someone could drop me a line on how it works only in principle that would be really great. So thanks again to Bill, Csaba, David, Elvis and everyone else on this thread. Kind regards, Berti PS: Example code, CMakeLists and example STL mesh are attached ________________________________ Von: Csaba Pinter > Gesendet: Montag, 11. Juni 2018 12:45 An: Berti Kr?ger Cc: vtkusers at vtk.org Betreff: RE: [vtkusers] Solid Voxelization with VTK Hi Berti, That code is under BSD-style license, so you?re free to do basically anything with it. This implementation is already pretty simple; just a concatenation of several VTK filters, so you can just give it a try by copy-pasting the relevant part of that function into your code and see if it works. If you?re interested in using the vtkSegmentation library, let me know though! Best, csaba From: Berti Kr?ger > Sent: Monday, June 11, 2018 02:46 To: Csaba Pinter >; David Gobbi > Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Solid Voxelization with VTK Hi Csaba, thank you very much for you answer and for offering your help. I already have looked at it and i think if no simpler option will come up, i will give it a try (hoping not to have to change too much to get it working with my pipeline since i am an absolute vtk beginner :-) ). How is this code licensed ? (i am only doing research work at the moment, the whole project i am working on is internal and just for testing and part of some larger work, it might be open sourced one day in the very far future but could even be not at all and it will never be used commercially). Regards Berti Am 05.06.2018 um 16:14 schrieb Csaba Pinter: Hi Berti, There is a pretty robust conversion algorithm implemented within 3D Slicer but using solely VTK: https://github.com/Slicer/Slicer/blob/master/Libs/vtkSegmentationCore/vtkClosedSurfaceToBinaryLabelmapConversionRule.cxx#L118 It consists of a short pipeline of standard VTK filters (some preprocessing then vtkPolyDataToImageStencil and vtkImageStencil). Let me know if you have any questions. csaba From: vtkusers On Behalf Of Berti Kr?ger Sent: Tuesday, June 5, 2018 03:26 To: David Gobbi Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Solid Voxelization with VTK Hi David, thank you very much for your help. I tried the example from your link. Unfortunately the result is same as using the vtkVoxelModeller: [Screenshot result voxelization] I get only a voxelization of the surface. The interior of the voxelized cone is still hollow and not filled with voxels (at least this is implied by the visualization). For the visualization i use Bill Lorensen's example code from here: https://lorensen.github.io/VTKExamples/site/Cxx/Medical/GenerateCubesFromLabels/ I have attached this small example which compiles with VTK 8.1 to show the issue. It basicly only consist of the example code from your link (https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataToImageData/) and the visualization code from the Bill Lorensen's example from the link above. I have not changed much. Any idea what is going wrong or what can i do get also voxelization of the interior (solid voxelization)? Thank you very much in advance. Regards Berti PolyDataToImageData - lorensen.github.io lorensen.github.io If VTK is not installed but compiled on your system, you will need to specify the path to your VTK build: GenerateCubesFromLabels - GitHub Pages lorensen.github.io Usage: GenerateCubesFromLabels FullHead.mhd StartLabel EndLabel where InputVolume is a meta file containing a 3 volume of discrete labels. ________________________________ Von: David Gobbi > Gesendet: Montag, 28. Mai 2018 23:13 An: Berti Kr?ger Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Solid Voxelization with VTK Hi Berti, If its a triangulated surface that you want to fill with voxels, use vtkPolyDataToImageStencil: https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataToImageData/ PolyDataToImageData - lorensen.github.io lorensen.github.io If VTK is not installed but compiled on your system, you will need to specify the path to your VTK build: If its a mesh of 3D elements and you want to sample the elements to create voxels, try vtkResampleToImage. - David On Mon, May 28, 2018 at 4:41 PM, Berti Kr?ger > wrote: Hello Everyone. For my Project i have to voxelize a 3D-Triangle-Mesh. I already found the vtkVoxelModeller which, while somewhat slow (only around 200 Triangles per second), works, but only voxelizes the outer shell where the mesh boundary triangles are. The inner part of the mesh stays hollow. Is there some way to get solid voxelization of 3D-Triangle-Meshes out of the box with VTK ? Thank you very much in advance, Berti -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: alienqueen_robust_voxelization.jpg Type: image/jpeg Size: 26953 bytes Desc: alienqueen_robust_voxelization.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_small_robust_voxelization.jpg Type: image/jpeg Size: 47103 bytes Desc: eiffel_tower_small_robust_voxelization.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bunny_timings_single.png Type: image/png Size: 22038 bytes Desc: bunny_timings_single.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bunny_timings_multi.png Type: image/png Size: 16108 bytes Desc: bunny_timings_multi.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: armadillo_timings.png Type: image/png Size: 21249 bytes Desc: armadillo_timings.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dragon_timings.png Type: image/png Size: 21345 bytes Desc: dragon_timings.png URL: From david.gobbi at gmail.com Mon Sep 24 00:09:36 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 23 Sep 2018 22:09:36 -0600 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: Message-ID: Hi Berti, You don't even have to initialize binaryLabelMap, since you don't use it as an input for anything until the DeepCopy. Really the DeepCopy isn't necessary either, you could call imageStencilToImage->SetOutput(binaryLabelMap) before calling imageStencilToImage->Update(). Thanks for the samples, those results are very interesting. Because of the way the algorithm works, the Z axis is immune to those bridges in the result, so you are correct that majority voting or a logical "and" might clean it up. For the Eiffel tower, the polygons might be wound the wrong way (i.e. the shape is inside-out). You could try applying vtkReverseSense. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: alienqueen_robust_voxelization.jpg Type: image/jpeg Size: 26953 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_small_robust_voxelization.jpg Type: image/jpeg Size: 47103 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bunny_timings_single.png Type: image/png Size: 22038 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bunny_timings_multi.png Type: image/png Size: 16108 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: armadillo_timings.png Type: image/png Size: 21249 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dragon_timings.png Type: image/png Size: 21345 bytes Desc: not available URL: From zihan_zhuo at hotmail.com Mon Sep 24 00:24:33 2018 From: zihan_zhuo at hotmail.com (Zhuo Zihan) Date: Mon, 24 Sep 2018 04:24:33 +0000 Subject: [vtkusers] Set opacity of PLY models Message-ID: Dear all, I load a PLY model using vtkPLYReader. When apply SetOpacity(0.5), the PLY model disappeared. I try to create a default texture to the PLY model, but it not work. What's wrong with it? Thanks a lot! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.westphal at kitware.com Mon Sep 24 04:03:37 2018 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Mon, 24 Sep 2018 10:03:37 +0200 Subject: [vtkusers] the New QVTKOpenGLWidget In-Reply-To: References: Message-ID: Hi Elvis, This is down to Qt developpers only, see this 2013 change : https://codereview.qt-project.org/#/c/68683/ And associated code : https://code.woboq.org/qt5/qtbase/src/widgets/kernel/qwindowcontainer.cpp.html#101 QTabWidget will never force it to be a native widget though and even if it was, you will be informed as we do put a QVTKOpenGLWidget in a QTabWidget in ParaView. My Advice is to use the new QVTKOpenGLWidget in your case. Best regards, Mathieu Westphal On Fri, Sep 21, 2018 at 6:48 PM Elvis Stansvik wrote: > Den tors 23 aug. 2018 11:09Mathieu Westphal > skrev: > >> Hello list, >> >> If you are working on a VTK/Qt application this information should >> interest you. >> Sometime ago, a new QVTKOpenGLWidget implementation has been added to >> VTK, while the old one has been moved to QVTKOpenGLSimpleWidget. >> The last fixes for this change have just been merged, so make sure to use >> VTK master to test this. >> >> *1. Why is there a new widget and what does it do ?* >> We have been having some issues reported for the old widget, and the old >> widget could not support quad buffer stereo rendering by design. >> Has it is a needed feature in ParaView, a reimplementation was necessary. >> This new widget fix most of the reported issues with the old widget as well >> as adding stereo support. >> >> *2. Why keeping the old widget around then ?* >> Due to Qt limitations, this new implementation does not support very well >> being a native widget. >> But native widget are sometimes mandatory, for example within QScrollArea >> and QMDIArea, so the >> > > Do you know what other containers apart from QScrollArea will require > native widget? Will QTabWidget? > > Asking because we are planning to possibly put one of our VTK views in a > tab widget, but would really like to benefit from some of the improvements > in the new VTK widget (respect for fractional device pixel ratio mostly). > > If tab widget will require native, then I should really brush up an old MR > of mine that fixes fractional device pixel ratio in the "old" native > widget. I should do this anyway of course, but now I've heard that 8.2 > might be around the corner, making it more urgent to do that asap. > > Elvis > > QVTKOpenGLSimpleWidget should be used when in needs of VTK rendering in >> the contact of Qt native widget. >> >> Also it allows users to switch back to the old widget if necessary. >> >> *3. I'm not sure what native widgets are, what should I do in my >> application ?* >> >> Here are the different situation : >> >> 1. Your Qt application only uses a central QVTKOpenGLWidget for >> rendering: >> -> Nothing to do, just build with last master and make sure all is >> working well >> 2. Your Qt application only uses QVTKOpenGLWidget within QScrollArea >> or QMDIArea, or manually set widgets to be native and you are not >> interested by stereo rendering. >> -> Change all your QVTKOpenGLWidget to QVTKOpenGLSimpleWidget and >> you are good to go >> 3. Your application uses a non-native QVTKOpenGLWidget for rendering >> as well as native QVTKOpenGLWidget for rendering (eg: ParaView, with the >> central rendering widget and the color map editor rendering widget in >> scroll areas) : >> -> Use QVTKOpenGLWidget for non-native widgets and >> QVTKOpenGLSimpleWidget for native ones. The later will never support stereo. >> >> >> *4. I followed your recommendation but I see some strange >> stuff/bugs/rendering issues* >> Even if this new class has been tested extensively and will be used in >> the next ParaView release, It may still contains some issues. Feel free to >> discuss them in this mailing list or on our gitlab >> . >> >> Best regards, >> >> Mathieu Westphal >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Mon Sep 24 04:01:26 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Mon, 24 Sep 2018 10:01:26 +0200 Subject: [vtkusers] the New QVTKOpenGLWidget In-Reply-To: References: Message-ID: Thanks for digging this up Mathieu. Would have been nice if Qt documented which situations will force native somewhere. We have another VTK widget in a QScrollArea at one place, so there we'll have to use the old one. But good to know QTabWidget can hold the new one. Elvis Den m?n 24 sep. 2018 kl 09:38 skrev Mathieu Westphal : > > Hi Elvis, > > This is down to Qt developpers only, see this 2013 change : > https://codereview.qt-project.org/#/c/68683/ > And associated code : > https://code.woboq.org/qt5/qtbase/src/widgets/kernel/qwindowcontainer.cpp.html#101 > > QTabWidget will never force it to be a native widget though and even if it was, you will be informed as we do put a QVTKOpenGLWidget in a QTabWidget in ParaView. > My Advice is to use the new QVTKOpenGLWidget in your case. > > Best regards, > > Mathieu Westphal > > > On Fri, Sep 21, 2018 at 6:48 PM Elvis Stansvik wrote: >> >> Den tors 23 aug. 2018 11:09Mathieu Westphal skrev: >>> >>> Hello list, >>> >>> If you are working on a VTK/Qt application this information should interest you. >>> Sometime ago, a new QVTKOpenGLWidget implementation has been added to VTK, while the old one has been moved to QVTKOpenGLSimpleWidget. >>> The last fixes for this change have just been merged, so make sure to use VTK master to test this. >>> >>> 1. Why is there a new widget and what does it do ? >>> We have been having some issues reported for the old widget, and the old widget could not support quad buffer stereo rendering by design. >>> Has it is a needed feature in ParaView, a reimplementation was necessary. This new widget fix most of the reported issues with the old widget as well as adding stereo support. >>> >>> 2. Why keeping the old widget around then ? >>> Due to Qt limitations, this new implementation does not support very well being a native widget. >>> But native widget are sometimes mandatory, for example within QScrollArea and QMDIArea, so the >> >> >> Do you know what other containers apart from QScrollArea will require native widget? Will QTabWidget? >> >> Asking because we are planning to possibly put one of our VTK views in a tab widget, but would really like to benefit from some of the improvements in the new VTK widget (respect for fractional device pixel ratio mostly). >> >> If tab widget will require native, then I should really brush up an old MR of mine that fixes fractional device pixel ratio in the "old" native widget. I should do this anyway of course, but now I've heard that 8.2 might be around the corner, making it more urgent to do that asap. >> >> Elvis >> >>> QVTKOpenGLSimpleWidget should be used when in needs of VTK rendering in the contact of Qt native widget. >>> >>> Also it allows users to switch back to the old widget if necessary. >>> >>> 3. I'm not sure what native widgets are, what should I do in my application ? >>> >>> Here are the different situation : >>> >>> Your Qt application only uses a central QVTKOpenGLWidget for rendering: >>> -> Nothing to do, just build with last master and make sure all is working well >>> Your Qt application only uses QVTKOpenGLWidget within QScrollArea or QMDIArea, or manually set widgets to be native and you are not interested by stereo rendering. >>> -> Change all your QVTKOpenGLWidget to QVTKOpenGLSimpleWidget and you are good to go >>> Your application uses a non-native QVTKOpenGLWidget for rendering as well as native QVTKOpenGLWidget for rendering (eg: ParaView, with the central rendering widget and the color map editor rendering widget in scroll areas) : >>> -> Use QVTKOpenGLWidget for non-native widgets and QVTKOpenGLSimpleWidget for native ones. The later will never support stereo. >>> >>> >>> 4. I followed your recommendation but I see some strange stuff/bugs/rendering issues >>> Even if this new class has been tested extensively and will be used in the next ParaView release, It may still contains some issues. Feel free to discuss them in this mailing list or on our gitlab. >>> >>> Best regards, >>> >>> Mathieu Westphal >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://public.kitware.com/mailman/listinfo/vtkusers From ken.martin at kitware.com Mon Sep 24 08:30:04 2018 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 24 Sep 2018 08:30:04 -0400 Subject: [vtkusers] VTK IOS In-Reply-To: <673317BF-9941-4294-BD14-8A25116674C5@gmail.com> References: <71B1934D-84B5-421A-838C-99058B9D2D2C@gmail.com> <673317BF-9941-4294-BD14-8A25116674C5@gmail.com> Message-ID: We have a nightly run on VTK master for iOS that is green. It's settings might help you. You can find them here. https://open.cdash.org/viewNotes.php?buildid=5551355 On Sat, Sep 22, 2018 at 9:08 AM, kamal shahim wrote: > Hello all, > i am trying to compile VTK on IOS, > > Cmake configuration and generation are fine, but when I apply ?make' > command on the generated Makefile, i received theses errors: > Complaining on the vtk-compile-tools... > > -- Build files have been written to: .../VTK-8.1.1 > [ 23%] *Performing build step for 'vtk-compile-tools'* > make[3]: *** No rule to make target `vtkCompileTools'. Stop. > make[2]: *** [CompileTools/src/vtk-compile-tools-stamp/vtk-compile-tools-build] > Error 2 > make[1]: *** [CMakeFiles/vtk-compile-tools.dir/all] Error 2 > make: *** [all] Error 2 > > I am testing it on Mac, with these Cmake configurations : > > > > I would appreciate your help, > regards, > kshahim > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 101 East Weaver Street Carrboro, North Carolina 27510 USA This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2018-09-22 at 14.46.14.png Type: image/png Size: 56883 bytes Desc: not available URL: From csaba.pinter at queensu.ca Mon Sep 24 09:37:56 2018 From: csaba.pinter at queensu.ca (Csaba Pinter) Date: Mon, 24 Sep 2018 13:37:56 +0000 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: Message-ID: Hi David, If the documentation is lacking, and you made the effort to give an explanation, then I think it would make sense to add this to the doxy. It would be simpler if someone with push access could just add it, but let me know and I?ll make a MR. Btw the discussion is very interesting, and I?ll make some changes accordingly to the algorithm in Slicer too. Thanks, csaba From: David Gobbi [mailto:david.gobbi at gmail.com] Sent: Sunday, September 23, 2018 12:16 To: Berti Kr?ger Cc: Csaba Pinter; VTK Users Subject: Re: [vtkusers] Solid Voxelization with VTK Hi Berti, Thanks for the code, I'm sure that people will find it useful. The vtkImageStencilData class isn't described in much detail in the VTK documentation, but I can provide a brief description. The vtkImageStencilData object stores each raster-line of a binary image as a list of (begin, end) pairs. That is, each raster line has zero or more non-overlapping (begin, end) pairs. When vtkImageStencil operates on an image, it simply iterates through the (begin, end) pairs to figure out what parts of the image to copy. One way to think about this is that if the original binary image volume is stored as O(n^3) voxels, the vtkImageStencilData stores O(n^2) values. When a vtkImageStencilData is created, it allocates enough memory to store one (begin, end) pair per raster line, since this matches the most common use case (i.e. a mask that corresponds to a convex object). Thereafter it performs additional allocations as necessary. As for vtkPolyDataToImageStencil, it works by cutting your STL object along each XY plane to create polygons (zero or more polygons per slice), and then it rasterizes each polygon to create the (begin, end) pairs for each raster line. One comment about your code: it would be more efficient to use vtkImageStencilToImage instead of vtkImageStencil and vtkImageCast. The vtkImageStencilToImage filter requires only one input (the stencil), i.e. it doesn't require 'binaryLabelMap' as input. Also, you can set the data type of the image that it produces as output, so it doesn't have to be followed by a cast. Cheers, - David On Sat, Sep 22, 2018 at 10:29 PM Berti Kr?ger > wrote: Hi all. I am very sorry to revive this ancient thread. But i thought that maybe it could help other vtk users in the future to have a compilable and working example of the final result. If someone thinks that this code could be useful as an vtk example then feel free to modify / correct / pimp / add this to the vtk examples on github. I adapted the 3D slicer vtk code Csaba has pointed me to and incorporated the hints from David and everything works like a charm: [cid:795e083b-ffaa-4d6b-8b3f-97deb637b01c] The whole procedure is incredibly simple. Basically the vtkPolyData of the mesh is converted via the vtkPolyDataToImageStencil filter to a vtkImageStencil and the rest of the whole magic is only done by the vtkImageStencil filter: // Convert stencil to image vtkNew stencil; stencil->SetInputData(binaryLabelMap); stencil->SetStencilConnection(polyDataToImageStencil->GetOutputPort()); stencil->ReverseStencilOn(); stencil->SetBackgroundValue(1); // General foreground value is 1 (background value because of reverse stencil) I would really like to know very roughly how the vtkImageStencil works internally without digging through all of the source code. Because it is really fast (some kind of rasterization maybe ?). If someone could drop me a line on how it works only in principle that would be really great. So thanks again to Bill, Csaba, David, Elvis and everyone else on this thread. Kind regards, Berti PS: Example code, CMakeLists and example STL mesh are attached ________________________________ Von: Csaba Pinter > Gesendet: Montag, 11. Juni 2018 12:45 An: Berti Kr?ger Cc: vtkusers at vtk.org Betreff: RE: [vtkusers] Solid Voxelization with VTK Hi Berti, That code is under BSD-style license, so you?re free to do basically anything with it. This implementation is already pretty simple; just a concatenation of several VTK filters, so you can just give it a try by copy-pasting the relevant part of that function into your code and see if it works. If you?re interested in using the vtkSegmentation library, let me know though! Best, csaba From: Berti Kr?ger > Sent: Monday, June 11, 2018 02:46 To: Csaba Pinter >; David Gobbi > Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Solid Voxelization with VTK Hi Csaba, thank you very much for you answer and for offering your help. I already have looked at it and i think if no simpler option will come up, i will give it a try (hoping not to have to change too much to get it working with my pipeline since i am an absolute vtk beginner :-) ). How is this code licensed ? (i am only doing research work at the moment, the whole project i am working on is internal and just for testing and part of some larger work, it might be open sourced one day in the very far future but could even be not at all and it will never be used commercially). Regards Berti Am 05.06.2018 um 16:14 schrieb Csaba Pinter: Hi Berti, There is a pretty robust conversion algorithm implemented within 3D Slicer but using solely VTK: https://github.com/Slicer/Slicer/blob/master/Libs/vtkSegmentationCore/vtkClosedSurfaceToBinaryLabelmapConversionRule.cxx#L118 It consists of a short pipeline of standard VTK filters (some preprocessing then vtkPolyDataToImageStencil and vtkImageStencil). Let me know if you have any questions. csaba From: vtkusers On Behalf Of Berti Kr?ger Sent: Tuesday, June 5, 2018 03:26 To: David Gobbi Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Solid Voxelization with VTK Hi David, thank you very much for your help. I tried the example from your link. Unfortunately the result is same as using the vtkVoxelModeller: [Screenshot result voxelization] I get only a voxelization of the surface. The interior of the voxelized cone is still hollow and not filled with voxels (at least this is implied by the visualization). For the visualization i use Bill Lorensen's example code from here: https://lorensen.github.io/VTKExamples/site/Cxx/Medical/GenerateCubesFromLabels/ I have attached this small example which compiles with VTK 8.1 to show the issue. It basicly only consist of the example code from your link (https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataToImageData/) and the visualization code from the Bill Lorensen's example from the link above. I have not changed much. Any idea what is going wrong or what can i do get also voxelization of the interior (solid voxelization)? Thank you very much in advance. Regards Berti PolyDataToImageData - lorensen.github.io lorensen.github.io If VTK is not installed but compiled on your system, you will need to specify the path to your VTK build: GenerateCubesFromLabels - GitHub Pages lorensen.github.io Usage: GenerateCubesFromLabels FullHead.mhd StartLabel EndLabel where InputVolume is a meta file containing a 3 volume of discrete labels. ________________________________ Von: David Gobbi > Gesendet: Montag, 28. Mai 2018 23:13 An: Berti Kr?ger Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Solid Voxelization with VTK Hi Berti, If its a triangulated surface that you want to fill with voxels, use vtkPolyDataToImageStencil: https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataToImageData/ PolyDataToImageData - lorensen.github.io lorensen.github.io If VTK is not installed but compiled on your system, you will need to specify the path to your VTK build: If its a mesh of 3D elements and you want to sample the elements to create voxels, try vtkResampleToImage. - David On Mon, May 28, 2018 at 4:41 PM, Berti Kr?ger > wrote: Hello Everyone. For my Project i have to voxelize a 3D-Triangle-Mesh. I already found the vtkVoxelModeller which, while somewhat slow (only around 200 Triangles per second), works, but only voxelizes the outer shell where the mesh boundary triangles are. The inner part of the mesh stays hollow. Is there some way to get solid voxelization of 3D-Triangle-Meshes out of the box with VTK ? Thank you very much in advance, Berti -------------- next part -------------- An HTML attachment was scrubbed... URL: From kshahim at gmail.com Mon Sep 24 09:44:58 2018 From: kshahim at gmail.com (kamal shahim) Date: Mon, 24 Sep 2018 15:44:58 +0200 Subject: [vtkusers] VTK IOS In-Reply-To: References: <71B1934D-84B5-421A-838C-99058B9D2D2C@gmail.com> <673317BF-9941-4294-BD14-8A25116674C5@gmail.com> Message-ID: <177475C3-5FE3-40D8-8A17-BFB0BA7A5764@gmail.com> Thanks Martin, I see there are two additional cmake files to create: ?2018-09-24 05:10:00 -- /Users/kenmartin/Dashboards/kwdashboardscripts/kens_ipad3.cmake? 2018-09-24 05:10:00 -- /Users/kenmartin/Dashboards/kwdashboardscripts/kens_ipad3.cmake ?2018-09-24 05:10:00 -- /Users/kenmartin/Dashboards/kwdashboardscripts/common/vtk_common.cmake? 2018-09-24 05:10:00 -- /Users/kenmartin/Dashboards/kwdashboardscripts/common/vtk_common.cmake can you explain a bit how to use them and compile which one first ? and the vtk cmake and source files should be placed in which address ? > On 24 Sep 2018, at 14:30, Ken Martin wrote: > > We have a nightly run on VTK master for iOS that is green. It's settings might help you. You can find them here. > > https://open.cdash.org/viewNotes.php?buildid=5551355 > > > > On Sat, Sep 22, 2018 at 9:08 AM, kamal shahim > wrote: > Hello all, > i am trying to compile VTK on IOS, > > Cmake configuration and generation are fine, but when I apply ?make' command on the generated Makefile, i received theses errors: > Complaining on the vtk-compile-tools... > > -- Build files have been written to: .../VTK-8.1.1 > [ 23%] Performing build step for 'vtk-compile-tools' > make[3]: *** No rule to make target `vtkCompileTools'. Stop. > make[2]: *** [CompileTools/src/vtk-compile-tools-stamp/vtk-compile-tools-build] Error 2 > make[1]: *** [CMakeFiles/vtk-compile-tools.dir/all] Error 2 > make: *** [all] Error 2 > > I am testing it on Mac, with these Cmake configurations : > > > > I would appreciate your help, > regards, > kshahim > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > > > > > -- > Ken Martin PhD > Distinguished Engineer > Kitware Inc. > 101 East Weaver Street > Carrboro, North Carolina > 27510 USA > > This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: document.png Type: image/png Size: 450 bytes Desc: not available URL: From ken.martin at kitware.com Mon Sep 24 09:49:26 2018 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 24 Sep 2018 09:49:26 -0400 Subject: [vtkusers] VTK IOS In-Reply-To: <177475C3-5FE3-40D8-8A17-BFB0BA7A5764@gmail.com> References: <71B1934D-84B5-421A-838C-99058B9D2D2C@gmail.com> <673317BF-9941-4294-BD14-8A25116674C5@gmail.com> <177475C3-5FE3-40D8-8A17-BFB0BA7A5764@gmail.com> Message-ID: Those are cmake files that provide settings and scripts to cmake for building on that specific system. They are just there so you can see what cmake settings I am using in building on my system. If you are unfamiliar with cmake try a few web searches, there are some good resources out on the web to get you started. On Mon, Sep 24, 2018 at 9:44 AM, kamal shahim wrote: > Thanks Martin, > I see there are two additional cmake files to create: > > [image: Notes] 2018-09-24 05:10:00 -- /Users/kenmartin/Dashboards/ > kwdashboardscripts/kens_ipad3.cmake > [image: Notes] 2018-09-24 05:10:00 -- /Users/kenmartin/Dashboards/ > kwdashboardscripts/common/vtk_common.cmake > > can you explain a bit how to use them and compile which one first ? > and the vtk cmake and source files should be placed in which address ? > > On 24 Sep 2018, at 14:30, Ken Martin wrote: > > We have a nightly run on VTK master for iOS that is green. It's settings > might help you. You can find them here. > > https://open.cdash.org/viewNotes.php?buildid=5551355 > > > > On Sat, Sep 22, 2018 at 9:08 AM, kamal shahim wrote: > >> Hello all, >> i am trying to compile VTK on IOS, >> >> Cmake configuration and generation are fine, but when I apply ?make' >> command on the generated Makefile, i received theses errors: >> Complaining on the vtk-compile-tools... >> >> -- Build files have been written to: .../VTK-8.1.1 >> [ 23%] *Performing build step for 'vtk-compile-tools'* >> make[3]: *** No rule to make target `vtkCompileTools'. Stop. >> make[2]: *** [CompileTools/src/vtk-compile-tools-stamp/vtk-compile-tools-build] >> Error 2 >> make[1]: *** [CMakeFiles/vtk-compile-tools.dir/all] Error 2 >> make: *** [all] Error 2 >> >> I am testing it on Mac, with these Cmake configurations : >> >> >> >> I would appreciate your help, >> regards, >> kshahim >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > Ken Martin PhD > Distinguished Engineer > Kitware Inc. > 101 East Weaver Street > > Carrboro, North Carolina > > 27510 USA > > This communication, including all attachments, contains confidential and > legally privileged information, and it is intended only for the use of the > addressee. Access to this email by anyone else is unauthorized. If you are > not the intended recipient, any disclosure, copying, distribution or any > action taken in reliance on it is prohibited and may be unlawful. If you > received this communication in error please notify us immediately and > destroy the original message. Thank you. > > > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 101 East Weaver Street Carrboro, North Carolina 27510 USA This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: document.png Type: image/png Size: 450 bytes Desc: not available URL: From rickfrank at me.com Mon Sep 24 09:50:26 2018 From: rickfrank at me.com (Richard Frank) Date: Mon, 24 Sep 2018 09:50:26 -0400 Subject: [vtkusers] Vtk.js volumeController transfer functions Message-ID: <61A7E916-7392-4483-8800-5A664A955FD6@me.com> Hi, Is it possible to add/remove our own transfer functions to the volumeController? Thanks Rick Sent from my iPad From MEEHANBT at nv.doe.gov Mon Sep 24 10:15:44 2018 From: MEEHANBT at nv.doe.gov (Meehan, Bernard (CONTR)) Date: Mon, 24 Sep 2018 14:15:44 +0000 Subject: [vtkusers] CMake staring points Message-ID: I know that this is a bit off-topic, but CMake is part of VTKs build system ... Kitware?s documentation is comprehensive, but can be a bit opaque to beginners. Much of the stuff you will find on the internet is a bit dated, or contains bad advice (or both). I got a copy of ?Mastering CMake,? which helped me a bunch (Ken Martin is one of the authors). I have also found ?Professional CMake: A Practical Guide? to be very good (and is very up-to-date). For free resources: Daniel Pfeifer had a good presentation about ?modern? CMake on YouTube, it is referenced in this blog in the first paragraph: https://rix0r.nl/blog/2015/08/13/cmake-guide/ GitHub hosts many repositories with example usage, such as: https://github.com/ttroy50/cmake-examples There was also an ?Ask Me Anything? with the CMake developers on Reddit that was an interesting read: It is featured on the CMake page: https://cmake.org/ Cheers, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Mon Sep 24 10:25:01 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 24 Sep 2018 10:25:01 -0400 Subject: [vtkusers] Good day In-Reply-To: References: Message-ID: VTK 6.0 split up the old kits into finer grained modules so that applications can be more selective about what parts of VTK they need. Thess pages explain the code changes you need to make to an old application to build against post 6.0 VTK. https://www.vtk.org/Wiki/VTK/Build_System_Migration https://www.vtk.org/Wiki/VTK/VTK_6_Migration_Guide In particular, if you are not using CMake for your project, pay attention to the implementation modules discussion and the new compiler flags you need to add to avoid null from New() runtime failure. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Sep 21, 2018 at 10:55 AM Marc Jaspar wrote: > I have been working with vtk version 5.10.1 and it works very well. > I just downloaded vtk 8.1.1 and I am trying to program a simple cone or > sphere and I seem to me missing required libraries. > Could I get a listing of the basic required libs? > I really don't want to include all of them in the directory. > > 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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Mon Sep 24 10:27:01 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 24 Sep 2018 08:27:01 -0600 Subject: [vtkusers] vtk.js volumeController transferFunctions In-Reply-To: References: Message-ID: I'm guessing you are talking about the LookupTable preset which are used here to fill that list only once. https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/UI/VolumeController/index.js#L15 To adjust its content just create an alias in you application to override the imported file to be what you want. Or add methods do allow dynamic re-computation of that list (on the UI side) since we already have methods to add or remove presets. On Sun, Sep 23, 2018 at 4:16 PM Richard Frank via vtkusers < vtkusers at public.kitware.com> wrote: > Hi, > > Is there a way to modify the list of transfer functions in the > volumeController? > > We'd like to at least add our own to the list... > > Thanks > > Rick > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Mon Sep 24 11:21:17 2018 From: rickfrank at me.com (Richard Frank) Date: Mon, 24 Sep 2018 11:21:17 -0400 Subject: [vtkusers] vtk.js volumeController transferFunctions In-Reply-To: References: Message-ID: I do t see the methods to add presets ( sorry if I missed it, C++ guy still getting up to speed on JS).... Can you point me to them? Thanks, Rick Sent from my iPad > On Sep 24, 2018, at 10:27 AM, Sebastien Jourdain wrote: > > I'm guessing you are talking about the LookupTable preset which are used here to fill that list only once. > https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/UI/VolumeController/index.js#L15 > > To adjust its content just create an alias in you application to override the imported file to be what you want. > > Or add methods do allow dynamic re-computation of that list (on the UI side) since we already have methods to add or remove presets. > >> On Sun, Sep 23, 2018 at 4:16 PM Richard Frank via vtkusers wrote: >> Hi, >> >> Is there a way to modify the list of transfer functions in the volumeController? >> >> We'd like to at least add our own to the list... >> >> Thanks >> >> Rick >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Mon Sep 24 11:23:36 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 24 Sep 2018 09:23:36 -0600 Subject: [vtkusers] vtk.js volumeController transferFunctions In-Reply-To: References: Message-ID: https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js#L25-L46 On Mon, Sep 24, 2018 at 9:21 AM Richard Frank wrote: > I do t see the methods to add presets ( sorry if I missed it, C++ guy > still getting up to speed on JS).... > > Can you point me to them? > > Thanks, > > Rick > > Sent from my iPad > > On Sep 24, 2018, at 10:27 AM, Sebastien Jourdain < > sebastien.jourdain at kitware.com> wrote: > > I'm guessing you are talking about the LookupTable preset which are used > here to fill that list only once. > > https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/UI/VolumeController/index.js#L15 > > To adjust its content just create an alias in you application to override > the imported file to be what you want. > > Or add methods do allow dynamic re-computation of that list (on the UI > side) since we already have methods to add or remove presets. > > On Sun, Sep 23, 2018 at 4:16 PM Richard Frank via vtkusers < > vtkusers at public.kitware.com> wrote: > >> Hi, >> >> Is there a way to modify the list of transfer functions in the >> volumeController? >> >> We'd like to at least add our own to the list... >> >> Thanks >> >> Rick >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Mon Sep 24 11:30:12 2018 From: rickfrank at me.com (Richard Frank) Date: Mon, 24 Sep 2018 11:30:12 -0400 Subject: [vtkusers] vtk.js volumeController transferFunctions In-Reply-To: References: Message-ID: <3140A9F4-706D-4ABE-9020-04D677C6FBF0@me.com> Ah I see, and I will have to add my presets before the volume corner loads them, it would seem, is that correct? Thanks Rick Sent from my iPad > On Sep 24, 2018, at 11:23 AM, Sebastien Jourdain wrote: > > https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js#L25-L46 > >> On Mon, Sep 24, 2018 at 9:21 AM Richard Frank wrote: >> I do t see the methods to add presets ( sorry if I missed it, C++ guy still getting up to speed on JS).... >> >> Can you point me to them? >> >> Thanks, >> >> Rick >> >> Sent from my iPad >> >>> On Sep 24, 2018, at 10:27 AM, Sebastien Jourdain wrote: >>> >>> I'm guessing you are talking about the LookupTable preset which are used here to fill that list only once. >>> https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/UI/VolumeController/index.js#L15 >>> >>> To adjust its content just create an alias in you application to override the imported file to be what you want. >>> >>> Or add methods do allow dynamic re-computation of that list (on the UI side) since we already have methods to add or remove presets. >>> >>>> On Sun, Sep 23, 2018 at 4:16 PM Richard Frank via vtkusers wrote: >>>> Hi, >>>> >>>> Is there a way to modify the list of transfer functions in the volumeController? >>>> >>>> We'd like to at least add our own to the list... >>>> >>>> Thanks >>>> >>>> Rick >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Mon Sep 24 11:34:10 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 24 Sep 2018 09:34:10 -0600 Subject: [vtkusers] vtk.js volumeController transferFunctions In-Reply-To: <3140A9F4-706D-4ABE-9020-04D677C6FBF0@me.com> References: <3140A9F4-706D-4ABE-9020-04D677C6FBF0@me.com> Message-ID: Yes but I think it will still be too late. That's why having an option to refresh that list in the UI will be needed. Unless we compute it at instantiation time. On Mon, Sep 24, 2018 at 9:30 AM Richard Frank wrote: > Ah I see, and I will have to add my presets before the volume corner loads > them, it would seem, is that correct? > > Thanks > > Rick > > Sent from my iPad > > On Sep 24, 2018, at 11:23 AM, Sebastien Jourdain < > sebastien.jourdain at kitware.com> wrote: > > > https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js#L25-L46 > > On Mon, Sep 24, 2018 at 9:21 AM Richard Frank wrote: > >> I do t see the methods to add presets ( sorry if I missed it, C++ guy >> still getting up to speed on JS).... >> >> Can you point me to them? >> >> Thanks, >> >> Rick >> >> Sent from my iPad >> >> On Sep 24, 2018, at 10:27 AM, Sebastien Jourdain < >> sebastien.jourdain at kitware.com> wrote: >> >> I'm guessing you are talking about the LookupTable preset which are used >> here to fill that list only once. >> >> https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/UI/VolumeController/index.js#L15 >> >> To adjust its content just create an alias in you application to override >> the imported file to be what you want. >> >> Or add methods do allow dynamic re-computation of that list (on the UI >> side) since we already have methods to add or remove presets. >> >> On Sun, Sep 23, 2018 at 4:16 PM Richard Frank via vtkusers < >> vtkusers at public.kitware.com> wrote: >> >>> Hi, >>> >>> Is there a way to modify the list of transfer functions in the >>> volumeController? >>> >>> We'd like to at least add our own to the list... >>> >>> Thanks >>> >>> Rick >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://public.kitware.com/mailman/listinfo/vtkusers >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Mon Sep 24 11:41:30 2018 From: rickfrank at me.com (Richard Frank) Date: Mon, 24 Sep 2018 11:41:30 -0400 Subject: [vtkusers] vtk.js volumeController transferFunctions In-Reply-To: References: <3140A9F4-706D-4ABE-9020-04D677C6FBF0@me.com> Message-ID: <87C9C4DC-2457-46A7-8F2D-5CA2E146940D@me.com> Perhaps at instantiation time for the volumeController as an optional parameter? If there?s none passed in use defaults otherwise use what?s passed in? I can take a try at it... Rick Sent from my iPad > On Sep 24, 2018, at 11:34 AM, Sebastien Jourdain wrote: > > Yes but I think it will still be too late. That's why having an option to refresh that list in the UI will be needed. Unless we compute it at instantiation time. > >> On Mon, Sep 24, 2018 at 9:30 AM Richard Frank wrote: >> Ah I see, and I will have to add my presets before the volume corner loads them, it would seem, is that correct? >> >> Thanks >> >> Rick >> >> Sent from my iPad >> >>> On Sep 24, 2018, at 11:23 AM, Sebastien Jourdain wrote: >>> >>> https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js#L25-L46 >>> >>>> On Mon, Sep 24, 2018 at 9:21 AM Richard Frank wrote: >>>> I do t see the methods to add presets ( sorry if I missed it, C++ guy still getting up to speed on JS).... >>>> >>>> Can you point me to them? >>>> >>>> Thanks, >>>> >>>> Rick >>>> >>>> Sent from my iPad >>>> >>>>> On Sep 24, 2018, at 10:27 AM, Sebastien Jourdain wrote: >>>>> >>>>> I'm guessing you are talking about the LookupTable preset which are used here to fill that list only once. >>>>> https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/UI/VolumeController/index.js#L15 >>>>> >>>>> To adjust its content just create an alias in you application to override the imported file to be what you want. >>>>> >>>>> Or add methods do allow dynamic re-computation of that list (on the UI side) since we already have methods to add or remove presets. >>>>> >>>>>> On Sun, Sep 23, 2018 at 4:16 PM Richard Frank via vtkusers wrote: >>>>>> Hi, >>>>>> >>>>>> Is there a way to modify the list of transfer functions in the volumeController? >>>>>> >>>>>> We'd like to at least add our own to the list... >>>>>> >>>>>> Thanks >>>>>> >>>>>> Rick >>>>>> >>>>>> _______________________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>>>>> >>>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>>> >>>>>> Follow this link to subscribe/unsubscribe: >>>>>> https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Mon Sep 24 11:42:00 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 24 Sep 2018 09:42:00 -0600 Subject: [vtkusers] vtk.js volumeController transferFunctions In-Reply-To: <87C9C4DC-2457-46A7-8F2D-5CA2E146940D@me.com> References: <3140A9F4-706D-4ABE-9020-04D677C6FBF0@me.com> <87C9C4DC-2457-46A7-8F2D-5CA2E146940D@me.com> Message-ID: That sounds like a good idea. On Mon, Sep 24, 2018 at 9:41 AM Richard Frank wrote: > Perhaps at instantiation time for the volumeController as an optional > parameter? If there?s none passed in use defaults otherwise use what?s > passed in? I can take a try at it... > > Rick > > Sent from my iPad > > On Sep 24, 2018, at 11:34 AM, Sebastien Jourdain < > sebastien.jourdain at kitware.com> wrote: > > Yes but I think it will still be too late. That's why having an option to > refresh that list in the UI will be needed. Unless we compute it at > instantiation time. > > On Mon, Sep 24, 2018 at 9:30 AM Richard Frank wrote: > >> Ah I see, and I will have to add my presets before the volume corner >> loads them, it would seem, is that correct? >> >> Thanks >> >> Rick >> >> Sent from my iPad >> >> On Sep 24, 2018, at 11:23 AM, Sebastien Jourdain < >> sebastien.jourdain at kitware.com> wrote: >> >> >> https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.js#L25-L46 >> >> On Mon, Sep 24, 2018 at 9:21 AM Richard Frank wrote: >> >>> I do t see the methods to add presets ( sorry if I missed it, C++ guy >>> still getting up to speed on JS).... >>> >>> Can you point me to them? >>> >>> Thanks, >>> >>> Rick >>> >>> Sent from my iPad >>> >>> On Sep 24, 2018, at 10:27 AM, Sebastien Jourdain < >>> sebastien.jourdain at kitware.com> wrote: >>> >>> I'm guessing you are talking about the LookupTable preset which are used >>> here to fill that list only once. >>> >>> https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/UI/VolumeController/index.js#L15 >>> >>> To adjust its content just create an alias in you application to >>> override the imported file to be what you want. >>> >>> Or add methods do allow dynamic re-computation of that list (on the UI >>> side) since we already have methods to add or remove presets. >>> >>> On Sun, Sep 23, 2018 at 4:16 PM Richard Frank via vtkusers < >>> vtkusers at public.kitware.com> wrote: >>> >>>> Hi, >>>> >>>> Is there a way to modify the list of transfer functions in the >>>> volumeController? >>>> >>>> We'd like to at least add our own to the list... >>>> >>>> Thanks >>>> >>>> Rick >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://public.kitware.com/mailman/listinfo/vtkusers >>>> >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From stn.gupta.pankaj at gmail.com Mon Sep 24 23:09:09 2018 From: stn.gupta.pankaj at gmail.com (stn.gupta.pankaj) Date: Mon, 24 Sep 2018 20:09:09 -0700 (MST) Subject: [vtkusers] How to get color of pixel(or position) on colored polydata In-Reply-To: <1493184584966-5742984.post@n5.nabble.com> References: <1493113372253-5742972.post@n5.nabble.com> <1493169522955-5742982.post@n5.nabble.com> <1493184584966-5742984.post@n5.nabble.com> Message-ID: <1537844949193-0.post@n5.nabble.com> Hi Tharun, Can you please provide me your solution. As i am also trying to find the color of pixel on colored polydata. I created polydata using VTKLine. VTKLine takes only start point and end point, it internally generate all the middle points(from start to end point). I want to know these internal points. Thanks in advance. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From ysa0829 at gmail.com Tue Sep 25 02:00:53 2018 From: ysa0829 at gmail.com (Ang) Date: Mon, 24 Sep 2018 23:00:53 -0700 (MST) Subject: [vtkusers] the New QVTKOpenGLWidget In-Reply-To: References: Message-ID: <1537855253605-0.post@n5.nabble.com> Hi Mathieu, Is this issue solved? https://gitlab.kitware.com/vtk/vtk/issues/17133 -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mathieu.westphal at kitware.com Tue Sep 25 04:33:45 2018 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Tue, 25 Sep 2018 10:33:45 +0200 Subject: [vtkusers] the New QVTKOpenGLWidget In-Reply-To: <1537855253605-0.post@n5.nabble.com> References: <1537855253605-0.post@n5.nabble.com> Message-ID: Hi Ang, The linked issue concerns QVTKOpenGLNativeWidget, and I'm not able to reproduce the behavior. Mathieu Westphal On Tue, Sep 25, 2018 at 8:04 AM Ang wrote: > Hi Mathieu, > > Is this issue solved? > > https://gitlab.kitware.com/vtk/vtk/issues/17133 > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From berti_krueger at hotmail.com Tue Sep 25 04:41:41 2018 From: berti_krueger at hotmail.com (=?iso-8859-1?Q?Berti_Kr=FCger?=) Date: Tue, 25 Sep 2018 08:41:41 +0000 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: , Message-ID: Hi David, thank you very much again for the hints. As you said, i removed the initialization code for the binaryLabelMap and replaced the DeepCopy with a call to imageStencilToImage->SetOutput and it works perfectly! The resulting code for the whole polygon mesh voxelization from this code review iteration is now simply: bool ConvertPolyDataToBinaryLabelMap(vtkSmartPointer closedSurfacePolyData, vtkSmartPointer binaryLabelMap) { // Check for consistency if (closedSurfacePolyData->GetNumberOfPoints() < 2 || closedSurfacePolyData->GetNumberOfCells() < 2) { std::cout << "Convert: Cannot create binary labelmap from surface with number of points: " << closedSurfacePolyData->GetNumberOfPoints() << " and number of cells: " << closedSurfacePolyData->GetNumberOfCells() << std::endl; return false; } // Compute polydata normals vtkNew normalFilter; normalFilter->SetInputData(closedSurfacePolyData); normalFilter->ConsistencyOn(); // Make sure that we have a clean triangle polydata vtkNew triangle; triangle->SetInputConnection(normalFilter->GetOutputPort()); // Convert to triangle strip vtkNew stripper; stripper->SetInputConnection(triangle->GetOutputPort()); // Convert polydata to stencil vtkNew polyDataToImageStencil; polyDataToImageStencil->SetInputConnection(stripper->GetOutputPort()); polyDataToImageStencil->SetOutputSpacing(binaryLabelMap->GetSpacing()); polyDataToImageStencil->SetOutputOrigin(binaryLabelMap->GetOrigin()); polyDataToImageStencil->SetOutputWholeExtent(binaryLabelMap->GetExtent()); polyDataToImageStencil->Update(); // Convert stencil to image vtkNew imageStencilToImage; imageStencilToImage->SetInputConnection(polyDataToImageStencil->GetOutputPort()); imageStencilToImage->SetOutsideValue(0); imageStencilToImage->SetInsideValue(1); imageStencilToImage->SetOutput(binaryLabelMap); imageStencilToImage->Update(); return true; } As always i attached the enhanced example code and the CMakeLists. The result for the voxelization with and without opacity turned on: [cid:a98f252d-e72d-4809-a32f-404b6d8007b7][cid:cff0c507-5d76-4450-a3dc-3cf160cb50fd] And yes you were right with the Eiffel tower mesh! I reoriented the polygon orientation / normals (but with meshlab not vtk) and now the voxelization code above also works with the Eiffel tower: [cid:1fe1d519-2656-4e2d-899c-7b685f711898] Maybe there are some small defects (broken normals, wrongly oriented polygons etc.) in the alien queen mesh as well. Here is a closeup: [cid:115412aa-d4c4-4377-8e33-5fa96e974b09] [cid:0d0e1d24-29f9-4f08-8acc-12ee09a34973] [cid:b5e05242-4131-4648-ab72-72e9f648438c] It could be that these small dark polygons at the backside of the nails of the claw are dark because their normals are broken or wrongly oriented. Could that lead to the strange voxelization result above? Cheers, Berti PS: Bill if you think this example could be of any use for other vtk users, then please feel free to add / modify / enhance / rip it apart / put it in the vtk github example repository. Personally i think vtk can not have enough examples. They are always life savers. ________________________________ Von: David Gobbi Gesendet: Montag, 24. September 2018 04:09 An: Berti Kr?ger Cc: Csaba Pinter; VTK Users; Bill Lorensen Betreff: Re: [vtkusers] Solid Voxelization with VTK Hi Berti, You don't even have to initialize binaryLabelMap, since you don't use it as an input for anything until the DeepCopy. Really the DeepCopy isn't necessary either, you could call imageStencilToImage->SetOutput(binaryLabelMap) before calling imageStencilToImage->Update(). Thanks for the samples, those results are very interesting. Because of the way the algorithm works, the Z axis is immune to those bridges in the result, so you are correct that majority voting or a logical "and" might clean it up. For the Eiffel tower, the polygons might be wound the wrong way (i.e. the shape is inside-out). You could try applying vtkReverseSense. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: skull2.jpg Type: image/jpeg Size: 64281 bytes Desc: skull2.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: skull1.png Type: image/png Size: 281975 bytes Desc: skull1.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_correct.png Type: image/png Size: 80360 bytes Desc: eiffel_tower_correct.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: alienqueen_voxelization.jpg Type: image/jpeg Size: 65454 bytes Desc: alienqueen_voxelization.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: queen_close1.jpg Type: image/jpeg Size: 132745 bytes Desc: queen_close1.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: queen_close2.jpg Type: image/jpeg Size: 28658 bytes Desc: queen_close2.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PolyDataToImageDataVisualizationSTL.cxx Type: text/x-c++src Size: 7101 bytes Desc: PolyDataToImageDataVisualizationSTL.cxx URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CMakeLists.txt URL: From david.gobbi at gmail.com Tue Sep 25 06:20:07 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 25 Sep 2018 04:20:07 -0600 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: Message-ID: Hi Berti, Just a few extra comments about the three "preprocessing" steps that you apply in your sample code: For vtkPolyDataNormals, you might want to add normalsFilter->AutoOrientNormalsOn(), since this option is specifically designed to fix inside-out shapes like the Eiffel tower model. And normalsFilter->SplittingOff() will make this filter work faster. It would also be good if the comment mentioned that the purpose of the filter is to enforce consistent orientation of the polygons, and that the filter is optional if all the polygons are already correctly oriented. The vtkStripper should be removed, unless you actually saw that it provides some benefit. The vtkPolyDataToImageStencil class should give exactly the same results for triangles as for strips. And vtkTriangleFilter is only needed if the input polygons are not flat. Thanks again for the code, - David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: skull2.jpg Type: image/jpeg Size: 64281 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: skull1.png Type: image/png Size: 281975 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_correct.png Type: image/png Size: 80360 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: alienqueen_voxelization.jpg Type: image/jpeg Size: 65454 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: queen_close1.jpg Type: image/jpeg Size: 132745 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: queen_close2.jpg Type: image/jpeg Size: 28658 bytes Desc: not available URL: From vpai at g.clemson.edu Tue Sep 25 14:46:37 2018 From: vpai at g.clemson.edu (Vipul Pai Raikar) Date: Tue, 25 Sep 2018 11:46:37 -0700 (MST) Subject: [vtkusers] vtkLookupTable crashes in release mode. VTK8.1.1 Message-ID: <1537901197877-0.post@n5.nabble.com> Hi, I am having issues creating a vtkLookupTable. I am encountering a peculiar issue with lookup tables when in release mode. Whenever I am trying to SetHueRange (or SaturationRange or ValueRange) I run into an access violation. But this works as expected in debug mode. Any one run into the same issue? Any help will be greatly appreciated. Example Code: vtkSmartPointer bwLut = vtkSmartPointer::New(); bwLut->SetHueRange (0, 0); bwLut->SetSaturationRange (0, 0); bwLut->SetValueRange (0, 1); bwLut->Build(); bwLut->SetTableRange (0, 255); -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From lasso at queensu.ca Tue Sep 25 16:41:17 2018 From: lasso at queensu.ca (Andras Lasso) Date: Tue, 25 Sep 2018 20:41:17 +0000 Subject: [vtkusers] vtkLookupTable crashes in release mode. VTK8.1.1 In-Reply-To: <1537901197877-0.post@n5.nabble.com> References: <1537901197877-0.post@n5.nabble.com> Message-ID: Order of operations matter. This works well: https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Core/vtkMRMLColorTableNode.cxx#L642-L648 Andras -----Original Message----- From: vtkusers On Behalf Of Vipul Pai Raikar Sent: Tuesday, September 25, 2018 2:47 PM To: vtkusers at vtk.org Subject: [vtkusers] vtkLookupTable crashes in release mode. VTK8.1.1 Hi, I am having issues creating a vtkLookupTable. I am encountering a peculiar issue with lookup tables when in release mode. Whenever I am trying to SetHueRange (or SaturationRange or ValueRange) I run into an access violation. But this works as expected in debug mode. Any one run into the same issue? Any help will be greatly appreciated. Example Code: vtkSmartPointer bwLut = vtkSmartPointer::New(); bwLut->SetHueRange (0, 0); bwLut->SetSaturationRange (0, 0); bwLut->SetValueRange (0, 1); bwLut->Build(); bwLut->SetTableRange (0, 255); -- Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Classo%40queensu.ca%7Cfc2fc98579cf487ee08108d623173bf8%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636734980033059634&sdata=vh%2BAIob8RcPNFIKqTXxPFrWag5tpIs%2Fi%2Fv4e7crlL8Y%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7Cfc2fc98579cf487ee08108d623173bf8%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636734980033059634&sdata=ydqBqIoi0brPwFm2PtZQmxCPsTXBsv62sM3COKW1yzM%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7Cfc2fc98579cf487ee08108d623173bf8%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636734980033059634&sdata=Ng7pZ6ohz1J1NkeEVA4tx9sQoIVUZ0ttK9OgYTUstTg%3D&reserved=0 Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7Cfc2fc98579cf487ee08108d623173bf8%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636734980033059634&sdata=E4utitZcoGaEhPhYmhSgdfz4pyzvAvQbU2dbgfuhXKo%3D&reserved=0 Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cfc2fc98579cf487ee08108d623173bf8%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636734980033059634&sdata=cOg%2FcimwE8fI0HtxljpU8WENsrfRVQy%2FcSs89bPPejo%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cfc2fc98579cf487ee08108d623173bf8%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636734980033059634&sdata=TD6xZu3x2nzYtumVwHzxvP92UzqU1DmihzJVS8pfLXA%3D&reserved=0 From scapegoat.sarthak at gmail.com Tue Sep 25 16:47:50 2018 From: scapegoat.sarthak at gmail.com (Scapegoat Sarthak) Date: Tue, 25 Sep 2018 13:47:50 -0700 Subject: [vtkusers] Compiling VTK with CopperSpice Message-ID: Hi, Has there been any effort towards getting the Qt-dependent classes working with CopperSpice instead? Thanks, Sarthak -------------- next part -------------- An HTML attachment was scrubbed... URL: From vpai at g.clemson.edu Tue Sep 25 18:13:25 2018 From: vpai at g.clemson.edu (Vipul Pai Raikar) Date: Tue, 25 Sep 2018 15:13:25 -0700 (MST) Subject: [vtkusers] vtkLookupTable crashes in release mode. VTK8.1.1 In-Reply-To: References: <1537901197877-0.post@n5.nabble.com> Message-ID: <1537913605357-0.post@n5.nabble.com> Hi Andras, Thanks for your quick response and suggestion. I tried to change the order as you pointed out and I am having the same issue in release mode. vtkLookupTable *bwLut = vtkLookupTable::New(); bwLut->SetRampToLinear(); bwLut->SetTableRange (0, 255); bwLut->SetHueRange (0, 0); bwLut->SetSaturationRange (0, 0); bwLut->SetValueRange (0, 1); bwLut->Build(); Exception: 0xC0000005: Access violation writing location 0x00007FF88A593298 Vipul -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From dave.demarle at kitware.com Tue Sep 25 18:16:17 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 25 Sep 2018 18:16:17 -0400 Subject: [vtkusers] Discussion: OK to change VTK's version number from 9.0 to 8.2? Message-ID: Hey Gang, I'd like to change the VTK version number in master from 9.0.0 to 8.2.0. Does anybody object? The proposed change can be found at: https://gitlab.kitware.com/vtk/vtk/merge_requests/4700 I want to do this because it will let me make a release now to preserve what is in master. The larger scale changes we planned for 9.0 will happen shortly after that. 8.2 will and 9.0 may come out before the end of this year. A topic for future discussion is whether we want to continue the existing, fairly haphazard naming scheme or move to something better, perhaps a year.month scheme like several other projects have moved to recently. thanks for your advice David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Sep 25 18:48:52 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 25 Sep 2018 15:48:52 -0700 Subject: [vtkusers] vtkLookupTable crashes in release mode. VTK8.1.1 In-Reply-To: <1537901197877-0.post@n5.nabble.com> References: <1537901197877-0.post@n5.nabble.com> Message-ID: SetTableRange before Build() On Tue, Sep 25, 2018, 11:46 AM Vipul Pai Raikar wrote: > Hi, > > I am having issues creating a vtkLookupTable. I am encountering a peculiar > issue with lookup tables when in release mode. Whenever I am trying to > SetHueRange (or SaturationRange or ValueRange) I run into an access > violation. But this works as expected in debug mode. Any one run into the > same issue? Any help will be greatly appreciated. > > Example Code: > vtkSmartPointer bwLut = > vtkSmartPointer::New(); > bwLut->SetHueRange (0, 0); > bwLut->SetSaturationRange (0, 0); > bwLut->SetValueRange (0, 1); > bwLut->Build(); > bwLut->SetTableRange (0, 255); > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Sep 25 19:03:55 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 25 Sep 2018 16:03:55 -0700 Subject: [vtkusers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: References: Message-ID: I like the idea of a monthly version number. As we add examples of new classes, we can test whether or not to build based on versions. We do that now, but we have to test on the slow-moving version now. At one time we changed the version every night. On Tue, Sep 25, 2018, 3:16 PM David E DeMarle wrote: > Hey Gang, > > I'd like to change the VTK version number in master from 9.0.0 to 8.2.0. > Does anybody object? > The proposed change can be found at: > https://gitlab.kitware.com/vtk/vtk/merge_requests/4700 > > I want to do this because it will let me make a release now to preserve > what is in master. The larger scale changes we planned for 9.0 will happen > shortly after that. 8.2 will and 9.0 may come out before the end of this > year. > > A topic for future discussion is whether we want to continue the existing, > fairly haphazard naming scheme or move to something better, perhaps a > year.month scheme like several other projects have moved to recently. > > thanks for your advice > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vpai at g.clemson.edu Tue Sep 25 20:30:51 2018 From: vpai at g.clemson.edu (Vipul Pai Raikar) Date: Tue, 25 Sep 2018 17:30:51 -0700 (MST) Subject: [vtkusers] vtkLookupTable crashes in release mode. VTK8.1.1 In-Reply-To: References: <1537901197877-0.post@n5.nabble.com> Message-ID: <1537921851644-0.post@n5.nabble.com> Hi Bill, I did set it before the build call, still the same issue. Vipul -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sigurd.cbq425 at gmail.com Wed Sep 26 00:30:34 2018 From: sigurd.cbq425 at gmail.com (baiqi cheng) Date: Wed, 26 Sep 2018 14:30:34 +1000 Subject: [vtkusers] data export problem Message-ID: Dear All, I'm trying to export a vtk into a csv file. however, it gives me an error message "ValueError: all the input array dimensions except for the concatenation axis must match exactly." my code is shown below. Can someone help me with this? I really appreciate it. import vtk from vtk.numpy_interface import dataset_adapter as dsa import numpy as np from scipy import sparse import keras reader = vtk.vtkUnstructuredGridReader() reader.SetFileName("1111.vtk") reader.ReadAllFieldsOn() reader.Update() vtk_data = reader.GetOutput() points = vtk_data.GetPoints() n_points = points. GetNumberOfPoints() vtk_dataset_adapter = dsa.WrapDataObject(vtk_data) coords = vtk_dataset_adapter.GetPoints() density = vtk_dataset_adapter.PointData['density'] data_export = np.column_stack((coords,density)) ---------------------------------------------------------------------------ValueError Traceback (most recent call last) in () 18 density = vtk_dataset_adapter.PointData['density'] 19 ---> 20 data_export = np.column_stack((coords,density)) 21 22 E:\Anacondapython3.6\envs\mlbook\lib\site-packages\numpy\lib\shape_base.py in column_stack(tup) 367 arr = array(arr, copy=False, subok=True, ndmin=2).T 368 arrays.append(arr)--> 369 return _nx.concatenate(arrays, 1) 370 371 def dstack(tup): ValueError: all the input array dimensions except for the concatenation axis must match exactly Regards, Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Wed Sep 26 02:58:56 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Wed, 26 Sep 2018 08:58:56 +0200 Subject: [vtkusers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: References: Message-ID: Den ons 26 sep. 2018 00:16David E DeMarle skrev: > Hey Gang, > > I'd like to change the VTK version number in master from 9.0.0 to 8.2.0. > Does anybody object? > The proposed change can be found at: > https://gitlab.kitware.com/vtk/vtk/merge_requests/4700 > > I want to do this because it will let me make a release now to preserve > what is in master. The larger scale changes we planned for 9.0 will happen > shortly after that. 8.2 will and 9.0 may come out before the end of this > year. > Sounds good to me. When roughly are you hoping to do the 8.2 release? Asking because I have this lingering MR that fixes support for fractional device pixel ratio in the "old"/"native" QVTKOpenGLWidget (the MR predates the new alien one) that I've been wanting to brush up and get merged, but work has just kept me swamped so I haven't gotten to it yet. MR is here: https://gitlab.kitware.com/vtk/vtk/merge_requests/3973 So just wondering whether I have weeks or days to get that done. The native QVTKOpenGLWidget is currently broken to the point of being unusable on fractional (eg 150%) device pixel ratio (for example a Linux/KDE machine with screen scaling set to 150%). > A topic for future discussion is whether we want to continue the existing, > fairly haphazard naming scheme or move to something better, perhaps a > year.month scheme like several other projects have moved to recently. > I'm not a dev, but this would be OK with me. We do internal Ubuntu package builds, and as long as the versioning works well as Ubuntu package versions, I think it sounds like a good idea (I think Debian supports just about any versioning scheme, so no worries). Elvis > thanks for your advice > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From berti_krueger at hotmail.com Wed Sep 26 03:04:49 2018 From: berti_krueger at hotmail.com (=?iso-8859-1?Q?Berti_Kr=FCger?=) Date: Wed, 26 Sep 2018 07:04:49 +0000 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: , Message-ID: Hi David, thanks again for your help. I added the method calls on the normalFilter as you have suggested but it didn't change the wrong voxelization of the Eiffel tower model. It did indead change the result to something different: [cid:ea753225-8561-4c0f-a7b0-2bb764dff664] [cid:a3cf6ebe-b37d-42ec-b0aa-fc502c405607] [cid:4439e9e1-f381-4580-8b22-005d383ff492] left image: result with wrong orientation and without normalsFilter->AutoOrientNormalsOn() center image: mesh with wrong orientation and normalsFilter->AutoOrientNormalsOn() right image: meshlab corrected version I attached both Eiffel tower models (with the wrong normals / polygon orientation and the corrected meshlab version) if you want to try it yourself. The vtkStripper is indead unecessary. I tried various meshes with and without using the vtkStripper filter step inbetween and it didn't make any difference. Since i took it from the Slicer3D source code Csaba pointed me to, i don't have any idea why the Slicer Guys use it there. Maybe they have some special kind of polydata where it is needed. For my general purpose meshes it does not seem to make a difference. The processing is, of course, faster without this additional step. The complete source code for voxelization and visualization and the CMakeList.txt is attached. The resulting code for the voxelization function: bool ConvertPolyDataToBinaryLabelMap(vtkSmartPointer closedSurfacePolyData, vtkSmartPointer binaryLabelMap) { // Check for consistency if (closedSurfacePolyData->GetNumberOfPoints() < 2 || closedSurfacePolyData->GetNumberOfCells() < 2) { std::cout << "Convert: Cannot create binary labelmap from surface with number of points: " << closedSurfacePolyData->GetNumberOfPoints() << " and number of cells: " << closedSurfacePolyData->GetNumberOfCells() << std::endl; return false; } // Compute polydata normals // // The purpose of the vtkPolyDataNormals filter here is to enforce a // consistent orientation of the polygons (via the method ConsistencyOn) // and to get an automatic determination of the correct orientation of the // normals on the polydata surface (via the method AutoOrientNormalsOn). // // To increase the performance of the filter we turn off the splitting of // sharp edges (via the method SplittingOff) since it is not necessary for // getting a correct result here. // // The application of the filter on the polydata is purely optional if all // the polygons are already correctly oriented. vtkNew normalFilter; normalFilter->SetInputData(closedSurfacePolyData); normalFilter->ConsistencyOn(); normalFilter->AutoOrientNormalsOn(); normalFilter->SplittingOff(); // Make sure that we have a clean triangle polydata using the // vtkTriangleFilter which generates triangles from input polygons. // Only needed if the input polygons are not flat. vtkNew triangle; triangle->SetInputConnection(normalFilter->GetOutputPort()); // Convert polydata to stencil vtkNew polyDataToImageStencil; polyDataToImageStencil->SetInputConnection(triangle->GetOutputPort()); polyDataToImageStencil->SetOutputSpacing(binaryLabelMap->GetSpacing()); polyDataToImageStencil->SetOutputOrigin(binaryLabelMap->GetOrigin()); polyDataToImageStencil->SetOutputWholeExtent(binaryLabelMap->GetExtent()); polyDataToImageStencil->Update(); // Convert stencil to image vtkNew imageStencilToImage; imageStencilToImage->SetInputConnection(polyDataToImageStencil->GetOutputPort()); imageStencilToImage->SetOutsideValue(0); imageStencilToImage->SetInsideValue(1); imageStencilToImage->SetOutput(binaryLabelMap); imageStencilToImage->Update(); return true; } Thanks again for everything. Cheers, Berti ________________________________ Von: David Gobbi Gesendet: Dienstag, 25. September 2018 10:20 An: Berti Kr?ger Cc: Csaba Pinter; VTK Users; Bill Lorensen Betreff: Re: [vtkusers] Solid Voxelization with VTK Hi Berti, Just a few extra comments about the three "preprocessing" steps that you apply in your sample code: For vtkPolyDataNormals, you might want to add normalsFilter->AutoOrientNormalsOn(), since this option is specifically designed to fix inside-out shapes like the Eiffel tower model. And normalsFilter->SplittingOff() will make this filter work faster. It would also be good if the comment mentioned that the purpose of the filter is to enforce consistent orientation of the polygons, and that the filter is optional if all the polygons are already correctly oriented. The vtkStripper should be removed, unless you actually saw that it provides some benefit. The vtkPolyDataToImageStencil class should give exactly the same results for triangles as for strips. And vtkTriangleFilter is only needed if the input polygons are not flat. Thanks again for the code, - David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_wrong_orientation.jpg Type: image/jpeg Size: 88782 bytes Desc: eiffel_tower_wrong_orientation.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_right_orientation.jpg Type: image/jpeg Size: 37648 bytes Desc: eiffel_tower_right_orientation.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_false.png Type: image/png Size: 54477 bytes Desc: eiffel_tower_false.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_small.stl Type: application/sla Size: 759184 bytes Desc: eiffel_tower_small.stl URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_small_wrong_orientation.stl Type: application/sla Size: 759184 bytes Desc: eiffel_tower_small_wrong_orientation.stl URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PolyDataToImageDataVisualizationSTL.cxx Type: text/x-c++src Size: 7818 bytes Desc: PolyDataToImageDataVisualizationSTL.cxx URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: CMakeLists.txt URL: From andrew.amaclean at gmail.com Wed Sep 26 04:03:16 2018 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Wed, 26 Sep 2018 18:03:16 +1000 Subject: [vtkusers] Discussion: OK to change VTK's version number from 9.0 to 8.2? Message-ID: Hi Dave, I don't have any issues changing the version number from 9.0 to 8.2. For the future, I would prefer a year.month naming scheme after you do that. At least yy.mm gives you a good clue as to when it was released. Furthermore it will make feature testing in versions easier. Andrew Maclean ---------- Forwarded message ---------- From: David E DeMarle To: vtkdev , "vtkusers at vtk.org" Cc: Bcc: Date: Tue, 25 Sep 2018 18:16:17 -0400 Subject: [vtkusers] Discussion: OK to change VTK's version number from 9.0 to 8.2? Hey Gang, I'd like to change the VTK version number in master from 9.0.0 to 8.2.0. Does anybody object? The proposed change can be found at: https://gitlab.kitware.com/vtk/vtk/merge_requests/4700 I want to do this because it will let me make a release now to preserve what is in master. The larger scale changes we planned for 9.0 will happen shortly after that. 8.2 will and 9.0 may come out before the end of this year. A topic for future discussion is whether we want to continue the existing, fairly haphazard naming scheme or move to something better, perhaps a year.month scheme like several other projects have moved to recently. thanks for your advice David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 > > _______________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrewkeeling at hotmail.com Wed Sep 26 04:04:03 2018 From: andrewkeeling at hotmail.com (andyjk) Date: Wed, 26 Sep 2018 01:04:03 -0700 (MST) Subject: [vtkusers] vtkLookupTable crashes in release mode. VTK8.1.1 In-Reply-To: <1537921851644-0.post@n5.nabble.com> References: <1537901197877-0.post@n5.nabble.com> <1537921851644-0.post@n5.nabble.com> Message-ID: <1537949043944-0.post@n5.nabble.com> Hi This appears to be the same issue as I was having here: http://vtk.1045678.n5.nabble.com/Reverse-color-in-vtkScalarsToColors-tp5741412.html As a minimal example: vtkSmartPointer myTable = vtkSmartPointer::New(); myTable->SetRange(0,100); //myTable->SetHueRange(0.667, 0); // CRASH! Unless in relwithdebug myTable->Build(); It doesn't matter what order you put things. In release mode VTK 8.1.1 will crash with the above example if you uncomment the SetHueRange. It will run fine in ReleaseWithDebugInfo mode. >From the other thread, it seems that VTK internally must not be explicitly setting some variable to '0' (whereas in RelWithDebug the compiler does this for us). So I think this is a VTK logical 'bug' in vtkLookUpTable or one of its subclasses, where a member variable is not explicitly set? Andy -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Zoltan.Kovacs at esi-group.com Wed Sep 26 05:56:59 2018 From: Zoltan.Kovacs at esi-group.com (Zoltan Kovacs) Date: Wed, 26 Sep 2018 09:56:59 +0000 Subject: [vtkusers] Multi block data set for rectilinear grid. Message-ID: Dear all, I have an issue with handling multiblock data of a rectilinear grid. I found an example program to plot the rectilinear grid. I modified this example by inserting some lines which create one block for the grid in a multiblock data set. If I run the example with the original poly data mapper then it shows the grid. However if I comment out the line wireActor->SetMapper(gridMapper); and I use the line wireActor->SetMapper(compMapper); for the multiblock data mapper then no grid appears in the scene. Is it possible that the class vtkCompositePolyDataMapper2 cannot handle data sets and some composite data set mapper is needed for it? I could not find any composite mapper for general data sets. Thanks for your help. Kind regards, Zoltan #include "vtkPolyData.h" #include "vtkPolyDataMapper.h" #include "vtkDataSetMapper.h" #include "vtkActor.h" #include "vtkRenderer.h" #include "vtkRenderWindow.h" #include "vtkRenderWindowInteractor.h" #include "vtkProperty.h" #include "vtkNamedColors.h" #include "vtkPointData.h" #include "vtkDataArray.h" #include "vtkFloatArray.h" #include "vtkRectilinearGrid.h" #include "vtkMultiBlockDataSet.h" #include "vtkCompositePolyDataMapper2.h" #include "vtkCompositeDataDisplayAttributes.h" #define VTK_CREATE(type,name) \ vtkSmartPointer name = vtkSmartPointer::New() #define VTK_INCOM(out,in) out->SetInputConnection(in->GetOutputPort()) int main( int argc, char *argv[] ) { float x[] = { -1.22396, -1.17188, -1.11979, -1.06771, -1.01562, -0.963542, -0.911458, -0.859375, -0.807292, -0.755208, -0.703125, -0.651042, -0.598958, -0.546875, -0.494792, -0.442708, -0.390625, -0.338542, -0.286458, -0.234375, -0.182292, -0.130209, -0.078125, -0.026042, 0.0260415, 0.078125, 0.130208, 0.182291, 0.234375, 0.286458, 0.338542, 0.390625, 0.442708, 0.494792, 0.546875, 0.598958, 0.651042, 0.703125, 0.755208, 0.807292, 0.859375, 0.911458, 0.963542, 1.01562, 1.06771, 1.11979, 1.17188, -100}; float y[] = { -1.25, -1.17188, -1.09375, -1.01562, -0.9375, -0.859375, -0.78125, -0.703125, -0.625, -0.546875, -0.46875, -0.390625, -0.3125, -0.234375, -0.15625, -0.078125, 0, 0.078125, 0.15625, 0.234375, 0.3125, 0.390625, 0.46875, 0.546875, 0.625, 0.703125, 0.78125, 0.859375, 0.9375, 1.01562, 1.09375, 1.17188, 1.25, -100 }; float z[] = { 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.75, 1.8, 1.9, 2, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.75, 2.8, 2.9, 3, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.75, 3.8, 3.9, -100 }; VTK_CREATE(vtkRenderer, renderer); VTK_CREATE(vtkRenderWindow, renderWindow); VTK_CREATE(vtkRenderWindowInteractor, renderWindowInteractor); VTK_CREATE(vtkDataSetMapper, gridMapper); VTK_CREATE(vtkActor, wireActor); VTK_CREATE(vtkFloatArray, xCoords); VTK_CREATE(vtkFloatArray, yCoords); VTK_CREATE(vtkFloatArray, zCoords); VTK_CREATE(vtkRectilinearGrid, grid); VTK_CREATE(vtkMultiBlockDataSet, mbDataSet); VTK_CREATE(vtkCompositePolyDataMapper2, compMapper); VTK_CREATE(vtkCompositeDataDisplayAttributes, dataDispAttrib); int i = 0; while(x[i] > -99) xCoords->InsertNextValue(x[i++]); int j = 0; while(y[j] > -99) yCoords->InsertNextValue(y[j++]); int k = 0; while(z[k] > -99) zCoords->InsertNextValue(z[k++]); grid->SetDimensions(i-1, j-1, k-1); grid->SetXCoordinates(xCoords); grid->SetYCoordinates(yCoords); grid->SetZCoordinates(zCoords); gridMapper->SetInputData(grid); mbDataSet->SetNumberOfBlocks(1); mbDataSet->SetBlock(0, grid); compMapper->SetInputDataObject(mbDataSet); compMapper->SetCompositeDataDisplayAttributes(dataDispAttrib); wireActor->SetMapper(gridMapper); //wireActor->SetMapper(compMapper); wireActor->GetProperty()->SetRepresentationToWireframe(); renderWindow->AddRenderer(renderer); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->AddActor(wireActor); renderer->SetBackground(.3, .6, .3); renderWindow->Render(); renderWindowInteractor->Start(); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Sep 26 07:39:04 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 26 Sep 2018 05:39:04 -0600 Subject: [vtkusers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: References: Message-ID: Hi Dave, If master becomes 8.2, would it be possible for the current release branch to be tagged/released as 8.1.2? The big thing that the release branch has, but that master doesn't, is the old OpenGL backend. I still find the old backend useful for projects that have to run in environments that don't support OpenGL 3.2. - David On Tue, Sep 25, 2018 at 4:16 PM David E DeMarle wrote: > Hey Gang, > > I'd like to change the VTK version number in master from 9.0.0 to 8.2.0. > Does anybody object? > The proposed change can be found at: > https://gitlab.kitware.com/vtk/vtk/merge_requests/4700 > > I want to do this because it will let me make a release now to preserve > what is in master. The larger scale changes we planned for 9.0 will happen > shortly after that. 8.2 will and 9.0 may come out before the end of this > year. > > A topic for future discussion is whether we want to continue the existing, > fairly haphazard naming scheme or move to something better, perhaps a > year.month scheme like several other projects have moved to recently. > > thanks for your advice > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Wed Sep 26 10:13:06 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 26 Sep 2018 10:13:06 -0400 Subject: [vtkusers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: References: Message-ID: Thanks for the feedback. I would like to branch in three weeks and rename master later this week. On Wed, Sep 26, 2018 at 2:59 AM Elvis Stansvik wrote: > Den ons 26 sep. 2018 00:16David E DeMarle > skrev: > >> Hey Gang, >> >> I'd like to change the VTK version number in master from 9.0.0 to 8.2.0. >> Does anybody object? >> The proposed change can be found at: >> https://gitlab.kitware.com/vtk/vtk/merge_requests/4700 >> >> I want to do this because it will let me make a release now to preserve >> what is in master. The larger scale changes we planned for 9.0 will happen >> shortly after that. 8.2 will and 9.0 may come out before the end of this >> year. >> > > Sounds good to me. When roughly are you hoping to do the 8.2 release? > Asking because I have this lingering MR that fixes support for fractional > device pixel ratio in the "old"/"native" QVTKOpenGLWidget (the MR predates > the new alien one) that I've been wanting to brush up and get merged, but > work has just kept me swamped so I haven't gotten to it yet. > > MR is here: https://gitlab.kitware.com/vtk/vtk/merge_requests/3973 > > So just wondering whether I have weeks or days to get that done. > > The native QVTKOpenGLWidget is currently broken to the point of being > unusable on fractional (eg 150%) device pixel ratio (for example a > Linux/KDE machine with screen scaling set to 150%). > > >> A topic for future discussion is whether we want to continue the >> existing, fairly haphazard naming scheme or move to something better, >> perhaps a year.month scheme like several other projects have moved to >> recently. >> > > I'm not a dev, but this would be OK with me. We do internal Ubuntu package > builds, and as long as the versioning works well as Ubuntu package > versions, I think it sounds like a good idea (I think Debian supports just > about any versioning scheme, so no worries). > > Elvis > > >> thanks for your advice >> >> David E DeMarle >> Kitware, Inc. >> Principal Engineer >> 21 Corporate Drive >> Clifton Park, NY 12065-8662 >> Phone: 518-881-4909 >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Wed Sep 26 10:14:43 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 26 Sep 2018 10:14:43 -0400 Subject: [vtkusers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: References: Message-ID: Sure I can tag and publish 8.1.2 while making 8.2.0.rc1 David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Wed, Sep 26, 2018 at 7:39 AM David Gobbi wrote: > Hi Dave, > > If master becomes 8.2, would it be possible for the current release branch > to be tagged/released as 8.1.2? > > The big thing that the release branch has, but that master doesn't, is the > old OpenGL backend. I still find the old backend useful for projects that > have to run in environments that don't support OpenGL 3.2. > > - David > > > On Tue, Sep 25, 2018 at 4:16 PM David E DeMarle > wrote: > >> Hey Gang, >> >> I'd like to change the VTK version number in master from 9.0.0 to 8.2.0. >> Does anybody object? >> The proposed change can be found at: >> https://gitlab.kitware.com/vtk/vtk/merge_requests/4700 >> >> I want to do this because it will let me make a release now to preserve >> what is in master. The larger scale changes we planned for 9.0 will happen >> shortly after that. 8.2 will and 9.0 may come out before the end of this >> year. >> >> A topic for future discussion is whether we want to continue the >> existing, fairly haphazard naming scheme or move to something better, >> perhaps a year.month scheme like several other projects have moved to >> recently. >> >> thanks for your advice >> >> David E DeMarle >> Kitware, Inc. >> Principal Engineer >> 21 Corporate Drive >> Clifton Park, NY 12065-8662 >> Phone: 518-881-4909 >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vpai at g.clemson.edu Wed Sep 26 10:16:38 2018 From: vpai at g.clemson.edu (Vipul Pai Raikar) Date: Wed, 26 Sep 2018 07:16:38 -0700 (MST) Subject: [vtkusers] vtkLookupTable crashes in release mode. VTK8.1.1 In-Reply-To: <1537949043944-0.post@n5.nabble.com> References: <1537901197877-0.post@n5.nabble.com> <1537921851644-0.post@n5.nabble.com> <1537949043944-0.post@n5.nabble.com> Message-ID: <1537971398581-0.post@n5.nabble.com> Hi Andy, Here is the minimum code that works well in setting up a gray colormap. vtkSmartPointer colorTxFn= vtkSmartPointer::New(); for (auto i = 0; i < 256; ++i) { // colorTxFn->AddRGBPoint(i, i/255.0,i/255.0,i/255.0); colorTxFn->AddHSVPoint(i, 0, 0, i / 255.0); } colorTxFn->SetAlpha(1); HTH Vipul -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From vpai at g.clemson.edu Wed Sep 26 10:19:20 2018 From: vpai at g.clemson.edu (Vipul Pai Raikar) Date: Wed, 26 Sep 2018 07:19:20 -0700 (MST) Subject: [vtkusers] vtkLookupTable crashes in release mode. VTK8.1.1 In-Reply-To: <1537949043944-0.post@n5.nabble.com> References: <1537901197877-0.post@n5.nabble.com> <1537921851644-0.post@n5.nabble.com> <1537949043944-0.post@n5.nabble.com> Message-ID: <1537971560234-0.post@n5.nabble.com> Also, I am curious to know as to what the issue is, but haven't investigated further. Like Andras suggests in the other thread, maybe trying to use Appverifier tool could shed some light. I have not used it before and will try this when I have a little more time. V -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From andrea.gavana at gmail.com Wed Sep 26 10:23:08 2018 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Wed, 26 Sep 2018 16:23:08 +0200 Subject: [vtkusers] Simple 2D unstructured grid Message-ID: Hello list, I m trying to create a very, very simple 2D unstructured grid but every time I run my script - no matter what modifications I do - Python crashes hard with a Windows message "Python has stopped working...". A simplified version of my grid is in the picture below (done in Excel, sorry...): [image: image.png] I attach a copy of my script below. Could anyone offer some suggestions on what I am doing wrong? I am using VTK 7.1.0 on Windows 7 64 bit, Python 2.7 64 bit - VTK comes from Christophe Gohlke very useful Python binary wheels. Thank you in advance for your help. Andrea. # -- BEGIN CODE -- # import numpy import vtk import vtk.util.numpy_support as numpy_support # X, Y coordinates of a simple grid - Z is zero X = [600.4957421, 600.5, 600.5, 600.4957421, 600.4913048, 600.5, 600.5, 600.4957421, 600.4913048, 600.4868674, 600.5, 600.5, 600.4913048, 600.4868674, 600.4824301, 600.5, 600.5, 600.4868674, 600.4824301, 600.4779928, 600.5, 600.5, 600.4824301, 600.4779928, 600.4735554, 600.5, 600.5, 600.4779928, 600.4735554] Y = [2940.5, 2940.5, 2940.404044, 2940.5, 2940.6, 2940.6, 2940.5, 2940.5, 2940.6, 2940.7, 2940.7, 2940.6, 2940.6, 2940.7, 2940.8, 2940.8, 2940.7, 2940.7, 2940.8, 2940.9, 2940.9, 2940.8, 2940.8, 2940.9, 2941, 2941, 2940.9, 2940.9, 2941] # First face is triangular, everything else is a 4-sided polygon IDS = [range(4)] IDS += numpy.split(numpy.arange(4, len(X)), 5) npoints = len(X) matrix = numpy.zeros((npoints, 3), numpy.float32) matrix[:, 0] = X matrix[:, 1] = Y # Create the grid points vtk_pts = vtk.vtkPoints() vtk_pts.SetData(numpy_support.numpy_to_vtk(matrix, deep=1)) # Create the unstructured grid grid = vtk.vtkUnstructuredGrid() grid.SetPoints(vtk_pts) # Allocate space for the cells in the grid nc = len(IDS) grid.Allocate(nc) # Loop through all cells for i in xrange(nc): cell_ids = IDS[i] ncoords = len(cell_ids) grid.InsertNextCell(vtk.VTK_POLYGON, ncoords, cell_ids) print grid.GetNumberOfCells(), nc mapper = vtk.vtkDataSetMapper() mapper.SetInputData(grid) actor = vtk.vtkActor() actor.SetMapper(mapper) ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # Add the actors to the renderer, set the background and size ren.AddActor(actor) ren.SetBackground(0, 0, 0) # This allows the interactor to initalize itself. It has to be # called before an event loop. iren.Initialize() ren.ResetCamera() renWin.Render() # Start the event loop. iren.Start() -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 14278 bytes Desc: not available URL: From srbn.ghosh99 at gmail.com Wed Sep 26 11:33:49 2018 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Wed, 26 Sep 2018 08:33:49 -0700 (MST) Subject: [vtkusers] How to convert a mesh file to a volume? Message-ID: <1537976029586-0.post@n5.nabble.com> I have a simplex mesh file . I want to convert to a volume polydata. How to do it? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From lasso at queensu.ca Wed Sep 26 11:37:44 2018 From: lasso at queensu.ca (Andras Lasso) Date: Wed, 26 Sep 2018 15:37:44 +0000 Subject: [vtkusers] Simple 2D unstructured grid In-Reply-To: References: Message-ID: Works well for me in 3D Slicer?s embedded Python 2.7 64 bit, both with latest VTK master and VTK 7.1.0. Andras From: vtkusers On Behalf Of Andrea Gavana Sent: Wednesday, September 26, 2018 10:23 AM To: vtkusers at public.kitware.com Subject: [vtkusers] Simple 2D unstructured grid Hello list, I m trying to create a very, very simple 2D unstructured grid but every time I run my script - no matter what modifications I do - Python crashes hard with a Windows message "Python has stopped working...". A simplified version of my grid is in the picture below (done in Excel, sorry...): [image.png] I attach a copy of my script below. Could anyone offer some suggestions on what I am doing wrong? I am using VTK 7.1.0 on Windows 7 64 bit, Python 2.7 64 bit - VTK comes from Christophe Gohlke very useful Python binary wheels. Thank you in advance for your help. Andrea. # -- BEGIN CODE -- # import numpy import vtk import vtk.util.numpy_support as numpy_support # X, Y coordinates of a simple grid - Z is zero X = [600.4957421, 600.5, 600.5, 600.4957421, 600.4913048, 600.5, 600.5, 600.4957421, 600.4913048, 600.4868674, 600.5, 600.5, 600.4913048, 600.4868674, 600.4824301, 600.5, 600.5, 600.4868674, 600.4824301, 600.4779928, 600.5, 600.5, 600.4824301, 600.4779928, 600.4735554, 600.5, 600.5, 600.4779928, 600.4735554] Y = [2940.5, 2940.5, 2940.404044, 2940.5, 2940.6, 2940.6, 2940.5, 2940.5, 2940.6, 2940.7, 2940.7, 2940.6, 2940.6, 2940.7, 2940.8, 2940.8, 2940.7, 2940.7, 2940.8, 2940.9, 2940.9, 2940.8, 2940.8, 2940.9, 2941, 2941, 2940.9, 2940.9, 2941] # First face is triangular, everything else is a 4-sided polygon IDS = [range(4)] IDS += numpy.split(numpy.arange(4, len(X)), 5) npoints = len(X) matrix = numpy.zeros((npoints, 3), numpy.float32) matrix[:, 0] = X matrix[:, 1] = Y # Create the grid points vtk_pts = vtk.vtkPoints() vtk_pts.SetData(numpy_support.numpy_to_vtk(matrix, deep=1)) # Create the unstructured grid grid = vtk.vtkUnstructuredGrid() grid.SetPoints(vtk_pts) # Allocate space for the cells in the grid nc = len(IDS) grid.Allocate(nc) # Loop through all cells for i in xrange(nc): cell_ids = IDS[i] ncoords = len(cell_ids) grid.InsertNextCell(vtk.VTK_POLYGON, ncoords, cell_ids) print grid.GetNumberOfCells(), nc mapper = vtk.vtkDataSetMapper() mapper.SetInputData(grid) actor = vtk.vtkActor() actor.SetMapper(mapper) ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # Add the actors to the renderer, set the background and size ren.AddActor(actor) ren.SetBackground(0, 0, 0) # This allows the interactor to initalize itself. It has to be # called before an event loop. iren.Initialize() ren.ResetCamera() renWin.Render() # Start the event loop. iren.Start() -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 14278 bytes Desc: image001.png URL: From srbn.ghosh99 at gmail.com Wed Sep 26 11:46:34 2018 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Wed, 26 Sep 2018 08:46:34 -0700 (MST) Subject: [vtkusers] How to build a 3D vtkImageData from a 3D Mesh? Message-ID: <1537976794130-0.post@n5.nabble.com> Dear VTK users I'm trying to build a vtkImageData from a 3D mesh. How to do that? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From andrea.gavana at gmail.com Wed Sep 26 11:52:40 2018 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Wed, 26 Sep 2018 17:52:40 +0200 Subject: [vtkusers] Simple 2D unstructured grid In-Reply-To: References: Message-ID: Hi Andras, On Wed, 26 Sep 2018 at 17:37, Andras Lasso wrote: > Works well for me in 3D Slicer?s embedded Python 2.7 64 bit, both with > latest VTK master and VTK 7.1.0. > Thank you for trying it out. I have upgraded VTK to 7.1.1 from Gohlke's site but the program still crashes Python hard. Does anyone know what might be going on? Andrea. > > > Andras > > > > *From:* vtkusers *On Behalf Of *Andrea > Gavana > *Sent:* Wednesday, September 26, 2018 10:23 AM > *To:* vtkusers at public.kitware.com > *Subject:* [vtkusers] Simple 2D unstructured grid > > > > Hello list, > > > > I m trying to create a very, very simple 2D unstructured grid but > every time I run my script - no matter what modifications I do - Python > crashes hard with a Windows message "Python has stopped working...". > > > > A simplified version of my grid is in the picture below (done in Excel, > sorry...): > > > > [image: image.png] > > > > I attach a copy of my script below. Could anyone offer some suggestions on > what I am doing wrong? I am using VTK 7.1.0 on Windows 7 64 bit, Python 2.7 > 64 bit - VTK comes from Christophe Gohlke very useful Python binary wheels. > > > > Thank you in advance for your help. > > > > Andrea. > > > > > > # -- BEGIN CODE -- # > > > > import numpy > > import vtk > > > > import vtk.util.numpy_support as numpy_support > > > > # X, Y coordinates of a simple grid - Z is zero > > > > X = [600.4957421, 600.5, 600.5, 600.4957421, 600.4913048, 600.5, > > 600.5, 600.4957421, 600.4913048, 600.4868674, 600.5, 600.5, > > 600.4913048, 600.4868674, 600.4824301, 600.5, 600.5, 600.4868674, > > 600.4824301, 600.4779928, 600.5, 600.5, 600.4824301, 600.4779928, > > 600.4735554, 600.5, 600.5, 600.4779928, 600.4735554] > > > > Y = [2940.5, 2940.5, 2940.404044, 2940.5, 2940.6, 2940.6, 2940.5, > > 2940.5, 2940.6, 2940.7, 2940.7, 2940.6, 2940.6, 2940.7, 2940.8, > > 2940.8, 2940.7, 2940.7, 2940.8, 2940.9, 2940.9, 2940.8, 2940.8, > > 2940.9, 2941, 2941, 2940.9, 2940.9, 2941] > > > > # First face is triangular, everything else is a 4-sided polygon > > IDS = [range(4)] > > IDS += numpy.split(numpy.arange(4, len(X)), 5) > > > > npoints = len(X) > > matrix = numpy.zeros((npoints, 3), numpy.float32) > > > > matrix[:, 0] = X > > matrix[:, 1] = Y > > > > # Create the grid points > > vtk_pts = vtk.vtkPoints() > > vtk_pts.SetData(numpy_support.numpy_to_vtk(matrix, deep=1)) > > > > # Create the unstructured grid > > grid = vtk.vtkUnstructuredGrid() > > grid.SetPoints(vtk_pts) > > > > # Allocate space for the cells in the grid > > nc = len(IDS) > > grid.Allocate(nc) > > > > # Loop through all cells > > for i in xrange(nc): > > cell_ids = IDS[i] > > ncoords = len(cell_ids) > > grid.InsertNextCell(vtk.VTK_POLYGON, ncoords, cell_ids) > > > > print grid.GetNumberOfCells(), nc > > > > mapper = vtk.vtkDataSetMapper() > > mapper.SetInputData(grid) > > > > actor = vtk.vtkActor() > > actor.SetMapper(mapper) > > > > ren = vtk.vtkRenderer() > > renWin = vtk.vtkRenderWindow() > > renWin.AddRenderer(ren) > > iren = vtk.vtkRenderWindowInteractor() > > iren.SetRenderWindow(renWin) > > > > # Add the actors to the renderer, set the background and size > > ren.AddActor(actor) > > ren.SetBackground(0, 0, 0) > > > > # This allows the interactor to initalize itself. It has to be > > # called before an event loop. > > iren.Initialize() > > > > ren.ResetCamera() > > renWin.Render() > > > > # Start the event loop. > > iren.Start() > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 14278 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 14278 bytes Desc: not available URL: From scott.wittenburg at kitware.com Wed Sep 26 11:54:26 2018 From: scott.wittenburg at kitware.com (Scott Wittenburg) Date: Wed, 26 Sep 2018 09:54:26 -0600 Subject: [vtkusers] How to build a 3D vtkImageData from a 3D Mesh? In-Reply-To: <1537976794130-0.post@n5.nabble.com> References: <1537976794130-0.post@n5.nabble.com> Message-ID: The vtkResampleToImage filter, mentioned here [1], may be what you're looking for. Cheers, Scott [1] https://blog.kitware.com/dataset-resampling-filters/ On Wed, Sep 26, 2018 at 9:46 AM Shrabani Ghosh wrote: > Dear VTK users > > I'm trying to build a vtkImageData from a 3D mesh. How to do that? > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Wed Sep 26 11:59:58 2018 From: lasso at queensu.ca (Andras Lasso) Date: Wed, 26 Sep 2018 15:59:58 +0000 Subject: [vtkusers] Simple 2D unstructured grid In-Reply-To: References: Message-ID: Your script works well in Paraview?s embedded Python interpreter, too. It seems that something is wrong in your Python/VTK environment. To confirm, you can check if other VTK Python examples crash, too. Andras From: Andrea Gavana Sent: Wednesday, September 26, 2018 11:53 AM To: Andras Lasso Cc: vtkusers at public.kitware.com Subject: Re: [vtkusers] Simple 2D unstructured grid Hi Andras, On Wed, 26 Sep 2018 at 17:37, Andras Lasso > wrote: Works well for me in 3D Slicer?s embedded Python 2.7 64 bit, both with latest VTK master and VTK 7.1.0. Thank you for trying it out. I have upgraded VTK to 7.1.1 from Gohlke's site but the program still crashes Python hard. Does anyone know what might be going on? Andrea. Andras From: vtkusers > On Behalf Of Andrea Gavana Sent: Wednesday, September 26, 2018 10:23 AM To: vtkusers at public.kitware.com Subject: [vtkusers] Simple 2D unstructured grid Hello list, I m trying to create a very, very simple 2D unstructured grid but every time I run my script - no matter what modifications I do - Python crashes hard with a Windows message "Python has stopped working...". A simplified version of my grid is in the picture below (done in Excel, sorry...): [image.png] I attach a copy of my script below. Could anyone offer some suggestions on what I am doing wrong? I am using VTK 7.1.0 on Windows 7 64 bit, Python 2.7 64 bit - VTK comes from Christophe Gohlke very useful Python binary wheels. Thank you in advance for your help. Andrea. # -- BEGIN CODE -- # import numpy import vtk import vtk.util.numpy_support as numpy_support # X, Y coordinates of a simple grid - Z is zero X = [600.4957421, 600.5, 600.5, 600.4957421, 600.4913048, 600.5, 600.5, 600.4957421, 600.4913048, 600.4868674, 600.5, 600.5, 600.4913048, 600.4868674, 600.4824301, 600.5, 600.5, 600.4868674, 600.4824301, 600.4779928, 600.5, 600.5, 600.4824301, 600.4779928, 600.4735554, 600.5, 600.5, 600.4779928, 600.4735554] Y = [2940.5, 2940.5, 2940.404044, 2940.5, 2940.6, 2940.6, 2940.5, 2940.5, 2940.6, 2940.7, 2940.7, 2940.6, 2940.6, 2940.7, 2940.8, 2940.8, 2940.7, 2940.7, 2940.8, 2940.9, 2940.9, 2940.8, 2940.8, 2940.9, 2941, 2941, 2940.9, 2940.9, 2941] # First face is triangular, everything else is a 4-sided polygon IDS = [range(4)] IDS += numpy.split(numpy.arange(4, len(X)), 5) npoints = len(X) matrix = numpy.zeros((npoints, 3), numpy.float32) matrix[:, 0] = X matrix[:, 1] = Y # Create the grid points vtk_pts = vtk.vtkPoints() vtk_pts.SetData(numpy_support.numpy_to_vtk(matrix, deep=1)) # Create the unstructured grid grid = vtk.vtkUnstructuredGrid() grid.SetPoints(vtk_pts) # Allocate space for the cells in the grid nc = len(IDS) grid.Allocate(nc) # Loop through all cells for i in xrange(nc): cell_ids = IDS[i] ncoords = len(cell_ids) grid.InsertNextCell(vtk.VTK_POLYGON, ncoords, cell_ids) print grid.GetNumberOfCells(), nc mapper = vtk.vtkDataSetMapper() mapper.SetInputData(grid) actor = vtk.vtkActor() actor.SetMapper(mapper) ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # Add the actors to the renderer, set the background and size ren.AddActor(actor) ren.SetBackground(0, 0, 0) # This allows the interactor to initalize itself. It has to be # called before an event loop. iren.Initialize() ren.ResetCamera() renWin.Render() # Start the event loop. iren.Start() -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.gavana at gmail.com Wed Sep 26 12:25:22 2018 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Wed, 26 Sep 2018 19:25:22 +0300 Subject: [vtkusers] Simple 2D unstructured grid In-Reply-To: References: Message-ID: Hi Andras, On Wed, 26 Sep 2018 at 19.00, Andras Lasso wrote: > Your script works well in Paraview?s embedded Python interpreter, too. > > > > It seems that something is wrong in your Python/VTK environment. To > confirm, you can check if other VTK Python examples > crash, too. > It appears that the issue is due to my laptop Intel?s integrated graphics card (!). I have tried on another, more serious machine with a NVidia graphics card and the script works flawlessly... I understand that my laptop may not be super duper (it?s fairly new though) in terms of GPU processing but I was not trying to visualize millions of polyhedrons, just 6 polygons... I wonder why VTK bombs out like that... Thank you again for investigating and for your suggestions. Andrea. > > Andras > > > > *From:* Andrea Gavana > *Sent:* Wednesday, September 26, 2018 11:53 AM > *To:* Andras Lasso > *Cc:* vtkusers at public.kitware.com > *Subject:* Re: [vtkusers] Simple 2D unstructured grid > > > > Hi Andras, > > On Wed, 26 Sep 2018 at 17:37, Andras Lasso wrote: > > Works well for me in 3D Slicer?s embedded Python 2.7 64 bit, both with > latest VTK master and VTK 7.1.0. > > > > > > Thank you for trying it out. I have upgraded VTK to 7.1.1 from Gohlke's > site but the program still crashes Python hard. Does anyone know what might > be going on? > > > > Andrea. > > > > > > > > Andras > > > > *From:* vtkusers *On Behalf Of *Andrea > Gavana > *Sent:* Wednesday, September 26, 2018 10:23 AM > *To:* vtkusers at public.kitware.com > *Subject:* [vtkusers] Simple 2D unstructured grid > > > > Hello list, > > > > I m trying to create a very, very simple 2D unstructured grid but > every time I run my script - no matter what modifications I do - Python > crashes hard with a Windows message "Python has stopped working...". > > > > A simplified version of my grid is in the picture below (done in Excel, > sorry...): > > > > [image: image.png] > > > > I attach a copy of my script below. Could anyone offer some suggestions on > what I am doing wrong? I am using VTK 7.1.0 on Windows 7 64 bit, Python 2.7 > 64 bit - VTK comes from Christophe Gohlke very useful Python binary wheels. > > > > Thank you in advance for your help. > > > > Andrea. > > > > > > # -- BEGIN CODE -- # > > > > import numpy > > import vtk > > > > import vtk.util.numpy_support as numpy_support > > > > # X, Y coordinates of a simple grid - Z is zero > > > > X = [600.4957421, 600.5, 600.5, 600.4957421, 600.4913048, 600.5, > > 600.5, 600.4957421, 600.4913048, 600.4868674, 600.5, 600.5, > > 600.4913048, 600.4868674, 600.4824301, 600.5, 600.5, 600.4868674, > > 600.4824301, 600.4779928, 600.5, 600.5, 600.4824301, 600.4779928, > > 600.4735554, 600.5, 600.5, 600.4779928, 600.4735554] > > > > Y = [2940.5, 2940.5, 2940.404044, 2940.5, 2940.6, 2940.6, 2940.5, > > 2940.5, 2940.6, 2940.7, 2940.7, 2940.6, 2940.6, 2940.7, 2940.8, > > 2940.8, 2940.7, 2940.7, 2940.8, 2940.9, 2940.9, 2940.8, 2940.8, > > 2940.9, 2941, 2941, 2940.9, 2940.9, 2941] > > > > # First face is triangular, everything else is a 4-sided polygon > > IDS = [range(4)] > > IDS += numpy.split(numpy.arange(4, len(X)), 5) > > > > npoints = len(X) > > matrix = numpy.zeros((npoints, 3), numpy.float32) > > > > matrix[:, 0] = X > > matrix[:, 1] = Y > > > > # Create the grid points > > vtk_pts = vtk.vtkPoints() > > vtk_pts.SetData(numpy_support.numpy_to_vtk(matrix, deep=1)) > > > > # Create the unstructured grid > > grid = vtk.vtkUnstructuredGrid() > > grid.SetPoints(vtk_pts) > > > > # Allocate space for the cells in the grid > > nc = len(IDS) > > grid.Allocate(nc) > > > > # Loop through all cells > > for i in xrange(nc): > > cell_ids = IDS[i] > > ncoords = len(cell_ids) > > grid.InsertNextCell(vtk.VTK_POLYGON, ncoords, cell_ids) > > > > print grid.GetNumberOfCells(), nc > > > > mapper = vtk.vtkDataSetMapper() > > mapper.SetInputData(grid) > > > > actor = vtk.vtkActor() > > actor.SetMapper(mapper) > > > > ren = vtk.vtkRenderer() > > renWin = vtk.vtkRenderWindow() > > renWin.AddRenderer(ren) > > iren = vtk.vtkRenderWindowInteractor() > > iren.SetRenderWindow(renWin) > > > > # Add the actors to the renderer, set the background and size > > ren.AddActor(actor) > > ren.SetBackground(0, 0, 0) > > > > # This allows the interactor to initalize itself. It has to be > > # called before an event loop. > > iren.Initialize() > > > > ren.ResetCamera() > > renWin.Render() > > > > # Start the event loop. > > iren.Start() > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rubendibattista at gmail.com Wed Sep 26 13:16:00 2018 From: rubendibattista at gmail.com (Ruben Di Battista) Date: Wed, 26 Sep 2018 19:16:00 +0200 Subject: [vtkusers] Simple 2D unstructured grid In-Reply-To: References: Message-ID: I would probably guess that's not your laptop *per se*, but probably how you compiled/installed VTK on it. You could try to use, for example, a Virtual Machine to check that... Are you using Conda? On Wed, Sep 26, 2018 at 6:25 PM Andrea Gavana wrote: > Hi Andras, > > > On Wed, 26 Sep 2018 at 19.00, Andras Lasso wrote: > >> Your script works well in Paraview?s embedded Python interpreter, too. >> >> >> >> It seems that something is wrong in your Python/VTK environment. To >> confirm, you can check if other VTK Python examples >> crash, too. >> > > > It appears that the issue is due to my laptop Intel?s integrated graphics > card (!). I have tried on another, more serious machine with a NVidia > graphics card and the script works flawlessly... > > I understand that my laptop may not be super duper (it?s fairly new > though) in terms of GPU processing but I was not trying to visualize > millions of polyhedrons, just 6 polygons... I wonder why VTK bombs out like > that... > > Thank you again for investigating and for your suggestions. > > Andrea. > > > >> >> Andras >> >> >> >> *From:* Andrea Gavana >> *Sent:* Wednesday, September 26, 2018 11:53 AM >> *To:* Andras Lasso >> *Cc:* vtkusers at public.kitware.com >> *Subject:* Re: [vtkusers] Simple 2D unstructured grid >> >> >> >> Hi Andras, >> >> On Wed, 26 Sep 2018 at 17:37, Andras Lasso wrote: >> >> Works well for me in 3D Slicer?s embedded Python 2.7 64 bit, both with >> latest VTK master and VTK 7.1.0. >> >> >> >> >> >> Thank you for trying it out. I have upgraded VTK to 7.1.1 from Gohlke's >> site but the program still crashes Python hard. Does anyone know what might >> be going on? >> >> >> >> Andrea. >> >> >> >> >> >> >> >> Andras >> >> >> >> *From:* vtkusers *On Behalf Of *Andrea >> Gavana >> *Sent:* Wednesday, September 26, 2018 10:23 AM >> *To:* vtkusers at public.kitware.com >> *Subject:* [vtkusers] Simple 2D unstructured grid >> >> >> >> Hello list, >> >> >> >> I m trying to create a very, very simple 2D unstructured grid but >> every time I run my script - no matter what modifications I do - Python >> crashes hard with a Windows message "Python has stopped working...". >> >> >> >> A simplified version of my grid is in the picture below (done in Excel, >> sorry...): >> >> >> >> [image: image.png] >> >> >> >> I attach a copy of my script below. Could anyone offer some suggestions >> on what I am doing wrong? I am using VTK 7.1.0 on Windows 7 64 bit, Python >> 2.7 64 bit - VTK comes from Christophe Gohlke very useful Python binary >> wheels. >> >> >> >> Thank you in advance for your help. >> >> >> >> Andrea. >> >> >> >> >> >> # -- BEGIN CODE -- # >> >> >> >> import numpy >> >> import vtk >> >> >> >> import vtk.util.numpy_support as numpy_support >> >> >> >> # X, Y coordinates of a simple grid - Z is zero >> >> >> >> X = [600.4957421, 600.5, 600.5, 600.4957421, 600.4913048, 600.5, >> >> 600.5, 600.4957421, 600.4913048, 600.4868674, 600.5, 600.5, >> >> 600.4913048, 600.4868674, 600.4824301, 600.5, 600.5, 600.4868674, >> >> 600.4824301, 600.4779928, 600.5, 600.5, 600.4824301, 600.4779928, >> >> 600.4735554, 600.5, 600.5, 600.4779928, 600.4735554] >> >> >> >> Y = [2940.5, 2940.5, 2940.404044, 2940.5, 2940.6, 2940.6, 2940.5, >> >> 2940.5, 2940.6, 2940.7, 2940.7, 2940.6, 2940.6, 2940.7, 2940.8, >> >> 2940.8, 2940.7, 2940.7, 2940.8, 2940.9, 2940.9, 2940.8, 2940.8, >> >> 2940.9, 2941, 2941, 2940.9, 2940.9, 2941] >> >> >> >> # First face is triangular, everything else is a 4-sided polygon >> >> IDS = [range(4)] >> >> IDS += numpy.split(numpy.arange(4, len(X)), 5) >> >> >> >> npoints = len(X) >> >> matrix = numpy.zeros((npoints, 3), numpy.float32) >> >> >> >> matrix[:, 0] = X >> >> matrix[:, 1] = Y >> >> >> >> # Create the grid points >> >> vtk_pts = vtk.vtkPoints() >> >> vtk_pts.SetData(numpy_support.numpy_to_vtk(matrix, deep=1)) >> >> >> >> # Create the unstructured grid >> >> grid = vtk.vtkUnstructuredGrid() >> >> grid.SetPoints(vtk_pts) >> >> >> >> # Allocate space for the cells in the grid >> >> nc = len(IDS) >> >> grid.Allocate(nc) >> >> >> >> # Loop through all cells >> >> for i in xrange(nc): >> >> cell_ids = IDS[i] >> >> ncoords = len(cell_ids) >> >> grid.InsertNextCell(vtk.VTK_POLYGON, ncoords, cell_ids) >> >> >> >> print grid.GetNumberOfCells(), nc >> >> >> >> mapper = vtk.vtkDataSetMapper() >> >> mapper.SetInputData(grid) >> >> >> >> actor = vtk.vtkActor() >> >> actor.SetMapper(mapper) >> >> >> >> ren = vtk.vtkRenderer() >> >> renWin = vtk.vtkRenderWindow() >> >> renWin.AddRenderer(ren) >> >> iren = vtk.vtkRenderWindowInteractor() >> >> iren.SetRenderWindow(renWin) >> >> >> >> # Add the actors to the renderer, set the background and size >> >> ren.AddActor(actor) >> >> ren.SetBackground(0, 0, 0) >> >> >> >> # This allows the interactor to initalize itself. It has to be >> >> # called before an event loop. >> >> iren.Initialize() >> >> >> >> ren.ResetCamera() >> >> renWin.Render() >> >> >> >> # Start the event loop. >> >> iren.Start() >> >> >> >> >> >> _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -- _ -. .? |???? ', ; |?????? ?? |????????? RdB ,., |?????? .' '. |???? -' `' https://rdb.is -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.gavana at gmail.com Wed Sep 26 13:51:36 2018 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Wed, 26 Sep 2018 20:51:36 +0300 Subject: [vtkusers] Simple 2D unstructured grid In-Reply-To: References: Message-ID: Hi, On Wed, 26 Sep 2018 at 20.16, Ruben Di Battista wrote: > I would probably guess that's not your laptop *per se*, but probably how > you compiled/installed VTK on it. You could try to use, for example, a > Virtual Machine to check that... > > Are you using Conda? > > No, as I wrote in a previous message, I used Christophe Gohlke?s precompiled Python wheel for Windows. Since they are for Python 2.7 64 bit, there is no underlying reason for them not to work, unless VTK is incompatible with my graphics card for some reason. Even then, though, I don?t think VTK should bomb out the interpreter. Some sort of exception raised is surely far more preferable to a hard crash, no? Andrea. On Wed, Sep 26, 2018 at 6:25 PM Andrea Gavana > wrote: > >> Hi Andras, >> >> >> On Wed, 26 Sep 2018 at 19.00, Andras Lasso wrote: >> >>> Your script works well in Paraview?s embedded Python interpreter, too. >>> >>> >>> >>> It seems that something is wrong in your Python/VTK environment. To >>> confirm, you can check if other VTK Python examples >>> crash, too. >>> >> >> >> It appears that the issue is due to my laptop Intel?s integrated graphics >> card (!). I have tried on another, more serious machine with a NVidia >> graphics card and the script works flawlessly... >> >> I understand that my laptop may not be super duper (it?s fairly new >> though) in terms of GPU processing but I was not trying to visualize >> millions of polyhedrons, just 6 polygons... I wonder why VTK bombs out like >> that... >> >> Thank you again for investigating and for your suggestions. >> >> Andrea. >> >> >> >>> >>> Andras >>> >>> >>> >>> *From:* Andrea Gavana >>> *Sent:* Wednesday, September 26, 2018 11:53 AM >>> *To:* Andras Lasso >>> *Cc:* vtkusers at public.kitware.com >>> *Subject:* Re: [vtkusers] Simple 2D unstructured grid >>> >>> >>> >>> Hi Andras, >>> >>> On Wed, 26 Sep 2018 at 17:37, Andras Lasso wrote: >>> >>> Works well for me in 3D Slicer?s embedded Python 2.7 64 bit, both with >>> latest VTK master and VTK 7.1.0. >>> >>> >>> >>> >>> >>> Thank you for trying it out. I have upgraded VTK to 7.1.1 from Gohlke's >>> site but the program still crashes Python hard. Does anyone know what might >>> be going on? >>> >>> >>> >>> Andrea. >>> >>> >>> >>> >>> >>> >>> >>> Andras >>> >>> >>> >>> *From:* vtkusers *On Behalf Of *Andrea >>> Gavana >>> *Sent:* Wednesday, September 26, 2018 10:23 AM >>> *To:* vtkusers at public.kitware.com >>> *Subject:* [vtkusers] Simple 2D unstructured grid >>> >>> >>> >>> Hello list, >>> >>> >>> >>> I m trying to create a very, very simple 2D unstructured grid but >>> every time I run my script - no matter what modifications I do - Python >>> crashes hard with a Windows message "Python has stopped working...". >>> >>> >>> >>> A simplified version of my grid is in the picture below (done in Excel, >>> sorry...): >>> >>> >>> >>> [image: image.png] >>> >>> >>> >>> I attach a copy of my script below. Could anyone offer some suggestions >>> on what I am doing wrong? I am using VTK 7.1.0 on Windows 7 64 bit, Python >>> 2.7 64 bit - VTK comes from Christophe Gohlke very useful Python binary >>> wheels. >>> >>> >>> >>> Thank you in advance for your help. >>> >>> >>> >>> Andrea. >>> >>> >>> >>> >>> >>> # -- BEGIN CODE -- # >>> >>> >>> >>> import numpy >>> >>> import vtk >>> >>> >>> >>> import vtk.util.numpy_support as numpy_support >>> >>> >>> >>> # X, Y coordinates of a simple grid - Z is zero >>> >>> >>> >>> X = [600.4957421, 600.5, 600.5, 600.4957421, 600.4913048, 600.5, >>> >>> 600.5, 600.4957421, 600.4913048, 600.4868674, 600.5, 600.5, >>> >>> 600.4913048, 600.4868674, 600.4824301, 600.5, 600.5, 600.4868674, >>> >>> 600.4824301, 600.4779928, 600.5, 600.5, 600.4824301, 600.4779928, >>> >>> 600.4735554, 600.5, 600.5, 600.4779928, 600.4735554] >>> >>> >>> >>> Y = [2940.5, 2940.5, 2940.404044, 2940.5, 2940.6, 2940.6, 2940.5, >>> >>> 2940.5, 2940.6, 2940.7, 2940.7, 2940.6, 2940.6, 2940.7, 2940.8, >>> >>> 2940.8, 2940.7, 2940.7, 2940.8, 2940.9, 2940.9, 2940.8, 2940.8, >>> >>> 2940.9, 2941, 2941, 2940.9, 2940.9, 2941] >>> >>> >>> >>> # First face is triangular, everything else is a 4-sided polygon >>> >>> IDS = [range(4)] >>> >>> IDS += numpy.split(numpy.arange(4, len(X)), 5) >>> >>> >>> >>> npoints = len(X) >>> >>> matrix = numpy.zeros((npoints, 3), numpy.float32) >>> >>> >>> >>> matrix[:, 0] = X >>> >>> matrix[:, 1] = Y >>> >>> >>> >>> # Create the grid points >>> >>> vtk_pts = vtk.vtkPoints() >>> >>> vtk_pts.SetData(numpy_support.numpy_to_vtk(matrix, deep=1)) >>> >>> >>> >>> # Create the unstructured grid >>> >>> grid = vtk.vtkUnstructuredGrid() >>> >>> grid.SetPoints(vtk_pts) >>> >>> >>> >>> # Allocate space for the cells in the grid >>> >>> nc = len(IDS) >>> >>> grid.Allocate(nc) >>> >>> >>> >>> # Loop through all cells >>> >>> for i in xrange(nc): >>> >>> cell_ids = IDS[i] >>> >>> ncoords = len(cell_ids) >>> >>> grid.InsertNextCell(vtk.VTK_POLYGON, ncoords, cell_ids) >>> >>> >>> >>> print grid.GetNumberOfCells(), nc >>> >>> >>> >>> mapper = vtk.vtkDataSetMapper() >>> >>> mapper.SetInputData(grid) >>> >>> >>> >>> actor = vtk.vtkActor() >>> >>> actor.SetMapper(mapper) >>> >>> >>> >>> ren = vtk.vtkRenderer() >>> >>> renWin = vtk.vtkRenderWindow() >>> >>> renWin.AddRenderer(ren) >>> >>> iren = vtk.vtkRenderWindowInteractor() >>> >>> iren.SetRenderWindow(renWin) >>> >>> >>> >>> # Add the actors to the renderer, set the background and size >>> >>> ren.AddActor(actor) >>> >>> ren.SetBackground(0, 0, 0) >>> >>> >>> >>> # This allows the interactor to initalize itself. It has to be >>> >>> # called before an event loop. >>> >>> iren.Initialize() >>> >>> >>> >>> ren.ResetCamera() >>> >>> renWin.Render() >>> >>> >>> >>> # Start the event loop. >>> >>> iren.Start() >>> >>> >>> >>> >>> >>> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers > > >> > > -- > _ > -. .? |???? > ', ; |?????? > ?? |????????? RdB > ,., |?????? > .' '. |???? > -' `' > https://rdb.is > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.hedges at lickenbrocktech.com Wed Sep 26 16:12:04 2018 From: robert.hedges at lickenbrocktech.com (robert.hedges at lickenbrocktech.com) Date: Wed, 26 Sep 2018 13:12:04 -0700 Subject: [vtkusers] Segfault when Adding Renderer in Linux but now Window Message-ID: <20180926131204.e8a0b42edd196f3ea490d37867d907e3.b2f1835b43.mailapi@email09.godaddy.com> I'm running VTK master branch (qt 5.10.1) and have code that will run in Windows but not in Linux: The ui file defines the qvtkWidget as a QVTKOpenGLWidget These lines run as expected: vtkSmartPointer vRendWin=vtkSmartPointer::New(); vtkSmartPointer vRend=vtkSmartPointer::New(); ui.qvtkWidget->SetRenderWindow(vRendWin); However, this line causes a segfault: ui.qvtkWidget->GetRenderWindow()->AddRenderer(vRend); -------------- next part -------------- An HTML attachment was scrubbed... URL: From nztoddler at yahoo.com Wed Sep 26 18:33:19 2018 From: nztoddler at yahoo.com (Todd) Date: Thu, 27 Sep 2018 10:33:19 +1200 Subject: [vtkusers] [vtk-developers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Wed Sep 26 22:11:59 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Thu, 27 Sep 2018 11:11:59 +0900 Subject: [vtkusers] Multi block data set for rectilinear grid. In-Reply-To: References: Message-ID: Hi, I think it is always necessary to extract surface geometry for composite non-polydata sets by vtkCompositeDataGeometryFilter before applying vtkCompositePolyDataMapper2. mbDataSet->SetNumberOfBlocks(1); mbDataSet->SetBlock(0, grid); VTK_CREATE(vtkCompositeDataGeometryFilter, surface); surface->SetInputData(mbDataSet); compMapper->SetInputConnection(surface->GetOutputPort()); compMapper->SetCompositeDataDisplayAttributes(dataDispAttrib); Regards, 2018?9?26?(?) 18:57 Zoltan Kovacs : > > Dear all, > > > > I have an issue with handling multiblock data of a rectilinear grid. I found an example program to plot the rectilinear grid. I modified this example > > by inserting some lines which create one block for the grid in a multiblock data set. If I run the example with the original poly data mapper then > > it shows the grid. > > However if I comment out the line > > wireActor->SetMapper(gridMapper); > > and I use the line > > wireActor->SetMapper(compMapper); > > for the multiblock data mapper then no grid appears in the scene. Is it possible that the class vtkCompositePolyDataMapper2 cannot handle data sets and some composite data set mapper is needed for it? I could not find any composite mapper for general data sets. Thanks for your help. > > > > Kind regards, > > Zoltan > > > > > > #include "vtkPolyData.h" > > #include "vtkPolyDataMapper.h" > > #include "vtkDataSetMapper.h" > > #include "vtkActor.h" > > #include "vtkRenderer.h" > > #include "vtkRenderWindow.h" > > #include "vtkRenderWindowInteractor.h" > > #include "vtkProperty.h" > > #include "vtkNamedColors.h" > > #include "vtkPointData.h" > > #include "vtkDataArray.h" > > #include "vtkFloatArray.h" > > #include "vtkRectilinearGrid.h" > > #include "vtkMultiBlockDataSet.h" > > #include "vtkCompositePolyDataMapper2.h" > > #include "vtkCompositeDataDisplayAttributes.h" > > > > #define VTK_CREATE(type,name) \ > > vtkSmartPointer name = vtkSmartPointer::New() > > #define VTK_INCOM(out,in) out->SetInputConnection(in->GetOutputPort()) > > > > int main( int argc, char *argv[] ) > > { > > float x[] = { > > -1.22396, -1.17188, -1.11979, -1.06771, -1.01562, -0.963542, > > -0.911458, -0.859375, -0.807292, -0.755208, -0.703125, -0.651042, > > -0.598958, -0.546875, -0.494792, -0.442708, -0.390625, -0.338542, > > -0.286458, -0.234375, -0.182292, -0.130209, -0.078125, -0.026042, > > 0.0260415, 0.078125, 0.130208, 0.182291, 0.234375, 0.286458, > > 0.338542, 0.390625, 0.442708, 0.494792, 0.546875, 0.598958, > > 0.651042, 0.703125, 0.755208, 0.807292, 0.859375, 0.911458, > > 0.963542, 1.01562, 1.06771, 1.11979, 1.17188, -100}; > > > > float y[] = { > > -1.25, -1.17188, -1.09375, -1.01562, -0.9375, -0.859375, > > -0.78125, -0.703125, -0.625, -0.546875, -0.46875, -0.390625, > > -0.3125, -0.234375, -0.15625, -0.078125, 0, 0.078125, > > 0.15625, 0.234375, 0.3125, 0.390625, 0.46875, 0.546875, > > 0.625, 0.703125, 0.78125, 0.859375, 0.9375, 1.01562, > > 1.09375, 1.17188, 1.25, -100 }; > > > > float z[] = { > > 0, 0.1, 0.2, 0.3, 0.4, 0.5, > > 0.6, 0.7, 0.75, 0.8, 0.9, 1, > > 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, > > 1.7, 1.75, 1.8, 1.9, 2, 2.1, > > 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, > > 2.75, 2.8, 2.9, 3, 3.1, 3.2, > > 3.3, 3.4, 3.5, 3.6, 3.7, 3.75, > > 3.8, 3.9, -100 }; > > > > VTK_CREATE(vtkRenderer, renderer); > > VTK_CREATE(vtkRenderWindow, renderWindow); > > VTK_CREATE(vtkRenderWindowInteractor, renderWindowInteractor); > > VTK_CREATE(vtkDataSetMapper, gridMapper); > > VTK_CREATE(vtkActor, wireActor); > > VTK_CREATE(vtkFloatArray, xCoords); > > VTK_CREATE(vtkFloatArray, yCoords); > > VTK_CREATE(vtkFloatArray, zCoords); > > VTK_CREATE(vtkRectilinearGrid, grid); > > VTK_CREATE(vtkMultiBlockDataSet, mbDataSet); > > VTK_CREATE(vtkCompositePolyDataMapper2, compMapper); > > VTK_CREATE(vtkCompositeDataDisplayAttributes, dataDispAttrib); > > > > int i = 0; > > while(x[i] > -99) > > xCoords->InsertNextValue(x[i++]); > > int j = 0; > > while(y[j] > -99) > > yCoords->InsertNextValue(y[j++]); > > > > int k = 0; > > while(z[k] > -99) > > zCoords->InsertNextValue(z[k++]); > > > > grid->SetDimensions(i-1, j-1, k-1); > > grid->SetXCoordinates(xCoords); > > grid->SetYCoordinates(yCoords); > > grid->SetZCoordinates(zCoords); > > gridMapper->SetInputData(grid); > > > > mbDataSet->SetNumberOfBlocks(1); > > mbDataSet->SetBlock(0, grid); > > > > compMapper->SetInputDataObject(mbDataSet); > > compMapper->SetCompositeDataDisplayAttributes(dataDispAttrib); > > > > wireActor->SetMapper(gridMapper); > > //wireActor->SetMapper(compMapper); > > wireActor->GetProperty()->SetRepresentationToWireframe(); > > > > renderWindow->AddRenderer(renderer); > > renderWindowInteractor->SetRenderWindow(renderWindow); > > > > renderer->AddActor(wireActor); > > renderer->SetBackground(.3, .6, .3); > > > > renderWindow->Render(); > > renderWindowInteractor->Start(); > > } > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From mathieu.westphal at kitware.com Thu Sep 27 04:19:19 2018 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Thu, 27 Sep 2018 10:19:19 +0200 Subject: [vtkusers] Segfault when Adding Renderer in Linux but now Window In-Reply-To: <20180926131204.e8a0b42edd196f3ea490d37867d907e3.b2f1835b43.mailapi@email09.godaddy.com> References: <20180926131204.e8a0b42edd196f3ea490d37867d907e3.b2f1835b43.mailapi@email09.godaddy.com> Message-ID: Hi Robert, Please take a look into VTK/GUISupport/Qt/Testing/Cxx/QVTKOpenGLWidget* for example usage of the QVTKOpenGLWidget Best, Mathieu Westphal On Wed, Sep 26, 2018 at 10:19 PM wrote: > > > I'm running VTK master branch (qt 5.10.1) and have code that will run in > Windows but not in Linux: > > The ui file defines the qvtkWidget as a QVTKOpenGLWidget > > These lines run as expected: > > > vtkSmartPointer > vRendWin=vtkSmartPointer::New(); > vtkSmartPointer vRend=vtkSmartPointer::New(); > ui.qvtkWidget->SetRenderWindow(vRendWin); > > > However, this line causes a segfault: > > > ui.qvtkWidget->GetRenderWindow()->AddRenderer(vRend); > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Zoltan.Kovacs at esi-group.com Thu Sep 27 05:59:46 2018 From: Zoltan.Kovacs at esi-group.com (Zoltan Kovacs) Date: Thu, 27 Sep 2018 09:59:46 +0000 Subject: [vtkusers] Multi block data set for rectilinear grid. In-Reply-To: References: Message-ID: Hi Kenichiro, Thanks for your help. That was exactly I needed. It works now! Kind regards, Zoltan -----Original Message----- From: kenichiro yoshimi Sent: Donnerstag, 27. September 2018 04:12 To: Zoltan Kovacs Cc: vtkusers Subject: Re: [vtkusers] Multi block data set for rectilinear grid. Hi, I think it is always necessary to extract surface geometry for composite non-polydata sets by vtkCompositeDataGeometryFilter before applying vtkCompositePolyDataMapper2. mbDataSet->SetNumberOfBlocks(1); mbDataSet->SetBlock(0, grid); VTK_CREATE(vtkCompositeDataGeometryFilter, surface); surface->SetInputData(mbDataSet); compMapper->SetInputConnection(surface->GetOutputPort()); compMapper->SetCompositeDataDisplayAttributes(dataDispAttrib); Regards, 2018?9?26?(?) 18:57 Zoltan Kovacs : > > Dear all, > > > > I have an issue with handling multiblock data of a rectilinear grid. I > found an example program to plot the rectilinear grid. I modified this > example > > by inserting some lines which create one block for the grid in a > multiblock data set. If I run the example with the original poly data > mapper then > > it shows the grid. > > However if I comment out the line > > wireActor->SetMapper(gridMapper); > > and I use the line > > wireActor->SetMapper(compMapper); > > for the multiblock data mapper then no grid appears in the scene. Is it possible that the class vtkCompositePolyDataMapper2 cannot handle data sets and some composite data set mapper is needed for it? I could not find any composite mapper for general data sets. Thanks for your help. > > > > Kind regards, > > Zoltan > > > > > > #include "vtkPolyData.h" > > #include "vtkPolyDataMapper.h" > > #include "vtkDataSetMapper.h" > > #include "vtkActor.h" > > #include "vtkRenderer.h" > > #include "vtkRenderWindow.h" > > #include "vtkRenderWindowInteractor.h" > > #include "vtkProperty.h" > > #include "vtkNamedColors.h" > > #include "vtkPointData.h" > > #include "vtkDataArray.h" > > #include "vtkFloatArray.h" > > #include "vtkRectilinearGrid.h" > > #include "vtkMultiBlockDataSet.h" > > #include "vtkCompositePolyDataMapper2.h" > > #include "vtkCompositeDataDisplayAttributes.h" > > > > #define VTK_CREATE(type,name) \ > > vtkSmartPointer name = vtkSmartPointer::New() > > #define VTK_INCOM(out,in) out->SetInputConnection(in->GetOutputPort()) > > > > int main( int argc, char *argv[] ) > > { > > float x[] = { > > -1.22396, -1.17188, -1.11979, -1.06771, -1.01562, -0.963542, > > -0.911458, -0.859375, -0.807292, -0.755208, -0.703125, -0.651042, > > -0.598958, -0.546875, -0.494792, -0.442708, -0.390625, -0.338542, > > -0.286458, -0.234375, -0.182292, -0.130209, -0.078125, -0.026042, > > 0.0260415, 0.078125, 0.130208, 0.182291, 0.234375, 0.286458, > > 0.338542, 0.390625, 0.442708, 0.494792, 0.546875, 0.598958, > > 0.651042, 0.703125, 0.755208, 0.807292, 0.859375, 0.911458, > > 0.963542, 1.01562, 1.06771, 1.11979, 1.17188, -100}; > > > > float y[] = { > > -1.25, -1.17188, -1.09375, -1.01562, -0.9375, -0.859375, > > -0.78125, -0.703125, -0.625, -0.546875, -0.46875, -0.390625, > > -0.3125, -0.234375, -0.15625, -0.078125, 0, 0.078125, > > 0.15625, 0.234375, 0.3125, 0.390625, 0.46875, 0.546875, > > 0.625, 0.703125, 0.78125, 0.859375, 0.9375, 1.01562, > > 1.09375, 1.17188, 1.25, -100 }; > > > > float z[] = { > > 0, 0.1, 0.2, 0.3, 0.4, 0.5, > > 0.6, 0.7, 0.75, 0.8, 0.9, 1, > > 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, > > 1.7, 1.75, 1.8, 1.9, 2, 2.1, > > 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, > > 2.75, 2.8, 2.9, 3, 3.1, 3.2, > > 3.3, 3.4, 3.5, 3.6, 3.7, 3.75, > > 3.8, 3.9, -100 }; > > > > VTK_CREATE(vtkRenderer, renderer); > > VTK_CREATE(vtkRenderWindow, renderWindow); > > VTK_CREATE(vtkRenderWindowInteractor, renderWindowInteractor); > > VTK_CREATE(vtkDataSetMapper, gridMapper); > > VTK_CREATE(vtkActor, wireActor); > > VTK_CREATE(vtkFloatArray, xCoords); > > VTK_CREATE(vtkFloatArray, yCoords); > > VTK_CREATE(vtkFloatArray, zCoords); > > VTK_CREATE(vtkRectilinearGrid, grid); > > VTK_CREATE(vtkMultiBlockDataSet, mbDataSet); > > VTK_CREATE(vtkCompositePolyDataMapper2, compMapper); > > VTK_CREATE(vtkCompositeDataDisplayAttributes, dataDispAttrib); > > > > int i = 0; > > while(x[i] > -99) > > xCoords->InsertNextValue(x[i++]); > > int j = 0; > > while(y[j] > -99) > > yCoords->InsertNextValue(y[j++]); > > > > int k = 0; > > while(z[k] > -99) > > zCoords->InsertNextValue(z[k++]); > > > > grid->SetDimensions(i-1, j-1, k-1); > > grid->SetXCoordinates(xCoords); > > grid->SetYCoordinates(yCoords); > > grid->SetZCoordinates(zCoords); > > gridMapper->SetInputData(grid); > > > > mbDataSet->SetNumberOfBlocks(1); > > mbDataSet->SetBlock(0, grid); > > > > compMapper->SetInputDataObject(mbDataSet); > > compMapper->SetCompositeDataDisplayAttributes(dataDispAttrib); > > > > wireActor->SetMapper(gridMapper); > > //wireActor->SetMapper(compMapper); > > wireActor->GetProperty()->SetRepresentationToWireframe(); > > > > renderWindow->AddRenderer(renderer); > > renderWindowInteractor->SetRenderWindow(renderWindow); > > > > renderer->AddActor(wireActor); > > renderer->SetBackground(.3, .6, .3); > > > > renderWindow->Render(); > > renderWindowInteractor->Start(); > > } > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From andrea.gavana at gmail.com Thu Sep 27 08:16:10 2018 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Thu, 27 Sep 2018 14:16:10 +0200 Subject: [vtkusers] vtkLinearExtrusionFilter and number of cells Message-ID: Dear list, I have a very simple script that generates a 2D polydata (similar to a 2D unstructured grid). In this simple script, the polydata has 6 cells. I then apply a vtkLinearExtrusionFilter to make this polydata "3D", by extruding the polydata across the Z direction. The resulting unstructured grid, though, has 41 cells (!). I was expecting it to have the same number of cells as the polydata itself, since the polydata should be implicitly converted into a polyhedron while extruding it... I am surely missing something, as maybe "cells" has a different meaning in 2D and 3D. I paste below a small Python example showing what I mean. Any suggestion/clarification would be more than welcome - especially on how to convert a polydata into a polyhedron while keeping the same number of cells. Thank you in advance. Andrea. # Begin code import vtk as vtk import numpy import vtk.util.numpy_support as numpy_support # X, Y coordinates of a simple grid - Z is zero X = [600.4957421, 600.5, 600.5, 600.4957421, 600.4913048, 600.5, 600.5, 600.4957421, 600.4913048, 600.4868674, 600.5, 600.5, 600.4913048, 600.4868674, 600.4824301, 600.5, 600.5, 600.4868674, 600.4824301, 600.4779928, 600.5, 600.5, 600.4824301, 600.4779928, 600.4735554, 600.5, 600.5, 600.4779928, 600.4735554] Y = [2940.5, 2940.5, 2940.404044, 2940.5, 2940.6, 2940.6, 2940.5, 2940.5, 2940.6, 2940.7, 2940.7, 2940.6, 2940.6, 2940.7, 2940.8, 2940.8, 2940.7, 2940.7, 2940.8, 2940.9, 2940.9, 2940.8, 2940.8, 2940.9, 2941, 2941, 2940.9, 2940.9, 2941] # First face is triangular, everything else is a 4-sided polygon IDS = [range(4)] IDS += numpy.split(numpy.arange(4, len(X)), 5) npoints = len(X) matrix = numpy.zeros((npoints, 3), numpy.float32) matrix[:, 0] = X matrix[:, 1] = Y # Create the grid points vtk_pts = vtk.vtkPoints() vtk_pts.SetData(numpy_support.numpy_to_vtk(matrix, deep=1)) # Create the polydata grid = vtk.vtkPolyData() grid.SetPoints(vtk_pts) # Allocate space for the cells in the grid nc = len(IDS) grid.Allocate(nc) # Loop through all cells for i in xrange(nc): cell_ids = IDS[i] ncoords = len(cell_ids) grid.InsertNextCell(vtk.VTK_POLYGON, ncoords, cell_ids) print 'Polydata Cells:', grid.GetNumberOfCells() extrude = vtk.vtkLinearExtrusionFilter() extrude.SetInputData(grid) extrude.SetExtrusionType(1) extrude.SetVector(0, 0, 1) extrude.CappingOn() extrude.SetScaleFactor(1) extrude.Update() ugrid = extrude.GetOutput() print 'Extruded Cells:', ugrid.GetNumberOfCells() -------------- next part -------------- An HTML attachment was scrubbed... URL: From shawn.waldon at kitware.com Thu Sep 27 10:29:07 2018 From: shawn.waldon at kitware.com (Shawn Waldon) Date: Thu, 27 Sep 2018 10:29:07 -0400 Subject: [vtkusers] [vtk-developers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: References: Message-ID: Hi Todd, You have a good point, but VTK's current versioning system doesn't guarantee anything about minor/major version changes. Even our "minor" version updates can and do have breaking changes and removed modules. If we followed strict semantic versioning then every release would be a major release. I think the main argument in favor of year.month is that it no longer seems to promise something we don't provide in terms of compatibility. Shawn On Wed, Sep 26, 2018 at 6:33 PM, Todd via vtk-developers < vtk-developers at public.kitware.com> wrote: > I have no objection, but I have to ask "What does the major version number > change mean? Does it signify breaking changes or the addition of > new/removal of old modules?" > > In regards to some of the other feedback; the problem with month.year > versioning is that it represents nothing more than chronology. How would > new/deprecated features be signalled? > > On 27 Sep 2018 2:13 a.m., David E DeMarle > wrote: > > Thanks for the feedback. I would like to branch in three weeks and rename > master later this week. > > On Wed, Sep 26, 2018 at 2:59 AM Elvis Stansvik < > elvis.stansvik at orexplore.com> wrote: > > Den ons 26 sep. 2018 00:16David E DeMarle > skrev: > > Hey Gang, > > I'd like to change the VTK version number in master from 9.0.0 to 8.2.0. > Does anybody object? > The proposed change can be found at: https://gitlab.kitware.com/ > vtk/vtk/merge_requests/4700 > > I want to do this because it will let me make a release now to preserve > what is in master. The larger scale changes we planned for 9.0 will happen > shortly after that. 8.2 will and 9.0 may come out before the end of this > year. > > > Sounds good to me. When roughly are you hoping to do the 8.2 release? > Asking because I have this lingering MR that fixes support for fractional > device pixel ratio in the "old"/"native" QVTKOpenGLWidget (the MR predates > the new alien one) that I've been wanting to brush up and get merged, but > work has just kept me swamped so I haven't gotten to it yet. > > MR is here: https://gitlab.kitware.com/vtk/vtk/merge_requests/3973 > > So just wondering whether I have weeks or days to get that done. > > The native QVTKOpenGLWidget is currently broken to the point of being > unusable on fractional (eg 150%) device pixel ratio (for example a > Linux/KDE machine with screen scaling set to 150%). > > > A topic for future discussion is whether we want to continue the existing, > fairly haphazard naming scheme or move to something better, perhaps a > year.month scheme like several other projects have moved to recently. > > > I'm not a dev, but this would be OK with me. We do internal Ubuntu package > builds, and as long as the versioning works well as Ubuntu package > versions, I think it sounds like a good idea (I think Debian supports just > about any versioning scheme, so no worries). > > Elvis > > > thanks for your advice > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > > Clifton Park, NY 12065 > > -8662 > Phone: 518-881-4909 > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Search the list archives at: http://markmail.org/search/?q=vtk-developers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtk-developers > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.boeckel at kitware.com Thu Sep 27 10:39:27 2018 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Thu, 27 Sep 2018 10:39:27 -0400 Subject: [vtkusers] [vtk-developers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: References: Message-ID: <20180927143927.GA22820@rotor.kitware.com> On Thu, Sep 27, 2018 at 10:33:19 +1200, Todd via vtk-developers wrote: > I have no objection, but I have to ask "What does the major version number > change mean? Does it signify breaking changes or the addition of new/removal of > old modules?" Even minor bumps could have added or removed modules. Major version bumps in the past have been gut feeling based on how much has changed since the last release (e.g., OpenGL2 backend, pipeline reworking, modularization). > In regards to some of the other feedback; the problem with month.year > versioning is that it represents nothing more than chronology. How would new/ > deprecated features be signalled? Release notes. For VTK, even 8.1 to 8.2 meant some code likely had to change, so even minor bumps have not been indicative of "just recompile" upgrades. --Ben From bill.lorensen at gmail.com Thu Sep 27 23:15:17 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 27 Sep 2018 20:15:17 -0700 Subject: [vtkusers] [vtk-developers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: <20180927143927.GA22820@rotor.kitware.com> References: <20180927143927.GA22820@rotor.kitware.com> Message-ID: I'd like to see a BUILD_NUMBER encoded in the version. On Thu, Sep 27, 2018 at 7:39 AM Ben Boeckel wrote: > > On Thu, Sep 27, 2018 at 10:33:19 +1200, Todd via vtk-developers wrote: > > I have no objection, but I have to ask "What does the major version number > > change mean? Does it signify breaking changes or the addition of new/removal of > > old modules?" > > Even minor bumps could have added or removed modules. Major version > bumps in the past have been gut feeling based on how much has changed > since the last release (e.g., OpenGL2 backend, pipeline reworking, > modularization). > > > In regards to some of the other feedback; the problem with month.year > > versioning is that it represents nothing more than chronology. How would new/ > > deprecated features be signalled? > > Release notes. For VTK, even 8.1 to 8.2 meant some code likely had to > change, so even minor bumps have not been indicative of "just recompile" > upgrades. > > --Ben > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers -- Unpaid intern in BillsParadise at noware dot com From david.gobbi at gmail.com Thu Sep 27 23:28:32 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 27 Sep 2018 21:28:32 -0600 Subject: [vtkusers] [vtk-developers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: References: <20180927143927.GA22820@rotor.kitware.com> Message-ID: On Thu, Sep 27, 2018 at 9:15 PM Bill Lorensen wrote: > I'd like to see a BUILD_NUMBER encoded in the version. > You mean a number that changes each time VTK is built? The download page already has an MD5 hash for each package, which serves the same purpose, unless I'm misunderstanding. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Thu Sep 27 23:44:22 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 27 Sep 2018 20:44:22 -0700 Subject: [vtkusers] [vtk-developers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: References: <20180927143927.GA22820@rotor.kitware.com> Message-ID: I mean a # that increments nightly. Resets to 0 when a the revision number changes. Major.Minor.Patch.Build Right now if a new class is added you there is no way to know from the version when it was added. I think we used to do this in vtk... Back in April 2008 a nightly build increment was stopped Bill On Thu, Sep 27, 2018 at 8:28 PM David Gobbi wrote: > > On Thu, Sep 27, 2018 at 9:15 PM Bill Lorensen wrote: >> >> I'd like to see a BUILD_NUMBER encoded in the version. > > > You mean a number that changes each time VTK is built? > The download page already has an MD5 hash for each package, > which serves the same purpose, unless I'm misunderstanding. > > - David -- Unpaid intern in BillsParadise at noware dot com From ben.boeckel at kitware.com Fri Sep 28 09:05:55 2018 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Fri, 28 Sep 2018 09:05:55 -0400 Subject: [vtkusers] [vtk-developers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: References: <20180927143927.GA22820@rotor.kitware.com> Message-ID: <20180928130555.GA7447@rotor.kitware.com> On Thu, Sep 27, 2018 at 20:44:22 -0700, Bill Lorensen wrote: > I mean a # that increments nightly. Resets to 0 when a the revision > number changes. > > Major.Minor.Patch.Build > > Right now if a new class is added you there is no way to know from the > version when it was added. > > I think we used to do this in vtk... CMake does this, but it is not just a number that resets to 0, but a datestamp: https://gitlab.kitware.com/cmake/cmake/commit/8bb0e09e38d3ab75198b1cd9746bfa7a7b80ff94 It is used *as* the patch number, not a fourth component. This means that as soon as we branch and make M.N.0, `master` is already M.N.2018MMDD and "bigger". --Ben From bill.lorensen at gmail.com Fri Sep 28 09:27:18 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Fri, 28 Sep 2018 06:27:18 -0700 Subject: [vtkusers] [vtk-developers] Discussion: OK to change VTK's version number from 9.0 to 8.2? In-Reply-To: <20180928130555.GA7447@rotor.kitware.com> References: <20180927143927.GA22820@rotor.kitware.com> <20180928130555.GA7447@rotor.kitware.com> Message-ID: That would work. On Fri, Sep 28, 2018, 6:05 AM Ben Boeckel wrote: > On Thu, Sep 27, 2018 at 20:44:22 -0700, Bill Lorensen wrote: > > I mean a # that increments nightly. Resets to 0 when a the revision > > number changes. > > > > Major.Minor.Patch.Build > > > > Right now if a new class is added you there is no way to know from the > > version when it was added. > > > > I think we used to do this in vtk... > > CMake does this, but it is not just a number that resets to 0, but a > datestamp: > > > https://gitlab.kitware.com/cmake/cmake/commit/8bb0e09e38d3ab75198b1cd9746bfa7a7b80ff94 > > It is used *as* the patch number, not a fourth component. This means > that as soon as we branch and make M.N.0, `master` is already > M.N.2018MMDD and "bigger". > > --Ben > -------------- next part -------------- An HTML attachment was scrubbed... URL: From berti_krueger at hotmail.com Fri Sep 28 22:57:42 2018 From: berti_krueger at hotmail.com (=?iso-8859-1?Q?Berti_Kr=FCger?=) Date: Sat, 29 Sep 2018 02:57:42 +0000 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: , , Message-ID: Hello everyone. One last update to this already long thread: Meanwhile i implemented a majority voting approach using the voxelization function from the last post because i had problems voxelizing meshes with degenerated normals or polygons with wrong orientation: [cid:35c9abf9-ea5c-48e4-98d5-db27ec909ccd] Since the original algorithm from the last post more ore less simply "rasterizes" the polygon data in 3D along the z-direction, no voxelization artifacts from wrong normals result in this direction. So to get rid of any artifacts in any direction, i voxelize the mesh three times in three different directions. With the voxelization function given in the last post, i voxelize the mesh as it was given and save the result in an vtkImageData object. Then i simply rotate the original mesh 90? around the y-Axis, voxelize it again and save the result in another vtkImageData object. After that i rotate the original mesh (unrotated version) again but this time 90? around the x-Axis, voxelize it and save the result again in another vtkImageData object. At the end i have three vtkImageData objects with results of the voxelization of the mesh in three different directions (along the x-axis, y-axis, z-axis). The resulting vtkImageData objects are of course all rotated 90? in different directions too, so a direction comparision of the voxelization results is not possible. But by using rotations by 90? all that changes for a direct comparision is that the x, y, z components of the coordinates of the different results simply switch (e.g. x <-> z or x <-> y). So comparisions between the results can be done without any additional computations (no rotations of the vtkImageData or so). I then compare each voxelization result with another. If at least two or all three voxelization results have a voxel set in a specific cell then the final result is that this cell is set. Otherwise it is unset. The result: [cid:784b647e-ef6e-461d-a16c-17b1974642a7] It is even quite fast (only around three times slower than the simple voxelization step which is clear since it does three times the work) and much faster than the raycasting approach. Btw: Does one of the filters (vtkPolyDataToImageStencil, vtkImageStencilToImage) use SMP? I think it could be easily exploited because of the parallel nature of it. Cheers, Berti ________________________________ Von: vtkusers im Auftrag von Berti Kr?ger Gesendet: Mittwoch, 26. September 2018 07:04 An: David Gobbi Cc: VTK Users Betreff: Re: [vtkusers] Solid Voxelization with VTK Hi David, thanks again for your help. I added the method calls on the normalFilter as you have suggested but it didn't change the wrong voxelization of the Eiffel tower model. It did indead change the result to something different: [cid:ea753225-8561-4c0f-a7b0-2bb764dff664] [cid:a3cf6ebe-b37d-42ec-b0aa-fc502c405607] [cid:4439e9e1-f381-4580-8b22-005d383ff492] left image: result with wrong orientation and without normalsFilter->AutoOrientNormalsOn() center image: mesh with wrong orientation and normalsFilter->AutoOrientNormalsOn() right image: meshlab corrected version I attached both Eiffel tower models (with the wrong normals / polygon orientation and the corrected meshlab version) if you want to try it yourself. The vtkStripper is indead unecessary. I tried various meshes with and without using the vtkStripper filter step inbetween and it didn't make any difference. Since i took it from the Slicer3D source code Csaba pointed me to, i don't have any idea why the Slicer Guys use it there. Maybe they have some special kind of polydata where it is needed. For my general purpose meshes it does not seem to make a difference. The processing is, of course, faster without this additional step. The complete source code for voxelization and visualization and the CMakeList.txt is attached. The resulting code for the voxelization function: bool ConvertPolyDataToBinaryLabelMap(vtkSmartPointer closedSurfacePolyData, vtkSmartPointer binaryLabelMap) { // Check for consistency if (closedSurfacePolyData->GetNumberOfPoints() < 2 || closedSurfacePolyData->GetNumberOfCells() < 2) { std::cout << "Convert: Cannot create binary labelmap from surface with number of points: " << closedSurfacePolyData->GetNumberOfPoints() << " and number of cells: " << closedSurfacePolyData->GetNumberOfCells() << std::endl; return false; } // Compute polydata normals // // The purpose of the vtkPolyDataNormals filter here is to enforce a // consistent orientation of the polygons (via the method ConsistencyOn) // and to get an automatic determination of the correct orientation of the // normals on the polydata surface (via the method AutoOrientNormalsOn). // // To increase the performance of the filter we turn off the splitting of // sharp edges (via the method SplittingOff) since it is not necessary for // getting a correct result here. // // The application of the filter on the polydata is purely optional if all // the polygons are already correctly oriented. vtkNew normalFilter; normalFilter->SetInputData(closedSurfacePolyData); normalFilter->ConsistencyOn(); normalFilter->AutoOrientNormalsOn(); normalFilter->SplittingOff(); // Make sure that we have a clean triangle polydata using the // vtkTriangleFilter which generates triangles from input polygons. // Only needed if the input polygons are not flat. vtkNew triangle; triangle->SetInputConnection(normalFilter->GetOutputPort()); // Convert polydata to stencil vtkNew polyDataToImageStencil; polyDataToImageStencil->SetInputConnection(triangle->GetOutputPort()); polyDataToImageStencil->SetOutputSpacing(binaryLabelMap->GetSpacing()); polyDataToImageStencil->SetOutputOrigin(binaryLabelMap->GetOrigin()); polyDataToImageStencil->SetOutputWholeExtent(binaryLabelMap->GetExtent()); polyDataToImageStencil->Update(); // Convert stencil to image vtkNew imageStencilToImage; imageStencilToImage->SetInputConnection(polyDataToImageStencil->GetOutputPort()); imageStencilToImage->SetOutsideValue(0); imageStencilToImage->SetInsideValue(1); imageStencilToImage->SetOutput(binaryLabelMap); imageStencilToImage->Update(); return true; } Thanks again for everything. Cheers, Berti ________________________________ Von: David Gobbi Gesendet: Dienstag, 25. September 2018 10:20 An: Berti Kr?ger Cc: Csaba Pinter; VTK Users; Bill Lorensen Betreff: Re: [vtkusers] Solid Voxelization with VTK Hi Berti, Just a few extra comments about the three "preprocessing" steps that you apply in your sample code: For vtkPolyDataNormals, you might want to add normalsFilter->AutoOrientNormalsOn(), since this option is specifically designed to fix inside-out shapes like the Eiffel tower model. And normalsFilter->SplittingOff() will make this filter work faster. It would also be good if the comment mentioned that the purpose of the filter is to enforce consistent orientation of the polygons, and that the filter is optional if all the polygons are already correctly oriented. The vtkStripper should be removed, unless you actually saw that it provides some benefit. The vtkPolyDataToImageStencil class should give exactly the same results for triangles as for strips. And vtkTriangleFilter is only needed if the input polygons are not flat. Thanks again for the code, - David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_wrong_orientation.jpg Type: image/jpeg Size: 88782 bytes Desc: eiffel_tower_wrong_orientation.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_right_orientation.jpg Type: image/jpeg Size: 37648 bytes Desc: eiffel_tower_right_orientation.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_false.png Type: image/png Size: 54477 bytes Desc: eiffel_tower_false.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: alienqueen_voxelization.jpg Type: image/jpeg Size: 65454 bytes Desc: alienqueen_voxelization.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: alienqueen_majority_voting.jpg Type: image/jpeg Size: 101543 bytes Desc: alienqueen_majority_voting.jpg URL: From david.gobbi at gmail.com Fri Sep 28 23:44:06 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 28 Sep 2018 21:44:06 -0600 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: Message-ID: Hi Berti, It's nice to see that the orientation voting gives such a clean result. To get a result without gaps it would be necessary to take a completely different approach to the rasterization: rasterize the polygons themselves, instead of rasterizing the volume enclosed by the polygons. Neither of the filters is parallel. I designed them both so that they could be parallel, but I never wrote the threading code because they already worked fast enough for my application. For instance, vtkPolyDataToImageStencil has this method: void vtkPolyDataToImageStencil::ThreadedExecute( vtkImageStencilData *data, int extent[6], int threadId) The vtkImageStencilData object is made so that it can be written and read in a thread-safe manner, so in order to multithread this filter, one would just have to subdivide the extent along Z and then write a threaded "For()" loop, e.g. with vtkSMPTools.h. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_wrong_orientation.jpg Type: image/jpeg Size: 88782 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_right_orientation.jpg Type: image/jpeg Size: 37648 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eiffel_tower_false.png Type: image/png Size: 54477 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: alienqueen_voxelization.jpg Type: image/jpeg Size: 65454 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: alienqueen_majority_voting.jpg Type: image/jpeg Size: 101543 bytes Desc: not available URL: From berti_krueger at hotmail.com Sat Sep 29 04:54:50 2018 From: berti_krueger at hotmail.com (=?iso-8859-1?Q?Berti_Kr=FCger?=) Date: Sat, 29 Sep 2018 08:54:50 +0000 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: , Message-ID: Hi David, thanks for the infos about the vtkPolyDataToImageStencil filter threaded approach. Is there some way with the available vtk filters to rasterize the polygons themselves instead of rasterizing the volume enclosed by the polygons? I know, i could in some way misuse the vtk renderer to do this by rendering the mesh without any shading, only in ambient, completely white with orthogonal projection etc. in a black render window, sized to the voxel resolution, then read the resulting screen pixels with the vtkWindowToImage Filter, fill the vtkImageData where i have white pixels, change the clipping planes to the next slice, draw the mesh again, read again ... and do that slice by slice for the depth part of the voxel resolution: [cid:4ffb8812-3732-4885-bb29-4da9ff0b3467] But are the available vtk filters able in some way to rasterize the polygons themselves ? Or could it be done with some kind of signed distance field filter (i don't know if there is something in vtk)? Thanks again. Cheers, Berti ________________________________ Von: David Gobbi Gesendet: Samstag, 29. September 2018 03:44 An: Berti Kr?ger Cc: VTK Users; Csaba Pinter Betreff: Re: [vtkusers] Solid Voxelization with VTK Hi Berti, It's nice to see that the orientation voting gives such a clean result. To get a result without gaps it would be necessary to take a completely different approach to the rasterization: rasterize the polygons themselves, instead of rasterizing the volume enclosed by the polygons. Neither of the filters is parallel. I designed them both so that they could be parallel, but I never wrote the threading code because they already worked fast enough for my application. For instance, vtkPolyDataToImageStencil has this method: void vtkPolyDataToImageStencil::ThreadedExecute( vtkImageStencilData *data, int extent[6], int threadId) The vtkImageStencilData object is made so that it can be written and read in a thread-safe manner, so in order to multithread this filter, one would just have to subdivide the extent along Z and then write a threaded "For()" loop, e.g. with vtkSMPTools.h. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: teapot_bw.png Type: image/png Size: 6802 bytes Desc: teapot_bw.png URL: From berti_krueger at hotmail.com Sun Sep 30 03:24:35 2018 From: berti_krueger at hotmail.com (=?iso-8859-1?Q?Berti_Kr=FCger?=) Date: Sun, 30 Sep 2018 07:24:35 +0000 Subject: [vtkusers] vtkTrimmedExtrusionFilter.h include file not found in vtk 8.1 Message-ID: Hello everyone. I stumbled upon the vtkTrimmedExtrusionFilter (https://www.vtk.org/doc/nightly/html/classvtkTrimmedExtrusionFilter.html) which might be very useful for the project i am working on. Unfortunately when i try to include it, i get a compiler error that the include file could not be found. Is this filter not yet part of the newest vtk 8.1? And if so, will it be part of vtk 8.2 or vtk 9.0? Best regards, Berti -------------- next part -------------- An HTML attachment was scrubbed... URL: From rubendibattista at gmail.com Sun Sep 30 05:12:25 2018 From: rubendibattista at gmail.com (Ruben Di Battista) Date: Sun, 30 Sep 2018 11:12:25 +0200 Subject: [vtkusers] Create a custom valueType vtkArray Message-ID: Hello,? At the moment I have some code that reads like this: ? ? ? ? m_H->SetNumberOfValues(nPoints); ? ? ? ? m_G->SetNumberOfValues(nPoints); ? ? ? ? m_C->SetNumberOfValues(nPoints); ? ? ? ? m_SI->SetNumberOfValues(nPoints); ? ? ? ? for ( auto p : this->IterateOver() ) { ? ? ? ? ? ? ? ? auto curvatures = p.HG(); ? ? ? ? ? ? ? ? m_H->SetValue(p.Id(), curvatures.H); ? ? ? ? ? ? ? ? m_G->SetValue(p.Id(), curvatures.G); ? ? ? ? ? ? ? ? m_C->SetValue(p.Id(), curvatures.C); ? ? ? ? ? ? ? ? m_SI->SetValue(p.Id(), curvatures.SI); ? ? ? ?} ? ? ? ? m_polyPtr->GetPointData()->AddArray(m_H); ? ? ? ? m_polyPtr->GetPointData()->AddArray(m_G); ? ? ? ? m_polyPtr->GetPointData()->AddArray(m_C); ? ? ? ? m_polyPtr->GetPointData()->AddArray(m_SI); Where m_polyPtr is a vtkPolyData* and the return type of p.HG() is: ? ?? ? ? ?struct Curvatures ? ? { ? ? ? ? double G; /**< Gauss Curvature */ ? ? ? ? double H; /**< Mean Curvature */ ? ? ? ? double C; /**< Curvedness */ ? ? ? ? double SI; /**< Shape Index */ ? ? }; Now I?m facing a problem where I need to add fields to the structure ?Curvatures? and so I need to change code in three different classes.? Is there a way to create a vtkArray whose (templated?) valueType is `Curvatures` such that I can just modify that struct to allow more fields to be stored and set in a ?more abstract way? and that can be appended to the `PointData` of the vtkPolyData in a transparent way? Any suggestion is appreciated!? :) _ -. .? |???? ', ; |?????? ?? |????????? RdB ,., |?????? .' '. |???? -' `? https://rdb.is -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP using AMPGpg URL: From scofieldzhu.zcg at gmail.com Sun Sep 30 23:51:44 2018 From: scofieldzhu.zcg at gmail.com (scofield zhu) Date: Mon, 1 Oct 2018 11:51:44 +0800 Subject: [vtkusers] vtkActor2D can not display at right display point! Message-ID: hi vtk guys: I write a Point2DBubble view class in order to display attached world point at display coordinator, and the point will be seen whatever you operate the active camera in renderer. the codes is as following: // head file class VX_LOVELYBUBBLE_API Point2DBubble : public Bubble { BUBBLE_DECL(Point2DBubble, Bubble) public: void setAttachedPoint(const Point3& pt) { attachedpoint_ = pt; } const Point3& attachedPoint()const { return attachedpoint_; } Double_t radius() { return radius_; } Point2DBubble(const Point3& worldpt, Double_t radius); ~Point2DBubble(); private: bool onRenderEvent(vtkObject*, unsigned long, void*); void makeActors(RenderPane& pane); bool addToRenderPane(RenderPane& pane); void removeFromRenderPane(RenderPane& pane); Double_t radius_; Point3 attachedpoint_; std::map rendererdict_; }; //source file #include "point2dbubble.h" #include "vtkRenderer.h" #include "vtkSphereSource.h" #include "vtkPolyDataMapper2D.h" #include "vtkCoordinate.h" #include "vtkActor2D.h" #include "vtkCommand.h" #include "coordconv.h" #include "renderpane.h" VX_NAMESPACE_BEGIN Point2DBubble::Point2DBubble(const Point3& worldpt, Double_t radius) :attachedpoint_(worldpt), radius_(radius) {} Point2DBubble::~Point2DBubble() {} bool Point2DBubble::addToRenderPane(RenderPane& pane) { if(Bubble::addToRenderPane(pane)){ vtkRenderer* ren = pane.getRenderer().GetPointer(); rendererdict_[ren] = ren->AddObserver(vtkCommand::StartEvent, this, &Point2DBubble::onRenderEvent); return true; } return false; } void Point2DBubble::removeFromRenderPane(RenderPane& pane) { Bubble::removeFromRenderPane(pane); vtkRenderer* ren = pane.getRenderer().GetPointer(); auto it = rendererdict_.find(ren); if(it != rendererdict_.end()){ ren->RemoveObserver(it->second); rendererdict_.erase(it); } } bool Point2DBubble::onRenderEvent(vtkObject* source, unsigned long eventid, void* data) { vtkRenderer* ren = vtkRenderer::SafeDownCast(source); if(ren == nullptr) return false; RenderPane* thepane = RenderPane::FindPane(ren); if(thepane == nullptr) return false; if(!checkConnective(*thepane)) return false; Point3 displaypt = utils::WorldToDisplay(attachedpoint_, *ren); vtkActor2DList actors = actor2d_collector_.getActors(thepane); actors[0]->SetDisplayPosition(displaypt[0], displaypt[1]); return true; } void Point2DBubble::makeActors(RenderPane& pane) { vtkSmartPointer source = vtkSmartPointer::New(); source->SetRadius(radius_); source->SetCenter(attachedpoint_); vtkSmartPointer coordinate = vtkSmartPointer::New(); coordinate->SetCoordinateSystemToDisplay(); vtkSmartPointer mapper2d = vtkSmartPointer::New(); mapper2d->SetTransformCoordinate(coordinate); mapper2d->SetInputConnection(source->GetOutputPort()); vtkSmartPointer actor2d = vtkSmartPointer::New(); actor2d->SetMapper(mapper2d); addPane2DActor(pane, newActor2DInfo(actor2d, "point2d")); } __________________________________________________________________________________________________________________________ now the problem is : the Actor2D does not display at position calculated by WorldToDisplay, and it seems than the display point keep a certain display distance offset with right display point! develop environment: VS2015+VTK7.1.0+WIN10(64bit) I cannot solve this problem, please give me some advice! that's will be very appreciate for you! -------------- next part -------------- An HTML attachment was scrubbed... URL: