The new VTK Examples site is now live

The new VTK Examples site is now live, please use this site: VTKExamples from now on. There have been many changes as outlined below. Special thanks must go to the people who have helped move the examples from Bill Lorensen’s original site to here, in particular @mwestphal, @will.schroeder, @brad.king and @dgobbi.

We recognise the massive effort Bill put into developing the original site with so many VTK examples. It is my hope that this site captures all this and will build on his legacy.

Changes

Over 2600 C++, Markdown and Python files were changed over a period of two months.

All languages

  • New How To pages have been introduced for each language. The aim of these pages is to provide pointers to existing examples that show you how to do something. E.g. using callbacks, camera positioning etc.
  • The column Classes Demonstrated has been removed, the information was never reviewed or updated and caused frequent errors when adding new examples. This was a hangover from the early days before I wrote the script VTKClassesUsedInExamples.py. Now this information is updated whenever the site is updated and is available as a link at the top of each language example page. By removing this column the display on small screens has been improved.

C++ and Python

  • Colors in the code are now referenced using vtkNamedColors this allows users to refer to colors by name or create their own named colors making it easier to color objects. No more … What color is (1.0, 0.4, 0.3)? Answer: “Tomato”.
  • Test images have been reviewed, mostly improving colors and redoing poses to make them more interesting. Once again the two files VTKColorSeriesPatches.html and VTKNamedColorPatches.html in the top level vtk-examples folder proved invaluable in choosing nice color combinations.
  • Some interesting C++ examples were ported to Python and vice versa.
  • Where data files are used in the examples, the names of the files to use have been added to the command line checking in the source code. These data files are all available in vtk-examples/src/Testing/Baseline.

C++

  • Code has been modernised and bought up to current VTK/C++11 standards. There is scope for more changes here.
  • vtkSmartPonter has been replaced by vtkNew in most cases, keeping vtkSmartpointer for when it is really needed.

Python

Testing

The focus here is to make sure that as may tests as possible pass when using the VTK master.

On the same machine, using the VTK master with no remote modules.

Linux

  • 100% tests passed , 0 tests failed out of 994, taking 660s.

Windows

  • 99% tests passed, 2 tests failed out of 994 taking 2005s.

    The following tests FAILED:
        420 - Meshes-InterpolateFieldDataDemo (Failed)
        655 - Rendering-StringToImageDemo (Failed)
    

Scripting

Scripting for generating the web pages has been extensively re-written.

15 Likes

Awesome accomplishment! Thank you for seeing this through.

Now this information is updated whenever the site is updated and is available as a link at the top of each language example page.

Nice. Thanks for this :+1:

This is a great resource, very well done, Thank you for this.
one question, links to the github repo is broken, so like the links to *.tar sources in “Download and Build” part of pages returns 404 error.
As I’m not yet fully aware of which is where, I appreciate if you can update those as well.

Thanks

Beautiful work guys, looking through the examples it’s nice to see new additions and updated graphics.

As the Python wheel is often lagging behind the main branch do you think it’s a good idea to add some form of disclaimer on particularly modern examples (OutlineGlowPass for instance) that just checks version requirements against the latest PyPi source?

Thanks for finding that @SArbabi, I’ll fix in a day or two. In the meantime just replace “master” with “gh-pages”.

Links should be fixed now.

@fraseyboo I have thought about this, however maintaining this information can be quite onerous. Several Python and C++ examples do use versioning e.g. PhysicallyBasedRendering but it would be a pain to introduce it for all new examples. Maybe something for the future.

Couple of broken links and one question

I was looking through the new examples/documentation pages. Looks pretty cool.

Noticed couple of broken links and was not sure, where to report them. Probably someone can pick them up here. Here is the list:

It is all in the page devoted to VTK Book: https://kitware.github.io/vtk-examples/site/VTKBook/:

By the way, I also had one question: the Markdown and Latex versions of the book - are they synchronized? Are they supposed to have the same content, or are they going to diverge?

And once again, thank you for all the efforts.

Just one more thought: a link to doxygen documentation (and probably some othe resources… wiki?) would be nice to have. Probably somewhere on a front page.

…and one more: this page: https://vtk.org/documentation/ does not have a link to the new examples page. And even the link to markdown version of the book points not to the new page, but to https://lorensen.github.io

Front page of doxigen documentation (https://vtk.org/doc/nightly/html/) also doesn’t have a link to new examples page (neither to the old one).

It would be a bit of shame, if people could not find such a good resource…

@dsemikin, links are all fixed now. Thanks for finding them.

With respect to your questions:
the Markdown and Latex versions of the book - are they synchronized? Are they supposed to have the same content, or are they going to diverge?

They will most likely diverge. The goals are different in that the markdown version is designed to provide an interactive, platform friendly version of the book, whilst the LaTex version provides a publication quality version of the book as a PDF file. The LaTex version is the most up-to-date. One day there may be scripts to automatically update the markdown version from the LaTex version. Something for the future.

@dsemikin There are already links to the VTK Doxygen documentation, for example look at the top of this page: Cxx also if a vtk class is mentioned in the description sections for an example it is linked to the VTK Doxygen documentation. In the left-hand menu look, for example, at Cxx and you will a section called Cxx/Coverage.

@ben.boeckel Is it possible to get someone to fix the links on the page referred to in the first paragraph above and also add links to new VTK Examples site: https://kitware.github.io/vtk-examples/site/ and to the updated LaTex textbook: https://gitlab.kitware.com/vtk/textbook/raw/master/VTKBook/VTKTextBook.pdf

Wrt to the second paragraph I’ll do a MR.

Thanks
Andrew

VTK Doxygen documentation updated and merged see: [MR 7481]https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7481

Regarding the link to doxygen: it is great to have links to particular classes from the examples, but I meant rather, that it would be nice to have a link to the front page of doxygen from the front page of the examples site, so that one can easily navigate to all help resources (examples, book and doxygen and maybe wiki) from one place.

请问下如何将一张2D的纹理图贴到点云上面?是灰度图像不是rgb的

@Ethan: Please open your own thread and ask in english, as this is the only language from which you will receive an anwer I’m afraid, 谢谢

Thank you very much for your reply to my email

When I use the settablevalue function in vtklookuptable, I can only set the value of RGBA, but my image is a gray image. How can I set the color to the point cloud? Looking forward to your reply

It is almost impossible to find the current VTK examples website: