我有一个 3D 卷itkImage<unsigned char, 3>
,想将其保存为 DICOM 系列。到目前为止保存系列工作,但元数据标签“图像位置病人”和“图像方向病人”没有保存在 dicom 文件中。所有其他标签均已正确保存。
如果我将元数据字典打印到控制台,这些标签将正确打印。当我在 ITK-SNAP 中打开文件时,这两个标签丢失了。
0010|0010 患者
0010|0020 12345
0020|0032 0\0\0
0020|0037 1\0\0\0\1\0
这是这些标签存储在元数据中的代码部分。我用一个工作示例创建了一个要点。
UC3ImageType::PointType position;
UC3ImageType::IndexType index;
index[0] = 0;
index[1] = 0;
index[2] = f;
image->TransformIndexToPhysicalPoint(index, position);
value.str("");
value << position[0] << "\\" << position[1] << "\\" << position[2];
itk::EncapsulateMetaData<std::string>(*dictionary, "0020|0032", value.str());
value.str("");
value << position[2];
itk::EncapsulateMetaData<std::string>(*dictionary, "0020|1041", value.str());
itk::EncapsulateMetaData<std::string>(*dictionary, "0020|0037", "1\\0\\0\\0\\1\\0");
这段代码有什么问题?是否需要其他标签,以便同时保存这些标签?