mwl_find method (or "how to perform sequence queries")

92 views
Skip to first unread message

Simon

unread,
Jul 7, 2013, 12:44:43 PM7/7/13
to ruby-...@googlegroups.com
Hi Chris,

I'm working on adding a simple "mwl_find" method to DClient. I was pleasantly surprised to see that I could pretty much use the "find_studies" method code and change the presentation context and ....voila! MWL query :)

However, to get any meaningful info from a MWL, the attributes one really needs to query are inside two sequences: (0032,1064) "Requested Procedure Code Sequence" and (0040,0100) "Scheduled Procedure Step Sequence". 

I seem to recall a previous post in which you described that sequence tag queries are not yet possible...is this still true? I'm not yet familiar enough with ruby-dicom's code (or philosophy/roadmap) to try and accomplish this on my own, especially if you already have some thoughts on how you might implement this.

That is really the only roadblock towards a simple MWL client functionality in ruby-dicom, everything else seems to work just fine.

Please let me know your thoughts on this.

Best regards,

Simon

Christoffer Lervåg

unread,
Jul 9, 2013, 5:39:02 PM7/9/13
to ruby-...@googlegroups.com
Hi Simon,

Thanks for bringing up this topic. You are right, I think it has been briefly touched on before. I had almost forgot about it though.

Indeed as of today, you can't do a sequence query with ruby-dicom. It only supports querying for top level tags.

My idea for fixing this is to change the argument of the DClient#find_xxx methods from a hash with tag string arguments, to a DICOM object (holding the tags/sequences you wish to query for).

Advantage:
-It allows the query of sequences.
-It's easy to encode the network package from the argument (just like encoding a DICOM file basically).

Disadvantage:
-More cumbersome to create the query argument.

With this suggestion, a query from the ruby-dicom documentation (link below) would undergo the following change:

Old version:
node.find_studies('0008,0020' => '20090604-', '0010,0020' => '123456789')
New version:

node.find_studies('0008,0020' => '20090604-', '0010,0020' => '123456789')

What do you think? Suggestions and comments are most welcome!

Best regards,
Chris


--
You received this message because you are subscribed to the Google Groups "ruby-dicom" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-dicom+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Simon Rascovsky

unread,
Jul 9, 2013, 5:43:11 PM7/9/13
to ruby-...@googlegroups.com
Hi Chris, 
​Are the old and new version examples the same? (Typo?) 

Sent from Mailbox for iPhone


You received this message because you are subscribed to a topic in the Google Groups "ruby-dicom" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ruby-dicom/E_swtMUZa48/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ruby-dicom+...@googlegroups.com.

Christoffer Lervåg

unread,
Jul 9, 2013, 5:44:43 PM7/9/13
to ruby-...@googlegroups.com
Sigh, I sent the email by accident before it was finished.

Here's the complete code example:

Old version:
node.find_studies('0008,0020' => '20090604-', '0010,0020' => '123456789')
New version:
dcm = DObject.new
dcm.add_element('0010,0020', '123456789' )
dcm.add_element('0008,0020', '20090604-')
node.find_studies(dcm)

Simon Rascovsky

unread,
Jul 9, 2013, 6:08:15 PM7/9/13
to ruby-...@googlegroups.com
Chris, 
Would all queries now have to be constructed as DObjects, or just the nested ones? (thinking backwards compatibility)

That looks like the most extensible way of supporting complex queries, based on existing core ruby-dicom code. I guess convenience methods can be added later to accept hashes of arrays (of hashes) if so desired, so eventually we may end up with something like (warning:pseudocode ahead->):

node.find_studies('0008,0020' => '20090604-', '0008,1111' => ['0008,0012' => '20130625'])
..or even take a JSON structure as a query....

But for now, being able to call DObjects directly would work just fine, in my humble opinion.


Simon Rascovsky MD, M.Sc
Coordinador de Investigación
Instituto de Alta Tecnología Médica - IATM


You received this message because you are subscribed to a topic in the Google Groups "ruby-dicom" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ruby-dicom/E_swtMUZa48/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ruby-dicom+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages