Access to OB/OW DICOM Elements

38 views
Skip to first unread message

Tim O'Connell

unread,
Apr 16, 2013, 11:08:14 PM4/16/13
to ruby-...@googlegroups.com
Hi, 

I'm just learning Ruby, so please feel free to call me out on it if this is a Ruby/user issue, not a dicomruby issue. 

I'm trying to use OB/OW elements in the DICOM header, but these just seem to get encoded as 'nil'.   I can't seem to print/use the data contained in these once a file is read into a DObject. 

I've created a private dictionary and been able to use it to decode other private VR types, but I'm not having any luck with the elements encoded as OB.  

Is this possible? Any suggestions? 

Best regards,
Tim

Christoffer Lervåg

unread,
Apr 17, 2013, 1:58:51 AM4/17/13
to ruby-...@googlegroups.com
Hi Tim,

Welcome to the ruby-dicom community!

In some cases, the print method will not print the value of some DICOM elements, because they aren't formatted. Take the pixel data as one example, printing hundreds of thousands of bytes to the screen wouldnt make much sense, it would just produce a lot of noise that interferes with the other nicely formatted DICOM data. So even if the value doesnt show up when using print, or trying to extract a value from an Element, doesn't mean that its not there, it just mean that there isnt any nicely formatted value. Use the bin method instead of the value method in such cases. If you're still having problems with it, perhaps post some code so it's easier to see what you're trying to do and where it goes wrong.

Best regards,
Chris
Reply all
Reply to author
Forward
0 new messages