VTK 9.0.1 with GDCM3.0, CMAKE

Hello VTK experts,

I am having some trouble with VTK 9.0 and GDCM 3.0.8. Using CMAKE 3.14 to configure both, turn on USING VTK on GDCM and using GDCM on VTK. It seems that cmake can never generate the correct VS 2019 project file for GDCM’s vtkgdcm. Just none VTK include paths is shown in GDCM. I cannot even edit the project properties by adding include paths.

Really appreciate any help.

Best regards,

Hi Frank, unless you specifically need the vtkGDCMImageReader, I recommend using the newer vtkDICOMReader instead. You can enable it in VTK as follows:

  1. First, build GDCM without enabling VTK within GDCM

If GDCM gives you any warnings about GDCM_VTK_DIR, just ignore them. The GDCM cmake files are less than perfect.

I haven’t specifically tried this with GDCM 3.0.8, but there’s no reason to believe that it shouldn’t work.

Hi David, thanks a lot for your quick response. Just wanted to find out, after your step 1 and 2, do we need to Re-configure GDCM with CMAKE to enable USE_VTK?

No, not for vtkDICOMReader, since it only uses the base GDCM libraries (libgdcmCommon, libgdcmMSFF, etc). You can try it if you really need GDCM’s own VTK classes, but I can’t help you much there because I haven’t used GDCM’s VTK classes for many years. I just use GDCM as a C++ library.