Reputation: 3
I'm trying to read data attribute from its tag in Java with the library pixelmed
.
the code that I had is :
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());
}
With this code i get data of all attributes :
���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
But I just want to get the information on the tag (0x0010,0x0010)
.
Upvotes: 0
Views: 1761
Reputation: 1582
Have you considered:
AttributeList list = new AttributeList();
list.read(file);
String patientName=Attribute.getDelimitedStringValuesOrEmptyString(list,TagFromName.PatientName);
Upvotes: 1