Skip to content

UCLHp/DicomExporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DicomExporter

ESAPI scripts for batch dicom export

Prerequisites

Before running any scripts you will need to ensure that:

  • You have created a dicom daemon on the Varian server and set up trusted entities as described in Chapter 4 here
  • Created a receiver dicom daemon where you will export the dicom files to - you may wish to use a free service such as ClearCanvas
  • You know the relevant AETitles, IP addresses and port numbers for the above

About the code


ESAPI does not provide any built-in functions for dealing with dicom and so we must use an external library. Here we've used EvilDicom by Rex Cardan which can be simply installed in Visual Studios via NuGet as described in Chapter 3 here.

Since this code will open multiple patients it must be built as a stand-alone executable.

The script as it stands requires a 2 column csv file, where the first column is a list of Patient IDs and the second is a list of Course IDs. This file must be located in the same directory as the executable. The script will then export every plan inside the specified course if it has a valid dose. Along with each plan, the dicom files for the structure set, plan dose, plan image and all 3D images that share the same FrameOfReferenceUID will be exported (frame of reference is used so that all phases and reconstructed images such as MIP, Ave, etc. belonging to the related 4DCTs will be exported).

ESAPI will allow you to explore the full patient data set intuitively - you can open a patient, loop through all plans, images, etc. referencing their IDs and other properties as they appear in Eclipse. However, when querying the ARIA database via EvilDicom the amount of information available is limited to a small number of each dicom images' tags: Patient ID and Name, plus the Series, SOP and Study instance UIDs. This just means that once know what you want to export, you need to find the objects with ESAPI and determine the relevant UIDs which you can then use as your export criteria.

Running the code

  1. Use the Eclipse Script Wizard to generate a stand-alone executable
  2. Copy the code in the .cs file into your own
  3. Install EvilDicom via NuGet and ensure the Varian libraries are referenced
  4. Update the parameters relating to the csv input file and all AETitles, IPs and ports
  5. Build the solution to generate your executable
  6. Ensure the executable and patient file are on Varian's server (\\vaimg103\...)
  7. From within the External Beam workspace select Tools > Scripts and in the Location section select System Scripts > Open Folder. Navigate to and select your executable

About

ESAPI scripts for automated dicom export

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages