Looking for old Slicer 3D source code with wxWidgets and VTK

Hi,

The question is not about Slicer 3D but I remember I’ve read that Slicer used to be using wxWidgets before it was translated to Qt.

Now there is a task to understand how can I combine wxWidgets with VTK (even I don’t have experience with wxWidgets yet). Mostly the question is how to create a widget with VTK render window in it and then to be able to connect wxWidgets signals (or events) with VTK observers.

Maybe somebody could give some hints about that? Or maybe there is still old Slicer 3D releases where it is already implemented?

This is probably better asked in the VTK forum. However, it looks like this link might of some interest to you:
https://forums.wxwidgets.org/viewtopic.php?p=212799&sid=facae6786160e8638a52c0a41423a10b#p212799

1 Like

Thank you!

Actually I was thinking where to ask this question but decided to ask there as most of the time Slicer 3D community helped a lot :slight_smile:

Thank you for the link! It is in Python and this will be the most easiest way to make first attempts.

To clarify, prior to Slicer 4.x, the cross-platform KWWidgets[1] toolkit was used and not wxWidgets

For reference:

KWWidgets [was] a free, cross-platform and open-license GUI Toolkit. Over a hundred C++ classes have been developed and used by Kitware, Inc. to create open-source and commercial end-user applications like ParaView or VolView […]. Is [was] also used by the National Alliance for Medical Image Computing for the 3D Slicer project.


  1. KWWidgets - KitwarePublic ↩︎

1 Like

Oh! I’m sorry.

Good to know, thank you!

I’m just curious, why are you thinking about using wxWidgets? Qt license costs? What alternatives have you considered?

Hello Andras,

It is all about sanctions. Qt have officially quited our country. Some companies don’t want to risk.

Also I remember your post about Qt licensing. But as I remember since Qt6 it started to use GPL3 (not LGPL) everywhere. This is going to add more restrictions right?

Regarding Qt6, from what I see the core is still available under LGPL:

https://doc.qt.io/qt-6/licensing.html

There are some Qt add-ons that are GPL or commercial only, so people should keep that in mind if they want to use them. We shouldn’t use these in Slicer:

https://doc.qt.io/qt-6/qtmodules.html#gpl-licensed-addons

1 Like

Thank you! Good to know.

I agree, I don’t think a lot has changed in Qt regarding GPL/LGPL (some very niche Qt components has been GPL but we don’t need any of them). The main difference in Qt6 that you cannot get long-term support versions for free from the Qt Company. If you need stable Qt distributions for free then you need to go elsewhere. For example you can get it from KDE, but probably they only work on fixes for Linux.

In general, Qt Company is not behaving in a developer-friendly way, it does not invest much effort into classic widgets, and it does not focus on making it possible to run Qt applications with classic widgets in web browsers. So, it would be nice to find a possible alternatives.

wxWidget has no licensing issues, but it has very limited feature set, its development is quite slow, and I am not sure if it officially supports usage in the web browser. What other frameworks have you considered? Have you found any more actively developed, more modern, more web-friendly GUI framework?

1 Like

I don’t think we have many choices because we need to use GUI framework along with VTK.

I know that wxWidgets have some (limited) support for VTK that is pros to use it.

Another option is to use client-server solutions and the use some other languages for frontend along with some remote VTK features. Here is the problem that not all the VTK functionality will be available (I guess) and it will be very sad to fall into such situation.

And for future references there was a similar topic

That topic is 1.5 years old, which is quite a long time these days. Now VTK can run natively in the web browser. No need for server-side rendering and remoting anymore.

1 Like

Do you mean Trame and VTK.js?

I mean C++ application using proper VTK (not vtk.js) compiled using webassembly and running in the web browser. See all the interactive examples in the VTK examples website: https://examples.vtk.org/site/Cxx/IO/ReadAllPolyDataTypesDemo/

1 Like

Thank you, cempletely forgot about that approach. I have to test that because it seems very attractive.

Would the Wt libraries have a place in this discussion? This is just a pointer since it aims at building web applications in C++.

1 Like

Looks interesting, thank you.

The only thing is how to combine it with VTK (no information in internet yet).
And another thing is GPL license: they claim to open source code for any user. Do they mean to open the whole project?

Don’t know, it was just a suggestion.

Quoting the page you pointed to:

**The Commercial License** has no such limitations: you may redistribute applications developed with Wt without needing to redistribute the source code.

Buying a license is mandatory for closed source applications.

1 Like