[英]Read and Write on DICOM attribute with pixelmed
我正在尝试使用pixelmed
库从Java中的其标签读取data属性。 我的代码是:
public static void main(String args[]) throws IOException, DicomException {
DicomInputStream my_image = new DicomInputStream(new File("/Volumes/CDP/20130212101717421/20130212101636203"));
AttributeList list = new AttributeList();
SpecificCharacterSet sc=new SpecificCharacterSet(list);
PersonNameAttribute pna=new PersonNameAttribute(TagFromName.PatientName,1000,my_image,sc);
System.out.println(pna.getDelimitedStringValuesOrEmptyString());
}
通过此代码,我可以获得所有属性的数据:
���UL������OB��������UI�1.2.840.10008.5.1.4.1.1.4���UI6�1.2.840.113619.2.244.6945.224850.21460.1360606914.740���UI�1.2.840.10008.1.2.1���UI�1.2.376.99999.1.1.20041017��SH�CDP_V3��AE�MRS��CS
�ISO_IR ... etc etc
但我只想获取有关标签(0x0010,0x0010)
。
你有没有考虑过:
AttributeList list = new AttributeList();
list.read(file);
String patientName=Attribute.getDelimitedStringValuesOrEmptyString(list,TagFromName.PatientName);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.