forked from ChristianGaser/cat12
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cat_conf_extopts.m
1206 lines (1105 loc) · 61.2 KB
/
cat_conf_extopts.m
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
function extopts = cat_conf_extopts(expert,spm)
% Configuration file for extended CAT options
%
% ______________________________________________________________________
%
% Christian Gaser, Robert Dahnke
% Structural Brain Mapping Group (https://neuro-jena.github.io)
% Departments of Neurology and Psychiatry
% Jena University Hospital
% ______________________________________________________________________
% $Id$
%#ok<*AGROW>
if ~exist('expert','var')
expert = 0; % switch to de/activate further GUI options
end
if ~exist('spm','var')
spm = 0; % SPM segmentation input
end
%_______________________________________________________________________
% options for output
%-----------------------------------------------------------------------
vox = cfg_entry;
vox.tag = 'vox';
vox.name = 'Voxel size for normalized images';
vox.strtype = 'r';
vox.num = [1 1];
vox.def = @(val)cat_get_defaults('extopts.vox', val{:});
vox.help = {
'The (isotropic) voxel sizes of any spatially normalised written images. A non-finite value will be replaced by the average voxel size of the tissue probability maps used by the segmentation.'
''
};
if expert > 1
vox.num = [1 inf];
vox.help = [vox.help; {
'Developer option: '
' For multiple values the first value is used for the final output, whereas results for the other values are saved in separate sub directories. '
''
}];
end
%------------------------------------------------------------------------
% SPM, Dartel, Shooting Template Maps
% e.g. for other species
%------------------------------------------------------------------------
darteltpm = cfg_files;
darteltpm.tag = 'darteltpm';
darteltpm.name = 'Dartel Template';
darteltpm.def = @(val)cat_get_defaults('extopts.darteltpm', val{:});
darteltpm.num = [1 1];
darteltpm.filter = 'image';
darteltpm.ufilter = 'Template_1';
darteltpm.help = {
'Select the first of six images (iterations) of a Dartel template. The Dartel template must be in multi-volume (5D) nifti format and should contain GM and WM segmentations. '
''
'Please note that the use of an own Dartel template will result in deviations and unreliable results for any ROI-based estimations because the atlases will differ and any ROI processing will be therefore deselected.'
''
};
%---------------------------------------------------------------------
shootingtpm = cfg_files;
shootingtpm.tag = 'shootingtpm';
shootingtpm.name = 'Shooting Template';
shootingtpm.def = @(val)cat_get_defaults('extopts.shootingtpm', val{:});
shootingtpm.num = [1 1];
shootingtpm.filter = 'image';
shootingtpm.ufilter = 'Template_0';
shootingtpm.help = {
'Select the first of five images (iterations) of a Shooting template. The Shooting template must be in multi-volume (5D) nifti format and should contain GM, WM, and background segmentations and have to be saved with at least 16 bit. '
''
'Please note that the use of an own Shooting template will result in deviations and unreliable results for any ROI-based estimations because the atlases will differ and any ROI processing will be therefore deselected.'
''
};
%------------------------------------------------------------------------
cat12atlas = cfg_files;
cat12atlas.tag = 'cat12atlas';
cat12atlas.name = 'CAT12 ROI atlas';
cat12atlas.filter = 'image';
cat12atlas.ufilter = 'cat';
cat12atlas.def = @(val)cat_get_defaults('extopts.cat12atlas', val{:});
cat12atlas.num = [1 1];
cat12atlas.help = {
'CAT12 atlas file to handle major regions.'
};
%------------------------------------------------------------------------
brainmask = cfg_files;
brainmask.tag = 'brainmask';
brainmask.name = 'Brainmask';
brainmask.filter = 'image';
brainmask.ufilter = 'brainmask';
brainmask.def = @(val)cat_get_defaults('extopts.brainmask', val{:});
brainmask.num = [1 1];
brainmask.help = {
'Initial brainmask.'
};
%------------------------------------------------------------------------
T1 = cfg_files;
T1.tag = 'T1';
T1.name = 'T1';
T1.filter = 'image';
T1.ufilter = 'T1';
T1.def = @(val)cat_get_defaults('extopts.T1', val{:});
T1.num = [1 1];
T1.help = {
'Affine registration template.'
};
%---------------------------------------------------------------------
% boundary box
bb = cfg_entry;
bb.strtype = 'r';
bb.num = [inf inf];
bb.tag = 'bb';
bb.name = 'Bounding box';
bb.def = @(val)cat_get_defaults('extopts.bb', val{:});
bb.hidden = expert < 1;
bb.help = {
'The bounding box describes the dimensions of the volume to be written starting from the anterior commissure in mm. It should include the entire brain (or head in the case of the Boundary Box of the SPM TPM) and additional space for smoothing the image. The MNI 9-mm boundary box is optimized for CATs MNI152NLin2009cAsym template and supports filter cores up to 10 mm. Although this box support 12 mm filter sizes theoretically, slight interference could occur at the edges and larger boxes are recommended for safety. '
'Additionally, it is possible to use the boundary box of the TPM or the template for special (animal) templates with strongly different boundary boxes. '
''
'The boundary box or its id (BBid see table below) has to be entered. '
''
' NAME BBID BOUNDARY BOX SIZE ? FILESIZE $ '
' TMP BB 0 boundary box of the template (maybe too small for smoothing!) '
' TPM BB 1 boundary box of the TPM '
' MNI SPM 16 [ -90 -126 -72; 90 90 108 ] [121x145x121] 4.2 MB (100%)'
' MNI CAT 12 [ -84 -120 -72; 84 84 96 ] [113x139x113] 3.8 MB ( 84%)'
' ? - for 1.5 mm; $ - for 1.5 mm uint8'
''
};
%---------------------------------------------------------------------
if expert==0
regstr = cfg_menu;
regstr.labels = {
'Optimized Shooting'
'Default Shooting'
};
regstr.values = {0.5 4}; % special case 0 = 0.5 due to Dartel default seting
regstr.help = [regstr.help; { ...
'For spatial registration CAT offers the use of the Dartel (Ashburner, 2008) and Shooting (Ashburner, 2011) registrations to an existing template. Furthermore, an optimized shooting approach is available that uses an adaptive threshold and lower initial resolutions to obtain a good tradeoff between accuracy and calculation time. The CAT default templates were obtained by standard Dartel/Shooting registration of 555 IXI subjects between 20 and 80 years. '
'The registration time is typically about 3, 10, and 5 minutes for Dartel, Shooting, and optimized Shooting for the default registration resolution. '
''
}];
elseif expert==1
regstr = cfg_menu;
regstr.labels = {
'Default Shooting (4)'
'Optimized Shooting - vox (5)'
'Optimized Shooting - fast (eps)'
'Optimized Shooting - standard (0.5)'
'Optimized Shooting - fine (1.0)'
'Optimized Shooting - strong (11)'
'Optimized Shooting - medium (12)'
'Optimized Shooting - soft (13)'
};
regstr.values = {4 5 eps 0.5 1.0 11 12 13}; % special case 0 = 0.5 due to Dartel default seting
regstr.help = [regstr.help; { ...
'The strength of the optimized Shooting registration depends on the stopping criteria (controlled by the "extopts.regstr" parameter) and by the final registration resolution that can be given by the template (fast,standard,fine), as fixed value (hard,medium,soft), or (iii) by the output resolution (vox). In general the template resolution is the best choice to allow an adaptive normalization depending on the individual anatomy with some control of the calculation time. Fixed resolution allows to roughly define the degree of normalization for all images with 2.0 mm for smoother and 1.0 mm for stronger deformations. For special cases the registration resolution can also be set by the output resolution controlled by the "extopts.vox" parameter. '
''
' 0 .. "Dartel"'
' 4 .. "Default Shooting"'
' 5 .. "Optimized Shooting - vox" .. vox/2:vox/4:vox'
''
' eps .. "Optimized Shooting - fast" .. TR/2:TR/4:TR (avg. change rate)'
' 0.5 .. "Optimized Shooting - standard" .. TR/2:TR/4:TR (avg. change rate)'
' 1.0 .. "Optimized Shooting - fine" .. TR/2:TR/4:TR (small change rate)'
''
' 11 .. "Optimized Shooting - strong" .. max( 1.0 , [3.0:0.5:1.0] )'
' 22 .. "Optimized Shooting - medium" .. max( 1.5 , [3.0:0.5:1.0] )'
' 23 .. "Optimized Shooting - soft" .. max( 2.0 , [3.0:0.5:1.0] )'
}];
else
% allow different registrations settings by using a matrix
regstr = cfg_entry;
regstr.strtype = 'r';
regstr.num = [1 inf];
regstr.help = [regstr.help; { ...
'"Default Shooting" runs the original Shooting approach for existing templates and takes about 10 minutes per subject for 1.5 mm templates and about 1 hour for 1.0 mm. '
'The "Optimized Shooting" approach uses lower spatial resolutions in the first iterations and an adaptive stopping criteria that allows faster processing of about 6 minutes for 1.5 mm and 15 minutes for 1.0 mm. '
''
'In the development modus the deformation levels are set by the following values (TR=template resolution) ...'
' 0 .. "Use Dartel" '
' eps - 1 .. "Optimized Shooting" with lower (eps; fast) to higher quality (1; slow; default 0.5)'
' 2 .. "Optimized Shooting" .. 3:(3-TR)/4:TR'
' 3 .. "Optimized Shooting" .. TR/2:TR/4:TR'
' 4 .. "Default Shooting" .. only TR'
' 5 .. "Optimized vox Shooting " .. vox/2:vox/4:vox'
' 6 .. "Optimized Shooting - hydrocephalus (6)"'
' Use many iterations! Very slow! Use k-means AMAP as initial Segmentation!'
''
' 10 .. "Stronger Shooting" .. max( 0.5 , [2.5:0.5:0.5] )'
' 11 .. "Strong Shooting" .. max( 1.0 , [3.0:0.5:1.0] )'
' 12 .. "Medium Shooting" .. max( 1.5 , [3.0:0.5:1.0] )'
' 13 .. "Soft Shooting" .. max( 2.0 , [3.0:0.5:1.0] )'
' 14 .. "Softer Shooting" .. max( 2.5 , [3.0:0.5:1.0] )'
' 15 .. "Supersoft Shooting" .. max( 3.0 , [3.0:0.5:1.0] )'
''
' 10 .. "Stronger Shooting TR" .. max( max( 0.5 , TR ) , [2.5:0.5:0.5] )'
' 21 .. "Strong Shooting TR" .. max( max( 1.0 , TR ) , [3.0:0.5:1.0] )'
' 22 .. "Medium Shooting TR" .. max( max( 1.5 , TR ) , [3.0:0.5:1.0] )'
' 23 .. "Soft Shooting TR" .. max( max( 2.0 , TR ) , [3.0:0.5:1.0] )'
' 24 .. "Softer Shooting TR" .. max( max( 2.5 , TR ) , [3.0:0.5:1.0] )'
' 25 .. "Softer Shooting TR" .. max( max( 3.0 , TR ) , [3.0:0.5:1.0] )'
''
'Double digit variants runs only for a limited resolutions and produce softer maps. The cases with TR are further limited by the template resolution and to avoid additional interpolation. '
''
'For each given value a separate deformation process is started in inverse order and saved in subdirectories. The first given value that runs last will be used in the following CAT processing. '
''
}];
end
regstr.tag = 'regstr';
if cat_get_defaults('extopts.regstr')>0
regstr.def = @(val)cat_get_defaults('extopts.regstr',val{:});
else
regstr.val = {0.5};
end
regstr.name = 'Method';
%---------------------------------------------------------------------
dartel = cfg_branch;
dartel.tag = 'dartel';
dartel.name = 'Dartel Registration';
dartel.val = {darteltpm};
dartel.help = {
'Classical Dartel (Ashburner, 2008) registrations to a existing template. The CAT default templates were obtained by standard Dartel registration of 555 IXI subjects between 20 and 80 years. '
''
};
shooting = cfg_branch;
shooting.tag = 'shooting';
shooting.name = 'Shooting Registration';
shooting.val = {shootingtpm regstr};
shooting.help = {
'Shooting (Ashburner, 2011) registrations to a existing template. Furthermore, an optimized shooting approach is available that use adaptive threshold and lower initial resolution to improve accuracy and calculation time at once. The CAT default templates were obtained by standard Shooting registration of 555 IXI subjects between 20 and 80 years. '
''
};
% only allow Shooting in default mode
if expert==0
registration = cfg_choice;
registration.tag = 'registration';
registration.name = 'Spatial Registration';
registration.values = {shooting};
registration.val = {shooting};
else
if expert==1
method = cfg_choice;
method.tag = 'regmethod';
method.name = 'Spatial Registration Method';
method.values = {dartel shooting};
if cat_get_defaults('extopts.regstr')==0
method.val = {dartel};
else
method.val = {shooting};
end
end
registration = cfg_branch;
registration.tag = 'registration';
registration.name = 'Spatial Registration Options';
if expert==2
registration.val = {T1 brainmask cat12atlas darteltpm shootingtpm regstr bb vox};
else
registration.val = {method vox bb};
end
end
registration.help = {
'For spatial registration CAT offers to use the classical Dartel (Ashburner, 2008) and Shooting (Ashburner, 2011) registrations to a existing template. Furthermore, an optimized shooting approach is available that use adaptive threshold and lower initial resolution to improve accuracy and calculation time at once. The CAT default templates were obtained by standard Dartel/Shooting registration of 555 IXI subjects between 20 and 80 years. '
'The registration time is typically about 3, 10, and 5 minutes for Dartel, Shooting, and optimized Shooting for the default registration resolution. '
''
};
%---------------------------------------------------------------------
% This version is not ready right now and I packed all working improvments
% (such as the Laplace-based blood-vessel-correction) into cat_surf_createCS2.
pbtver = cfg_menu;
pbtver.tag = 'pbtmethod';
pbtver.name = 'Projection-based thickness';
pbtver.labels = {'PBT','PBTx','PBT2'};
pbtver.values = {'pbt2','pbt2x','pbt3'};
pbtver.def = @(val) 'pbt2x';
pbtver.hidden = expert<2;
pbtver.help = {
['Version of the projection-based thickness (PBT) thickness and surface reconstruction approach (Dahnke et al., 2013). ' ...
'Version 2 first estimates a temporary central surface by utilizing higher CSF and lower WM boundaries to utilize the partial volume effect. ' ...
'This surface divides the GM into a lower and upper GM area where PBT is used with sulcal reconstruction in the lower and gyrus reconstruction in the upper part. ' ...
'The estimated thickness values of each part were projected over the whole GM and summed up to obtain the full thickness. ' ...
'Similar to PBT, the project-based thickness and the direct thickness (of the distance maps without sulcus/gyrus reconstruction) are combined by using the minimum. ']
''
'Experimental development parameter - do not change! '
''
};
pbtres = cfg_entry;
pbtres.tag = 'pbtres';
pbtres.name = 'Voxel size for thickness estimation';
pbtres.strtype = 'r';
pbtres.num = [1 1];
pbtres.def = @(val)cat_get_defaults('extopts.pbtres', val{:});
pbtres.help = {
'Internal isotropic resolution for thickness estimation in mm.'
''
};
% replaced by general myelination function
%{
pbtlas = cfg_menu;
pbtlas.tag = 'pbtlas';
pbtlas.name = 'Use correction for cortical myelination';
pbtlas.labels = {'No','Yes'};
pbtlas.values = {0 1};
pbtlas.def = @(val)cat_get_defaults('extopts.pbtlas', val{:});
pbtlas.help = {
'Apply correction for cortical myelination by local intensity adaptation to improve the description of the GM/WM boundary (added in CAT12.7).'
'Experimental parameter, not yet working properly!'
''
};
%}
% currently only for developer and experts ... check hidden field
% ###############################################################
SRP = cfg_menu;
SRP.tag = 'SRP';
SRP.name = 'Surface reconstruction pipeline';
if ~expert
SRP.labels = {...
'CS1 without SIC',...
'CS2 with SIC',...
};
SRP.values = {10 22};
elseif expert == 1
SRP.labels = {...
'CS1 without SIC (10)',...
'CS2 without SIC (20)',...
'CS1 with SIC (12)',...
'CS2 with SIC (22)',...
};
SRP.values = {10 20 12 22};
elseif expert > 1
SRP.labels = {...
'CS1 without SIC (10)',...
'CS1 with SIC without optimization (11)',...
'CS1 with SIC with optimization (12)',...
'CS2 without SIC (20)',...
'CS2 with SIC without optimization (21)',...
'CS2 with SIC with optimization (22)',...
};
SRP.values = {10 11 12 20 21 22};
end
SRP.help = {
['CAT uses the projection-based thickness approach (PBT; Dahnke et al., 2012) to reconstruct the central surface. ' ...
'With CAT12.8, we extensively revised the surface reconstruction pipeline (SRP), resulting in a new reconstruction scheme (CS2) that supports better control of the mesh resolution and runtime. ' ...
'Both pipelines provide high-precision reconstruction of the central surface and estimation of cortical thickness, which allows estimation of the cortical layer by transforming the surface points along the surface normals. ' ...
'In particular, this allows the estimation of white and pial surfaces by addition/subtraction of half thickness. ' ...
'Because the surface normals are modeled quite simply, the interface suffers locally from self-intersections (SIs), especially in highly convoluted regions with high GM but low CSF/WM fractions (i.e. in young subjects). ' ...
'Although these overlaps are usually not a problem in structural analyses, SIs are still inoptimal and may cause issues for mapping 3D information onto the surface. ' ...
'We have therefore developed a fast self-intersection correction (SIC) to provide accurate inner and outer surfaces. ' ...
'The SIC reduces SIs below 1% of the total area, which are also almost invisible and can be neglected. ']
''
};
SRP.def = @(val)cat_get_defaults('extopts.SRP', val{:});
SRP.hidden = expert < 1;
% Control surface mesh resolution by different pipelines.
% Major problem is that MATLAB sometimes fatally crashs in the SPM/MATLAB
% mesh reduction function. Hence, volumetric resultion is used to control
% the resultion of the created isosurfaces. However, topology correction
% used a normalized mesh with oversampling the insula.
reduce_mesh = cfg_menu;
reduce_mesh.tag = 'reduce_mesh';
reduce_mesh.name = 'Reduce Mesh';
if expert == 1
reduce_mesh.labels = { ...
'No reduction, PBT resolution (0)',...
'No reduction, optimal resolution (1)',...
'No reduction, internal resolution (2)',...
'SPM approach (5)',...
'MATLAB approach (6)'
};
reduce_mesh.values = {0 1 2 3 5 4 6};
elseif expert > 1
reduce_mesh.labels = { ...
'No reduction, PBT resolution (0)',...
'No reduction, optimal resolution (1)',...
'No reduction, internal resolution (2)',...
'SPM approach init (3)',...
'SPM approach full (5)',...
'MATLAB approach init (4)',...
'MATLAB approach full (6)'
};
reduce_mesh.values = {0 1 2 3 5 4 6};
end
reduce_mesh.def = @(val)cat_get_defaults('extopts.reduce_mesh', val{:});
reduce_mesh.hidden = expert<1;
reduce_mesh.help = {
['Limitation of the surface resolution is essential for fast processing and acurate and equaly distributed meshes. ' ...
'Mesh resolution depends in general on the voxel resolution used for surface creation and can be modified afterwards by refinment and reduction. ' ...
'However, surface mesh reduction is not trivial and we observered fatal MATLAB errors (full uncatchable crash) and freezing of the following spherical registration on some computers. ' ...
'This variable therefor controls multiple ways to handle mesh resolution in the surface creation process. ']
''
['The first setting (0) uses no reduction at all, creating the intial surface at the PBT resolution and also use no mesh reduction and is very slow. ' ...
'In general, PBT is processed at 0.5 mm and surface creation result in about 1.200k faces with a quadratic increase of processing time. ' ...
'However, this resolution is not necessary for nearly all analysis that often takes place at meshes with 164k (FreeSurfer) or 32k (HCP). ']
...
['Option (1) and (2) use volume reduction to created intial meshes on an optimal (1, depending on the final mesh resolution) or ' ...
'the internal voxel-resolution (2, depending on your image resolution). ' ...
'In both cases the maps are refined and further adapted to the PBT position map with a final mesh resolution of about 300k. '];
''
['Surface-based reduction by SPM (3,5) or MATLAB (4,6) are used to optimize the initial surface, supporing a fast but still accurate topology correction. ' ...
'Although this option support best quality, both the SPM and the MATLAB function can cause unreproducable MATLAB crash and are therefore not used yet! ' ...
'After topology correction the resolution of the mesh is increased again and adapted for PBT position map. ' ...
'In option 3 and 4, a supersampling with following reduction is used to obtain an optimal equally distributed sampling. ' ...
'However, some systems showed problems in the spherical registration (freezing) that seamed to depend on these severe modifications of the mesh. ' ...
'Hence, option (1) and (2) only use a normal refinement without supersampling.']
''
'These settings are still in developent!'
''
};
% Expert parameter to control the number of mesh elements and processing
% time. 200k surfaces support good quality in relation to processing time,
% because surface reconstruction times are dominated by the registration
% that depends on the mesh resolution of the individual and template brain.
% A fast version with 100k was tested but showed different problems and is
% relatively slow (70% of the default) and at the end too risky for the low benefit.
% The parameter is the square of the refinement distance but for surface
% creation by the volume-resolution, a general limit of 1.5 mm exist, where
% lower resolution (e.g. 2 mm) can cause problems in thin structures.
vdist = cfg_menu;
vdist.tag = 'vdist';
vdist.name = 'Mesh resolution';
vdist.labels = {'optimal (2)','fine (1)','extra fine (0.5)'};
vdist.values = {2 1 0.5};
vdist.def = @(val)cat_get_defaults('extopts.vdist', val{:});
vdist.hidden = expert<1;
vdist.help = {
['Higher mesh resolution may support indipendent measuresments but also increase the chance of self-intersections. ' ...
'For each level, the mesh resolution (number of elements) is doubled and accuracy is increased slightly (by the square root). ' ...
'The depends in addition on the "reduce mesh" parameter. ']
['The mesh resolution is defined by an absolute resolution (e.g. 1 point per 1 mm) and smaller surfaces have therefore a smaller number of total mesh elements. ' ...
'']
''
' Setting distance limit between vertices number faces'
' ------------------------------------------------------------'
' optimal: 1.41 mm ~200k'
' fine: 1.00 mm ~400k'
' extra fine: 0.71 mm ~800k'
''
'Experimental parameter that only works for "SRP>=20" (CAT12.8, 202003)!'
''
};
%------------------------------------------------------------------------
% special expert and developer options
%------------------------------------------------------------------------
lazy = cfg_menu;
lazy.tag = 'lazy';
lazy.name = 'Lazy processing';
lazy.labels = {'Yes - check only output','Yes - check parameter and output','No'};
lazy.values = {2,1,0};
lazy.val = {0};
lazy.help = {
'Do not process data if the result already exists (and were created with the same parameters). '
};
experimental = cfg_menu;
experimental.tag = 'experimental';
experimental.name = 'Use experimental code';
experimental.labels = {'No','Yes'};
experimental.values = {0 1};
experimental.def = @(val)cat_get_defaults('extopts.experimental', val{:});
experimental.hidden = expert<2;
experimental.help = {
'Use experimental code and functions.'
''
'WARNING: This parameter is only for developer and will call functions that are not safe and may change in future versions!'
''
};
ignoreErrors = cfg_menu;
ignoreErrors.tag = 'ignoreErrors';
ignoreErrors.name = 'Error handling';
ignoreErrors.help = {
['Try to catch preprocessing errors and continue with the next data set or ignore all warnings (e.g., bad intensities) ' ...
'and use an experimental pipeline which is still in development. ' ...
'In case of errors, CAT continues with the next subject if this option is enabled. ' ...
'If the experimental option with backup functions is selected and warnings occur, CAT will try to use backup routines ' ...
'and skip some processing steps which require good T1 contrasts (e.g., LAS). ' ...
'If you want to avoid processing of critical data and ensure that only the main pipeline is used ' ...
'then select the option "Ignore errors (continue with the next subject)". ' ...
'It is strongly recommended to check for preprocessing problems, especially with non-T1 contrasts. ']
};
if expert
% The case 2 is trying to run all function and then catch errors but it
% is maybe not really clear at what point it crash and what state the
% variables have. To test the backup pipeline directly use value 3. In
% low contrast cases it is maybe better to avoid the AMAP completely (4).
% Although, there is a routine to identify problematic AMAP cases this is
% quite new and may not working.
ignoreErrors.labels = {'Interrupt on errors (0)','Ignore errors (continue with the next subject, 1)','Ignore errors (use backup functions - IN DEVELOPMENT, 2)',...
'Ignore errors (always use backup functions, 3)','Ignore errors (always use backup functions without AMAP, 4)'};
ignoreErrors.values = {0 1 2 3 4};
ignoreErrors.help = [ignoreErrors.help {'The last two options were designed to test the backup funnction with/without AMAP (experimental!)'}];
else
ignoreErrors.labels = {'Interrupt on errors','Ignore errors (continue with the next subject)','Ignore errors (use backup functions - IN DEVELOPMENT)'};
ignoreErrors.values = {0 1 2};
end
ignoreErrors.def = @(val)cat_get_defaults('extopts.ignoreErrors', val{:});
verb = cfg_menu;
verb.tag = 'verb';
verb.name = 'Verbose processing level';
verb.labels = {'none','default','details'};
verb.values = {0 1 2};
verb.def = @(val)cat_get_defaults('extopts.verb', val{:});
verb.help = {
'Verbose processing.'
};
print = cfg_menu;
print.tag = 'print';
print.name = 'Create CAT report';
print.labels = {'No','Yes (volume only)','Yes (volume and surfaces)'};
print.values = {0 1 2};
print.def = @(val)cat_get_defaults('extopts.print', val{:});
print.help = {
'Create final CAT report that requires Java.'
};
%---------------------------------------------------------------------
% Resolution
%---------------------------------------------------------------------
resnative = cfg_branch;
resnative.tag = 'native';
resnative.name = 'Native resolution ';
resnative.help = {
'Preprocessing with native resolution.'
''
'Examples:'
' native resolution internal resolution '
' 0.95 0.95 1.05 > 0.95 0.95 1.05'
' 0.45 0.45 1.70 > 0.45 0.45 1.70'
' 2.00 2.00 2.00 > 2.00 2.00 2.00'
''
};
resbest = cfg_entry;
resbest.tag = 'best';
resbest.name = 'Best native resolution';
resbest.def = @(val)cat_get_defaults('extopts.resval', val{:});
resbest.num = [1 2];
resbest.help = {
'Preprocessing with the best (minimal) voxel dimension of the native image. The first parameters defines the lowest spatial resolution for every dimension, while the second defines a tolerance range to avoid tiny interpolations for almost correct resolutions. '
''
'Examples:'
' Parameters native resolution internal resolution'
' [1.00 0.10] 0.95 1.05 1.25 > 0.95 1.05 1.00'
' [1.00 0.10] 0.95 1.05 1.05 > 0.95 1.05 1.05'
' [1.00 0.20] 0.45 0.45 1.50 > 0.45 0.45 1.00'
' [0.75 0.20] 0.45 0.45 1.50 > 0.45 0.45 0.75'
' [0.75 0.00] 0.45 0.45 0.80 > 0.45 0.45 0.80'
''
};
resfixed = cfg_entry;
resfixed.tag = 'fixed';
resfixed.name = 'Fixed resolution';
resfixed.val = {[1.0 0.1]};
resfixed.num = [1 2];
resfixed.help = {
'This option sets an isotropic voxel size that is controlled by the first parameter, whereas the second parameter defines a tolerance range to avoid tiny interpolations for almost correct resolutions. The fixed resolution option can also be used to improve preprocessing stability and speed of high resolution data, for instance protocols with high in-plane resolution and large slice thickness (e.g. 0.5x0.5x1.5 mm) and atypical spatial noise pattern. '
''
'Examples: '
' Parameters native resolution internal resolution'
' [1.00 0.10] 0.45 0.45 1.70 > 1.00 1.00 1.00'
' [1.00 0.10] 0.95 1.05 1.25 > 0.95 1.05 1.00'
' [1.00 0.02] 0.95 1.05 1.25 > 1.00 1.00 1.00'
' [0.75 0.10] 0.75 0.95 1.25 > 0.75 0.75 0.75'
''
};
resopt = cfg_entry;
resopt.tag = 'optimal';
resopt.name = 'Optimal resolution';
resopt.def = @(val)cat_get_defaults('extopts.resval', val{:});
resopt.num = [1 2];
resopt.help = {
'Preprocessing with an "optimal" voxel dimension that utilize the median and the volume of the voxel size for special handling of anisotropic images. In many cases, untypically high slice-resolution (e.g. 0.5 mm for 1.5 Tesla) comes along with higher slice-thickness and increased image interferences. Our tests showed that a simple interpolation to the best voxel resolution not only resulted in much longer calculation times but also in a poor segmenation (and surface reconstruction) compared to the fixed option with e.g. 1 mm. Hence, this option tries to incooperate the voxel volume and its anisotropy to balance the internal resolution. E.g., an image with 0.5x0.5x1.5 mm will resampled at a resolution of 0.9x0.9x0.9 mm. '
'The first parameters defines the lowest spatial resolution, while the second defines a tolerance range to avoid tiny interpolations for almost correct resolutions. '
''
'Examples:'
' Parameters native resolution internal resolution'
' [1.00 0.10] 0.95 1.05 1.25 > 0.95 1.05 1.00'
' [1.00 0.30] 0.95 1.05 1.25 > 0.95 1.05 1.25'
' [1.00 0.10] 0.80 0.80 1.00 > 0.80 0.80 1.00'
' [1.00 0.10] 0.50 0.50 2.00 > 1.00 1.00 1.00'
' [1.00 0.10] 0.50 0.50 1.50 > 0.90 0.90 0.90'
' [1.00 0.10] 0.80 1.00 1.00 > 1.00 1.00 1.00'
' [1.00 0.30] 0.80 1.00 1.00 > 0.80 1.00 1.00'
''
};
restype = cfg_choice;
restype.tag = 'restypes';
restype.name = 'Internal resampling for preprocessing';
switch cat_get_defaults('extopts.restype')
case 'native', restype.val = {resnative};
case 'best', restype.val = {resbest};
case 'fixed', restype.val = {resfixed};
case 'optimal', restype.val = {resopt};
end
if ~expert
restype = cfg_menu;
restype.tag = 'restypes';
restype.name = 'Internal resampling for preprocessing';
restype.labels = {
'Optimal'
'Fixed 1.0 mm'
'Fixed 0.8 mm'
'Native'
};
restype.values = {struct('optimal', cat_get_defaults('extopts.resval')) ...
struct('fixed', [1.0 0.1]) ...
struct('fixed', [0.8 0.1]) ...
struct('native', [])};
restype.val = {struct(cat_get_defaults('extopts.restype'), cat_get_defaults('extopts.resval'))};
% add default value to selection if not yet included
found = 0;
for i=1:numel(restype.values)
if isfield(restype.values{i},cat_get_defaults('extopts.restype'))
if restype.values{i}.(cat_get_defaults('extopts.restype')) == cat_get_defaults('extopts.resval')
found = 1;
end
end
end
if ~found, restype.values{end+1} = restype.val{1}; end
restype.help = {
'The default "optimal" image resolution offers a good trade-off between optimal quality and preprocessing time and memory demands. This interpolation prefers an isotropic voxel size controlled by the median voxel size and a volume term that penalizes highly anisotropic voxels. Standard structural data with a voxel resolution around 1 mm or even data with high in-plane resolution and large slice thickness (e.g. 0.5x0.5x1.5 mm) will benefit from this setting. If you have higher native resolutions the highres option "Fixed 0.8 mm" will sometimes offer slightly better preprocessing quality with an increase of preprocessing time and memory demands. In case of even higher resolutions and high signal-to-noise ratio (e.g. for 7 T data) the "native" option will process the data on the original native resolution. '
''
};
else
restype.values = {resopt resnative resbest resfixed};
restype.help = {
'The default "optimal" image resolution offers a good trade-off between optimal quality and preprocessing time and memory demands. This interpolation prefers an isotropic voxel size controlled by the median voxel size and a volume term that penalizes highly anisotropic voxels. Standard structural data with a voxel resolution around 1 mm or even data with high in-plane resolution and large slice thickness (e.g. 0.5x0.5x1.5 mm) will benefit from this setting. If you have higher native resolutions the highres option "Fixed 0.8 mm" will sometimes offer slightly better preprocessing quality with an increase of preprocessing time and memory demands. In case of even higher resolutions and high signal-to-noise ratio (e.g. for 7 T data) the "native" option will process the data on the original native resolution. '
''
};
end
%------------------------------------------------------------------------
% AMAP MRF Filter (expert)
%------------------------------------------------------------------------
mrf = cfg_menu; %
mrf.tag = 'mrf';
mrf.name = 'Strength of MRF noise correction';
mrf.labels = {'none','light','medium','strong','auto'};
mrf.values = {0 0.1 0.2 0.3 1};
mrf.def = @(val)cat_get_defaults('extopts.mrf', val{:});
mrf.hidden = expert<2;
mrf.help = {
'Strength of the MRF noise correction of the AMAP segmentation. '
''
};
%------------------------------------------------------------------------
% Cleanup
%------------------------------------------------------------------------
cleanupstr = cfg_menu;
cleanupstr.tag = 'cleanupstr';
cleanupstr.name = 'Strength of Final Clean Up';
cleanupstr.def = @(val)cat_get_defaults('extopts.cleanupstr', val{:});
if ~expert
cleanupstr.labels = {'none','light','medium','strong'};
cleanupstr.values = {0 0.25 0.50 0.75};
cleanupstr.help = {
'Strength of tissue cleanup after AMAP segmentation. The cleanup removes remaining meninges and corrects for partial volume effects in some regions. If parts of brain tissue were missing then decrease the strength. If too many meninges are visible then increase the strength. '
''
};
else
cleanupstr.labels = {'none (0)','light (0.25)','medium (0.50)','strong (0.75)','heavy (1.00)'};
cleanupstr.values = {0 0.25 0.50 0.75 1.00};
cleanupstr.help = {
'Strength of tissue cleanup after AMAP segmentation. The cleanup removes remaining meninges and corrects for partial volume effects in some regions. If parts of brain tissue were missing then decrease the strength. If too many meninges are visible then increase the strength. '
''
'The strength changes multiple internal parameters: '
' 1) Size of the correction area'
' 2) Smoothing parameters to control the opening processes to remove thin structures '
''
};
end
if expert==2
cleanupstr.labels = [cleanupstr.labels 'SPM (2.00)'];
cleanupstr.values = [cleanupstr.values 2.00];
end
%------------------------------------------------------------------------
% Skull-stripping
%------------------------------------------------------------------------
gcutstr = cfg_menu;
gcutstr.tag = 'gcutstr';
gcutstr.name = 'Skull-Stripping';
gcutstr.def = @(val)cat_get_defaults('extopts.gcutstr', val{:});
gcutstr.help = {
'Method of initial skull-stripping before AMAP segmentation. The SPM approach works quite stable for the majority of data. However, in some rare cases parts of GM (i.e. in frontal lobe) might be cut. If this happens the GCUT approach is a good alternative. GCUT is a graph-cut/region-growing approach starting from the WM area. '
'APRG (adaptive probability region-growing) is a new method that refines the probability maps of the SPM approach by region-growing techniques of the gcut approach with a final surface-based optimization strategy. This is currently the method with the most accurate and reliable results. '
'If you use already skull-stripped data you can turn off skull-stripping although this is automaticaly detected in most cases. '
'Please note that the choice of the skull-stripping method will also influence the estimation of TIV, because the methods mainly differ in the handling of the outer CSF around the cortical surface. '
''
};
if ~expert
gcutstr.labels = {'none (already skull-stripped)' 'SPM approach' 'GCUT approach' 'APRG approach'};
gcutstr.values = {-1 0 0.50 2};
else
gcutstr.labels = {'none (post-mortem CSF~BG) (-2)','none (already skull-stripped) (-1)','SPM approach (0)','GCUT medium (0.50)','APRG approach (2)',...
'APRG approach V2 (2.5)','APRG approach V2 wider (2.1)','APRG approach V2 tighter (2.9)'};
gcutstr.values = {-2 -1 0 0.50 2 2.5 2.1 2.9};
end
gcutstr.hidden = expert<1;
%------------------------------------------------------------------------
% Noise correction (expert)
%------------------------------------------------------------------------
% expert only
NCstr = cfg_menu;
NCstr.tag = 'NCstr';
NCstr.name = 'Strength of Noise Corrections';
if expert
NCstr.help = {
'Strength of the spatial adaptive (sub-resolution) non local means (SANLM) noise correction. Please note that the filter strength is automatically estimated. Change this parameter only for specific conditions. Typical values are: none (0), classic (1), light (2), medium (3|-inf), and strong (4). The "classic" option use the ordinal SANLM filter without further adaptations. The "light" option applies half of the filter strength of the adaptive "medium" cases, whereas the "strong" option uses the full filter strength, force sub-resolution filtering and applies an additional iteration. Sub-resolution filtering is only used in case of high image resolution below 0.8 mm or in case of the "strong" option. '
''
};
NCstr.labels = {'none (0)','classic (1)','light (2)','medium (3|-inf)','strong (4)'};
NCstr.values = {0 1 2 -inf 4};
else
NCstr.labels = {'none','light','medium','strong'};
NCstr.values = {0 2 -inf 4};
NCstr.help = {
'Strength of the (sub-resolution) spatial adaptive non local means (SANLM) noise correction. Please note that the filter strength is automatically estimated. Change this parameter only for specific conditions. The "light" option applies only half of the filter strength of the adaptive "medium" cases and no sub-resolution filtering. The "medium" case use the full adaptive filter strength and sub-resolution filtering in case of high image resolution below 0.8 mm. The "strong" option uses the full filter strength without adaptation, forces the sub-resolution filtering and applies an additional iteration. All cases used an anatomical depending filter strength adaptation, i.e. full (adaptive) filter strength for 1 mm data and no filtering for 2.5 mm data. '
''
};
end
NCstr.def = @(val)cat_get_defaults('extopts.NCstr', val{:});
%------------------------------------------------------------------------
% Blood Vessel Correction (expert)
%------------------------------------------------------------------------
BVCstr = cfg_menu;
BVCstr.tag = 'BVCstr';
BVCstr.name = 'Strength of Blood Vessel Corrections';
BVCstr.labels = {'none (0)','light (eps)','medium (0.50)','strong (1.00)'};
BVCstr.values = {0 eps 0.50 1.00};
BVCstr.def = @(val)cat_get_defaults('extopts.BVCstr', val{:});
BVCstr.hidden = expert<2;
BVCstr.help = {
'Strength of the Blood Vessel Correction (BVC).'
''
};
%------------------------------------------------------------------------
% Local Adaptive Segmentation
%------------------------------------------------------------------------
LASstr = cfg_menu;
LASstr.tag = 'LASstr';
LASstr.name = 'Strength of Local Adaptive Segmentation';
if ~expert
LASstr.labels = {'none','light','medium','strong'};
LASstr.values = {0 0.25 0.50 0.75};
else
LASstr.labels = {'none (0)','ultralight (eps)','light (0.25)','medium (0.50)','strong (0.75)','heavy (1.00)'};
LASstr.values = {0 eps 0.25 0.50 0.75 1.00};
end
LASstr.def = @(val)cat_get_defaults('extopts.LASstr', val{:});
LASstr.help = {
'Additionally to WM-inhomogeneities, GM intensity can vary across different regions such as the motor cortex, the basal ganglia, or the occipital lobe. These changes have an anatomical background (e.g. iron content, myelinization), but are dependent on the MR-protocol and often lead to underestimation of GM at higher intensities and overestimation of CSF at lower intensities. Therefore, a local intensity transformation of all tissue classes is used to reduce these effects in the image. This local adaptive segmentation (LAS) is applied before the final AMAP segmentation.'
''
};
LASstr.hidden = expert<1;
LASmyostr = cfg_menu;
LASmyostr.tag = 'LASmyostr';
LASmyostr.name = 'Strength of LAS myelin correction';
if ~expert
LASmyostr.labels = {'none','light','medium','strong'};
LASmyostr.values = {0 0.25 0.50 0.75};
else
LASmyostr.labels = {'none (0)','ultralight (eps)','light (0.25)','medium (0.50)','strong (0.75)','heavy (1.00)'};
LASmyostr.values = {0 eps 0.25 0.50 0.75 1.00};
end
LASmyostr.val = {0};
LASmyostr.help = {
'Add more local myelination correction of LAS based on the assumption of an equally thick cortex. '
'Please, note that because myelination increases with age this will interact with aging and atrophy in degenerative diseases. '
''
'IN DEVELOPMENT'
};
% RD202104:
% Ideally, the myelination should be used to classify the L4 (VanEssen) but
% for a sample resolution of about 1 mm the thickness estimation becomes
% more instable (depending on the metric).
LASmyostr.hidden = expert<1;
%------------------------------------------------------------------------
% WM Hyperintensities (expert)
%------------------------------------------------------------------------
wmhc = cfg_menu;
wmhc.tag = 'WMHC';
wmhc.name = 'WM Hyperintensity Correction (WMHCs)';
wmhc.def = @(val)cat_get_defaults('extopts.WMHC', val{:});
wmhc.help = {
'WARNING: Please note that the detection of WM hyperintensies is still under development and does not have the same accuracy as approaches that additionally consider FLAIR images (e.g. Lesion Segmentation Toolbox)! '
'In aging or (neurodegenerative) diseases WM intensity can be reduced locally in T1 or increased in T2/PD images. These so-called WM hyperintensies (WMHs) can lead to preprocessing errors. Large GM areas next to the ventricle can cause normalization problems. Therefore, a temporary correction for normalization is useful if WMHs are expected. CAT allows different ways to handle WMHs: '
''
' 0) No Correction (handled as GM). '
' 1) Temporary (internal) correction as WM for spatial normalization and estimation of cortical thickness. '
' 2) Permanent correction to WM. '
};
if expert
wmhc.help = [wmhc.help; {
' 3) Handling as separate class. '
''
}];
wmhc.values = {0 1 2 3};
wmhc.labels = { ...
'no correction (0)' ...
'set WMH temporary as WM (1)' ...
'set WMH as WM (2)' ...
'set WMH as own class (3)' ...
};
else
%wmhc.help = [wmhc.help; {
% ' 3) Handling as separate class. '
% ''
%}];
wmhc.values = {0 1 2}; ... 3
wmhc.labels = { ...
'no WMH correction' ...
'set WMH temporary as WM' ...
'set WMH as WM' ...
... 'set WMH as own class' ...
};
end
wmhc.hidden = expert<1;
% deactivated 20180714 because the WMHC in cat_vol_partvol did not support
% user modification yet
%{
WMHCstr = cfg_menu;
WMHCstr.tag = 'WMHCstr';
WMHCstr.name = 'Strength of WMH Correction';
WMHCstr.labels = {'none (0)','light (eps)','medium (0.50)','strong (1.00)'};
WMHCstr.values = {0 eps 0.50 1.00};
WMHCstr.def = @(val)cat_get_defaults('extopts.WMHCstr', val{:});
WMHCstr.help = {
'Strength of the modification of the WM Hyperintensity Correction (WMHC).'
''
};
%}
%------------------------------------------------------------------------
% stroke lesion handling (expert)
%------------------------------------------------------------------------
slc = cfg_menu;
slc.tag = 'SLC';
slc.name = 'Stroke Lesion Correction (SLC) - in development';
slc.def = @(val)cat_get_defaults('extopts.SLC', val{:});
slc.help = {
'WARNING: Please note that the handling of stroke lesion is still under development. '
'Without further correction, stroke lesions will be handled by their most probable tissue class, i.e. typically as CSF or GM. Because the spatial registration tries to normalize these regions, the normalization of large regions will lead to strong inproper deformations. '
'To avoid poor deformations, we created a work-around by manually defined lesion maps. The "Manual image (lesion) masking" tool can be used to set the image intensity to zeros to avoid normalization of stroke lesions. '
''
' 0) No Correction. '
' 1) Correction of manually defined regions that were set to zeros. '
};
if expert>1
slc.values = {0 1 2};
slc.labels = { ...
'no SL handling (0)' ...
'manual SL handling (1)' ...
'manual & automatic handling (2)' ...
};
slc.help = [slc.help;{
' 2) Correction automatic detected regions. '
''}];
else
slc.values = {0 1};
slc.labels = { ...
'no SL handling' ...
'manual SL handling' ...
};
slc.help = [slc.help;{
''}];
end
%------------------------------------------------------------------------
% Currently there are to much different strategies and this parameter needs
% revision. There a three basic APP functions that each include an initial
% rough and a following fine method. The first is the SPM appraoch that
% is a simple iterative call of the Unified segmentation with following
% maximum-based bias correction. It is relatively stable but slow and can be
% combined with the other APP routines. The second one is the classical
% APP approach with default and fine processing (1070), followed by further
% developed version that should be more correct with monitor variables and
% T2/PD compatibility but finally worse results.
%
% So we need more test to find out which strategies will survive to support
% an alternative if the standard failed with a fast standard and slow but
% more powerfull other routines. Hence APP1070 (init) or it successor
% should be the standard. The SPM routines are a good alternative due to
% their differnt concept.
%------------------------------------------------------------------------
app = cfg_menu;
app.tag = 'APP';
app.name = 'Affine Preprocessing (APP)';
% short help text
app.help = { ...
'Affine registration and SPM preprocessing can fail in some subjects with deviating anatomy (e.g. other species/neonates) or in images with strong signal inhomogeneities, or untypical intensities (e.g. synthetic images). An initial bias correction can help to reduce such problems (see details below). Recommended are the "default" and "full" option.'
''
' none - no additional bias correction'
' light - iterative SPM bias correction on different resolutions'
' full - iterative SPM bias correction on different resolutions and final high resolution bias correction'
' default - default APP bias correction (r1070)'
};
app.def = @(val)cat_get_defaults('extopts.APP', val{:});
app.labels = {'none','light','full','default'};
app.values = {0 1 2 1070};
if expert
app.labels = [app.labels, {'rough (new)'}];
app.values = [app.values {1144}];
app.help = [app.help;{
' rough (new) - rough APP bias correction (r1144) - in development'
}];
end
% long help text
app.help = [app.help; { ...
''
'light: This approach focuses on an iterative application of the standard SPM preprocessing with different bias-correction options from low (samp=6 mm, biasfwhm=120 mm) to high frequency corrections (samp=4.5 mm, biasfwhm=45 mm). However, the iterative calls require a lot of additional processing time (~500s) and is normally not required in data with low intensity inhomogeneity. '
'full: In addition to the "light" approach a final maximum-based filter (similar to the ''default'' method that needs about additional 60s) is used to remove remaining local inhomogeneities. '
'default: Fast correction (~60s) that identifies large homogeneous areas to estimate the intensity inhomogeneity. A maximum-filter is used to reduce the partial volume effects in T1-weighted data. Moreover, gradient and divergence maps were used to avoid side effects by high intensity tissues (e.g. blood vessels or head tissue). '
}];
if expert
app.help = [app.help; { ...
'rough (new): New version of the ''rough'' approach with improved handling of T2/PD data that is still in development. '
}];
end
app.help = [app.help;{''}];
app.hidden = expert<1;
%------------------------------------------------------------------------
setCOM = cfg_menu;
setCOM.tag = 'setCOM';
setCOM.name = 'Use center-of-mass to set origin';
setCOM.help = { ...
''
'Use center-of-mass to roughly correct for differences in the position between image and template. This will internally correct the origin. '
''
'If affine registration fails you can try to disable this option and/or set the origin manually. '
};
setCOM.def = @(val) cat_get_defaults('extopts.setCOM', val{:});