Uploading data Automatically

409 views
Skip to first unread message

suyash Bhogawar

unread,
Mar 28, 2016, 5:27:30 PM3/28/16
to DicomBrowser users
Hello NRG team,

I am looking for an option to upload data to XNAT from our Linux machine instead of uploading from the console. 
To this dicombrowser does help me to upload data, I have to add every time new subjets to it and then set the attributes and then send. 

I have set up on our console where we just have to click on XNAT and data gets sent to XNAT. is there any option with dicombrowser where it automatically reads new exam from the directory assigned and then push it to XNAT?

I have tried OsiriX but it's not working very well. Is there any other solution or way to achieve this?

Thanks!
Suyash

Herrick, Rick

unread,
Mar 28, 2016, 8:42:19 PM3/28/16
to dicombrow...@googlegroups.com
Not with DicomBrowser itself, but you could write a script that uses DicomRemap to set the appropriate DICOM header values and send the data via C-STORE to XNAT. You could then set that up with a cron task that runs periodically and runs the script on any data that’s arrived since the last check. Or you could use something like inotify-tools to monitor the directory where the data is sent and use that to launch the script that processes and sends the new data to your XNAT.

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

(314) 740-5961


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

 


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.

Kumar

unread,
Mar 29, 2016, 2:38:30 PM3/29/16
to DicomBrowser users
Thank you Rick!

I could understand the cron job part to automate it but didn't quite understand the main part of using DicomRemap to set appropriate dicom header values. AS already we have dicom catcher in place, dicom header contains all the required information. I couldn't understand why DicomRemap have to be used? 

Also, as i read from XNAT website, C-store is a protocol to send data from SCu to SCP. Can you share, which application have the feature to send data from Linux machine to XNAT using C-store protocol? I am very new to this and might be asking very dumb questions. I apologize for that. 

Any links for the application or a sample script if you have would help a lot. 

Thank you!
Kumar


On Monday, March 28, 2016 at 8:42:19 PM UTC-4, Rick Herrick wrote:
Not with DicomBrowser itself, but you could write a script that uses DicomRemap to set the appropriate DICOM header values and send the data via C-STORE to XNAT. You could then set that up with a cron task that runs periodically and runs the script on any data that’s arrived since the last check. Or you could use something like inotify-tools to monitor the directory where the data is sent and use that to launch the script that processes and sends the new data to your XNAT.

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

(314) 740-5961


From: <dicombrow...@googlegroups.com> on behalf of suyash Bhogawar <suyas...@gmail.com>
Reply-To: "dicombrow...@googlegroups.com" <dicombrow...@googlegroups.com>
Date: Monday, March 28, 2016 at 4:27 PM
To: DicomBrowser users <dicombrow...@googlegroups.com>
Subject: Uploading data Automatically

Hello NRG team,

I am looking for an option to upload data to XNAT from our Linux machine instead of uploading from the console. 
To this dicombrowser does help me to upload data, I have to add every time new subjets to it and then set the attributes and then send. 

I have set up on our console where we just have to click on XNAT and data gets sent to XNAT. is there any option with dicombrowser where it automatically reads new exam from the directory assigned and then push it to XNAT?

I have tried OsiriX but it's not working very well. Is there any other solution or way to achieve this?

Thanks!
Suyash

--
You received this message because you are subscribed to the Google Groups "DicomBrowser users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dicombrowser-users+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Herrick, Rick

unread,
Mar 29, 2016, 3:04:34 PM3/29/16
to dicombrow...@googlegroups.com
If the DICOM header values have already been set to the values required to properly route the incoming data to the appropriate project/subject/session in XNAT, then you don’t need to use DicomRemap. The main thing DicomRemap gets you over other DICOM command-line utilities like those in dcmtk is the ability to process DicomEdit scripts and thereby modify the values in the DICOM headers, so if you’re already there then any tool that can do a C-STORE operation will work.

And you’re correct, C-STORE sends data from one place to another. In the case of a command-line tool like DicomRemap, the tool itself is the DICOM SCU (service class user), which basically just means it’s the “thing sending data to something else”. The SCP (service class provider) is anything on the network (any DICOM thing on the network, SCU or SCP, is called an “application entity”) that can receive and handle the incoming DICOM.

The simplest way to think of it is that you can have a command-line tool as a client or an SCU and XNAT serves as the server or SCP.

DicomRemap is one way to do this, but the dcmtk also provides a couple of tools, storescu and dcmsend, that can also do the C-STORE to XNAT. They don’t provide support for applying DicomEdit but are otherwise fine. dcmsend is the simpler tool to use. You can send all of the DICOM files in a particular folder with one command:

dcmsend -v yourxnat.yourlab.edu 8104 -aet XNAT --scan-directories --recurse <FOLDER>

If you have your cron or inotifywait task looking for new folders, then you can just stick the folder name there in place of <FOLDER>. This command says:
  • Send the DICOM…
  • In verbose mode…
  • To the server at the address yourxnat.yourlab.edu (this can also be an IP like 10.100.10.24)…
  • Running on port 8104 (this is the default XNAT SCP receiver port)
  • With the AE title XNAT (this is the default XNAT SCP receiver AE title)
  • Scan the directories…
  • And recurse the folder <FOLDER>
This will walk that folder, find all of the DICOM files contained in it and its subfolders, and send each of them onto your XNAT.

The documentation for dcmsend is available at:


-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

To unsubscribe from this group and stop receiving emails from it, send an email to dicombrowser-us...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

suyash Bhogawar

unread,
Apr 6, 2016, 3:56:33 PM4/6/16
to dicombrow...@googlegroups.com
Thank you very much, Rick, for the detailed response. I appreciate your help.

Just needed one small clarification, is dcmsend a command line too? Because i installed dcmtk as per instructions here but when i type dcmsend it says no command found. i understand this is not your support area and hence tried a lot to  understand if dcmtk has some command line tools or its a C library. 

Can you please share any specific instruction about how should i install dcmtk for dcmsend command? 

Thank you, 
yash

On Tue, Mar 29, 2016 at 3:04 PM, Herrick, Rick <jrhe...@wustl.edu> wrote:
Boxbe This message is eligible for Automatic Cleanup! (jrhe...@wustl.edu) Add cleanup rule | More info

If the DICOM header values have already been set to the values required to properly route the incoming data to the appropriate project/subject/session in XNAT, then you don’t need to use DicomRemap. The main thing DicomRemap gets you over other DICOM command-line utilities like those in dcmtk is the ability to process DicomEdit scripts and thereby modify the values in the DICOM headers, so if you’re already there then any tool that can do a C-STORE operation will work.

And you’re correct, C-STORE sends data from one place to another. In the case of a command-line tool like DicomRemap, the tool itself is the DICOM SCU (service class user), which basically just means it’s the “thing sending data to something else”. The SCP (service class provider) is anything on the network (any DICOM thing on the network, SCU or SCP, is called an “application entity”) that can receive and handle the incoming DICOM.

The simplest way to think of it is that you can have a command-line tool as a client or an SCU and XNAT serves as the server or SCP.

DicomRemap is one way to do this, but the dcmtk also provides a couple of tools, storescu and dcmsend, that can also do the C-STORE to XNAT. They don’t provide support for applying DicomEdit but are otherwise fine. dcmsend is the simpler tool to use. You can send all of the DICOM files in a particular folder with one command:

dcmsend -v yourxnat.yourlab.edu 8104 -aet XNAT --scan-directories --recurse <FOLDER>

If you have your cron or inotifywait task looking for new folders, then you can just stick the folder name there in place of <FOLDER>. This command says:
  • Send the DICOM…
  • In verbose mode…
  • To the server at the address yourxnat.yourlab.edu (this can also be an IP like 10.100.10.24)…
  • Running on port 8104 (this is the default XNAT SCP receiver port)
  • With the AE title XNAT (this is the default XNAT SCP receiver AE title)
  • Scan the directories…
  • And recurse the folder <FOLDER>
This will walk that folder, find all of the DICOM files contained in it and its subfolders, and send each of them onto your XNAT.

The documentation for dcmsend is available at:


-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

To unsubscribe from this group and stop receiving emails from it, send an email to dicombrowser-us...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

 


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.

--
You received this message because you are subscribed to the Google Groups "DicomBrowser users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dicombrowser-us...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

 


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.

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

suyash Bhogawar

unread,
Apr 14, 2016, 1:37:18 PM4/14/16
to dicombrow...@googlegroups.com
Hi Rick, 

I am getting following error when sending data  using dcmsend:

dcmsend -v 128.82.39.181 8104 -aet XNAT --scan-directories --recurse /Users/ybd99/Subject23/Subject22/505/0001/

I: determining input files ...

I: checking input files ...

I: starting association #1

I: initializing network ...

I: negotiating network association ...

I: Requesting Association

F: cannot negotiate network association: DUL Association Rejected


This might be due to AE Title but when we send data from scanner, XNAT is only used and its working. I am sure there is no firewall between too. 

Is there anything I need to change on XNAT installation?

 

Thank you, 

Yash



On Tue, Mar 29, 2016 at 3:04 PM, Herrick, Rick <jrhe...@wustl.edu> wrote:
Boxbe This message is eligible for Automatic Cleanup! (jrhe...@wustl.edu) Add cleanup rule | More info

If the DICOM header values have already been set to the values required to properly route the incoming data to the appropriate project/subject/session in XNAT, then you don’t need to use DicomRemap. The main thing DicomRemap gets you over other DICOM command-line utilities like those in dcmtk is the ability to process DicomEdit scripts and thereby modify the values in the DICOM headers, so if you’re already there then any tool that can do a C-STORE operation will work.

And you’re correct, C-STORE sends data from one place to another. In the case of a command-line tool like DicomRemap, the tool itself is the DICOM SCU (service class user), which basically just means it’s the “thing sending data to something else”. The SCP (service class provider) is anything on the network (any DICOM thing on the network, SCU or SCP, is called an “application entity”) that can receive and handle the incoming DICOM.

The simplest way to think of it is that you can have a command-line tool as a client or an SCU and XNAT serves as the server or SCP.

DicomRemap is one way to do this, but the dcmtk also provides a couple of tools, storescu and dcmsend, that can also do the C-STORE to XNAT. They don’t provide support for applying DicomEdit but are otherwise fine. dcmsend is the simpler tool to use. You can send all of the DICOM files in a particular folder with one command:

dcmsend -v yourxnat.yourlab.edu 8104 -aet XNAT --scan-directories --recurse <FOLDER>

If you have your cron or inotifywait task looking for new folders, then you can just stick the folder name there in place of <FOLDER>. This command says:
  • Send the DICOM…
  • In verbose mode…
  • To the server at the address yourxnat.yourlab.edu (this can also be an IP like 10.100.10.24)…
  • Running on port 8104 (this is the default XNAT SCP receiver port)
  • With the AE title XNAT (this is the default XNAT SCP receiver AE title)
  • Scan the directories…
  • And recurse the folder <FOLDER>
This will walk that folder, find all of the DICOM files contained in it and its subfolders, and send each of them onto your XNAT.

The documentation for dcmsend is available at:


-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

To unsubscribe from this group and stop receiving emails from it, send an email to dicombrowser-us...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

 


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.

--
You received this message because you are subscribed to the Google Groups "DicomBrowser users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dicombrowser-us...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

 


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.

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

Herrick, Rick

unread,
Apr 14, 2016, 4:27:54 PM4/14/16
to dicombrow...@googlegroups.com
You need to add the flag -aec, so that your command looks like this:

dcmsend -v 128.82.39.181 8104 -aec XNAT -aet XNAT --scan-directories --recurse /Users/ybd99/Subject23/Subject22/505/0001/

You’ve set the -aet parameter, but that sets the AE title of the client, i.e. your dcmsend operation. Unless the receiving service filters by AE title, you don’t even need to set this. There does need to be an AE title for the client, but dcmsend sets that to DCMSEND by default. But with your command, you’re getting the default AE title for the receiver, which is ANY-SCP. That means your data is probably making it to your server, but when it gets there it’s trying to hand its data to ANY-SCP on port 8104, which doesn’t exist.

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

(314) 362-1882

suyash Bhogawar

unread,
Apr 14, 2016, 4:59:37 PM4/14/16
to dicombrow...@googlegroups.com
Thank you Rick, 
Yes that works. 
But now the question i have is with XNAT reception. 
Do we have to close the connection?
Because when i send data with dcmsend through command line, all images are are sent within few seconds but XNAT Status is still Receiving..

Inline image 1

Herrick, Rick

unread,
Apr 14, 2016, 8:04:09 PM4/14/16
to dicombrow...@googlegroups.com
That's because there's no such thing as closing the connection for a C-STORE operation and is also (one of) the reason(s) we have the prearchive in XNAT. Since you can't really tell when you've received the last bit of data from a study, we store it in the prearchive and, for each file we receive, update the timestamp associated with the study instance UID. There's a worker process that runs every minute and checks the prearchive for any session that hasn't been updated for more than some particular latency period (by default this is set to 5 minutes but is configurable).

So that's why you're seeing the session as still receiving: it's been less than five minutes since any data was received. If you wait for five minutes or so, eventually the status will be updated to BUILDING and then, after a few seconds, READY. Or, if the project to which the session is automatically assigned is set to autoarchive, the session will get moved as soon as the building phase is completed.

Alternatively, if you're watching the prearchive and know that all of the data has been received, you can click the Rebuild button and start the process yourself. If you want to script the equivalent, there's a commit REST function that you can call. I don't know it right off the top of my head, but if you look at the network monitor in your browser's developer tools, it would be the same call that the prearchive UI makes when you click the Rebuild button.

Sent from Outlook on my iPhone: please excuse typos or terse responses.

suyash Bhogawar

unread,
Apr 18, 2016, 5:32:01 PM4/18/16
to dicombrow...@googlegroups.com
Thank you, Rick very much for sharing detailed information about the XNAT behaviour. 

Yash

On Thu, Apr 14, 2016 at 8:04 PM, Herrick, Rick <jrhe...@wustl.edu> wrote:
Boxbe This message is eligible for Automatic Cleanup! (jrhe...@wustl.edu) Add cleanup rule | More info

That's because there's no such thing as closing the connection for a C-STORE operation and is also (one of) the reason(s) we have the prearchive in XNAT. Since you can't really tell when you've received the last bit of data from a study, we store it in the prearchive and, for each file we receive, update the timestamp associated with the study instance UID. There's a worker process that runs every minute and checks the prearchive for any session that hasn't been updated for more than some particular latency period (by default this is set to 5 minutes but is configurable).

So that's why you're seeing the session as still receiving: it's been less than five minutes since any data was received. If you wait for five minutes or so, eventually the status will be updated to BUILDING and then, after a few seconds, READY. Or, if the project to which the session is automatically assigned is set to autoarchive, the session will get moved as soon as the building phase is completed.

Alternatively, if you're watching the prearchive and know that all of the data has been received, you can click the Rebuild button and start the process yourself. If you want to script the equivalent, there's a commit REST function that you can call. I don't know it right off the top of my head, but if you look at the network monitor in your browser's developer tools, it would be the same call that the prearchive UI makes when you click the Rebuild button.

Sent from Outlook on my iPhone: please excuse typos or terse responses.




On Thu, Apr 14, 2016 at 1:59 PM -0700, "suyash Bhogawar" <suyas...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages