C-FIND and Cyrillic charset.

285 views
Skip to first unread message

Семён Дунаев

unread,
Jan 13, 2017, 2:40:05 AM1/13/17
to Fellow Oak DICOM
Hello!
I Am completly new in programming and in Dicom.
First i would like to say a big thx for Fellow Oak DICOM Team. realy awesome instrument!
-------
Please help me to understand how to set encoding in C-FIND.
i know how to Add DicomTag with Cyrillic encoding, but cant understand how to Get with C-FIND.

for example:
rename patient and send to Orthanc:
var file = Dicom.DicomFile.Open(@"file.dcm");
 file
.Dataset.Remove(Dicom.DicomTag.PatientName);
 file
.Dataset.Add( new DicomPersonName(
 
DicomTag.PatientName, DicomEncoding.GetEncoding(
 
"ISO 2022 IR 144"), "Иванов Иван Иванович")
 
);

 file
.Save(@"file_renamed.dcm");

 
var client = new DicomClient();
client.AddRequest(new DicomCStoreRequest(@"file_renamed.dcm"));
client.Send("127.0.0.1", 12345, false, "SCU", "ANY-SCP"); 

C-FIND:

 
var cfind = DicomCFindRequest.CreateStudyQuery(patientId: "*");
             cfind
.OnResponseReceived = (DicomCFindRequest rq, DicomCFindResponse rp) =>
             
{
             
Console.WriteLine("PatientName: {0}\n", rp.Dataset.Get<string>(DicomTag.PatientName));
             
             
var client = new DicomClient();
             client
.AddRequest(cfind);
             client
.Send("127.0.0.1", 12345, false, "SCU", "ANY-SCP");

and i got something like "?????? ???? ????????"

How can i Get PatientName with right encoding?

thx a lot.

 

Anders Gustafsson Cureos AB

unread,
Jan 13, 2017, 7:51:55 AM1/13/17
to Fellow Oak DICOM
First of all, are you sure that the Orthanc server is interpreting the file correctly? If you open file_renamed.dcm with a fo-dicom based tool such as DICOM Dump, are you still seeing only question marks?

You might want to try a different encoding, most preferably "ISO IR 192" (UTF-8). Does that work?

Regards,
Anders @ Cureos

Семён Дунаев

unread,
Jan 14, 2017, 12:55:10 AM1/14/17
to Fellow Oak DICOM
First of all, are you sure that the Orthanc server is interpreting the file correctly?

Yes. Orthanc web interfaces show it correctly. 

 If you open file_renamed.dcm with a fo-dicom based tool such as DICOM Dump, are you still seeing only question marks?

No. When i dump file_renamed.dcm or when i recieve it from Orthanc and dump - it looks correctly too.

You might want to try a different encoding, most preferably "ISO IR 192" (UTF-8). Does that work?

No. Doesnt work. i mean - when i dump or recieve and dump - its look ok, but with web interface or with C-FIND i see question marks. 



Anders Gustafsson Cureos AB

unread,
Jan 16, 2017, 2:50:14 AM1/16/17
to Fellow Oak DICOM
So:

You send the image with the Cyrillic name to Orthanc, and Orthanc tools display the name correctly?
Then you use C-FIND to query files from the Orthanc server, and the name in the response is displayed with question marks?

What happens if you use another tool/library than fo-dicom to query Orthanc, is the name then displayed correctly?

Семён Дунаев

unread,
Jan 16, 2017, 1:55:22 PM1/16/17
to Fellow Oak DICOM
After a lot of experiments  i found a bug in Orthanc, that was fixed in 1.2 version.
I compiled it from the git and now it works!
but i have an offtop question:
can you help me with c-find output into ListView?

Anders Gustafsson Cureos AB

unread,
Jan 17, 2017, 2:17:44 AM1/17/17
to Fellow Oak DICOM
What I would do is to populate a list of C-FIND responses in the OnResponseReceived event handler, and then populate my ListView control with certain properties of the C-FIND response. Not sure if that is what you are asking. Are you using Windows Forms or WPF?

Семён Дунаев

unread,
Jan 17, 2017, 2:31:46 AM1/17/17
to Fellow Oak DICOM
Windows Forms.
All that i need is an example with simple Form: listview with 2 columns - patientName and studyDate. Its enaugh for me to understand how to output from cfind to listview.

Anders Gustafsson Cureos AB

unread,
Jan 17, 2017, 8:06:40 AM1/17/17
to Fellow Oak DICOM
OK. I don't have anything straight away, but maybe someone else in the community has a similar sample? You can also post your question in the fo-dicom forum on Gitter, here.

Семён Дунаев

unread,
Jan 17, 2017, 8:31:48 AM1/17/17
to Fellow Oak DICOM
Understood!
Thx for the help!
Reply all
Reply to author
Forward
0 new messages