Thursday, February 09, 2012
Google Custom Search

ClearCanvas Highlights

Download our Open Source software
Watch some Videos
Get the Source
Check out our Licensing
Join our  Forums
Some Research: OICR IPP-Trials

Our Community

Membership Membership:
Latest New User Latest: VMCCNY
New Today New Today: 18
New Yesterday New Yesterday: 26
User Count Overall: 20581

People Online People Online:
Visitors Visitors: 12
Members Members: 4
Total Total: 16

Online Now Online Now:
01: Chimarides
02: Leighann
03: lecalos
04: VMCCNY

ClearCanvas Community Forums

SR Help
Last Post 2009-11-27 10:55 AM by robertvanommen. 5 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
robertvanommen
Basic Member
Basic Member
Posts:26

--
2009-11-24 03:27 PM  

I'm trying to read Dicom SR files but i can't get it to work.

When i try to get the value of (0040,A160) Text Value it always is empty, but when i do a dicomdump with dcmtk it shows that (0040,A160) Text Value is filled.

How can i get the value of (0040,A160) Text Value with CC?

 string test = dicomfile.DataSet[DicomTags.TextValue].GetString(0, "nothing :(");
            MessageBox.Show(test);

returns the default string value

 

 

jasper.yeh
Senior Member
Senior Member
Posts:521
Avatar

--
2009-11-25 12:47 PM  
Hi robertvanommen,

Are you able to read the values of any other tag? After constructing a DicomFile object, force a .Load() on it to read every attribute value (or supply some options to optimize what to read).

If that's not the case, have you tried just .ToString()? Text Value is UT, so it shouldn't matter though.

Please let me know if either of these worked for you.

Thanks,
// Jasper
jasper.yeh
Senior Member
Senior Member
Posts:521
Avatar

--
2009-11-25 01:10 PM  
Or perhaps, is the Text Value attribute nested inside one or more sequences? If so, you will need to drill down the correct sequence hierarchy to get to the level where the Text Value attribute exists.

You'll know this is the case if your dcmtk dump (or the dump using the Workstation) has one or more angled brackets to the left of the tag name.
// Jasper
robertvanommen
Basic Member
Basic Member
Posts:26

--
2009-11-26 05:35 PM  

Hi,

i can get other tags just fine. The tag indeed resides in a sequence, how would i get a value out of a sequence?

regards,

Robert

jasper.yeh
Senior Member
Senior Member
Posts:521
Avatar

--
2009-11-26 05:43 PM  

Hi Robert,

On an attribute whose VR is SQ, the Values property is an array of DicomSequenceItems. Each individual DicomSequenceItem has an indexer to get individual attributes in that sequence.

For example, if you had a file with the Text Value attribute embedded in the each item of the Content Sequence attribute of the file, you would use the following:


DicomFile myFile = ...
DicomSequenceItem[] items = myFile.DataSet[DicomTags.ContentSequence].Values as DicomSequenceItem[];
if (items != null) {
for(int n=0; n < items.Length; n++) {
DicomSequenceItem item = items[n];
Console.WriteLine(item[DicomTags.TextValue].ToString());
}
} else {
// no values :(
}

Edit: The forum software ripped out the spacing ><

// Jasper
robertvanommen
Basic Member
Basic Member
Posts:26

--
2009-11-27 10:55 AM  

thanks! it works like a charm

You are not authorized to post a reply.

Active Forums 4.1
Copyright 2011 ClearCanvas Inc.