简体   繁体   中英

Read and Write on DICOM attribute with pixelmed

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) .

Have you considered:

AttributeList list = new AttributeList();
list.read(file);
String patientName=Attribute.getDelimitedStringValuesOrEmptyString(list,TagFromName.PatientName);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM