-
Notifications
You must be signed in to change notification settings - Fork 0
/
automatic_wmh_pipeline_lpa_ubo_w_fix.mlab
1196 lines (1122 loc) · 29.3 KB
/
automatic_wmh_pipeline_lpa_ubo_w_fix.mlab
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
// MDL v1 utf8
network {
watchlist = ""
}
module itkImageFileWriter {
internal {
frame = "385 57 192 72"
moduleGroupName = "UBO world matrix fix:"
windows {
window _default {
geometry = "714 595 1011 418"
sizeHint = "293 418"
wasOpen = no
}
}
}
fields {
instanceName = SAVE_WMH_MAP_UBO_FIX
useCompression = FALSE
correctSubVoxelShift = FALSE
forceDirectionCosineWrite = TRUE
outputVoxelType = Automatic
info = ""
unresolvedFileName = $(DicomBrowserPath)/4_wmh_cases_collected/100152/UBO_wmh_map_fix.nii.gz
}
}
module RunPythonScript {
internal {
frame = "1273 461 128 56"
moduleGroupName = "Code: HERE!"
windows {
window _default {
geometry = "2863 213 976 847"
sizeHint = "813 798"
wasOpen = yes
}
}
}
fields {
instanceName = RunPythonScript
in0 = ""
in1 = ""
in2 = ""
in3 = ""
in4 = ""
in5 = ""
in6 = ""
in7 = ""
in8 = ""
in9 = ""
inComment0 = in0
inComment1 = in1
inComment2 = in2
inComment3 = in3
inComment4 = in4
inComment5 = in5
inComment6 = in6
inComment7 = in7
inComment8 = in8
inComment9 = in9
autoApply0 = TRUE
autoApply1 = TRUE
autoApply2 = TRUE
autoApply3 = TRUE
autoApply4 = TRUE
autoApply5 = TRUE
autoApply6 = TRUE
autoApply7 = TRUE
autoApply8 = TRUE
autoApply9 = TRUE
out0 = ""
out1 = ""
out2 = ""
out3 = ""
out4 = ""
out5 = ""
out6 = ""
out7 = ""
out8 = ""
out9 = ""
outComment0 = out0
outComment1 = out1
outComment2 = out2
outComment3 = out3
outComment4 = out4
outComment5 = out5
outComment6 = out6
outComment7 = out7
outComment8 = out8
outComment9 = out9
initCode = "*# For backward compatibility, set up CTX as alias for ctx
CTX = ctx # ctx is the network's context, not RunPythonScript's
#######
#Please take a short look through the code to ensure that everything matches with your own files.
#######
#Imports:
import os
##Remember to comment out paths before uploading to GitHub... (Since "init code" is run on start-up.)
base_input_path = "/Users/lhi003/Documents/4_wmh_cases_collected/" #USER ADVISED TO DOUBLE CHECK.
base_summary_path = "/Users/lhi003/Documents/4_wmh_cases_collected_other/" #USER ADVISED TO DOUBLE CHECK.
##Threshold number to binarize a Probability Lesion map,
## if it is already thresholded then that value will override whatever value is specified here.
LPA_threshold = 0.05 #USER ADVISED TO DOUBLE CHECK. (Assume 0 -> 1)
##STRUCTURE:
#Assuming using the structure from the LPA run, which loosely follows the BIDS structure:
# (e.g. [ID]/*/[images].nii.gz or [ID]/[images].nii.gz)
##INPUTS:
#T2 FLAIR (t2_flair_3d.nii) image should be the reference image read in at T2_FLAIR module.
#The [ID]_FLAIRspace.nii.gz files should be the source image read in at WMH_MAP_UBO.
#Setting up: (To ensure that the correct files are selected before committing to running code.)
print "="*10
print "Retrieving IDs from: " + base_input_path
print "Saving volume information to: " + base_summary_path
print "="*10
id_list = os.listdir(base_input_path)
id_list = [x for x in id_list if not (x.startswith("."))] #Omitting hidden files that start with "." typically present in macOS.
n = len(id_list)
counter = 1
summary_list = []
print(id_list)
print "Total number of IDs are: " + str(n)
print "LPA PMAP threshold is set to be " + str(LPA_threshold)
print "Ready to begin execution of Main code..."
print "="*10*"
wakeUpCode = ""
code = "*
CTX.field("Threshold_LPA_PMAP.threshold").value = LPA_threshold
###Iterating through all IDs:
for i in id_list:
print "="*10
print "Working at number: " + str(counter) + " of " + str(n)
print "Current ID is: " + i
##Paths:
#Constructing current ID path:
current_id_path = base_input_path + i + "/"
print(current_id_path)
#Constructing (source) WMH_MAP_UBO input path:
ubo_path = current_id_path + i + "_WMH_FLAIRspace.nii.gz" #USER ADVISED TO DOUBLE CHECK.
print(ubo_path)
#Constructing (reference) T2_FLAIR input path:
flair_path = current_id_path + "t2_flair_3d.nii" #USER ADVISED TO DOUBLE CHECK.
print(flair_path)
#Constructing WMH_PMAP_LPA input path:
lpa_path = current_id_path + "ples_lpa_mt2_flair_3d.nii" #USER ADVISED TO DOUBLE CHECK.
print(lpa_path)
##There should be no need to make new output directories, but we will specify the out paths.
#ID neutral output names/paths are enforced similarly to other BIDS elements.
#Constructing WMH_MAP_UBO fix output path:
fixed_ubo_path = current_id_path + "UBO_wmh_map_fix.nii.gz"
print(fixed_ubo_path)
if not os.path.isfile(fixed_ubo_path):
print "A new UBO WMH map fix file will saved."
else:
print "A previous UBO WMH map file exists and will be overwritten."
#Constructing THRESHOLD_LPA_PMAP output path:
threshold_lpa_path = current_id_path + "LPA_wmh_map.nii.gz"
print(threshold_lpa_path)
if not os.path.isfile(threshold_lpa_path):
print "A new LPA WMH map file will saved."
else:
print "A previous LPA WMH map file exists and will be overwritten."
#Constructing OR_UBO_LPA_BIN_MASK output path:
or_ubo_lpa_path = current_id_path + "OR_UBO_LPA_wmh_map.nii.gz"
print(or_ubo_lpa_path)
if not os.path.isfile(or_ubo_lpa_path):
print "A new OR_UBO_LPA WMH map file will saved."
else:
print "A previous OR_UBO_LPA WMH map file exists and will be overwritten."
###Paths should be ready by now; proceed to insert into context fields.
##Read in the files:
#Source: WMH_UBO_MAP
CTX.field("WMH_MAP_UBO.unresolvedFileName").value = ubo_path
#Reference: T2_FLAIR
CTX.field("T2_FLAIR.unresolvedFileName").value = flair_path
#WMH_PMAP_LPA
CTX.field("WMH_PMAP_LPA.unresolvedFileName").value = lpa_path
##Mask volumes: (Write to csv along ID??)
ubo_fix_volume = CTX.field("CalculateVolume_UBO.totalVolume").value
print "UBO volume is: " + str(ubo_fix_volume)
lpa_thresh_volume = CTX.field("CalculateVolume_LPA.totalVolume").value
print "LPA volume is: " + str(lpa_thresh_volume)
or_ubo_lpa_volume = CTX.field("CalculateVolume_UBOLPA.totalVolume").value
print "UBO or LPA volume is: " + str(or_ubo_lpa_volume)
###Saves and other potential relevant logical tests:
##UBO world matrix fix:
#Get values from INFO_WMH_MAP_UBO_FIX and INFO_T2_FLAIR and compare their "World Matrix" as a security check.
if (CTX.field("INFO_WMH_MAP_UBO_FIX.worldMatrix").value != CTX.field("INFO_T2_FLAIR.worldMatrix").value):
print "WARNING! The world matrices differ!!! They should be equal..."
print "CHECK!"*20
else:
#Save UBO fix if equal world matrices.
CTX.field("SAVE_WMH_MAP_UBO_FIX.unresolvedFileName").value = fixed_ubo_path
CTX.field("SAVE_WMH_MAP_UBO_FIX.save").touch()
print("Current ID's UBO WMH map has been fixed and saved...")
#Save LPA threshold:
CTX.field("SAVE_THRESHOLD_LPA_PMAP.unresolvedFileName").value = threshold_lpa_path
CTX.field("SAVE_THRESHOLD_LPA_PMAP.save").touch()
print("Current ID's thresholded LPA WMH map has been saved...")
#Save OR_UBO_LPA:
CTX.field("SAVE_OR_UBO_LPA_BIN_MASK.unresolvedFileName").value = or_ubo_lpa_path
CTX.field("SAVE_OR_UBO_LPA_BIN_MASK.save").touch()
print("Current ID's joint OR_UBO_LPA WMH map has been saved...")
#Append to summary_list:
summary_list.append([i,ubo_fix_volume,lpa_thresh_volume,or_ubo_lpa_volume])
#Count iterations:
counter = counter + 1
print("Finished...")
print "="*10
##Saving to CSV:
print "="*10
import csv
csv_file = "wmh_volume_id_ubo_lpa_both.csv"
csv_path = base_summary_path + csv_file
print("Writing to csv...")
with open(csv_path,"w") as output:
writer = csv.writer(output, lineterminator="\\n")
writer.writerows(summary_list)
print "Look for output at: " + str(csv_path)
print("Finished with csv...")
print "="*10*"
finalizeCode = "
"
showFields = FALSE
showInitCode = TRUE
showWakeUpCode = FALSE
showCode = TRUE
showFinalizeCode = TRUE
showConsole = FALSE
}
}
module Info {
internal {
frame = "877 461 120 72"
moduleGroupName = Inputs:
windows {
window _default {
geometry = "674 765 618 384"
sizeHint = "618 384"
wasOpen = no
}
}
}
fields {
instanceName = INFO_T2_FLAIR
}
}
module Info {
internal {
frame = "673 461 160 72"
moduleGroupName = Inputs:
windows {
window _default {
geometry = "290 698 599 401"
sizeHint = "599 401"
wasOpen = no
}
}
}
fields {
instanceName = INFO_WMH_MAP_UBO
}
}
module SetWorldMatrix {
internal {
frame = "477 169 200 72"
moduleGroupName = "UBO world matrix fix:"
windows {
window _default {
geometry = "1056 668 528 355"
sizeHint = "471 355"
wasOpen = no
}
}
}
fields {
instanceName = FORWARD_REF_TO_SOURCE
center = "0 0 0"
scaleOrientation = "0 0 1 0"
scale = "1 1 1"
rotation = "0 0 1 0"
translation = "0 0 0"
sourceUsage = Ignore
referenceUsage = Forward
elementaryUsage = Ignore
invertResult = FALSE
setCInfo = FALSE
setTInfo = FALSE
setUInfo = FALSE
}
}
module itkImageFileReader {
internal {
frame = "877 561 144 72"
moduleGroupName = Inputs:
windows {
window _default {
geometry = "1337 634 394 431"
sizeHint = "323 431"
wasOpen = no
}
}
}
fields {
instanceName = T2_FLAIR
fileDataType = float
autoDetermineDataType = TRUE
correctSubVoxelShift = FALSE
fileDimension = 3
info = "Loading okay."
numDims = 3
fileType = TypeNotApplicable
componentType = float
pixelType = SCALAR
loaderType = NiftiImageIO
outputMetaDataStr = "ITK_FileNotes : FSL5.0
aux_file :
bitpix : 32
cal_max : 0
cal_min : 0
datatype : 16
descrip : FSL5.0
dim[0] : 3
dim[1] : 176
dim[2] : 256
dim[3] : 256
dim[4] : 1
dim[5] : 1
dim[6] : 1
dim[7] : 1
dim_info :
intent_code : 0
intent_name :
intent_p1 : 0
intent_p2 : 0
intent_p3 : 0
pixdim[0] : 1
pixdim[1] : 1
pixdim[2] : 1
pixdim[3] : 1
pixdim[4] : 5
pixdim[5] : 0
pixdim[6] : 0
pixdim[7] : 0
qform_code : 1
qoffset_x : -119.331
qoffset_y : -121.652
qoffset_z : -137.235
quatern_b : 0.0458373
quatern_c : 0.083519
quatern_d : -0.0134084
scl_inter : 0
scl_slope : 1
sform_code : 1
slice_code :
slice_duration : 0
slice_end : 0
slice_start : 0
srow_x : 0.985694 0.034349 0.165034 -119.331
srow_y : -0.019036 0.995438 -0.093489 -121.652
srow_z : -0.167493 0.0890096 0.981847 -137.235
toffset : 0
vox_offset : 352
xyzt_units :
"
suppressErrorPosting = FALSE
unresolvedFileName = $(DicomBrowserPath)/4_wmh_cases_collected/100152/t2_flair_3d.nii
}
}
module itkImageFileReader {
internal {
frame = "693 561 144 72"
moduleGroupName = Inputs:
windows {
window _default {
geometry = "1509 636 411 431"
sizeHint = "323 431"
wasOpen = no
}
}
}
fields {
instanceName = WMH_MAP_UBO
fileDataType = double
autoDetermineDataType = TRUE
correctSubVoxelShift = FALSE
fileDimension = 3
info = "Loading okay."
numDims = 3
fileType = TypeNotApplicable
componentType = double
pixelType = SCALAR
loaderType = NiftiImageIO
outputMetaDataStr = "ITK_FileNotes : FSL5.0
aux_file :
bitpix : 64
cal_max : 0
cal_min : 0
datatype : 64
descrip : FSL5.0
dim[0] : 3
dim[1] : 176
dim[2] : 256
dim[3] : 256
dim[4] : 1
dim[5] : 1
dim[6] : 1
dim[7] : 1
dim_info :
intent_code : 0
intent_name :
intent_p1 : 0
intent_p2 : 0
intent_p3 : 0
pixdim[0] : 1
pixdim[1] : 1
pixdim[2] : 1
pixdim[3] : 1
pixdim[4] : 0
pixdim[5] : 0
pixdim[6] : 0
pixdim[7] : 0
qform_code : 2
qoffset_x : -121.469
qoffset_y : -121.334
qoffset_z : -135.06
quatern_b : 0.0433895
quatern_c : 0.0885091
quatern_d : -0.0187064
scl_inter : 0
scl_slope : 1
sform_code : 2
slice_code :
slice_duration : 0
slice_end : 0
slice_start : 0
srow_x : 0.983637 0.0449048 0.174502 -121.469
srow_y : -0.0295434 0.995535 -0.0896525 -121.334
srow_z : -0.177749 0.0830299 0.980567 -135.06
toffset : 0
vox_offset : 352
xyzt_units :
"
suppressErrorPosting = FALSE
unresolvedFileName = $(DicomBrowserPath)/4_wmh_cases_collected/100152/100152_WMH_FLAIRspace.nii.gz
}
}
module Info {
internal {
frame = "589 57 184 72"
moduleGroupName = "UBO world matrix fix:"
windows {
window _default {
geometry = "683 348 618 384"
sizeHint = "618 384"
wasOpen = no
}
}
}
fields {
instanceName = INFO_WMH_MAP_UBO_FIX
}
}
module itkImageFileReader {
internal {
frame = "1061 561 144 72"
moduleGroupName = Inputs:
windows {
window _default {
geometry = "1213 346 707 431"
sizeHint = "323 431"
wasOpen = no
}
}
}
fields {
instanceName = WMH_PMAP_LPA
fileDataType = float
autoDetermineDataType = TRUE
correctSubVoxelShift = FALSE
fileDimension = 3
info = "Loading okay."
numDims = 3
fileType = TypeNotApplicable
componentType = float
pixelType = SCALAR
loaderType = NiftiImageIO
outputMetaDataStr = "ITK_FileNotes : Probability lesion map obtained by LPA within LST toolbox
aux_file :
bitpix : 32
cal_max : 0
cal_min : 0
datatype : 16
descrip : Probability lesion map obtained by LPA within LST toolbox
dim[0] : 3
dim[1] : 176
dim[2] : 256
dim[3] : 256
dim[4] : 1
dim[5] : 1
dim[6] : 1
dim[7] : 1
dim_info :
intent_code : 0
intent_name :
intent_p1 : 0
intent_p2 : 0
intent_p3 : 0
pixdim[0] : 1
pixdim[1] : 1
pixdim[2] : 1
pixdim[3] : 1
pixdim[4] : 0
pixdim[5] : 0
pixdim[6] : 0
pixdim[7] : 0
qform_code : 2
qoffset_x : -119.331
qoffset_y : -121.652
qoffset_z : -137.235
quatern_b : 0.0458372
quatern_c : 0.083519
quatern_d : -0.0134084
scl_inter : 0
scl_slope : 1
sform_code : 2
slice_code :
slice_duration : 0
slice_end : 0
slice_start : 0
srow_x : 0.985694 0.034349 0.165034 -119.331
srow_y : -0.0190361 0.995438 -0.0934889 -121.652
srow_z : -0.167493 0.0890095 0.981847 -137.235
toffset : 0
vox_offset : 352
xyzt_units :
"
suppressErrorPosting = FALSE
unresolvedFileName = $(DicomBrowserPath)/4_wmh_cases_collected/100152/ples_lpa_mt2_flair_3d.nii
}
}
module Info {
internal {
frame = "1037 469 168 72"
moduleGroupName = Inputs:
windows {
window _default {
geometry = "55 777 618 384"
sizeHint = "618 384"
wasOpen = no
}
}
}
fields {
instanceName = INFO_WMH_PMAP_LPA
}
}
module Threshold {
internal {
frame = "1211 -230 160 88"
moduleGroupName = "Intermediate calculations:"
showNetworkPanel = true
windows {
window _default {
geometry = "2736 490 312 292"
sizeHint = "274 292"
wasOpen = no
}
}
}
fields {
instanceName = Threshold_LPA_PMAP
threshold = 0.05
relativeThreshold = FALSE
comparisonOperator = GreaterEqual
conditionTrueWriteValue = UserDef
userConditionTrueValue = 1
conditionFalseWriteValue = UserDef
userConditionFalseValue = 0
}
}
module SynchroView2D {
internal {
frame = "1033 -328 184 72"
moduleGroupName = "Intermediate calculations:"
windows {
window _default {
geometry = "2477 361 804 400"
sizeHint = "804 400"
wasOpen = no
}
}
}
fields {
instanceName = SYNC_2D_VIEW_LPA_MOD
leftInventorInputOn = FALSE
rightInventorInputOn = FALSE
synchSlicing = TRUE
synchZooming = TRUE
synchTiming = TRUE
synchLUTs = FALSE
disconnectOnHide = TRUE
hiResRendering = FALSE
snapToCenter1 = FALSE
snapToCenter2 = FALSE
slice1 = 26
timepoint1 = 0
filterMode = FILTER_LINEAR
slice2 = 26
timepoint2 = 0
lut1w = 0.970340728759766
lut1c = 0.485170364379883
lut2w = 1
lut2c = 0.5
annotationColor = "0.899999976158142 0.899999976158142 0.899999976158142"
borderOn = FALSE
drawCurrentPos = FALSE
showCurrentPos = FALSE
worldPosition = "-8.59580993652344 14.0424690246582 85.9715423583984"
background = "0 0 0"
}
}
module Info {
internal {
frame = "1061 -448 208 72"
moduleGroupName = "Intermediate calculations:"
windows {
window _default {
geometry = "1302 776 618 384"
sizeHint = "618 384"
wasOpen = no
}
}
}
fields {
instanceName = INFO_THRESHOLD_LPA_PMAP
}
}
module CalculateVolume {
internal {
frame = "485 -811 192 88"
moduleGroupName = "Volume calculations:"
showNetworkPanel = true
windows {
window _default {
geometry = "765 506 382 261"
sizeHint = "382 261"
wasOpen = no
}
}
}
fields {
instanceName = CalculateVolume_UBO
minMode = UserDefined
intMin = 0.5
maxMode = UserDefined
intMax = 1
autoUpdate = TRUE
unit = Voxels
factor = 1
userTimepoint = 0
curveType = Line
curveStyle = 0
}
}
module Arithmetic2 {
internal {
frame = "1453 -472 176 88"
moduleGroupName = "Intermediate calculations:"
showNetworkPanel = true
windows {
window _default {
geometry = "2686 515 392 93"
sizeHint = "387 93"
wasOpen = no
}
}
}
fields {
instanceName = OR_UBO_LPA_BIN_MASK
function = Or
outputImageSize = InvalidateOutputIfSizesDiffer
constant = 0
autoReplicate = FALSE
}
}
module CalculateVolume {
internal {
frame = "693 -811 192 88"
moduleGroupName = "Volume calculations:"
showNetworkPanel = true
windows {
window _default {
geometry = "1259 484 382 261"
sizeHint = "382 261"
wasOpen = no
}
}
}
fields {
instanceName = CalculateVolume_LPA
minMode = UserDefined
intMin = 0.5
maxMode = UserDefined
intMax = 1
autoUpdate = TRUE
unit = Voxels
factor = 1
userTimepoint = 0
curveType = Line
curveStyle = 0
}
}
module CalculateVolume {
internal {
frame = "897 -811 216 88"
moduleGroupName = "Volume calculations:"
showNetworkPanel = true
windows {
window _default {
geometry = "1198 459 382 261"
sizeHint = "382 261"
wasOpen = no
}
}
}
fields {
instanceName = CalculateVolume_UBOLPA
minMode = UserDefined
intMin = 0.5
maxMode = UserDefined
intMax = 1
autoUpdate = TRUE
unit = Voxels
factor = 1
userTimepoint = 0
curveType = Line
curveStyle = 0
}
}
module Info {
internal {
frame = "1629 -456 208 72"
moduleGroupName = "Intermediate calculations:"
windows {
window _default {
geometry = "1302 327 618 405"
sizeHint = "618 384"
wasOpen = no
}
}
}
fields {
instanceName = INFO_OR_UBO_LPA_BIN_MASK
}
}
module itkImageFileWriter {
internal {
frame = "1425 -875 208 72"
moduleGroupName = "Save remaining 2 masks:"
windows {
window _default {
geometry = "1156 416 764 418"
sizeHint = "293 418"
wasOpen = no
}
}
}
fields {
instanceName = SAVE_THRESHOLD_LPA_PMAP
useCompression = FALSE
correctSubVoxelShift = FALSE
forceDirectionCosineWrite = TRUE
outputVoxelType = Automatic
info = ""
unresolvedFileName = $(DicomBrowserPath)/4_wmh_cases_collected/100152/LPA_wmh_map.nii.gz
}
}
module itkImageFileWriter {
internal {
frame = "1669 -875 216 72"
moduleGroupName = "Save remaining 2 masks:"
windows {
window _default {
geometry = "2733 352 359 418"
sizeHint = "293 418"
wasOpen = no
}
}
}
fields {
instanceName = SAVE_OR_UBO_LPA_BIN_MASK
useCompression = FALSE
correctSubVoxelShift = FALSE
forceDirectionCosineWrite = TRUE
outputVoxelType = Automatic
info = ""
unresolvedFileName = $(DicomBrowserPath)/4_wmh_cases_collected/100152/OR_UBO_LPA_wmh_map.nii.gz
}
}
connections {
SAVE_WMH_MAP_UBO_FIX.input0 = FORWARD_REF_TO_SOURCE.output0
INFO_T2_FLAIR.input0 = T2_FLAIR.output0
INFO_WMH_MAP_UBO.input0 = WMH_MAP_UBO.output0
FORWARD_REF_TO_SOURCE.input0 = WMH_MAP_UBO.output0
FORWARD_REF_TO_SOURCE.input1 = T2_FLAIR.output0
INFO_WMH_MAP_UBO_FIX.input0 = FORWARD_REF_TO_SOURCE.output0
INFO_WMH_PMAP_LPA.input0 = WMH_PMAP_LPA.output0
Threshold_LPA_PMAP.input0 = WMH_PMAP_LPA.output0
SYNC_2D_VIEW_LPA_MOD.inImage1 = WMH_PMAP_LPA.output0
SYNC_2D_VIEW_LPA_MOD.inImage2 = Threshold_LPA_PMAP.output0
INFO_THRESHOLD_LPA_PMAP.input0 = Threshold_LPA_PMAP.output0
CalculateVolume_UBO.input0 = FORWARD_REF_TO_SOURCE.output0
OR_UBO_LPA_BIN_MASK.input0 = FORWARD_REF_TO_SOURCE.output0
OR_UBO_LPA_BIN_MASK.input1 = Threshold_LPA_PMAP.output0
CalculateVolume_LPA.input0 = Threshold_LPA_PMAP.output0
CalculateVolume_UBOLPA.input0 = OR_UBO_LPA_BIN_MASK.output0
INFO_OR_UBO_LPA_BIN_MASK.input0 = OR_UBO_LPA_BIN_MASK.output0
SAVE_THRESHOLD_LPA_PMAP.input0 = Threshold_LPA_PMAP.output0
SAVE_OR_UBO_LPA_BIN_MASK.input0 = OR_UBO_LPA_BIN_MASK.output0
}
networkModel {
parentItems {
0 {
MLABNetworkModelItem MLABNetworkModelItemGroup {
uniqueId = 17
objectName = "UBO world matrix fix:"
parentUniqueId = 0
color {
r = 59
g = 142
b = 123
a = 40
}
}
MLABNetworkModelItem MLABNoteItem {
uniqueId = 68
objectName = ""
parentUniqueId = 17
frame = "793 53 200 200"
backgroundColor {
r = 247
g = 221
b = 91
a = 255
}
text = "This part is only to ensure that the world matrix in WMH_MAP_UBO from the UBO Detector algorithm is the same as T2_FLAIR and WMH_PMAP_LPA."
richText = "*<html>
<head>
<style type="text/css">
a.headerlink {
visibility: hidden;
}
table {
border-collapse: collapse;
}
</style>
</head>
<body>
<p>This part is only to ensure that the world matrix in WMH_MAP_UBO from the UBO Detector algorithm is the same as T2_FLAIR and WMH_PMAP_LPA.</p>
</body>
</html>*"
titleText = Note:
isCollapsed = False
drawAsComment = False
titleFrame = "798 58 190 22"
}
MLABNetworkModelItem MLABNetworkModelItemGroup {
uniqueId = 37
objectName = Inputs:
parentUniqueId = 0
color {
r = 52
g = 144
b = 16
a = 40
}
}
MLABNetworkModelItem MLABNoteItem {
uniqueId = 106
objectName = ""
parentUniqueId = 37
frame = "1000 653 200 200"
backgroundColor {
r = 247
g = 221
b = 91
a = 255
}
text = "The specific input names have to be specified in the RunPythonScript.
Data types are (inefficiently, but robustly) set to automatic detection since intensity range and use of float/integer may vary."
richText = "*<html>
<head>
<style type="text/css">
a.headerlink {
visibility: hidden;
}
table {
border-collapse: collapse;
}
</style>
</head>
<body>
<p>The specific input names have to be specified in the RunPythonScript.</p>
<p>Data types are (inefficiently, but robustly) set to automatic detection since intensity range and use of float/integer may vary.</p>
</body>
</html>*"
titleText = "Input note:"
isCollapsed = False
drawAsComment = False
titleFrame = "1005 658 190 22"
}
MLABNetworkModelItem MLABNetworkModelItemGroup {
uniqueId = 66
objectName = "Code: HERE!"
parentUniqueId = 0
color {
r = 250
g = 0
b = 6
a = 40
}
}
MLABNetworkModelItem MLABNoteItem {
uniqueId = 69
objectName = ""
parentUniqueId = 66
frame = "1268 525 200 200"
backgroundColor {
r = 247
g = 221
b = 91
a = 255
}
text = "The RunPythonScript module is what ensures automatic iteration through all relevant files in a specific base directory. Do check that the initializing code part is correct with regards to your own data.
Further comments about the code is in the module itself."
richText = "*<html>
<head>
<style type="text/css">
a.headerlink {
visibility: hidden;
}
table {