-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdgate.cpp
More file actions
18551 lines (16259 loc) · 608 KB
/
dgate.cpp
File metadata and controls
18551 lines (16259 loc) · 608 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
MvH 19980327: Disable logfile for speed and save disk
MvH 19980327: -! Enables logging to Personal pacs console; RunServer works; -p breaks
MvH 19980327: All printf's to systemdebug
MvH 19980320: Integrated dumppacs code here for convenience
MvH 19980320: Fixed -p option; SaveToDisk returns filename, printed in stats
MvH 19980320: Documented and added print of usage
MvH 19980404: Added test options, SQL config option and command line specified console pipe/udp
MvH 19980409: added FileCompressMode option; use local save to disk code instead of pdu member
MvH+LJZ 19980409: Return on failed GenerateFileName in SaveToDisk
MvH 19980409: Cleaned up nki private compression code and allow >15 bit differences
MvH 19980410: Added run length encoding for equal pixels to compressor; fix 3-byte case
MvH 19980415: Cleaned up the messages; -! does not enable debug; do not enable accessupdates (use aroute)
MvH 19980618: Some work on manual and database layout listing
MvH 19980621: Added -z option: zap patient
MvH 19980624: Comm test also produces systemdebug and long text output; added \n to some output
MvH 19980625: SaveDicomDataObject in loadddo.cpp supports NKI compression
MvH 19980704: Added some test code for counting disk space and renaming device for patient
MvH 19980705: Added CACHE devices in free store check; added FindPhysicalDevice (searches for file)
MvH 19980709: Added archiving options: -as, -au, -ab, -ac, -ad
MvH 19981217: Temporary use PDU.Save... code for testing DICOM objects (does not compress)
MvH 19981218: Temp use Pdu.Load as well (no compression)
MvH 19981228: Disabled ljz's code until it has been completed
ljz 19990108: Reenabled ljz's code: Replace uncompressed by compressed pixeldata VR in
SaveToDisk (it seemed to work anyway...)
MvH 19990109: Removed some commented out code; added comments for alternative load and save routines
Added Regen of specified device
MvH 19990110: Added n, for MAGn, as parameter in -as and -ab archiving options (default all)
exit(1) on failure
MvH 19990111: Fixed exit code on -ar option
MvH 19990117: If the filename is *.dcm (depends on FileNameSyntax) use uncompressed chapter 10 format
ljz 19990317: Added NKI-private stuff
MvH 19990628: Temporary enabled debug in -!nnnn option
MvH 19990630: Added MIRROR option; disabled debug in -!nnnn option
MvH 19990707: Fixed MIRROR option; added MIRROR message; added check on FindPhysicalDevice result
ljz 19990817: Added ability to spawn ExportConverters at the end of SaveToDisk
MvH 19990827: Optimized read of slices: cache a DB to pass to GetFileName (10% faster)
ljz 19991117: Added parameter FileCompressMode to in nki_private_compress call
mvh 20000318: Added private command object 9999, 0300 = print to console
Added private command object 9999, 0400 = force C-Echo to be 'silent' (no log)
Display C-Move Destination; print time info about threads
ljz 20000323: Serious fix: MainThread 'hangs' when several associations occur simultaneously, caused
by compiler-optimisation. Solution: DriverApp.Lock should be 'volatile'.
mvh 20000329: On request by ljz: designed crash of server if silent VR receives 'DEAD'
ljz 20000501: Compare dicom modality with UPPER-case ini-file setting (ExportConverters)
ljz 20000221: Initialize TroubleLogFile and UserLogFile; log C-STORE and C-MOVE
ljz 20000703: Logging of trouble now starts with '***'
mvh 20000703: Exclude archival messages from trouble log; removed force dcm code
mvh 20001104: Added WINAPI to thread routines
mvh 20001105: Replaced malloc by new where a mix could occur (vr->data)
Made compilable for MSC and BC and WC using some #ifdefs
Changed order of verification and store; better localized new/delete DDO more
mvh 20001106: Run-time load odbcinst routine for BC and WC, use spawn... i/s/o _spawn...
mvh 20001106: Use delete [] operation for vr->Data
mvh 20010328: Added -av: verify mirror disk
mvh 20010415: Added DeleteSeries, DeleteStudy and DeleteImage routines and -f options
mvh 20010416: Added -f options: -feFile = enter MAGN file into DB, -fdFile = delete file from DB
-faFile = add (also makes copy) file into server, -f?=ask UID of file,
-fu = generate UID, -fcNEWPATID,file = modify patient ID of image file (moves file!)
NOTE: -fc is irreversible in the sense that if a portion of a study/series is changed
and changed back it winds up as a different study/series. This occurs because the
UIDs must be changed for each image modification. This problem does not occur when
a whole series or study is changed
mvh 20010417: Simplified code to change uids to allow easy extension to referenced SOPs
Check after load on common UIDs to avoid accepting dropped non-dicom files
NOTE: ChangeUIDinDDO should also change sequences and referenced SOPs (0008,1155)
mvh 20010418: Fix in above change
mvh 20010418: Changed names of database fields in UIDMODS - did not work on msaccess
mvh 20010419: Added -fk option: copy image file to other patient ID (as -fc but no delete)
Added version number 1.3.9 to command line help
mvh 20010429: Added -fz option: zap file from server and database
mvh 20010430: Some work on read ahead thread: note that thread must not use any pointer copy!
mvh 20010502: Made read ahead thread working; fixed thread counter; fix odbc option: strings too short
mvh 20020506: Fixed handle leak in read ahead thread
mvh 20020507: Fixed memory leak in read ahead thread; kbhit() test #ifdef DO_LEAK_DETECTION
mvh 20010509: Added RenameDevice is -ae option
ljz 20010730: Replaced parameter argv[0] of ExportConverters to proper value
mvh 20010829: Added ExportStationName as export filter; default Export... value set to "*"
Made export comparisons case insensitive; added special 'forward to AE' ExportConverter
Version to 1.3.10
mvh 20010831: Added extended syntax for exportconverters with %f=filename, %m=modality,
%s=stationname, %b=file base name, %p=file path;
Also allows 'copy %f destination', but for windows NT only (uses cmd.exe)
Added ExportFilter option that uses an SQL statement to filter.
mvh 20010901: Added a simple queue to process exportconverters asynchroniously
mvh 20010901: Create a queue for each converter; queue mirror copy requests
mvh 20010902: Added %o = SOP; %n = newline; added the following hard coded converters:
append "text" to file; write "text" to file; copy file to file; copy file to dir
ljz 20010904: Re-entered change of 20010730
ljz 20010905: Fix: After 'SaveToDisk', do not free pDDO
mvh 20011109: Fix: made ExportConverter stuff case insensitive
Note: empty filter tests for empty contents - this is not the same as '*'
Released 1.3.10
mvh 20011110: Note: in release 1.3.10, the " to " in e.g., write "%f%n" to file must be lowercase
mvh 20011115: Made " to" case insensitive; Added *** before some error messages for better logging
Removed cache db: would hang the server if SQL has gone down and up.
Now use one DB per thread which is passed to the read ahead thread = fast too!
ljz 20011207: Added extra errormessage when creation of datasource fails
mvh 20020109: Disabled this code for watcom or borland (instead of run-time loading an address)
mvh 20020314: Implemented ignore of C-CANCEL request for ADAC NM (was error before)
Blocked out SQLInstallerError call; does not compile on clinical MS4.2
mvh 20020413: Added some notes about thread safety and db's: The serverchild is not thread
safe when reading and writing is done on the same association.
mvh 20020415: Added -atDEVICE option: sanity check of images on disk; version to 1.3.11
mvh 20020416: Made UID generator configurable through UIDPrefix in dicom.ini; made time print unsigned
mvh 20020422: Sleazy fix of ModifyPatID: time(null) created same UID: now wait 1 s per changed file
mvh 20020426: Generate filename no longer gives an error: is done at higher level
mvh 20020428: Only serious error messages use *** in message
mvh 20020428: Added FAILSAFE_STORAGE: tries to save incoming files even when DB errors occur
mvh 20020429: Put SaveToDisk in myUnknownStorage: pass DB failures to caller
Disabled FAILSAFE_STORAGE: any storage failures should now be detected by client
mvh 20020508: Do not rewrite image not on MAG but it is not an error (warning is generated earlier)
mvh 20020520: Added -gSERVER,DATE option: grab images on date from remote server
mvh 20020521: fix displaying junk filename when rewriting image not on MAG
ljz 20020522: Fix in SetStringVR: strings must be padded with a space
mvh 20020529: -i and -r now have mode parameter (0=normal and default, 1=simple, e.g., for DBASEIII)
ljz 20020531: In 'QualifyOn', support case-sensitive call to 'GetACRNema', but make AE-Title
uppercase after retrieving IP and port.
ljz 20020613: Better handling of Compression ON/OFF in 'SaveToDisk'
Fixed crash in DeleteImageFile (twice free of VR->Data)
mvh 20020613: compress to specified mode, check (de)compress result, decompresses data before
forward; added 'export compressed to AE' export; -fa has optional ,NEWPATID syntax;
mvh 20020802: Simplified rmdir code and allow multiple subdirectories in rmdir and mkdir code
Version to 1.3.12 (unreleased)
mvh 20020804: Use PATHSEPCHAR where possible
mvh 20020807: Changed SaveToDisk order: only make patientdir when DB save succeeded
mvh 20020812: Added skeleton of printer support
mvh 20020816: Added color imagebox; Save incoming print DDO as file
mvh 20020819: UIDs of imageboxes end on rows.cols.position for easy print handling
mvh 20020819: Fix in delete unexistent mirror files for changepatientUID
Extract pixel data from sequence in ImageBox; added sleep(10) in -fk option
mvh 20020819: Added better UID generation (but gets close to 64 chars)
mvh 20020821: Fix printer UID generation; display page orientation and film #; shorter info
mvh 20021016: Added (indexed) patid to exportfilter query and getfilename for speed;
The option tests for rev5 db or higher; increase 64 strings to 66;
Note: the GrabImagesFromServer option does not yet pass patid to the query
(i.e., will be slow with non-odbc driver)
mvh 20021017: Control NeedPack from here; added -c option: set UID counter at startup
Removed Sleep from anonimize options; do not re-create UIDMODS
mvh 20021018: Pass NoKill through GenerateFilename for interactive DGATE
mvh 20021028: Fix query on study in PatientStudyOnlyQuery (did an image query)
mvh 20021105: Revamped read-ahead thread logic to try fix rare crash where ratd->DDOOutPtr became NULL
mvh 20021115: Use Generic style retrieve classes with NKIqrsop code instead of older qrsop code
Advantages: read ahead thread used, and allows print of error messages from C-MOVE
Required changes such that ratd->pcdo can be NULL.
mvh 20021121: Disabled read-ahead thread for time being
mvh 20021212: Also loop ServerApp.Server(Port) in threaded mode server
mvh 20021213: Re-entered fix by Hanne Kooy: compressed forwarding had extra ;
mvh 20021213: Re-enabled use of generic query classes with read-ahead thread;
but made read-ahead thread configurable with "EnableReadAheadThread"
Made grab query faster by including date - note grab is independent of FixPhilips
mvh 20021215: Found read-ahead thread problem reported by Aaron Cann - missing Sleep in wait for slices
mvh 20021223: Version to 1.4.1 pre-release; added in dgatefn forbidden filename chars suggest by Thomas Buerer
mvh 20030113: Removed loop ServerApp.Server(Port): gave endless loop error messages
ljz 20030120: Added cleanup-code when DO_LEAK_DETECTION is defined for easy leak checking
mvh+ljz 20030205: Fix bug found by Frank-Andre Siebert: read ahead thread crashed when ID or SOP is missing
Also fix 2 other potential missing VR problems
mvh 20030228: Fixed bug reported by Jeff Bacbcock: series retrieve from E-film crashed (patid not passed)
ljz 20030424: Version to 1.3.12
Changed calls to obsolete PDU.Write(&DDO)
In 'SaveToDisk' the call to PDU.SaveDICOMDataObject now has parameterDICOM_CHAPTER_10_EXPLICIT
(which in writes IMPLICIT files iff not compressed)
ljz 20030606: Fixed incremental counter when creating UIDs or generating filenames
Fix: QueryRetrieveLevel is mandatory for a QueryResponse
mvh 20030625: Fix NGET of BasicPrinterSOPClass
ljz 20030625: Fix in above fix
mvh 20030627: Adapted for MSC4.2; Finally really fix NGET of BasicPrinterSOPClass (wrong UID used)
mvh 20030629: Added -nd, -nc, -jd and -jc options: (de)compress NKI; (de)compress JPEG (used OFFIS executables)
mvh 20030630: Started on compression for dropped, incoming, transmitted; NKI vr 0x9999,0x700=custom compression
Added 'forward compressed as xx to ...'
mvh 20030701: QualifyOn now also has compression parameter
mvh 20030703: Moved compression code to nkiqrsop; dgate -j-xx and -j*xx = test compression options
Removed "forward compressed to" because "forward compressed as .. to" is better.
Note that FileCompressMode is now obsolete. KNOWN BUG: JPEG compressed images may be
rewritten as V2 (when written originally as NKI) which are then not correctly read.
mvh 20030704: Made that FileCompressMode parameter still works even though is obsolete
Moved faulty delete DDO after SOPUnknownStorage.Read
mvh 20030705: Added check of Tranfer Syntax next to extension for save type; ProcessDDO takes **DDO
mvh 20030706: Use dgate.dic; Attach VRType to PDU's for implicit little endian support; small fix in dump code
mvh 20030709: Printer support fix; version to 1.4.2; added SendUpperCaseAE parameter (default 0)
ljz 20030730: Force ImplicitLittleEndian, ExplicitLittleEndian and ExplicitBigEndian objects that must
be stored in Chapter10 format, to ImplicitLittleEndian.
mvh 20030815: Version to 1.4.3
mvh 20030905: Allow longer filenames
mvh 20030910: Added check on rights to write (trouble) log file and printer_files in MAG0
mvh 20030921: Allow write to any MIRROR if MAG is full; added -ff# option: delete until # MB free
mvh 20030922: Added StorageFailedErrorCode (default 0x110 = 272 decimal = failed processing)
Added ExportCallingAE and ExportCalledAE export filters (also %u=SCU, %c=calledAE in converter)
mvh 20040401: Version to 1.4.4; pass status pointer to compress routines
mvh 20040402: Delete DDOptr when SaveToDisk cannot write but does not give an error
Added "Cannot rewrite jpeg/rle image in v2 format" check
Use system DSN for ODBC (easier login)
mvh 20040406: Always use EXPLICIT syntax for jpeg, fix v2 always use DUMP
mvh 20040426: Version to 1.4.4a
mvh 20040520: Version to 1.4.4b
mvh 20040523: Added patient ID to speed GetFileName for single slice move
ljz 20040602: Fix: 'forward compressed as' always failed
mvh 20040528: Set NeedPack (controls DbaseIII indexing) for regen, archive, maintenance; Version to 1.4.4c
mvh 20040528: Added built-in maintenance commands through silent VR in ECHO; pass patid in DeleteImageFile
mvh 20040530: extract (DBF only) to database like XDicomImages in same directory; Version to 1.4.5
mvh 20040601: Added deletestudy, deleteseries and packdbf maintenance commands
mvh 20040605: packdbf maintenance command sets NeedPack to 3: forces pack
mvh 20040606: fix rewrite to not MAG (JUKEBOX) was NOT ignored
mvh 20040607: Merged fix ljz 20040602; do not allow rename and delete with empty name
mvh 20040610: Added maintenance server tasks for archival and regeneration
mvh 20040612: Added indexdbf maintenance server task
mvh 20040614: dgate command line maintenance options use NeedPack=5: non-threaded index generation
Added -am option: move (all) device data; to move selected data use -amMAG0.Archiving,MAG1
mvh 20040624: Version to 1.4.5a
mvh 20040626: Pass study and series UID to getfilename; version to 1.4.5b; Fixed leak of pats array
mvh 20040713: Version to 1.4.6
mvh 20040805: Fix in C-MOVE for single file (fix from ljz); version to 1.4.6b
ljz 20040909: Increased length of ExportFilter (was 64, now 510)
mvh 20041020: Added mergeseries(file) and mergestudy(file) maintenance commands, silenttext to 1024
mvh 20041101: Added deletesopfromdb maintenance command; version to 1.4.7
mvh 20041103: called, e.g., AE~nj overrides IncomingCompression to nj
mvh 20041108: Added $c test compression mode (alt-drop files with $c as patient ID tests compression modes)
mvh 20041109: Added $tSERVER test compressed forward; some fixes in forward compressed to (server name read wrong)
$s tests all filename syntaxes
mvh 20041112: Added $rN N times repeated entry test, and $tN which enters image N time each on its own thread
mvh 20041128: Added -^file: log to file (timestamped) instead of to server console; -#file: same with debug
mvh 20041129: Added silent commands debuglog_on and log_on to set logging to UDP or file
Added silent command read_amap to re-read acrnema.map without restarting the server
mvh 20050102: Small modifications to allow compile through total.cxx
mvh 20050107: Added code to hold and retry queued forwards and mirror copies when failed:
After failed export/copy, start storing entries in file ExportFailuresN (CopyFailures)
if a new export/copy is requested >1 minute after last failed one, try again
if queue is empty, >100 seconds after last fail, try export/copy stored ones
processing queued entries has priority over processing stored entries
mvh 20050107: Version to 1.4.8; modifications for linux compile
mvh 20050108: Added server PORT# to fail files, so that multiple servers on different ports do not share files
mvh 20050109: Added configurable TCPIPTimeOut, FailHoldOff, RetryDelay and QueueSize
mvh 20050109: Adapted thread code for linux; still need to implement WaitForSingleObject
mvh 20050111: Added ctype.h (for mingw)
mvh 20050118: Linux: crudely implemented WaitForSingleObject; detach pthreads to avoid leaks;
crudely implemented export converter apps
mvh 20050119: Added grabimagesfromserver, regendir and makespace server commands
dgate -- sends server commands to other running server; adapted manual
mvh 20050121: Small updates to manual
mvh 20050124: Replaced BackGroundExec with simpler system() for Linux; added query server command, e.g.,
dgate "--query:DICOMpatients|patientid,patientname,patientsex|patientsex='F'|%s %s %s|t.t"
Added read_ini: server command to reread dicom.ini; changes most config except:
TCPPort (busy), UseBuiltInDecompressor (cached) and FileNameSyntax (cached)
mvh 20050130: added get_param, get_freestore, get_amap, get_sqldef that respond through echo-response
also: get_sop, get_transfer, get_application, get_localae, get_remoteae, get_dic, forward
added: dump_header (to file), convert_to_gif (to file); adapted query (to file)
where file="cgi" for stdout in cgi/mime mode, file="" to send to stdout as is
most GUI commands can now pass PatientID|SOPInstanceUID instead of filename of dicom object
added put_amap, write_amap, put_sop, put_transfer, put_application, put_localae, put_remoteae,
put_param. Note: get/put_param work through disk (read_ini activates), get/put_amap through
memory (write_amap writes to disk), get/put_sop etc read from memory and write to mem and disk.
mvh 20050204: Added delete_param, delete_amap and fix cgi output (double \n)
mvh 20050204 most GUI commands can now pass PatientID|?*:SOPInstanceUID; added delete sop etc commands
More fixes in cgi data passing VR vr() is mostly wrong; use VR *vr=new VR()
mvh 20050205: Allow up to 16 output fields in query:, repeat queried fields over all 16 outputs
Added counters for server status; start on display_status server command
mvh 20050206: More work at display_status, renamed testtable to xtesttable: default not opened
Access ObjectFile and DeviceName through query instead of with GetFileName up to 3 x faster!!
Also fixes potential leak in read ahead thread: pats, series and studies not always freed
Allow up to 32 cgi query outputs, tidied dump layout, start on web interface (put dgate and ini in cgi-bin)
mvh 20050207: Added query2 option: limits number of output rows as asked; gui command not counted as association
Some more work for web interface
mvh 20050210: Adapted web interface queries such that they run on sql server
mvh 20050212: Removed need for thread local storage; automatically adapt dgate extension in cgi scripts depending in OS
mvh 20050213: Added more parameters to server configuration web page
mvh 20050214: Added update button to server config (updateconfig page to be implemented)
ljz 20050215: Fix in LoadForGUI: Drag 'n' drop of files in the server did not work anymore
Fixed dgate crash in case of failure in 'recompress()' (pDDO=NULL when OFFIS failes)
mvh merged
mvh 20050327: Added rudimentary gz unzip support for dropped files (uses 7za.exe)
mvh 20050401: Start on Modality WorkList Support
mvh 20050404: List End/Start sequence db types (only supported for worklist)
mvh 20050411: Fix incorrect space after filename and device in C-MOVE internal query
mvh 20050414: Added addrecord server command: for now only option to enter worklist entries
mvh 20050603: Fix servercommand query(2) for empty where part
mvh 20050825: Fix web interface queries for sql server (were OK for dbase)
mvh 20050826: More work on web interface and added worklist there; deleterecord command
mvh 20050827: Fixes in addrecord and query commands, editworklist,saveworklist,deleteworklist
mvh 20050829: More fixes in web interface, disable caching for most/all? of it
mvh 20050831: Allow command line length of up to 4096, allow edit all worklist database fields
mvh 20050901: Removed invalid cache-control: cache; added WorkListMode:0= off, 1=optional, 2=compulsory
mvh 20050902: Read db config for worklist edit page in web interface; use generic webpages for db edit
Added HL7Tag in DumpDD
mvh 20050903: Added 'simple' loadhl7: server task implementation and HL7->DICOM translation
Also addimagefile will enter HL7 files into the server, i.e., drag and drop works
Fix some web queries for sql server with denormalized tables
mvh 20050904: Some more tweaks to hl7 code; max query formats to 48; max format to 8192
mvh 20050905: Auto split HL7 subfields and repeats without using a list
mvh 20050907: Merged change by Hans-Peter Hellemann: fixes extension problem for linux web
interface for some browsers
mvh 20050908: Protect convert_to_gif when file not found
mvh 20051121: Recompute SQLResultLength because it does not work in PostGres BindField
mvh 20051123: put in #ifdef POSTGRES
mvh 20051208: put in #if 0 (fixed in odbci.cpp); start on virtual server: will grab images from
other server as needed in read-ahead thread: when in db but not on disk; for now
use rat also for single image access to avoid code duplication
mvh 20051209: Start on virtual query: image (!) query is passed to other server, results populate db
mvh 20051210: Added "vX" incomingcompression (stores dbf but not image; forwarding disabled)
Added virtual queries on all queries and moves: now works as transparant file cache
Added VirtualServerFor0..9 configuration entries: server merges own data with these AE's
Added CacheVirtualData control; if set data not deleted after use (db kept for now)
mvh 20051211: Fix: override query level in virtual query
mvh 20051212: Store virtual server # in device; saved on query, used when retrieving, stripped when storing
mvh 20051214: Use different sleep lenghts under linux - not all sleep(0); small fix in virtual server
mvh 20051215: Implemented a linux version of Sleep using nanosleep
mvh 20051217: Use new VR::ReAlloc method to replace data in VR; added quit: command
mvh 20051218: Use ReplaceVR instead of Push in anonymize etc; also changes in sequences
Version to 1.4.10; show version and exe date in startup log
Do not start mirror copy queue unless it is needed; show some thread startup info
Added -b = NOTHREAD: run server as single process, useful for debugging and profiling
Fixed doc of --regendir: command
mvh 20051219: Fixed several small leaks - as tested with Linux malloc_stats
mvh 20051222: Started on bypass server for virtual query - not functional yet (cleanup required)
Removed debugVR logic: errors should now list DCO
mvh 20051228: Fix virtual device logic for VirtualServerFor0;
Cleanup vr's and duplicates when bypassing server for virtual query, seems functional
mvh 20051229: NonDestructiveDumpDICOMObject now also list sequences;
DebugLevel>0 lists DCO, >1 lists query DDO; fixed leaks in virtual query and some others
mvh 20051230: Added --debuglevel: command, small fix in NonDestructiveDumpDICOMObject
mvh 20060103: Small fix in virtual query; disabled virtual query for worklist; debuglevel 3 shows some query results
mvh 20060123: Added patient/study/seriesfinder (server parameter ignored for now, later for virtual servers etc)
mvh 20060125: Added serieslister (server parameter ignored for now, later for virtual servers etc)
mvh 20060128: Renamed to imagelister, added serieslister
mvh 20060131: Sort filenames from imagelister on ImageNumber (0020,0013)
mvh 20060226: Version to 1.4.11
mvh 20060228: Small fix in isxdigit thanks to ljz
mvh 20060311: Use ReplaceVR in virtual query - level was sent twice (thanks David Lang)
Added WEBReadOnly flag
mvh 20060317: Support calledae and callingae in filenamesyntax - for virtualquery called is always MYACRNEMA
mvh 20060324: Strip group 2 from outgoing c-stores if not compression "as" or "is"
mvh 20060328: Improved forwarder, always propose Verification and use IsAbstractSyntaxAccepted(iUID) to test if host accepts image
mvh 20060402: Fix hang condition when a file failed to read in the read-ahead thread
mvh 20060402: Do not remove transfer syntax prior to dcmdjpeg/dcmcjpeg (here in test recompress only)
mvh 20060405: Tried fix for multiple moves on same assoc (thanks Andrej Savelov)
mvh 20060405: Added message when IOD fails to read
mvh 20060603: Fix crash when started as dgate -v: empty statbuf
mvh 20060607: Finally fixed multiple moves on same assoc (thanks Andrej Savelov and Fred Roener)
mvh 20060618: Renamed dfilecopy and define ODBC_ADD_SYS_DSN if needed
mvh 20060619: Set version to 1.4.12alpha1
mvh 20060621: Added clonedb: command; transfer FULL db from other server to this one using virtualquery
mvh 20060628: AddToDatabase has JustAdd parameter: skip one unnecessary query
mvh 20060701: Speeded filter string handling
mvh 20060702: Pass DB to GenerateFilename to avoid zillions of db open and closes
mvh 20060704: Print number of records found in all queries
mvh 20060708: Set version to 1.4.12alpha
mvh 20061126: Moved servertask temporary files to MAG0/printer_files; protected query: and query2 against empty input
mvh 20061126: Experimental forwarding on same association: close unused association after 5 seconds
Clean collected sopclasses after one hour of inactivity
Note 1: there is a problem with AReleaseRQ: do not use in this task
Note 2: maximal 20 forwarders have a remaining association
mvh 20061127: Added ForwardAssociationLevel (PATIENT, SERIES, STUDY, IMAGE, SOPCLASS; default STUDY),
ForwardAssociationRefreshDelay (default 3600 s), and ForwardAssociationCloseDelay (default 5 s)
Limit maximum number of ExportConverters to MAXExportConverters=20 (for static arrays used in forwarders)
Forwarders keep association open as long as UID at ForwardAssociationLevel does not change.
Show filename in forward log; document where fixkodak should operate for virtual queries
mvh 20061128: Added ForwardAssociationLevel GLOBAL: use association until timout or incompatible
Close ForwardAssociation after send when ForwardAssociationLevel is IMAGE
mvh 20061129: VirtualServerForN may be "server,FIXKODAK" to clean queries (add 0) and their response (remove 0)
Hardcoded filters for exportconverters (modality, called, calling, station) can now match e.g., RT*
mvh 20061130: Pass series and study in virtualserver outgoing c-move
mvh 20061213: Fixed nasty bug in query2 and TestFilter: Query without bindfield overwrites previous bound strings!
Maybe was problem causing crash on linux with query2: and problem with option -g reportedly stopping incorrectly
mvh 20061219: Version to 1.4.12
mvh 20061231: Added ForwardAssociationRelease to allow testing reconnect problem (default 0 = just hangup)
mvh 20070103: FixKodak blocks *xxxx wildcard virtual queries on date (not allowed in Kodak)
mvh 20070103: Version to 1.4.12b; start on ImportConverters e.g., <set 0008,1040 to "%V0008,0080">
mvh 20070104: ImportConverters %QP %QS %QE %QW; <destroy> <delete xxxx,yyyy> <save to filename>
Added %% and %i to Export and Import converters
mvh 20070105: <set 0008,1040 if "...">, <setifempty 0008,1040 to "...">, <setifempty 0008,1040 if "...">
Import/export converters only report when syntax OK and report when action is void
Added %Vxxxx,yyyy to export converters and %d(date/time) to import and export converters
An import/export converter can thus be used to extensively log incoming images
Added import converters: <stop>, <if "string">, <ifempty "string">, <nop> (also export)
Added general purpose variables x, y, z (read as %x, %y, %z) to import converters
Definition of number of ImportConverters now unnecessary.
Note: importconverter and exportconverter strings may be changed run-time in dicom.ini
mvh 20070105: Some fixes in dgate --archiving options manual; fixed dgate --restoremagflags:
mvh 20070107: Fix web access broken by change in odbci for dbaseIII; query must now always include spaces around =
mvh 20070113: Do not store NKI compressed data in v2 format: decompress and give error message
Recompress to NKI format now enables StripGroup2; Tested with $c server debug command
mvh 20070117: Allow multiple rules per Export or ImportConverter separated by ; and zero or more spaces
<nop> statement prints itself on console: useful for logging anything that follows
mvh 20070117: Now maintain multiple connections per ExportConverter line (max 20x20 forwards)
Added <stop>, <silentstop>, <if> and <ifempty> to ExportConverters; but they only affect single rule
(while these would cross over to the subsequent rules in ImportConverters)
mvh 20070122: Now also show free space on mirror devices
mvh 20070123: Fixed TestFilter for patientid with '
mvh 20070125: Removed <if> and added <ifnotempty>, <ifequal>, <ifnotequal>, <ifmatch>, <ifnotmatch>,
<ifnumequal>, <ifnumnotequal>, <ifnumgreater>, <ifnumless> as im/exportconverters
Added %xxx[first,last] substring operator; and protect it against overrange
<ifxxx> no longer crosses over importconverters; added {} block for im/exportconverters
E.g.: ifequal "%V0008,0020[0,3]", "2004"; { forward to CONQUESTSRV3; forward to CONQUESTSRV4; } nop test
Note: 1) all (also ifxxxx) statements end with ; 2) statements may begin with { or };
3) extra spaces only allowed after ;{} and single space after ,
mvh 20070127: Fix {} in exportconverters.
Release 1.4.12b to fix more or less critical odbci error
mvh 20070131: Fix in TestFilter (quotes double); Version to 1.4.12c
mvh 20070201: Added <storage MAGn> import converter: sets device to store this (new) image to (default MAG0)
Fixed importconverters stop and destroy: did not break current line
mvh 20070204: Added extra format starting with # to ImageFileLister: e.g. #%s:%s prints MAG0:filename
mvh 20070206: Added create database: dgate -esapw name user password
mvh 20070207: Fix query string bug on applyworklist found by capolan1
mvh 20070207: dgate -e name root <blank> works for mysql: root is used as admin and login
Also implemented dgate -esapw name sa sapw where sapw may be empty
mvh 20070210: Added CheckDuplicates to UpdateOrAddToTable; added @ in imagefilelister: replace \ by /
Start on ocx based viewer integrated in cgi interface; used dicom over http:
Small change in gif export; added * as separator in query/2
mvh 20070211: Added WebScriptAddress (default http://server/cgi-bin/dgate), WebMAG0Address (defaults http://server/mag0)
and WebServerFor (default 127.0.0.1). Fix in cgi query parser: now loads dsize and size correctly
Version to 1.4.12d
mvh 20070212: Added WebCodeBase, show version in status_display, added config of which dicom server the web server
connects to, added [webdefaults] section, added iconsize parameter
mvh 20070213: Added : as format in imagefilelister: use to list pat:sopuid
Fixed sorting problem by using adapted imagefilelister for seriesviewer
Fixed default for WebCodebase; Version to 1.4.12e;
Use correct case of sql table names in cgi interface: required by mysql on linux
Unsolved: n3 does not always decompress correctly in dview.pas see p20401977:i47, changed default to n4
mvh 20070215: Fixed logging and added *** Association rejected message when association is rejected
mvh 20070304: Added <defer> exportconverter: retry later as if connection unavailable
mvh 20070305: Note: n3 problem fixed in dview.pas, version to 1.4.13alpha
Allow merging of up to 1000 UIDs: set SilentText to 64000 and *uids[1000] (thanks mp)
Allow named pipes for log_on and debuglog_on
mvh 20070307: Work on extending extract: allow e.g. SQlite -> dbaseIII
bcb 20070308: Made changes for big endian and Apple's DARWIN
mvh 20070314: Fisished extract: allow e.g. SQlite -> dbaseIII in directory MAGO dbase
mvh 20070315: Merged DARWIN stuff; Set TCPIPTimeOut for PDU that moves images
mvh 20070316: Display defer import converter; Clumsily added <compression> import converter and
improved <storage> import converter; Made <storage> thread safe
Failed recompress() no longer reason to fail drag and drop; add convert_to_bmp
Use | instead of , to separate patientid from file in addimagefile:
Distributed , code to each of the server commands to make it more , safe
Note: it is NOT a good idea to use a , in a flexible filenamesyntax
Added level & window to convert_to_gif and convert_to_bmp; longer log lines for dump VR
mvh 20070317: <prefetch> using new prefetch_queue, mayprocess and into_queue_unique, <preforward>, <preget>
mvh 20070324: preget now <preretrieve> and avoids looping by checking orgmessageid!=0xfbad
I.e., data collected by <preretrieve> does not go through import/exportconverters
Added delayed exportconverters <forward patient>, <forward study>, <forward series> with optional compression
Removed "forward compressed to" (without as section) as is never used
Version to 1.4.13beta; delay to 10 minutes
mvh 20070326: Fixed leak in <forward patient> etc. preretrieve also checking orgmoveae
mvh 20070330: Change by Mark Pearson: read dicom.ini from same dir as exe in unix mode; merged more Darwin stuff
Also taken over bcb's fix for the finder: studymodality was asked at patient level
Also put in a more ENxxxx as command and messageid
ljz 20070404: Added CommaInFilenameWorkAround()
mvh 20070407: Use reentrant ctime_r when available; moved static SOPPatientRootQuery etc to stack to fix
reentrancy problem: concurrent outgoing c-move of CT and MRI on different associations would
share PDU causing sopclass not accepted on one. Also seems to reduce linux crash problems on
multiple inbound (4 or more) C-stores. Also moved CreateBasicFilmSessionRequest etc to fix
potential reentrance problem for printing.
mvh 20070410: Merged CommaInFilenameWorkAround()
mvh 20070413: "extract:" will just create dbase III clone of full patient DB; added "prefetch" server command
mvh 20070415: Added Prefetcher option to dicom.ini: is set will aggresively preread queried patient or studies
mvh 20070416: Prefetcher prints more information; use windows calls in windows for faster preread
mvh 20070705: extract: uses DT_DBASEIIINOINDEX to disable indexing and packing when extracting from e.g. sqlite to dbaseiii
Note: extract: non dbaseIII goes to MAG0\dbase, dbaseIII goes to DataSource
mvh 20070706: Added <between "9", "17"> (9:00 to 16:59) or <between "17", "9"> (17:00 to 08:59) import/exportconverter
mvh 20070709: Fixed print of clone db done
mvh 20070720: Fixed problem where waiting "forward ... to " task caused high CPU load
mvh 20070901: Added dgate --checklargestmalloc:
mvh 20071027: Added ForwardCollectDelay for delayed forwarding (default 600 sec)
mvh 20071030: Fill in called and calling AE for SaveToDisk for e.g., dropped files etc
Fix %u and %c in Export and ImportConverters: called and calling AE
Log flow control Export and ImportConverters only in debug mode
Added retrying to delayed forwards or prefetches
mvh 20071102: SetDicomErrorHandler: orderly shutdown of server on serious DICOM library errors
Fixed a bug in ForwardAssociationLevel: last UID was lost when reading INI file to szTemp
Added MaximumExportRetries and MaximumDelayedFetchForwardRetries (default=0 is no maximum)
mvh 20071103: Version to 1.4.13; defer resets queue fails -> keeps on retrying
mvh 20071104: Use local as AE for imagelister in web page instead of CONQUESTSRV1
Enable remote servers (use AE instead of 'local') in finder and lister commands
Fix crash when dgate -- option gets empty filename: now lists to stdout
mvh 20071114: Put --checklargestmalloc: in dgate -?
mvh 20071118: Adapted for 64 bits (use SQLLEN for BindField)
mvh 20071120: Fixed KodakFixer for empty patient ID (crashed on 64 bits only)
Added [modality xx] and [date yyyymmdd-yyyymmdd] clauses to export [patient|study|series] to AE
mvh 20071121: Added %V*GGGG,EEEE: search VR in any sequence; version to 1.4.13a
Added [now -ddd+ddd] and [age -ddd+ddd] clauses to export [patient|study|series] to AE
No retry on remote dicom error in forward xxx to: would retry zero records response
Use study date for data, age and now clauses
mvh 20071123: Made forward command case insensitive; added forward image; added get [patient|study|series|image] from AE
The latter option makes preretrieve obsolete
mvh 20071124: Added [sop xxx] clause to [forward|get]
Reorganized exportconverter code: all converters now do % substitution; reduced code duplication
Added reading of sequence items like in %V/300c,0060.0/0008,1155 or %V/300c,0060/0008,1155
Real life example (must all be one one line, max 512 characters):
ifnotequal "%m", "RTPLAN"; stop; nop "tests modality = RTPLAN";
ifnotequal "%V*300a,00b2[0,1]", "A2"; stop; nop "test machine name = A2"
forward to XVI_A2; nop "forwards the current recieved RTPLAN";
get study modality CT from NKIPACS; nop "collects associated CT";
get study modality RTSTRUCT sop %V/300c,0060.0/0008,1155 from NKIPACS; nop "collects associated RTSTRUCT";
forward study modality CT imagetype *AXIAL* to XVI_A2; nop "forwards associated CT";
forward study modality CT series %V(/300c,0060/0008,1155)/3006,0010/3006,0012/3006,0014/0020,000e
forward study modality RTSTRUCT sop %V/300c,0060.0/0008,1155 to XVI_A2; nop "forwards associated RTSTUCT";
mvh 20071125: Fixed syntax for %V/gggg,eeee.i/ *gggg,eeee (search all groups under a specified one)
mvh 20071126: Start on StorageCommitment
mvh 20080103: Switched to ms7 compiler; fixed forward and get date, modality, sop filters: would not supress the UIDs
mvh 20080107: Fixed malformed web viewer header: worked for IE but not for other browsers
Check presence of dicom.sql in web pages that need it
Deal with spaces in patient IDs in web pages
mvh 20080126: Check presence of dgate.dic when starting server
mvh 20080129: Fix KodakFixer: wrote one byte outside VR data (pr)
mvh 20080129: Added [imagetype xxxx] clause to [forward|get] (pr)
mvh 20080130: Small fix in above
mvh 20080205: Added experimental PadAEWithZeros flag; version to 1.4.14alpha
mvh 20080210: Added experimental IgnoreOutOfMemoryErrors;
Added "delete [patient|study|series|image] [date yyyymmdd-yyyymmdd] [now -ddd+ddd] [age -ddd+ddd]
[modality mm] [sop xxxx] [imagetype xxxx]" export converter
mvh 20080221: Added [seriesdesc xxxxx] filter and "process [patient|study|series|image] [by command]"
mvh 20080222: Small fix in imagetype filter code; process by clause not part of unique check
mvh 20080302: Fixed case of DICOM table names
mvh 20080316: Added dgate --deletestudies:date(range) and dgate --movepatient/study/studies/series
mvh 20080318: Added [series xxxx] and [study xxxxx] filters; work on web page
--deleteseries/study and --moveseries/study allow patid:uid as parameter
Web interface can now push and delete on series and study level, but
delete is disabled in readonly web interface
Version to 1.4.14beta
mvh 20080319: Delete in browsers fixed?; added %v(desc)desc: search VR in given sop of same patient
Example: %V(/300c,0060/0008,1155)/3006,0010/3006,0012/3006,0014/0020,000e
Gives referenced CT series UID in referenced structure set from forwarded RTPLAN
mvh 20080321: Fixes in browser; added graphic web setting; may be gif or bmp for now;
Fix %V for non-existing items
mvh 20080322: Added dgate --anonymize that uses general scripting
mvh 20080323: Small fix in (local) for DcmMove: overwrote destination
mvh+pr 20080404: Fixes in series and study filter (rethink naming)
pr added value* match for in match() routine
mvh 20080618: Added extra logging in IARQ()
mvh 20080620: Only show extra logging in IARQ when assoc rejected
mvh 20080816: IARQ shows which sops are accepted; and differentiates no sop from connection terminated
mvh 20080817: Small layout fixes; <process with> import converter; show PDU length in log
Check saving of file succeeded (thanks Jeff Bellamy and Alberto Smulders)
mvh 20080819: Added experimental DT_MSTR: multi-value entry, e.g. query on 'PET' matches 'PET\CT'
map 20080819: added --get_ini_param (same as get_param) and get_ini_num to list parameter by index
map 20080819: Added get_ini to list all parameters in DICOM.INI
mvh 20080819: Added code by map but kept original get_param for old web cgi client compatibility
Version to 1.4.14
mvh 20080820: Solaris 10 fixes, and general UNIX fixes (map): configfiles may not be in current dir
mvh 20080821: Default of ForwardAssociationRelease to 1; added sleep export converter
mvh 20080823: Added study UID search to PatientStudyFinder; fixed DcmMove: would call local when remote adressed
Added rudimentary query/move web pages
mvh 20080825: query/move looks better; added "thumbs" column to local series lister; config patched to readonly
added background color and display of icon (to be placed in WebCodeBase)
mvh 20080826: One more fix in DcmMove, still called wrong server sometimes
Do not use 0xfbad as message ID for DcmMove from web page; webreadonly defaults to true
CGI viewer configurable: seriesviewer, seriesviewer2, noviewer, aiviewer
mvh 20080827: Added slice number and repeat output data in ImagefileLister and SeriesUIDLister for more flexible formatting
Added flexviewer: reads code from dicom.ini in web server directory
mvh 20080831: Translate yyyy and yyyymm to date range in finder; further only accept valid date and date ranges
Added dgate --get_amaps: lists all non wildcard entries from acrnema.map
Fixed handling of patient ID with spaces in ImageFileLister mode :
All undefined cgi modes can come from the cgi dicom.ini; added special and cgi script variables
Lines can start with -- to start dgate, with # as comment, any other passed as HTML
Added source parameter: flex pages can be read from script file
Added serversideviewer: requires javascript only, nothing to install
mvh 20080901: Fixed some leaks in printing and --commands; fixed --get_ini: formatting
mvh 20080902: Added header option for web scripts; added some CGI environment variables
bcb 20080905: Made new changes for big endian and undid some old ones.
mvh 20080908: Index in filelister format is now a string (%s), and added next string that gives index+1 (is1)
Fixed manual of --modifypatid: and --anonymize:; dicom mime to application/dicom
Added modes imagelisthttp, imagelisturls and imagelistfiles; added ? format for imagelister: gives #files
mvh 20080909: Added studyuid option to moveseries; pass it studyuid in seriesmover call from seriesfinder
Added --modifyimage:file,script (uses import converter scripting language, where you can use ' instead of ")
mvh 20080910: In modifyimage only replace ' with " conditionally; version to 1.4.14a;
mvh 20080910: Forbid patid, studuid and seruid change in modifyimage; medged bcb Mac stuff
mvh 20080913: Modified and use SetStringVR to correctly send UIDs with padded 0
mvh 20081016: Show bitness on startup
mvh 20081104: Attach dictionary to DcmMove PDU
mvh 20081105: Fixed display of bitness in web page
mvh 20081116: Adapted for very large objects (use unsigned int for length); remove extra 0 byte in HTML generator; fixed CheckLargestMalloc
mvh 20081121: Added create database for PostGres
mvh 20081123: Skip export converters for dropped, modpatid, modimage, merging
mvh 20081124: show database type on startup; Temp version to 1.4.14a1; fix many scripting crashes
mvh 20081129: start on better patient ID change: process all UIDs; fix drag/drop error introduced in 1.4.14a1
mvh 20081129: Removed double access of SOPInstanceUID in SaveToDisk; fix: do not free ddo after SaveToDisk;
added <newuids> and <newuids except > import converters; added --genuid, --changeuid and --checksum commands
Version back to 1.4.14a; modifyimage can change patient ID and study/seriesUID if newuids used as well
set can now also work in exactly one deep sequence: set gggg,eeee/gggg,eeee to "string"
mvh 20081130: Added --attachrtplantortstruct:planfile,structfile command using script; also --attachanytopatient/study/series
stop now stops one importconverter- not the chain; added <call file> and <return> statements to return from file
Added optional anonymize_script.cq: overrules fixed anonymizer;
added %A = %V but then gives CRC32 of data and %E = %V but gives new UID for given UID
mvh 20081201: added --convert_to_jpg and web page use (experimental)
mvh 20081203: If jpg graphic: list options as jpg, yes, no; fix slice number display is serversideviewer
Added frame control to convert_to_jpg etc as l/w/frame; add optional frame control to
convert_to_dicom; added frame control in serversideviewer
mvh 20090203: Removed DNS reversing (you can use wildcard AE instead); work on zip loading
mvh 20090204: Finished zip loading (to be tested on linux), uses now waiting BackgroundExec
mvh 20090206: Added QueryConverter0, WorkListQueryConverter0, RetrieveConverter0: can read called (%c),
calling (%u), and c-move destination for retrieve (in %s), as well as all data in data object
mvh 20090209: Made compiling under linux
mvh 20090211: Export MyDcmError; only DCM_ERROR_MEMORY is fatal
mvh 20090212: Recoded virtual server (kept old code), to provide better grouping of move requests
mvh 20090215: Added VirtualServerPerSeries..9 flags: determines if virtual gets are per image (default) or per entire series
mvh 20090216: Added %Rgggg,eeee: gives restored UID for newly generated one
Prepare for RetrieveResultConverter0
mvh 20090411: Added simple wildcard matching in match(), accept *text*
mvh 20090411: Version to 1.4.15alpha
mvh 20090513: Added CompressionConverter0 .. 9: called from recompress to 's0' to 's9'
Added <fixkodak> and <unfixkodak> import converters; added <after NN> clause to <forward study> etc
Blocked out StorageCommitment
mvh 20090514: %QXgggg,eeee reads aliasfileqX.txt with lines like old<tab>new<return> to map VR to new value
mvh 20090616: Add ^/~ after % command to convert to upper/lowercase, %^ %~ %[; fixed leak when save to sql fails
20090616 jf Include file stuff; fixes to Unix 7z stuff
20090618 mvh VirtualServerPerSeries is now a limit: if set to N, more than N images go per series
20090620 mvh Version to 1.4.15beta
20090802 mvh Support DCM_ERROR_DEBUG (debug messages from library) that print only if debuglevel>0
20090821 mvh Removed need to specify "delete series modality *" instead of "delete series"
Fixed "process by " command; now uses all command string upto ;
20090824 mvh Version to 1.4.15beta1
20090921 mvh Added extract_frames: command
20090922 mvh Tried to fix <compression> import converter; added <reject> import converter
20090924 mvh Restructured manual; fix crash of studyfinder without search string
Note: on vista, commands like dgate --imagelister wont give large lists (does when piping)
20090926 mvh %t = tab in scripts; fixed failed storage error message; added RetryForwardFailed flag (default 0)
20090929 mvh Added ImportExportDragAndDrop
20090929 mvh Version to 1.4.15
20090930 mvh Version to 1.4.15a
20091005 mvh Version to 1.4.15b
20091012 mvh Optimized preprocessing of read-ahead thread by saving tt
20091108 mvh Started on <merge study> import converter
20091120 mvh Started on <forward> import(!) converter
20091229 mvh Version to 1.4.15c
20091230 mvh Merged bcb changes: DGATE_VERSION, PATH_MAX, const char, bigendian fixes
20091231 bcb Defined PATH_MAX for Apple's Snow Leopard,endian fixes, &
fixed gcc4.2 warnings (char to const char, VERSION, DEBUG and char* to program memory)
Added jpeg2k stuff (HAVE_LIBJASPER)
20100111 mvh Merged; but keep cgi formats local (less changes)
20100113 mvh Fixed one signed/unsigned mix in dump routines
20100119 mvh cast %d print to (int), %ud to (unsigned int); one more const issue
20100120 mvh Fixed two const issues detected with ms8
20100122 mvh fixed: %ud should be %u
20100122 mvh DcmMove uses study-root query when UID passed to fix move to osirix from web interface
20100123 mvh Fixed rare crash in function VirtualServer2; started on DT_FL and DT_FD; version to 1.4.16alpha
20100123 mvh Added counters for jpeg2000; put info about jpeg libraries into serverstatus display
20100124 mvh Blocked old VirtualServer(); rephrased cancel message; changeuidback and count_frames commands
Optimized DcmError call to gpps
20100124 mvh Use much faster MyGetPrivateProfileString: profiled as followed:
Installed C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\xperf_x64.msi
set _NT_SYMBOL_PATH=e:\quirt\comps\exe\dgate;srv*c:\symbols*http://msdl.microsoft.com/download/symbols
set _NT_SYMCACHE_PATH=C:\symbols
xperf -on latency -stackwalk profile; run dgate; xperf -d out4.etl
xperfview out4.etl; select time range; select trace-load symbols;
right click selection; summary table (takes very long the first time - downloads all symbols!)
20100207 mvh Added uncompress command; version to 1.4.16alpha2
20100209 mvh Fixed another rare crash in function VirtualServer2 (thanks PR)
20100227 mvh Fixed Scotts modifyimage problem: http://forum.image-systems.biz/viewtopic.php?f=33&t=2143
20100227 mvh Added -q option to set target address of dgate -- command; version to 1.4.16alpha3
pass DCO also for non-nki clients: used in %s for RetrieveResultConverter
Added more extensive printer activity logging
20100228 bcb Changed HAVE_LIBJASPER to HAVE_J2K so Jasper or OpenJPEG can be used
20100309 bcb Added double parentheses (gcc4.2 Warnings)
20100309 bcb Changed int to unsigned int, commented out unused variables and routine (gcc4.2 Warnings)
20100619 bcb Added #ifndefs and fixed shadowed variables(gcc4.0 Warnings)
20100723 mvh Merged: Reread all changed; agreed with all but two in checklargestmalloc and cgi; 1.4.16alpha4
20100728 bcb Added delete vr's after ->ReplaceVR's
20100802 jd Added scheduletransfer
20100815 mvh Merged; version to 1.4.16alpha5
20100815 mvh Fixed bug 32 in t=2127: seriesdesc filter
20100816 mvh Added QueryResultConverter and ModalityWorkListQueryResultConverter
20100816 mvh Fixed bug in VirtualQuery introduced by only partly renaming shadowed variable
20100816 bcb Allow dicom.ini and other files to be moved; fixed / as cmd line option
20100816 mvh removed (a) from #ifndef EnterCriticalSection(a) etc
20100819 mvh Added system export converter; added "get study" etc import converter.
Allow "set" in sequence items; Allow "set" to add sequence items.
20100823 mvh Extended virtualservermask; pass server directly to VirtualServer to override server list
20100823 mvh Merged and simplified bcbs basedir code; use exe dir as default basedir
Fixed overlap in ImportConverter number; Made %xyz variables local; Version to 1.4.16beta
20100824 mvh Use dFileSize to test if file is written correctly: catched 0 byte files with full disk
20100827 mvh Fixed two typos in warning fix extract: command
20100901 mvh Fixed empty virtual query sent if no images there
20100905 mvh Removed file functions: now use RecompressFile; document -j* and -j-
WIP: added testmode: function to allow internal file comparison
20100914 bcb Fixed leak in PrinterSupport
20101017 mvh Added MergeSeriesConverter and MergeStudyConverter
20100918 mvh Merged; version to 1.4.16beta2; testmode does not affect LoadForGUI direct filenames
Fixed that changing patid etc in importconverter breaks exportconverter data
20100919 mvh Added <format> clause to <set> importconverter command
20100920 mvh Fixed [,fromend] operator
20100924 mvh Started on error handling in virtualserver
20100925 mvh Fixed problem in <forward> IMPORT converter; only worked as first command in line
SearchDicomObject now checks on buffer overflow; ; # lines are comment in script file
note: <system> converter should run hidden; <call> now passed called and calling
20100925 mvh Version to 1.4.16beta3
20100926 mvh Added <mkdir> and <rm> IE converters
20100927 mvh Added <save frame> and <save bmp/gif/jpg> IE converters, <save to> E converter
20100928 mvh Fixed in delayed <merge>, <delete>; fixed MergeSeriesConverter and MergeStudyConverter crash
Fixed 1.4.16beta2 introduced bug: patientid was passed incorrectly into importconverter
20101003 mvh Added seriesdesc filter and script to DcmMerge, script to DcmMove
20101003 mvh --browsepatient command; fixed that split/merge series generated new study
20101003 mvh Version to 1.4.16beta4; merged jd scheduletransfer
20101003 mvh ImageFileLister now internally also takes study and sop
20101003 mvh Added dgate --submit:patid,studyuid,seriesuid,sopuid,username@machine:folder,password
Requires 7za.exe and pscp.exe
20101003 mvh Modified dgate --scheduletransfer:patid,studyuid,seriesuid,sopuid,username@machine:folder,password
Added IE <submit> command with target and password clause
Added next slice and frame buttons in serversideviewer
20101005 mvh Fixed ? imagefilelister (count), added $ imagefilelister (#frames), started on passing frames
to serversideviewer
20101005 mvh Started on WADO
20101006 mvh Enabled WADO; do not try to remove images from failed virtualserver request (double messages)
20101008 mvh Started on rudimentary WADO client (PatientStudyFinder now also lists images)
20101009 mvh Enabled rudimentary VirtualServer for WADO client: loadforgui will try virtualservers
20101009 mvh Tried to speedup query result processsing; implemented POST method (no multipart yet)
20101009 mvh WADO server and client function; upload button, not functional yet as requires multipart parser
20101010 mvh Set default WADO correct for conquest; finished (single file) upload fuctionality;
20101010 mvh Scan incoming folder once per second (thread starts when incoming folder exists on startup);
Some fixes in serversideviewer; started on VirtualQueryCached
20101013 ljz Fix : CreateDatabase "root", used UserName as Password for postgres
20101014 mvh Fix in virtualserver for LoadForGUI
20101016 mvh Improved virtualserver for LoadForGUI; Cached queries start to work; virtual queries now return computed fields
use e.g., VirtualServerFor0 = AE,CACHESERIES or AE,CACHESTUDIES
20101017 mvh Added OverlapVirtualGet parameter: controls interleaving of recieve and send of virtualserver (suggest: 16)
20101018 mvh Limited memory use of OverlapVirtualGet, tried out of order processing but this failed; dated folders for querycache
Submit and scheduletransfer call submit.cq if exists to anonymize
20101020 mvh Small fix in querycache: query file sometimes not stored; and study cache did not read date
20101108 mvh Added --loadanddeletedir command
20101116 bcb Warnings
20101120 mvh Fix reading of FIXKODAK in virtualserver if e.g., CACHESERIES appended;
merged bcb warnings (and fixed introduced errors); version to 1.4.16releasecandidate
Added warning if cached virtualserver does not provide computed fields
Added NONVIRTUAL flag to allow block recursive virtualserver connections
Do not forward transfer syntax to virtual queries data object
20101121 mvh Fixed NONVIRTUAL flag for non-cached queries if caching is ON
Added dgate --export: command to zip/7z/tar selected data
Added dgate --safequit: command and OpenThreadCount; prepare for ArchiveConverter0 (1900)
Show in log when a file is rewritten; Added [wadoservers] section in cgi config
Document ul, ub, and ue in acrnema.map
20101122 mvh Pass script to export: command; added ZIP thread that runs when the system is a service
Fix for spaces in zipfilename for export; background exe for 7za
20101124 mvh Fix compile and 2 warnings for linux;
drop zip file extracts with paths to avoid overlapping filenames
20101209 mvh Fixed FIXKODAK parameter detection of virtualservers
20101212 mvh Warn if FIXKODAK paramater set in virtualquery does not match FixKodak global
Fix rewrite message for virtual server data
20101212 mvh Correct file formats listed and accepted for 7za decompression
20101212 mvh Version to 1.4.16
20101213 mvh Implemented NightlyCleanThreshhold here for Linux and Windows (if logging to file)
20101220 mvh newuids will change empty uids into a new one
20101222 mvh Fix for empty cached query that crashed
20101227 mvh Fixed some delete NULL crashes on failures
20101227 mvh Added org clause to forward <compressed as xx> to AE org AE
20101227 mvh ImportConverters now also use ForwardAssociationLevel
20101228 mvh Added \n after cloning db message
20110105 mvh Use MakeSafeStringValues for exact match; Added MoveDeviceScript0
20110105 mvh Added --echo and --selectseriestomove commands
20110105 mvh Version to 1.4.16rc1
20110106 mvh Added --moveseriestodevice; changed --selectseriestomove syntax
20110106 mvh Todo: NightlyMoveSource, NightlyMoveDest, NightlyMoveAmount, NightlyMoveAge, NightlyTestAge
20110106 mvh Version to 1.4.16rc2
20110110 mvh Note: mergestudiesconverter called for series and other way around
20110111 mvh Check for empty patient ID in virtual query and for other empty VRs
20110111 mvh merge study converter merges series: now calls MergeSeriesConverter.
Merging studies now calls MergeStudiesConverter
20110111 mvh changed logic of converters passing study or series uid to be consistent
20110111 mvh reject or destroy in merge script stops object from being merged
20110113 mvh fix script clause in merge study, call also tries line in [scripts] in dicom.ini
20110113 mvh Allow script clause without "" as well; unrecognized line attempts call
20110114 mvh "" in script string; script command evaluates string as script
20110115 mvh delete changed UIDs after merge study (remerge will create new series)
20110115 mvh fixed "script" converter and substitution of ""; experimental "lua" command
20110116 mvh fixed error message for incorrect script commands; first lua functions built-in
20110116 mvh SearchDicomObject now supports %VName; allow setting/reading more than 10 sequence items
20110116 mvh The set command now accepts names, e.g., set PatientID to "9999"; nop %VPatientID
20110116 mvh Lua now allows, e.g., Data.PatientID = 'aap'; print(Data.PatientID)
20110117 mvh Started on lua Global, Association, Command
20110118 mvh Primary PDU is Extended to allow embedding lua state in it
20110119 mvh Added a global PDU as script context; associations add new contexts
20110120 mvh Fix in Association.Calling/Called; for now each thread has an isolated lua state
Fix in speed of query results (were all processed by ImportConverter). Added lua
startup/command/QueryConverter0 etc; count all threads including gui threads
20110121 mvh Added prefetcherPDU for delayed forwards and such
20110122 mvh Fixed lua print, added lua error handling; added %f %b %p to ImportConverter
20110122 mvh Fixed SearchDicomObject for US,SS,UL,SL tags (note: 'set to' not fixed yet)
20110124 mvh bug fixes in new code; implemented reject in lua
20110125 mvh Put UID changes into debuglog
20110127 mvh Added lua getpixel and setpixel (takes 3-5 microseconds)
20110129 mvh Added lua getrow, setrow, getcolumn, setcolumn, readdicom, writedicom; sd.ddo leaks
20110201 mvh Lua: R/W sequence e.g., print('0 implied', Data.InstitutionCodeSequence.InstitutionName)
or Data.InstitutionCodeSequence[2].InstitutionName = 'write for now max one level deep'
20110203 mvh Lua: Unified reading and writing of Data/Command/Sequences;
Allow write at any depth in existing sequences
20110204 mvh Allow creating sequence in script and in Lua: Data.xxxx = {}
20110205 mvh Added newdicomobject and deletedicomobject
20110206 mvh Fix for set .. to ""; added set .. to nil for simple VR;
create sequence will not overwrite existing sequence;
lua web page creation: CGI(), HTML(), <?lua ?> <%= %> source=xx.lua
20110207 mvh Added lua: get_amap(N) -- N starts at 1, dbquery(db, flds, query, sort) { returns table of tables starting at 1)
20110208 mvh lua gc for dicomobject; lua dicomarray and dicomquery; allow virtualquery without setting level in DDO
20110208 mvh 1.4.16rc4
20110214 mvh Fixed lua Data access; fixed "" in exportconverter; 1.4.16rc4a
20110216 mvh Fixed calling and called in ExportConverter; fixed %f etc in ImportConverter
mkdir IE converter also creates subdirs; 1.4.16rc4b
20110228 mvh Added Write, Read and Dump methods to lua dicomobject as closure with passed method name
20110320 mvh Fixed Association.Calling in lua; Added RejectedImageConverter0; added t_1500 checks to all queries
20110320 mvh 1.4.16rc5
20110326 mvh 1.4.16rc6
20110328 mvh Fix crash when setting lua Filename for import file
20110331 mvh Added NoDICOMCheck option: if set, do not stop parsing DICOM stream on error
FlushPrivateProfileStringCache after writing to dicom.ini
20110331 mvh 1.4.16
20110404 mvh Fix in CGI behavior for IIS (check REQUEST_METHOD); version to 1.4.16a (unreleased)
20110413 mvh NoDICOMCheck also forces use of sequence enabled reader (allows JPEG compressed V2 file)
20110419 mvh Added lua getvr(Object, g, e), Object:GetVR(g, e), setvr(Object, g, e, data), Object:SetVR(g, e, data)
full lua webpage now basically works and gives error messages to web page
20110419 mvh version 1.4.16a
20110501 mvh added heapinfo() in lua; version 1.4.16b
20110502 mvh Made DcmMove almost always work on study level
added lua dicommove(source, dest, obj, patroot) and sql(statement)
20110603 mvh loadkfactor now required for dgate -a commands; added -h option (wait for getkey)
20110604 mvh lua endassociation and clienterror events; added retry command for rejectedImageConverter0
20110604 mvh implemented/fixed size (may be %)/dsize for sliceviewer/serversideviewer/seriesviewer; version 1.4.16c
also allow size='': use original size or 80% for those requiring a fixed size
20110605 mvh Added zip download of series/study through push page
20110606 mvh Added --modifystudy and --modifyseries commands, e.g., dgate "--modifystudy:20000321,,compression j2"
20110628 lsp Set PDU.Link.Connected to FALSE on !PDU.Read(&DCO)) in
StorageApp::ServerChild() to avoid subsequent use of a closed socket in
AReleaseRQ::Write() and AReleaseRP::Read() in PDU_Service::Close()
(called in destructor of PDU_Service)
20110710 mvh Added RejectedImageWorkListConverter0; fixed retry for RejectedImageWorkList and RejectedImage
20110710 mvh Fixed WADO application/dicom mime header
20110710 mvh zip from web page calls zip.cq script on each file; also forces DCM extension
20110710 mvh Fix compile of getch and heapinfo linux
20110710 mvh Version to 1.4.16d
20110904 mvh Clear address (0010,1040) in default anonymizer; Fixed lua deletedicmobject, leak in readdicomobject
Create empty sequence is really empty, # operator for DICOM sequence in lua
Version to 1.4.16e
20110904 mvh Fix read of %i, %s, %m in lua not from ImportConverter;
protect getpixel etc against missing pixel data
Fix crash of %QX if file does not exist
20110905 mvh Fixed leak in %QP etc; fixed leaks in ADDO cleaning in web interface
20110906 mvh Added optional script instead of submit.cq to dgate --scheduletransfer: and dgate --submit:
20110907 mvh Added script clause to forward; e.g., forward to PACS001fir org SELF script fixkodak
20110927 mvh Added "crop x1,x2,y1,y2" and "tomono" importconverters
20110928 mvh Added the DEST clause to e.g., "forward to AE org CALLING dest CALLED script nop"
20110930 mvh Fixed crash forwarding from lua
Version to 1.4.16f
20111009 mvh Fixed sequence writing problem; make it one long when first writing
Fixed AliasFile reading issue: i index into command updated incorrectly
Fixed lua dbquery issue due to typo
Added channel clause to forward import converter; use PDU[19,channel] from lua
fix forward org dest clauses; fixed forward to HOST:PORT
20111010 mvh Protect channel clause againt incorrect values
Version to 1.4.16g
20111015 mvh Fixed wado dcm compression (incorrect extension)
20111018 mvh Added TempDir ini file option
20111114 mvh Version to 1.4.16h
20111120 mvh Default size in convert_to_gif etc is now 0: as is
20120112 mvh+jd Fix in passing script to submit command
20120211 mvh Allow passing optional DDO as first arg to set/getpixel set/getrow
Object:SetPixel, Object:GetPixel, Object:SetRow, Object:GetRow
20120212 mvh Fixed uncompress WADO; fix POST code for SOAP serving; export globals to lua in CGI mode
20120212 mvh Fixed POST for IIS (read len, not len+1)
20120213 mvh Small fix in x:GetRow etc; Setting Dictionary and ACRNemaMap for CGI enables moves and queries
20120213 mvh Moved some set and virtualquery logging to SystemDebug
20120214 mvh Allow any file to be POSTed, saves as xxx.dat; Added DefaultPage and AnyPage items
20120215 mvh Reversed CGI key test to allow query string where e.g., mode= appears twice, hit on first
20120215 mvh Added optional markseries and markstudy pages if passing value 'key' down into them
20120217 mvh Added shoppingcart option; enabled if configured and passing value 'key'
20120218 mvh Added DefaultPage to make own top and AnyPage to totally disable built-in CGI server
20120219 mvh Disabled WEB push to self, and zip from remote server (which was invalid anyway)
20120220 mvh Added WebPush configuration to allow disabling push options; show more config items
20120220 mvh Version to 1.4.16i
20120221 mvh lua can run script on any dicom object; empty tag does not return NIL to lua; lua dictionary(); fix uploadedfile
20120222 mvh Fix webpush and crash on IIS for empty QUERY_STRING
20120229 mvh Extended number of possible columns in PatientStudyFinder
20120302 mvh Added gpps lua function; DefaultPage may be e.g., *.lua; any mode is that mapped to mode.lua
20120304 mvh Implemented region and anonymize options to wado
20120304 mvh Made DefaultPage and AnyPage sections; Fixed WADO text output; Version to 1.4.16j
20120305 mvh Added statusstring for simple web feedback of dicommove and submit (not multiuser safethough)
20120306 mvh Added lua callback to dcmmove2; added statusstring: server command
20120306 mvh A failed virtualserver request will now not wait until a timeout and log error messages
20120307 mvh Added bridge=AE option to make local WADO server a proper bridge (see MyBridgeStorage and LoadForBridge and 0x2bad)
20120317 mvh Documented imagefinder; added process study|series with xxxx.lua (just command_line is passed)
20120318 mvh Allow "file.lua" directly as importconverter instead of lua "dofile('file.lua')"
20120319 mvh Implemented lua: filenamesyntax; e.g. lua:dofile('generatefilename.lua') or lua:Data.SOPInstanceUID..'.dcm'
20120320 mvh Added [wadoservers] bridge = AE to force wadoserver by default to bridge for one given AE
20120325 mvh "lua" and [lua] ExportConverter, "copy" ImportConverter and "defer" ImportConverter (for lua ExportConverter)
20120327 mvh Document status_string: command
20120402 mvh Improved OverlapVirtualGet: allow to reverse operation - give slices out mainly in incoming order
Avoid deadlock by conflicting requirements; SystemDebug some status messages in OverlapVirtualGet and ReadAheadThread
20120402 mvh Released 1.4.16j
20120525 mvh When retrieve from virtualserver is ready cancel outstanding c-move requests
Increased virtualserver timeout to 200 sec
20120601 mvh Implemented WORKLIST query from lua
20120621 ljz Fix readahead crash when client hangs up in the middle of the transfer
20120624 mvh Limit virtualserver to 64 per move; virtualserverperseries obsolete; fixes crash when series larger than move
20120624 mvh move mkdir etc defines in dgate.cpp up to line 2220
20120624 mvh Keep move object intact in lua dicommove and dicomquery; report fail for lua sql and readdicom functions
20120624 mvh Prerelease 1.4.16k
20120630 mvh Allow compression to be e.g. JL etc or JLNN, J3NN, J4NN, J5NN, J6NN: NN is quality factor
20120630 mvh Reverse .dcm check: all is assumed .DCM except .V2
20120701 mvh Added dicomdelete; note: tried to make heapinfo() thread safe but failed;
20120701 mvh release 1.4.16k
20120703 bcb Changes WIN32 & WINDOWS to !UNIX, moved mkdir define to before first use. Fixed prototypes, local shadows, overflow
20120710 bcb Split up dgate into dgate, dgatecgi, dgatehl7 and nkiqrsop into nkiqrsop, jpegconv; moved parseArgs to parse.
Use ROOTCONFIG_SZ and MAX_PATH
20120721 mvh Fixed CGI code that got extension wrong on unix with . in folder name
Blocked out unreachable code
20120723 mvh Fixed *count-- --> (*count)--
20120820 bcb Replaced some strlen with safer strnlen. Added ACRNemaMap class and moved code there.
20120829 mvh "mkdir " script command no longer requires a trailing / or \
20120829 mvh Force even text/plain output; first pad ' '; then strip when odd
20120829 mvh Version to 1.4.17
20120905 mvh Fixed bug found by Bruce Barton in [lua] ExportConverter
20120908 mvh Added fix for virtualserver on imagetype and NOIMAGETYPEFIX flag
VirtualServerForN may be e.g., "server,NOIMAGETYPEFIX,FIKKODAK"
20120914 mvh Changed default of above fix to off: flag is now IMAGETYPEFIX
20120914 mvh Attempt to use VirtualQueryCached to build list of images to be retrieved in VirtualQuery
Filter response in virtualquery(for virtualserver) for
incorrect response of carestream to IMAGETYPE query
20120916 mvh Cleaned up code; split in VirtualQuery and VirtualQueryToDB (that uses VirtualQueryCached)
Renamed option IMAGETYPEFIX to send only 3rd element of ImageType to IMAGETYPEFIX3
IMAGETYPEFIX just tests each received record for a match against queried ImageType
20120917 mvh Move dumps response in case of error; finished IMAGETYPEFIX
20120922 mvh IMAGETYPEFIX also works on EchoNumbers
20121015 mvh Fixed check on V2 filename extension to enable NKI compression again
20121016 mvh 1.4.17alpha release
20121201 mvh Added and disabled code to link optional socket.core library
20121208 mvh Added __tostring method to lua representation of dicom objects;
fix luaGlobalNewIndex: writes dicom.ini as well as direct variables
Blocked delayed export converters of non-existent objects
Added WatchFolder parameter (second monitored incoming folder)
20121214 mvh Enabled socket.core; use .zip for submit version to 1.4.17beta
Fixed 'forward compressed as ' in import and export converter (viewtopic.php?f=33&t=15588)
Added lua Association.ConnectedIP member (WIP)
20121216 mvh Added DicomObject as class factory with new and newarray, added :free(), fixed ConnectedIP
20130125 mvh Added changeuid and changeuidback to lua interface;
Anonymizer accepts anonymize_script.lua as well as anonymize_script.cq
Added ImportConverters "olduids" and "olduids except"
20130127 mvh Added dgate --luastart: (returns immediate)
20130128 mvh Added crc to lua interface
20130202 mvh Added getimage, setimage, :GetImage, :SetImage to string
GetVr has extra parameter (binary), SetVR accepts (binary) string
Added "pack" library hardcoded; lua genuid; protect lua :Read filename
20130210 mvh Fixed e.g. process study after 5 with test.lua %i:%o
Note: there must be arguments passed to command_line
20130215 mvh Fixed source = xxx.lua cgi starter
20130218 mvh re-allow readdicom on empty Data object;
header now works for lua cgi script (default disabled)
20130218 mvh Report move failure in dgate -- commands
20130218 mvh Added studyviewer (default disabled); added dgate --dolua:
Documented lua command line options; socket.core only for win32 now
20130219 mvh 1.4.17beta released as update
20130226 bcb Replaced gpps with IniValue class. Removed all globals and routines now in IniValue class.
Made ACRNemaClass a singleton. Version to 1.4.18a.
20130328 bcb Merged with 1.4.17b
20130416 bcb Removed else do_lua(&(globalPDU.L), "", &sd)
20130320 mvh Fix BackGroundExec with spaces in path
20130321 mvh Add BaseDir\clibs to path; added missing logs for converters such as rm
20130502 mvh Added \nAccess-Control-Allow-Origin: * or \nAccess-Control-Allow-Origin:*
to all WADO generated messages, the space is omitted to force header EVEN
20130502 mvh 1.4.17beta2 update
20130520 bcb Fixed ImportConverter.
20130522 mvh Fixed setting path to Basedir\clibs
ENDOFUPDATEHISTORY
*/
//#define DGATE_VERSION "1.4.18a2"
//#define DO_LEAK_DETECTION 1
//#define DO_VIOLATION_DETECTION 1
//#define FAILSAFE_STORAGE
// max ExportConverters lines AND max forwards per line
#define MAXExportConverters 20
#ifndef UNUSED_ARGUMENT
#define UNUSED_ARGUMENT(x) (void)x
#endif
#ifndef max
inline int max(int a, int b) { return a > b ? a : b; }
#endif
#ifdef UNIX
#define mkdir(a) mkdir(a, 0777)
#endif
#ifdef UNIX
#ifndef EnterCriticalSection
# define EnterCriticalSection(a) pthread_mutex_lock(a)
#endif
#ifndef LeaveCriticalSection
# define LeaveCriticalSection(a) pthread_mutex_unlock(a)
#endif
#ifndef CRITICAL_SECTION
# define CRITICAL_SECTION pthread_mutex_t
#endif
#ifndef InitializeCriticalSection
# define InitializeCriticalSection(a) pthread_mutex_init(a, NULL);
#endif
#endif
#include <stdarg.h>
# include "dgate.hpp"
# include "odbci.hpp" // ODBC Interface routines
# include "device.hpp"
//# include "gpps.hpp" //DUCKHEAD92
# include "dprintf.hpp" // Debug output