Using Icons in C-FIND
From DicomObjectsWiki
DICOM has from the start had the facility to include icon images in C-FIND requests, but it is rarely used. Of course it only makes sense for STUDY, SERIES and IMAGE level queries as the image used should be representative of the study/series being queried, but it can be useful in some circumstances. Support is easy to add into projects using DicomObjects, and though it will normally work most reliably where the same vendor provides the SCU & SCP, it is a proper DICOM solution, and may work with other vendors' applications also. The icon is sent (if requested and supported) in the (0088, 0200) attribute of the C-Find Response.
Contents |
SCU Usage
There are 2 aspects, requesting that you be sent an icon, and then (if the SCP sends you one) displaying it.
Requesting the icon
All you need to do is to add a null item to the request with the tag 0088,0200. If you are already doing a raw query, then simply add the attribute directly to the query, but if you are currently using DoQuery (COM) or Find() (.NET), then you will need to convert first as follows:
COM Version
The method needed is DicomQuery.DoRawQuery, but to make life easier, and avoid the need to make your own query from scratch, you can use the default query as a starting point, using the QueryDataSet method. replace this line:
set results = query.DoQuery()
by this:
set queryDS = query.QueryDataSet() ' queryDS is a DicomDataSet queryDS.Attributes.Add(&h0088, &h0200,"") set results = query.DoRawQuery(queryDS)
.NET Version
The method needed is DicomQuery.Find(dataset) but to make life easier, and avoid the need to make your own query from scratch, you can use the default query as a starting point, using the QueryDataSet method. e.g. to query for studies with accession number 12345 then you would replace this line:
set results = query.Find()
by this:
queryDS = query.QueryDataSet() ' queryDS is a DicomDataSet queryDS.Attributes.Add(&h0088, &h0200, Nothing) results = query.Find(queryDS)
Displaying the icon
The first thing you need to do is to check if the SCP has sent you an icon (it is optional!), so check for response.Attributes(&h88,&h200).Exists (in .NET this is simply response(&h88,&h200).Exists. If true, then you need to extract the icon into a new DicomImage as follows:
COM Version
Dim images as New DicomImages Dim IconSequence as DicomDataSets Set IconSequence = response.Attributes(&h88,&h200) images.add IconSequence(1)
The images collection will then hold a single icon which you can display in a DicomViewer or do anything else you like with to show to the user.
.NET Version
Dim IconSequence as DicomDataSetCollection = response.Attributes(&h88,&h200) Dim image as new DicomImage(IconSequence(1))
SCP
See the article on Creating Thumbnails and Icons for details of how to make an icon. Of course, you are responsible for choosing a suitable image to "represent" a whole study or series (or perhaps a frame of a multi-frame image!)
You then simply need to add the sequence according the article Adding Sequence Items - i.e.
COM Version
Dim Sequence as New DicomDataSets Sequence.Add IconImage ' Don't worry, a DicomImage may be added to a DicomDataSets collection response.Attributes.Add &h88, &h200, Sequence
.NET Version
Dim Sequence as New DicomDataSetCollection Sequence.Add IconImage ' Don't worry, a DicomImage may be added to a DicomDataSetCollection response.Add(&h88, &h200, Sequence)
Remember that according to the general DICOM rules, you should only add an icon such as this if requested by the SCU (i.e. if a blank sequence item exists in the request).
