Sign in
RadiAnt DICOM Viewer - Discussion Forum
automatically extract patients data from DICOM tags

Nov 6, 2015 12:09 PM
by Tommy
hi there,
is there any way I can automatically extract some patients data (name, DOB, ID) from the currently viewed case in RadiAnt and save them as a text string?

actually you can inspect those data from DICOM tags panel (Ctrl+Alt+T) select them and copy them one by one with Ctrl+C and Ctrl+V

I'd like to create a script that automatically copies them all together and assembles them in a string with this format


my aim is to link the images viewed in RadiAnt to my report templates which follow the same format.

If I'm able to obtain such a string from the study viewed in RadiAnt it will be easy for me to have a custom script that loads the report template that corresponds to that patient

so the question is, command line parameters of RadiAnt may help me doing this?
Nov 6, 2015 02:36 PM
by Tommy
to make a more concrete example

I have a MICKEY MOUSE_110134_061115_mri.doc
which is the report template for the MRI exam of MICKEY MOUSE (date of birth 11-01-34) (date of exam 06-11-2015)

ideally loading the DICOM images in RadiAnt and running my script I want to extract the data of the current exam from the DICOM tags, then assemble into a text string which is the filename of the template report .doc file I wanna load
Nov 7, 2015 06:13 AM
by Tommy
an alternative and maybe easier approach could be acting the opposite direction...
I already have the patients data in my report template...

is there any way I can create a script that extract the patient data from the report template and the loads the corresponding images in the RadiAnt viewer?
Nov 7, 2015 06:23 AM
by Tommy
in the manual I see these interesting command line examples...


Start downloading studies that match a specific DICOM tag/value pair (radiantviewer.exe -pstv 00080050 "1412-14-ACCESSION-NUMBER" or radiantviewer.exe -pstv 0020000D "")


Start downloading studies from the specific PACS host, matched by the AE title (radiantviewer.exe -paet MYPACSAETITLE -pstv 00100020 "23874623-PATIENTID")


Export DICOM meta data to text files (radiantviewer.exe -d folder_in -tg folder_out)

a few questions:

1- which is the exact different between "pstv" and "paet" ? consider that I have a single PACS archive but multiple RadiAnt installations on different PCs. which one best fits my setting?

2- does the "tg" command extract the full list of DICOM tags or is it possible to extract selectively only those you need?

Nov 7, 2015 08:20 PM
by Tommy
after playing with command line I was able to extract the DICOM tags as a .txt file

I used this syntax in the commands prompt

C:\Program Files\RadiAntViewer64bit>radiantviewer.exe -d C:\Test\DICOM -tg C:\Test\DICOM

I tried to save this code as a .bat file but it doesn't work this way...

what I'm doing wrong? it would be easier to me to just click a .bat file instead of using the commands prompt

Nov 8, 2015 01:51 AM
by Tommy
got it... had to put the .bat file inside the RadiAnt installation folder and run it from there
Nov 8, 2015 02:56 AM
by Tommy
I made some more progress

thanks to a macro I can correctly extract the data I need from the DICOM tags text file

next step would be to have a fast way to automatically extract the DICOM tags from the currently viewed case in RadiAnt

actually I manually export a single DICOM image from the currently viewed case into the target folder of my .bat file and then run the .bat and the macro

is there a way I can export that single image with command line?
Nov 9, 2015 08:05 PM
by RadiAnt
1) If you have only one PACS location defined, you don't need to use "-paet", as searching all locations and a specified location will be just the same.
2) You can't extract dicom tags selectively with the "-tg" param. Actually it was a feature for our internal testing that happened somehow to make its way to the manual ;-)
3) You can export tags from a single file: radiantviewer.exe -f file.dcm -tg outputfolder
4) Use this code in a bat file:
C:\Program Files\RadiAntViewer64bit\radiantviewer.exe -f C:\inputfile.dcm -tg C:\outputfolder

Nov 9, 2015 08:07 PM
by RadiAnt
I'm afraid that you can't export the tags of currently viewed image...
Nov 10, 2015 07:10 PM
by Tommy
Ok, it's not a problem since I can already extract tags from a .dcm file using the -tg command.

what about saving the currently viewed .dcm image into a target folder with command line?

is there a way I can automate this instead of manually click the export images toolbar menu?
Nov 11, 2015 06:19 AM
by Tommy
for the record the code:
C:\Program Files\RadiAntViewer64bit\radiantviewer.exe -f C:\inputfile.dcm -tg C:\outputfolder

doesn't work since there's a space in the "Program Files" path
I had to put quotes to make it work

"C:\Program Files\RadiAntViewer64bit\RadiAntViewer.exe" -d C:\Test\DICOM -tg C:\Test\DICOM
Nov 12, 2015 07:12 PM
by RadiAnt
Tommy, I'm afraid that currently there's only the manual way of doing this.
I'm not sure if and when we could implement this. It seems very "specific" feature...
Nov 12, 2015 09:50 PM
by Tommy
ok. nevermind.
I'll workaround this creating a script that monitors the temp folder and when a new DICOM case appears it extracts DICOM tags using the command line
Jul 2, 2018 02:45 AM
by Perebre MD
Hi Tommy,

I had recently the same question about extracting dicom data to create a report. Did you find a workaround for it? I'm using macros with AHK (Auto Hot Key) for extracting the tags I need, one by one, it works but sometimes it fails. Did you find a better way?

Jul 4, 2018 04:57 AM
by Tommy
sorry I did not make any progress about that.
Post reply
Author (first name or pseudonym):


Captcha image

Visitors can post messages on the forum without having to register. Please input your first name or pseudonym in the "Author" field. Do not publish any personally identifiable information (PII).

Please ensure you write your posts in English so that our international audience can understand and reply to your message.

The Administrator reserves the right to remove any messages that violate our forum rules; for example, those that are not related to the RadiAnt DICOM Viewer software, published in a language other than English, contravene regulations, etc.