custom DICOM routing

159 views
Skip to first unread message

angel.m...@gmail.com

unread,
Jun 24, 2021, 10:54:42 PM6/24/21
to xnat_discussion
Hi I've got XNAT 1.8 running and I would like to write a new custom dicom routing rule for creating the session ID. To test this out I went to Site Administration -> Manage Data -> Custom Dicom Routing. I turned the routing on for session ID and I followed the link for help with formatting the string (https://wiki.xnat.org/workshop-2016/step-3-of-8-configure-dicom-project-routing-29032850.html). This page could use some updating as the examples are given only for rest calls. However I've assumed that this part " (0008,1030):(?:[^\^]+)\^((?:[a-zA-Z\d]+)[_\-](?:\d+))(.*?)" is the relevant string and tried using that. I've so far tried it with and without quotation marks and I've tried changing the dicom tag to be that of the field I actually want to use. I've also tried just using the DICOM tag without the regular expression.

Nothing I've done has changed the assigned session ID when a new data set is imported. There are no relevant messages in the logs as far as I can tell to let me know what is happening with the session routing. 

What I'd like to know is...
- What is the easiest way for me to find out what is happening with the routing?
- Will the routing be applied when the compressed up-loader is how the data is being imported?
- Is the problem with my string formatting?

any help is much appreciated
Angel


angel.m...@gmail.com

unread,
Jun 25, 2021, 3:05:09 AM6/25/21
to xnat_discussion
Related to the above... I'd like to be able o see what is happening with the DICOM routing within the code. I'm pretty new to the code base so I'm hoping someone could tell me where I should be looking in the code base. 

thanks again
Angel

Steve Moore

unread,
Jun 25, 2021, 10:00:28 AM6/25/21
to xnat_discussion
Angel,


It is current because we updated in the last few months.  That page links to this one: https://wiki.xnat.org/documentation/xnat-administration/xnat-custom-dicom-routing-rules-in-the-admin-ui which describes how you set this in the admin UI and how the rules are written.

This might not answer your detailed question about syntax. Please let us know if you are still stuck.

Steve Moore

Angel Kennedy

unread,
Jun 28, 2021, 12:02:31 AM6/28/21
to xnat_di...@googlegroups.com
Thanks for that but it still does nothing (that is it has no impact on what XNAT uses to populate the session field I was trying to modify). I suspect that the custom rule is being totally ignored when using the compressed uploader and the desktop uploader. Does it only work for the DICOM receiver?

thanks
Angel

--
You received this message because you are subscribed to a topic in the Google Groups "xnat_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xnat_discussion/rQBpSvrGJpI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xnat_discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/83dbf909-a582-4087-982a-8aac570529cdn%40googlegroups.com.

Steve Moore

unread,
Jun 28, 2021, 4:06:43 PM6/28/21
to xnat_discussion
I will ask one of our developers (any of whom know more than me) to review.

steve

Angel Kennedy

unread,
Jun 28, 2021, 10:44:19 PM6/28/21
to xnat_di...@googlegroups.com
thanks

You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/68b74026-9eb5-438d-a96a-6d079a68ab34n%40googlegroups.com.

Moore, Charlie

unread,
Jun 29, 2021, 10:30:50 AM6/29/21
to xnat_di...@googlegroups.com
Hi Angel,

It should work for the compressed uploader. Can you post the data you're uploading (or at least the value of the particular DICOM element you're using) and the routing configuration?

Thanks,
Charlie

From: xnat_di...@googlegroups.com <xnat_di...@googlegroups.com> on behalf of Angel Kennedy <angel.m...@gmail.com>
Sent: Monday, June 28, 2021 9:44 PM
To: xnat_di...@googlegroups.com <xnat_di...@googlegroups.com>
Subject: Re: [XNAT Discussion] Re: custom DICOM routing
 

* External Email - Caution *

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

angel.m...@gmail.com

unread,
Jun 30, 2021, 11:20:44 PM6/30/21
to xnat_discussion
Sure so this is the routing configuration I'm using...
I've set session site-wide routing to enabled (subject and project are disabled) with the following routing string: (0008,1030):Session:\s*(\w+)
The value in the study description (0008,1030) dicom tag is:  Session: PMCC_CT_3.75mm_Helical
The value that ends up as the seesion ID is: 02Jan2020-690 which corresponds to the series date (0008,0021)

thanks again
Angel

Moore, Charlie

unread,
Jul 1, 2021, 10:50:44 AM7/1/21
to xnat_di...@googlegroups.com
Hi Angel,

That looks like you based it off the example under "Specifying a Single Rule in a DICOM Tag", right? Note the assumption for this example: 'Look for the term "Project:", then look for whitespace, then look for one or more "word" characters (i.e., letters, digits, and/or the underscore character).' In particular, your example contains a period/dot. Therefore, the regex doesn't match, and so XNAT won't try to assign the session label from it. I tried removing the period, and it seems to work just fine after that. I'm not a regex expert, but it seems to work well enough even with the period with this routing string: (0008,1030):Session:\s*(.*)

YMMV, but I hope that helps.
Thanks,
Charlie

From: xnat_di...@googlegroups.com <xnat_di...@googlegroups.com> on behalf of angel.m...@gmail.com <angel.m...@gmail.com>
Sent: Wednesday, June 30, 2021 10:20 PM
To: xnat_discussion <xnat_di...@googlegroups.com>

Angel Kennedy

unread,
Jul 2, 2021, 3:25:10 AM7/2/21
to xnat_di...@googlegroups.com
Thanks for you help, that works, sorry I didn't notice the issue with the period. 

There was a link on the guide page to a java visual regex tester but it's broken unfortunately. I just googled java regex tester and found this site https://www.regexplanet.com/advanced/java/index.html which does work. I'm pasting it here in case anyone else is having trouble with this.

Reply all
Reply to author
Forward
0 new messages