GDCM:实现使用gdcm::Series类进行DICOM的序列化和反序列化操作
下面是一个使用GDCM库中的gdcm::Series类进行DICOM序列化和反序列化操作的示例代码:
#include <iostream>
#include "gdcmReader.h"
#include "gdcmWriter.h"
#include "gdcmGlobal.h"
#include "gdcmSystem.h"
#include "gdcmSeries.h"
int main(int argc, char *argv[])
{
if (argc < 3)
{
std::cerr << "Usage: " << argv[0] << " <input DICOM directory> <output DICOM directory>" << std::endl;
return 1;
}
const char *inputDirectory = argv[1];
const char *outputDirectory = argv[2];
gdcm::Series *series = new gdcm::Series;
gdcm::Directory *dir = new gdcm::Directory;
dir->Load(inputDirectory, true);
const gdcm::Directory::FilenamesType &files = dir->GetFilenames();
// Add all files in the input directory to the series
f
标签:include,Series,源码,gdcm,GDCM,DICOM,序列化
From: https://blog.csdn.net/it_xiangqiang/article/details/136665160