Reputation: 15
I want to search the DICOM server. if for example user enters a patient id to serach, then my app populate a table with all the metadata relating to that id , such as id, name, accession number e.tc. if tha study id exists in the dicom server, How can this be done using dcm4chee kit. –
Upvotes: 1
Views: 2088
Reputation: 4233
You can use dcm4che3 tool dcm4che-tool-findscu
. This code shows you how to do a C-FIND against a PACS (or whatever implementing C-FIND as SCP).
FindSCU.java
is quite clear, take a while and don't get missed through Apache Commons CLI code to understand input from console. Most of CLI management code is not in this project, but you can find it in the dcm4che3 tool dcm4che-tool-common
project, org.dcm4che3.tool.common.CLIUtils.java
class.
Take into account following considerations:
FindSCU.java
, you will see that you can manage four different levels: PATIENT|STUDY|SERIES|IMAGE
.This will instruct C-FIND SCP how to search matching attributes.0020, 000D
StudyInstanceUID tag.
0020, 000D
StudyInstanceUID tag value to do the C-GET/C-MOVE operation.You can see how to configure attribute keys to do C-FIND SCU into CLIUtils.java
class that is part of dcm4che3 tool dcm4che-tool-common
project. See CLIUtils.addAttributes(Attributes, String[])
.
Hope it helps!
Due to you comment you are using dcm4che2 and that you already have a DicomObject
with the search result, if you want to obtain metadata from this DicomObject
you must parse it before, using DicomInputStream
, and then you can use getXXXX(Tag)
from BasiDicomObject
, something like this:
DicomObject dcmObj;
DicomInputStream dis = null;
dis = new DicomInputStream(file);
dcmObj = dis.readDicomObject();
String someVar = dcmObj.getString(Tag.SeriesInstanceUID);
Keep in mind, some attributes are inside sequences, and thus you have to search it before.
You can also take a look into dcm4che-tool-dcm2txt
, you will see Dcm2Txt.java
and in lines 170 and so on, there is how to parse whole dicom object.
Upvotes: 6
Reputation: 948
If you need some general description about the DICOM network protocol, you could read the "Understanding DICOM with Orthanc" guide, and more specifically the section about C-Find.
Upvotes: 0