问题
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).
回答1:
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.
回答2:
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
.
来源:https://stackoverflow.com/questions/20367002/gdcmimg-to-convert-stack-of-dicom-images-into-a-vti-file