我正在使用 dcm4chee2 来解析带有它们的标签DicomInputStream
和DicomObject
. 然后,我将元数据转换为 String 类型的 ArrayList。但是,当我使用 toString() 方法将标签从 DicomObject 转换为字符串时,我注意到我没有获得 DICOM 标签、VR 代码和描述的完整列表。谁能告诉我是否应该使用另一个 DicomObject 方法来获取完整列表而不是 toString()?
这是我目前拥有的代码:
ArrayList<String> dicomTags = new ArrayList<String>();
DicomInputStream din = null;
FileOutputStream fos = new FileOutputStream("dicomTagResults.txt");
ObjectOutputStream oos = new ObjectOutputStream(fos);
din = new DicomInputStream(new File(pathName));
try {
DicomObject dcmObj = din.readDicomObject();
dicomTags.add(dcmObj.toString());
for (String findMatch : dicomTags){
System.out.println(findMatch.toString());
oos.writeObject(dicomTags);
oos.close();
}
}
catch (IOException e)
{
e.printStackTrace();
return;
}