how can i get patient info for dcm4che3.x

928 views
Skip to first unread message

guo_...@foxmail.com

unread,
Feb 12, 2017, 11:18:54 PM2/12/17
to dcm4che
hi,now i have a dicom file ,but i don't know how to parsing it .example, i want get patient's name and other info . please help me .thanks.use java and dcm4che3.x 

Dimitri Pianeta

unread,
Feb 13, 2017, 8:28:33 AM2/13/17
to dcm...@googlegroups.com


In dcm4che3, use my class DisplayTag  use :
File f = new File(myImage);
  1. Attributes attr = DisplayTag.loadDicomObject(File f) ;
  2. All  Tags :  string lisTag = readTagDicom(f)


or :

 public static final  int[] tag = {
            0x00080020,
                0x00080022,
        };


 *FileInputStream fis = new FileInputStream(fileInput);
 *DicomInputStream dis = new DicomInputStream(fis);
 *DicomObject obj = dis.readDicomObject();
 *String nounValue[] =getValue(obj,tag);


And so on,


If problem for metadata send email me that find in the header DisplayTag.







DisplayTag.java

郭宇浩

unread,
Mar 17, 2017, 3:47:41 AM3/17/17
to dcm4che
Hi, thanks for your answer. i use your DisplayTag,but has a question. 
now i have a dicom file.for example:
get patient info :

but i get patient's name has a problem


and result is null . So please tell me how can i get patient info? thanks.

 

------------------ 原始邮件 ------------------
发件人: "Dimitri Pianeta";<dimitri...@gmail.com>;
发送时间: 2017年2月13日(星期一) 晚上9:28
收件人: "dcm4che"<dcm...@googlegroups.com>;
主题: [dcm4che-group] Re: how can i get patient info for dcm4che3.x



In dcm4che3, use my class DisplayTag  use :
File f = new File(myImage);
  1. Attributes attr = DisplayTag.loadDicomObject(File f) ;
  2. All  Tags :  string lisTag = readTagDicom(f)


or :

 public static final  int[] tag = {
            0x00080020,
                0x00080022,
        };


 *FileInputStream fis = new FileInputStream(fileInput);
 *DicomInputStream dis = new DicomInputStream(fis);
 *DicomObject obj = dis.readDicomObject();
 *String nounValue[] =getValue(obj,tag);


And so on,


If problem for medata send email me that find in the header DisplatTag.







--
You received this message because you are subscribed to a topic in the Google Groups "dcm4che" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dcm4che/DFEVLkotSN4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dcm4che+u...@googlegroups.com.
To post to this group, send email to dcm...@googlegroups.com.
Visit this group at https://groups.google.com/group/dcm4che.
For more options, visit https://groups.google.com/d/optout.
08303623@651AB147.9194CB58.jpg
9042248E@F8195113.9194CB58.jpg
8CD8342C@1817D939.9194CB58.jpg

Dimitri Pianeta

unread,
Mar 17, 2017, 2:13:44 PM3/17/17
to dcm4che

Your problem come that getString(Tag.PatientName);
I work yesterday on conversion for example Name^surname to name surname.



Dimitri Pianeta

unread,
Mar 18, 2017, 11:41:28 AM3/18/17
to dcm...@googlegroups.com

Remind that Person name is struct so :
VR = PN , Value : Family^GivenName^MIddleName^NamePrefix^NameSuffix

My code is

string patienName = attr.getString(Tag.PatientName);

string patientNameWithoutExtension = texteDicom(patienName);



/**
 
* Remove string ^ in file dicom
 
* @param num
 
* @return
 
*/
 
public static String texteDicom(String num) {

        num
= num.replaceAll("\\^+", " ");

return num;
   
}




  • For PatientAge

For Dicom is writing that nnnD or nnnW or nnnY or nnM   with D : Day, W: Week, M:Months and Y: Years


  • For PatientSex

M : Male

F:Female

O = other

 

guo_...@foxmail.com

unread,
Mar 20, 2017, 3:50:39 AM3/20/17
to dcm4che
thank you answer my stupid question.  but have you erver met. patient name is 张三.  but i get dicom file patient name is ??? .all chinese is ??? . and i try transcoding. use :
patientName = new String(patientName.getBytes(),"utf-8");  but i get ??? .  
i at internet find convert dicom file to jpg or png file answer, but a lot of answer is dcm4che 2.x  
how can i write a jpg for dcm4che 3.x

在 2017年3月18日星期六 UTC+8下午11:41:28,Dimitri Pianeta写道:

Dimitri Pianeta

unread,
Mar 20, 2017, 7:58:15 AM3/20/17
to dcm4che
Seeing  this code dcm to jpeg.
Dcm2jpg.java

guo_...@foxmail.com

unread,
Mar 20, 2017, 10:36:40 AM3/20/17
to dcm4che
thank you ! my brother. if you come to china. i will with you eat good food . it's very nice.

在 2017年3月20日星期一 UTC+8下午7:58:15,Dimitri Pianeta写道:
Reply all
Reply to author
Forward
0 new messages