Assign a project to incoming data

Skip to first unread message

M.R. Dijkhuizen

Nov 22, 2021, 5:37:26 PM11/22/21
to xnat_discussion
Hi all,

We are trying to migrate data from a pacs to Xnat using  dicom send from the pacs to a Xnat scp receiver port. 

What we are trying to accomplish are the following things:
1) Assign a project when there is a match on a Patientname. Included is part of a ctp script as an example. The reason why we cannot use CTP because the subjects in the pacs contain segmentation data. CTP can't read segmentation dicom files.

  <e en="T" t="00324000" n="StudyComments">@always()@if(PatientName,contains,"A"){Project:ProjectA;Subject:@contents(PatientName);Session:@contents(PatientID)}

2) One research project on the pacs has spaces in de patientname. We would like to replace the spaces with a _ and then assign a project to the data. 

With kind regards.

Martin Dijkhuizen
Xnat admin
University of Groningen

Moore, Charlie

Nov 22, 2021, 6:04:42 PM11/22/21
Hi Martin,

I can't claim I'm exactly following what you mean, but it sounds too complicated for the built-in custom routing. I think the only real choice would be writing a custom DICOM object identifier in a plugin. We don't have any documentation on this, but I can point you at an example: . Hopefully that helps a bit.


From: <> on behalf of M.R. Dijkhuizen <>
Sent: Monday, November 22, 2021 4:37 PM
To: xnat_discussion <>
Subject: [XNAT Discussion] Assign a project to incoming data

* External Email - Caution *

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
To view this discussion on the web visit


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.

M.R. Dijkhuizen

Nov 23, 2021, 2:56:22 AM11/23/21
to xnat_discussion
Hi Charlie,

Thank you for your reply. What we would like to automate is the following. When a dicom session is send to xnat it is automatically put in the pre-archive. 
In the pre-archive you can attach a project to the dicom session.

For one project we need to get rid of the spaces in the patientname dicom header before we attach a xnat project. 

With kind regards,

Message has been deleted

P Summers

Nov 26, 2021, 5:39:04 AM11/26/21
to xnat_discussion
Hi Martin,
 if it might help for the elimination of spaces in patient names, 
 the following lines in a dicom edit script (.das) seem to work in replacing spaces and slashes with _ 

tempId := (0010,1001)
(0010,1001) := replace[ replace[ tempId, " ", "_" ], "/", "_" ]

it will probably also work as a one-liner:
(0010,1001) := replace[ replace[ (0010,1001), " ", "_" ], "/", "_" ]
but I haven't verified that.

Paul S

M.R. Dijkhuizen

Nov 30, 2021, 3:15:11 AM11/30/21
to xnat_discussion
Hi Paul,

Thank you for your reply.

We added this line in Project Routing (Site Wide) section.

(0010,0010):.*(?i)(project1).*:1 t:(?i)project1 r:pr1

In the Subject Routing (Site Wide) section
The code below changes the space into a _
(0010,0020):ROBINSCA\s.* t:\s r:_ 

With kind regards,


Reply all
Reply to author
0 new messages