VTK modules and dependencies

This is a question about how the modules in VTK are organized.

I have a project that uses vtkImageImport and vtkImageExport to handle raw memory data, but doesn’t import or export any files. However, because vtkImageImport is located in the IO-module, we have to include all of its dependencies, e.g. libpng and libtiff. This of course increases the time it takes to compile the project and potentially the size. It also makes scanning for vulnerabilities cumbersome.

Unfortunately, I don’t know much about the different modules and how they are structured. But from my perspective, it would be nice to take into account the external dependencies. If you could move vtkImageImport and vtkImageExport to a module without any dependencies then we could remove many dependencies from the project entirely.

I definitely agree with your point.

Technically, you “only” need vtkIOImage, but it depends on many things:

DEPENDS
  VTK::CommonCore
  VTK::CommonExecutionModel
  VTK::IOCore
  VTK::ImagingCore
PRIVATE_DEPENDS
  VTK::CommonDataModel
  VTK::CommonMath
  VTK::CommonMisc
  VTK::CommonSystem
  VTK::CommonTransforms
  VTK::DICOMParser
  VTK::jpeg
  VTK::metaio
  VTK::png
  VTK::pugixml
  VTK::tiff
  VTK::vtksys
  VTK::zlib

We definitely should split that module into a vtkIOImageCore, vtkIOImageTIFF, vtkIOImagePugiXML and so on.

That’s not a small work though, especially as we first need to fix this issue: https://gitlab.kitware.com/vtk/vtk/-/work_items/19575 in order to do a proper deprecation.

I’m glad to see interest into this though :slight_smile:

1 Like

Thanks for the quick response! I was half expecting this request to be dismissed. I realize that it’s a lot of work and won’t happen very soon. But great to know it’s on your roadmap.