1

I've compiled GDCM using CMake (using VS2012). However, I can't find gdcm2vtk.exe in my bin/Debug folder.

I was able to find gdcmimg.exe, would that one work to convert a stack of images into 3D? I've read somewhere that if I'm able to generate a vti file from the stack of images then I'll be able to show it using ActiViz.

Is there any known reason why I'm not seeing the file gdcm2vtk.exe? It is in the source code (I can find the gdcm2vtk.cxx source code).

Mörre
  • 5,699
  • 6
  • 38
  • 63
Matimont
  • 739
  • 3
  • 14
  • 33

2 Answers2

2

The GDCM applications are not enabled by default. You need to enable GDCM_BUILD_APPLICATIONS (and possibly GDCM_BUILD_EXAMPLES) when you configure gdcm with cmake-gui. Also you have to enable GDCM_USE_VTK to get VTK support with GDCM.

If any of these were not enabled when you last built GDCM I would run cmake-gui configure and then generate then do a build all on GDCM.

drescherjm
  • 10,365
  • 5
  • 44
  • 64
  • Thanks, I added GDCM_USE_VTK and I think that's the issue. HEre's what I get: CMake Error at C:/Buildvtk/VTKConfig.cmake:48 (include): include could not find load file: C:/VTKSource/VTK/CMake/vtkModuleAPI.cmake Call Stack (most recent call first): C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindVTK.cmake:73 (find_package) Utilities/VTK/CMakeLists.txt:4 (FIND_PACKAGE) I think I need to download VTK?? – Matimont Dec 04 '13 at 21:33
  • I think you will need to download and build vtk from source. Please use the 5.10.x version. I have a feeling that this is a lot of work to get a conversion program to work. – drescherjm Dec 04 '13 at 21:42
  • Should I build VTK first and then specify the build directory for GDCM in Cmake? I'm getting this when I reference the VTK source directory: CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindVTK.cmake:135 (message): VTK not found. Set the VTK_DIR cmake cache entry to the directory containing VTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/vtk for an installation. For VTK 4.0, this is the location of UseVTK.cmake. This is either the root of the build tree or – Matimont Dec 06 '13 at 13:35
  • You need to build VTK before GDCM. – drescherjm Dec 06 '13 at 14:48
  • Ok, so I build VTK using Cmake and then VS2012. Once done that I just build GDCM using Cmake and then in VS2012. That's the sequence right? – Matimont Dec 06 '13 at 15:16
  • If that is what you are building GCDM with yes. Its very important to use the same compiler. – drescherjm Dec 06 '13 at 15:18
  • 1
    Ok, I've managed to get GDCM with VTK working! I needed to download VTK 5.0.1, the latest release doesn't seem to work with GDCM. Thanks! – Matimont Dec 09 '13 at 17:05
  • Were you still using an older version of GDCM? I now use VTK-5.10.0 + GDCM-2.4.0 with VS2012. Although if you have an executable that works for what you want I would leave it alone.. – drescherjm Dec 09 '13 at 17:08
  • I'm using GDCM 2.0.17 and VTK 5.0.1 – Matimont Dec 09 '13 at 17:25
  • @Matimont Since you are asking additional questions about this.. Although do I use VTK, ITK, GDCM, DCMTK and other related libraries (since 2008) with my Breast and Lung CT dicom images, I have never used cloud points. I can't help with that task. – drescherjm Dec 10 '13 at 18:51
  • Ok, no problem. Since you've been using these libraries, do you know how to use the gdcm2vtk application? I've tried to convert a stack of images into a ".vti" file with no success... – Matimont Dec 11 '13 at 10:47
  • I have only used that for converting dicom 2d image to a vti. – drescherjm Dec 11 '13 at 17:11
1

As explained by @drescherjm this will require a recompilation. Instead you could use another trick: simply use GDCM to decompress your input DICOM.

Eg:

$ gdcmconv --raw input_comp.dcm output_raw.dcm

VTK comes with a minimal DICOM reader (vtkDICOMImageReader) which should handle output_raw.dcm nicely.

If this really does not work, you could also try, converting your compressed DICOM to PGM (PPM if RGB.):

$ gdcmconv --raw input_comp.dcm output_raw.dcm
$ gdcmimg output_raw.dcm output_raw.pgm

Then use vtkPNMReader to read in output_raw.pgm.

malat
  • 12,152
  • 13
  • 89
  • 158