Tuesday, 17 June 2008

dgate.exe usage

I recently found that executin dgate.exe -h at command line gives you all the switches that can be used for the application. This could be quite usefull if you want to automate certain tasks with batch scripts and windows task scheduler.

the output for dgate.exe -h is as follows:

DGATE: UCDMC/NKI DICOM server thread and PACS utility application 1.4.12c

Usage:
(1) DGATE <-!#|-v|-u#|-^#> Report as in dicom.ini|stdout|UDP|File(#=port)
[-p#|-b] Set listen port|run in non-theaded debug mode
[-i|-r|-arDEVICE] Init|Init/regenerate DB|Regen single device
[-d|-m|-k] List (-d) devices (-m) AE map (-k) DICOM.SQL
[-t|-o] Test console|Test database
[-sOptions] Create ODBC data source (WIN32 only)
[-nd|-nc#|-jd|-jc#] NKI de-/compress#|JPEG de-/compress# FILE
[-as#,N|-amFROM,TO] Select#KB to archive of MAGN|move device data
[-au|-aeFROM,TO] Undo select for archiving|rename device
[-av|-atDEVICE] Verify mirror disk|Test read files for DEVICE
[-abJUKEBOX1.2,N] Make cacheset to burn JUKEBOX1,CD2 from MAGN
[-acJUKEBOX1.2] Verify JUKEBOX1,CD2 against cacheset
[-adJUKEBOX1.2] Verify and delete cacheset for JUKEBOX1, CD2
[-fID] Delete DB for Patient, sTudy, Series, Image
[-ffile] Enter/Delete DB of file, Zap server file
[-faFILE<,ID>] Add file to server
[-zID] Delete (zap) patient
[-frDEVICE,DIR] Regen single directory DIR on DEVICE
[-fPATID,file] Change/Kopy PATID of file (irreversible/once)
[-f?file|-fu|-c#] get UID of file|Make new UID|UID helper(0..99)
[-ff#] Delete old patients until #MB free
[-gSERVER,DATE] grab images from SERVER of date not on here
Otherwise: run as threaded server, port=1111

(2) DGATE FileMapping Run server child; shared memory has socket#

(3) DGATE --command:arguments Send command to running server in other process
(works directly - use with care)
Delete options:
--deleteimagefile:file Delete given image file from server
--deletepatient:patid Delete given patient from server
--deletestudy:studyuid Delete given study from server
--deleteseries:seriesuid Delete given series from server
--deleteimagefromdb:file Delete given file from db only
--deletesopfromdb:pat,study,series,sop Delete specified image from db only

Dbase without ODBC options:
--packdbf: Pack dbase databases and recreate memory index
--indexdbf: Re-create memory index for dbase database
--extract:patid Extract dbase databases for single patient to X..

Modification of dicom objects:
--modifypatid:file,patid Change patid of given file
--mergestudy:uid,uid,.. Start merging studies with given studyuids
--mergestudyfile:file Use to process all files to merge
--mergeseries:uid,uid,.. Start merging series with given seriesuids
--mergeseriesfile:file Use to process all files to merge

Maintenance options:
--initializetables: Clear and create database
--initializetables:1 Clear and create database for DbaseIII via ODBC
--initializetables:2 Clear and create worklist database
--regen: Re-generate entire database
--regendevice:device Re-generate database for single device
--regendir:device,dir Re-generate database for single directory
--regenfile:file Re-enter given file in database
--addimagefile:file,patid Copy file into server, optionally with new patid
--testcompress:file Test: enter file in server with many compressions
--debuglog_on:file/port Start debug logging
--log_on:file/port Start normal logging
--debuglevel:# Set debug logging level
--makespace:# Delete old patients to make #MB space
--get_freestore:dev,fmt Report free #Mb on device
--get_param:name,fmt Read any parameter from DICOM.INI
--put_param:name,value Write any parameter to DICOM.INI
--delete_param:name Delete any parameter from DICOM.INI
--read_ini: Re-read all parameters from DICOM.INI
--get_amap:index,fmt List any entry from ACRNEMA.MAP
--put_amap:i,AE,ip,p#,cmp Write entry in memory for ACRNEMA.MAP
--delete_amap:index Delete entry in memory for ACRNEMA.MAP
--write_amap: Write ACRNEMA.MAP from memory to disk
--read_amap: Re-read ACRNEMA.MAP from disk to memory
--get_sop:index,fmt List any accepted service class UID
--put_sop:index,UID,name Write/add accepted service class UID
--delete_sop:index Delete accepted service class UID
--get_transfer:index,fmt List any accepted transfer syntax
--put_transfer:in,UID,nam Write/add accepted transfer syntax
--delete_transfer:index Delete accepted transfer syntax
--get_application:idx,fmt List any accepted application UID
--put_application:i,U,n Write/add accepted application UID
--delete_application:inde Delete accepted application UID
--get_localae:index,fmt List any accepted local AE title
--put_localae:in,AE,name Write/add accepted local AE title
--delete_localae:index Delete accepted local AE title
--get_remoteae:index,fmt List any accepted remote AE title
--put_remoteae:in,AE,name Write/add accepted remote AE title
--delete_remoteae:index Delete accepted remote AE title
--get_dic:index,fmt List any dicom dictionary item
--get_sqldef:level,in,fmt List any database field definition
--dump_header:filein,fileout Create header dump of file
--forward:file,mode,server Send file with compr. mode to server
--convert_to_gif:file,size,fileout Downsize and convert to GIF
--query:table|fields|where|fmt|file Arbitrary query output to file
--query2:tab|fld|whe|fmt|max|file Same but limit output rows to max
--patientfinder:srv|str|fmt|file List patients on server
--studyfinder:srv|str|fmt|file List studies on server
--seriesfinder:srv|str|fmt|file List series on server
--serieslister:srv|pat|stu|fmt|file List series in a study
--imagelister:srv|pat|ser|fmt|file List files in a series
--addrecord:table|flds|values Append record, values must be in ''
--deleterecord:table,where Delete record from table
--grabimagesfromserver:AE,date Update this server from other
--display_status:file Display server status
--loadhl7:file Load HL7 data into worklist
--clonedb:AE Clone db from server for testing
--quit: Stop the server

Archival options:
--renamedevice:from,to Rename device in database
--verifymirrordisk:device Verify mirror disk for selected device
--testimages:device Test read all images on device
--movedatatodevice:to,from Move data from one device to another
--selectlruforarchival:kb,device Step 1 for archival: to device.Archival
--preparebunchforburning:to,from Step 2 for archival: moves to cache
--deletebunchafterburning:deviceto Step 3 for archival: deletes from cache
--comparebunchafterburning:deviceto Part step 3 - compare jukebox to cache
--restoremagflags: Undo archival sofar