-
Notifications
You must be signed in to change notification settings - Fork 26
/
workflow.sh
806 lines (716 loc) · 46.8 KB
/
workflow.sh
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
PURPOSE="
This script describes by way of demonstration various explicit examples of
how to use the pypx family of tools to connect a PACS database to a ChRIS
instance. By 'connect' is meant the set of actions to determine images of
interest in a PACS and to ultimately send those same images to a ChRIS
instance for subsequent image analysis.
The set of operations, broadly, are:
* pack a bunch of DICOM files that are on the local filesystem into
the pypx database;
* explore the local pypx simple database for information on patients
series / studies;
* query a PACS for images of interest and report on results in a
variety of ways;
* retrieve a set of images of interest;
* push the retrieved images to CUBE swift storage;
* register the pushed-into-swift images with CUBE;
Each set of operations is present with as CLI using 'on-the-metal' tools
installed with PyPI followed by the equivalent docker CLI. The CLI is
purposefully tailored to show strong overlap between the 'on-the-metal'
call and the docker call.
NOTE:
* This script should work across all shells of note: bash/zsh/fish
but has only fully tested on 'fish'.
Q/A LOG:
* 07-Dec-2021 -> 08-Dec-2021
Full test of each command/line against a ChRIS instance and orthanc
server running within a local network.
"
# Which pypx do you want to use? :)
# export PYPX=fnndsc/pypx
export PYPX=local/pypx
#
# Manually run a storescp:
# Obviously change paths accordingly!
# This is only necessary if you are running pypx without/outside of a
# pfdcm service.
#
# MOST LIKELY YOU WILL NOT NEED TO DO THIS
#
#storescp -od /tmp/data \
# -pm -sp \
# -xcr "/home/rudolphpienaar/src/pypx/bin/px-repack --xcrdir #p --xcrfile #f --verbosity 0 --logdir /home/dicom/log --datadir /home/dicom/data" \
# -xcs "/home/rudolphpienaar/src/pypx/bin/px-smdb --xcrdir #p --action endOfStudy" \
# 11113
# Edit any/all of the following as appropriate to your local env.
# storage type
export STORAGETYPE=swift
#
# swift storage environment
#
export SWIFTKEY=local
export SWIFTHOST=192.168.0.9
export SWIFTPORT=8080
export SWIFTLOGIN=chris:chris1234
export SWIFTSERVICEPACS=orthanc
#
# CUBE login details
#
export CUBEKEY=local
export CUBEURL=http://192.168.0.9:8000/api/v1/
export CUBEusername=chris
export CUBEuserpasswd=chris1234
#
# PACS details
#
# For ex a FUJI PACS
export AEC=CHRIS
export AET=CHRISV3
export PACSIP=134.174.12.21
export PACSPORT=104
export DB=/neuro/users/chris/PACS/log
#
# For ex an orthanc service
#
export AEC=ORTHANC
export AET=CHRISLOCAL
export PACSIP=192.168.0.9
export PACSPORT=4242
#
# Local file paths -- if you don't have a /home/dicom
# directory, I'd strongly suggest creating one...
#
export DB=/home/dicom/log
export DATADIR=/home/dicom/data
export BASEMOUNT=/home/dicom
export LOCALDICOMDIR=/home/rudolphpienaar/data/4665436-305/all-full
#
# NB!
# Make sure that the $DB directory is accessible as described from the
# host running this script!
#
# Patient / Study / Series detail
# Obviously re-assign these for a given target!
export MRN=4443508
export STUDYUID=1.2.840.113845.11.1000000001785349915.20130312110508.6351586
export SERIESUID=1.3.12.2.1107.5.2.19.45152.2013031212563759711672676.0.0.0
export ACCESSIONNUMBER=22681485
###############################################################################
#_____________________________________________________________________________#
# R E P A C K #
#_____________________________________________________________________________#
# Pack a single flat dir of many DICOM files that exist on the local file #
# system into the pypx database -- this will also organize the files into #
# nice directory trees / etc in the database directory. #
# #
# Note that it is also possible to "pack" files by transmitting them to the #
# DICOM listener service, which will receive the files and then effectively #
# do this exact px-repack operation. By calling px-repack directly we can #
# streamline this process a bit. Also the DICOM listener handling process is #
# rather computationally intensive. #
###############################################################################
# Pack a whole slew of files that are in a directory
px-repack \
--logdir $DB \
--datadir $DATADIR \
--xcrdir $LOCALDICOMDIR \
--parseAllFilesWithSubStr dcm
docker run --rm -ti -v $BASEMOUNT:$BASEMOUNT -v $LOCALDICOMDIR:$LOCALDICOMDIR \
$PYPX \
--px-repack \
--logdir $DB \
--datadir $DATADIR \
--xcrdir $LOCALDICOMDIR \
--parseAllFilesWithSubStr dcm
###############################################################################
#_____________________________________________________________________________#
# S M D B #
#_____________________________________________________________________________#
# Some smdb experiences. #
# The smdb is a "simple data base" with all table data represented as JSON #
# files in the FS. The FS itself provides some hierarchical database #
# organization
###############################################################################
#
# NOTE!
# o All CLI calls are shown as "on-the-metal" as well as docker equivalents.
# The docker equivalents are constructed to closely map/mirror the
# corresponding on-the-metal call.
# o For the most part, the docker call differs in:
# [] The "prefix" docker command
# [] All JSON passed to a command needs special quoting and importantly
# NO spaces (or at least escaped spaces)
#
# Set the swift login info in a key-ref'd service
px-smdb \
--logdir $DB \
--action storage \
--actionArgs '
{
"'$SWIFTKEY'": {
"storagetype": "'$STORAGETYPE'",
"ip": "'$SWIFTHOST'",
"port":"'$SWIFTPORT'",
"login":"'$SWIFTLOGIN'"
}
}'
# docker equivalent -- note the JSON string needs special quoting and needs to
# be a single-line string WITH NO SPACES!
docker run --rm -ti -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-smdb \
--logdir $DB \
--action storage \
--actionArgs \
'{\"'$SWIFTKEY'\":{\"storagetype\":\"'$STORAGETYPE'\",\"ip\":\"'$SWIFTHOST'\",\"port\":\"'$SWIFTPORT'\",\"login\":\"'$SWIFTLOGIN'\"}}'
# Get the swift login details for all keys
# This examines the service file, swift.json, located in
# $DB/services/swift.json
px-smdb \
--logdir $DB \
--action swift
docker run --rm -ti -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-smdb \
--logdir $DB \
--action storage
# Query smdb for all image dirs on a patient
px-smdb \
--action imageDirsPatientID \
--actionArgs $MRN \
--logdir $DB
docker run --rm -ti -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-smdb \
--action imageDirsPatientID \
--actionArgs $MRN \
--logdir $DB
# Query smdb for dir on a SeriesInstanceUID
px-smdb \
--action imageDirsSeriesInstanceUID \
--actionArgs $SERIESUID \
--logdir $DB
docker run --rm -ti -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-smdb \
--action imageDirsSeriesInstanceUID \
--actionArgs $SERIESUID \
--logdir $DB
# Explicitly update all maps/catalogues for a Patient
# This is typically only needed if for some (rare) case not all the
# constituent DB json files have been created properly.
px-smdb \
--action mapsUpdateForPatient \
--actionArgs $MRN \
--logdir $DB
docker run --rm -ti -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-smdb \
--action mapsUpdateForPatient \
--actionArgs $MRN \
--logdir $DB
# Check the swift storage -- this will only return a valid payload if files
# have been successfully pushed to swift!
pfstorage \
--swiftIP $SWIFTHOST \
--swiftPort $SWIFTPORT \
--swiftLogin $SWIFTLOGIN \
--verbosity 1 \
--debugToDir /tmp \
--type swift \
--do '
{
"action": "ls",
"args": {
"path": "SERVICES/PACS/'$SWIFTSERVICEPACS'"
}
}
' --json
# docker equivalent -- note the JSON string needs special quoting and needs to
# be a single-line string WITH NO SPACES!
docker run --rm -ti -v $BASEMOUNT:$BASEMOUNT $PYPX \
--pfstorage \
--swiftIP $SWIFTHOST \
--swiftPort $SWIFTPORT \
--swiftLogin $SWIFTLOGIN \
--verbosity 1 \
--debugToDir /tmp \
--do \
'{\"action\":\"ls\",\"args\":{\"path\":\"SERVICES/PACS/'$SWIFTSERVICEPACS'\"}}' --json
###############################################################################
#_____________________________________________________________________________#
# S E A R C H #
#_____________________________________________________________________________#
# #
# Some search experiences. #
# Note that if $SEARCHTAG and $SEARCHVAL are NOT set, then orthanc #
# will return data on all PATIENTS/STUDIES/SERIES #
###############################################################################
# Search targets
# Edit the following as you see fit!
export SEARCHTAG="--PatientID"
export SEARCHTAG="--AccessionNumber"
export SEARCHVAL=$ACCESSIONNUMBER
export SEARCHTAG="--SeriesInstanceUID"
export SEARCHVAL=$SERIESUID
# Simple "search":
px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--verbosity 1 \
--json \
--then report \
--withFeedBack
docker run --rm -ti -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--verbosity 1 \
--json \
--then report \
--withFeedBack
# Simple "search" with more detailed reporting
px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--json |\
px-report \
--colorize dark \
--printReport csv \
--csvPrettify \
--csvPrintHeaders \
--reportHeaderStudyTags PatientName,PatientID,StudyDate \
--reportBodySeriesTags SeriesDescription,SeriesInstanceUID
docker run --rm -ti -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--json |\
docker run --rm -i -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-report \
--colorize dark \
--printReport csv \
--csvPrettify \
--csvPrintHeaders \
--reportHeaderStudyTags PatientName,PatientID,StudyDate \
--reportBodySeriesTags SeriesDescription,SeriesInstanceUID
# Let's reduce the header to only the PatientID, StudyDate and StudyInstanceUID
px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--json |\
px-report \
--colorize dark \
--printReport csv \
--csvPrettify \
--csvPrintHeaders \
--reportHeaderStudyTags PatientID,StudyDate,StudyInstanceUID \
--reportBodySeriesTags SeriesDescription,SeriesInstanceUID
docker run --rm -ti -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--json |\
docker run --rm -i -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-report \
--colorize dark \
--printReport csv \
--csvPrettify \
--csvPrintHeaders \
--reportHeaderStudyTags PatientID,StudyDate,StudyInstanceUID \
--reportBodySeriesTags SeriesDescription,SeriesInstanceUID
###############################################################################
#_____________________________________________________________________________#
# R E T R I E V E #
#_____________________________________________________________________________#
# Now for some search driven retrieves. #
# The semantics are built around a <search>then<retrieve> construct #
###############################################################################
# Retrieve
# The --intraSeriesRetrieveDelay is a throttle that might be necessary if you
# are running this infrastructure on a low spec machine.
#
px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--json \
--then retrieve \
--withFeedBack \
--intraSeriesRetrieveDelay dynamic:10 \
docker run --rm -i -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--json \
--then retrieve \
--withFeedBack \
--intraSeriesRetrieveDelay dynamic:10 \
###############################################################################
#_____________________________________________________________________________#
# S T A T U S #
#_____________________________________________________________________________#
# Check status in internal smdb . #
# The semantics are built around a <search>then<retrieve> construct #
###############################################################################
px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--verbosity 1 \
--json \
--then status \
--withFeedBack
docker run --rm -i -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--verbosity 1 \
--json \
--then status \
--withFeedBack
# Retrieve only a single series in a study
export STUDYINSTANCEUID=1.2.840.113845.11.1000000001785349915.20130312110508.6351586
export SERIESINSTANCEUID=1.3.12.2.1107.5.2.19.45152.30000013022413214670400289776
# Check that this is the study/series of interest
px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
--StudyInstanceUID $STUDYINSTANCEUID \
--SeriesInstanceUID $SERIESINSTANCEUID \
--db $DB \
--json \
--then report \
--withFeedBack
docker run --rm -i -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
--StudyInstanceUID $STUDYINSTANCEUID \
--SeriesInstanceUID $SERIESINSTANCEUID \
--db $DB \
--json \
--then report \
--withFeedBack
# Now pull it... (and show the status after pulling)
px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
--StudyInstanceUID $STUDYINSTANCEUID \
--SeriesInstanceUID $SERIESINSTANCEUID \
--db $DB \
--json \
--then retrieve,status \
--withFeedBack
docker run --rm -it -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
--StudyInstanceUID $STUDYINSTANCEUID \
--SeriesInstanceUID $SERIESINSTANCEUID \
--db $DB \
--json \
--then retrieve,status \
--withFeedBack
# Check the status using the report module:
px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--verbosity 1 \
--json \
--then status |\
px-report \
--seriesSpecial seriesStatus \
--printReport tabular \
--colorize dark \
--reportBodySeriesTags seriesStatus
docker run --rm -i -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--verbosity 1 \
--json \
--then status |\
docker run --rm -i -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-report \
--seriesSpecial seriesStatus \
--printReport tabular \
--colorize dark \
--reportBodySeriesTags seriesStatus
# Check the status using the report module and csv output:
px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--verbosity 1 \
--json \
--then status |\
px-report \
--seriesSpecial seriesStatus \
--printReport csv \
--csvPrettify \
--csvPrintHeaders \
--reportHeaderStudyTags PatientName,StudyDate \
--reportBodySeriesTags seriesStatus
docker run --rm -i -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--verbosity 1 \
--json \
--then status |\
docker run --rm -i -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-report \
--seriesSpecial seriesStatus \
--printReport csv \
--csvPrettify \
--csvPrintHeaders \
--reportHeaderStudyTags PatientName,StudyDate \
--reportBodySeriesTags seriesStatus
###############################################################################
#_____________________________________________________________________________#
# P U S H #
#_____________________________________________________________________________#
# Once data is pulled locally, either from a retrieve or from some other #
# mechanism, we can now push images to CUBE swift storage. #
# #
# #
# As earlier with the retrieve, we can do a <search>then<push> construct. #
# The <source> to PUSH is a directory on the locally accessible filesystem #
# which can either be specified directly with the '--xcrdir' parameter, or #
# resolved by a call to find event off a connected PACS (this is ultimately #
# used simply to determine the location of files within the smdb tree). #
###############################################################################
# Now, choose a single series by simply passing the SeriesInstanceUID and
# StudyInstanceUID in the `px-find` appropriately
# Push some data to swift storage:
export SWIFTSERVICEPACS=covidnet
export LOCALDICOMDIR=/home/rudolphpienaar/data/WithProtocolName/all
px-push \
--swiftIP $SWIFTHOST \
--swiftPort $SWIFTPORT \
--swiftLogin $SWIFTLOGIN \
--swiftServicesPACS $SWIFTSERVICEPACS \
--db $DB \
--swiftPackEachDICOM \
--xcrdir $LOCALDICOMDIR \
--parseAllFilesWithSubStr dcm \
--verbosity 1 \
--json > push.json
docker run --rm -i -v $LOCALDICOMDIR:$LOCALDICOMDIR -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-push \
--swiftIP $SWIFTHOST \
--swiftPort $SWIFTPORT \
--swiftLogin $SWIFTLOGIN \
--swiftServicesPACS $SWIFTSERVICEPACS \
--db $DB \
--swiftPackEachDICOM \
--xcrdir $LOCALDICOMDIR \
--parseAllFilesWithSubStr dcm \
--verbosity 1 \
--json
# Or, using the $SWIFTKEY...
px-push \
--swift $SWIFTKEY \
--swiftServicesPACS $SWIFTSERVICEPACS \
--db $DB \
--swiftPackEachDICOM \
--xcrdir $LOCALDICOMDIR \
--parseAllFilesWithSubStr dcm \
--verbosity 1 \
--json
docker run --rm -i -v $LOCALDICOMDIR:$LOCALDICOMDIR -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-push \
--swift $SWIFTKEY \
--swiftServicesPACS $SWIFTSERVICEPACS \
--db $DB \
--swiftPackEachDICOM \
--xcrdir $LOCALDICOMDIR \
--parseAllFilesWithSubStr dcm \
--verbosity 1 \
--json
# Push from a find event:
px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--verbosity 1 \
--json \
--then push \
--thenArgs '
{
"db": "'$DB'",
"swift": "'$SWIFTKEY'",
"swiftServicesPACS": "'$SWIFTSERVICEPACS'",
"swiftPackEachDICOM": true
}' \
--withFeedBack
docker run --rm -i -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--verbosity 1 \
--json \
--then push \
--thenArgs \
'{\"db\":\"'$DB'\",\"swift\":\"'$SWIFTKEY'\",\"swiftServicesPACS\":\"'$SWIFTSERVICEPACS'\",\"swiftPackEachDICOM\":true}' \
--withFeedBack
###############################################################################
#_____________________________________________________________________________#
# R E G I S T E R #
#_____________________________________________________________________________#
# Pushing data to swift storage does not make ChRIS aware of the data yet. #
# In order for the data to be visible to ChRIS, it needs to be registered to #
# ChRIS from swift. #
# #
###############################################################################
# Set lookup in smdb
px-smdb \
--logdir /home/dicom/log \
--action CUBE \
--actionArgs \
'
{
"'$CUBEKEY'": {
"url": "'$CUBEURL'",
"username":"'$CUBEusername'",
"password":"'$CUBEuserpasswd'"
}
}'
docker run --rm -ti -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-smdb \
--logdir /home/dicom/log \
--action CUBE \
--actionArgs \
'{\"'$CUBEKEY'\":{\"url\":\"'$CUBEURL'\",\"username\":\"'$CUBEusername'\",\"password\":\"'$CUBEuserpasswd'\"}}'
# Get the CUBE login details for all keys
# This examines the service file, swift.json, located in
# $DB/services/swift.json
# Get the swift login details for all keys
# This examines the service file, swift.json, located in
# $DB/services/swift.json
px-smdb \
--logdir $DB \
--action CUBE
docker run --rm -ti -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-smdb \
--logdir $DB \
--action CUBE
# Register from a set of local directories (assuming this directory has already
# been pushed)
px-register \
--CUBE $CUBEKEY \
--swiftServicesPACS $SWIFTSERVICEPACS \
--db $DB \
--xcrdir $LOCALDICOMDIR \
--parseAllFilesWithSubStr dcm \
--verbosity 1 \
--json
docker run --rm -i -v $LOCALDICOMDIR:$LOCALDICOMDIR -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-register \
--CUBE $CUBEKEY \
--swiftServicesPACS $SWIFTSERVICEPACS \
--db $DB \
--xcrdir $LOCALDICOMDIR \
--parseAllFilesWithSubStr dcm \
--verbosity 1 \
--json
# Register from a find event
px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--verbosity 1 \
--json \
--then register \
--thenArgs '
{
"db": "'$DB'",
"CUBE": "'$CUBEKEY'",
"swiftServicesPACS": "'$SWIFTSERVICEPACS'",
"parseAllFilesWithSubStr": "dcm"
}' \
--withFeedBack
docker run --rm -i -v $LOCALDICOMDIR:$LOCALDICOMDIR -v $BASEMOUNT:$BASEMOUNT $PYPX \
--px-find \
--aec $AEC \
--aet $AET \
--serverIP $PACSIP \
--serverPort $PACSPORT \
$SEARCHTAG $SEARCHVAL \
--db $DB \
--verbosity 1 \
--json \
--then register \
--thenArgs '
{\"db\":\"'$DB'\",\"CUBE\":\"'$CUBEKEY'\",\"swiftServicesPACS\":\"'$SWIFTSERVICEPACS'\",\"parseAllFilesWithSubStr\":\"dcm\"}' \
--withFeedBack
# ends.
#
#_-30-_