-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathdocsModelGuide.html
More file actions
1811 lines (1371 loc) · 106 KB
/
docsModelGuide.html
File metadata and controls
1811 lines (1371 loc) · 106 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>SimVascular Docs</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="css/shop-item.css" rel="stylesheet" type="text/css" />
<link href="css/codestyle.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="font-awesome-4.1.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/1.5.2/css/ionicons.min.css">
<link rel="shortcut icon" href="img/favicon.ico">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
<i class="fa fa-bars" id="barIcon"></i>
</button>
<a class="navbar-brand" id="brandName" href="index.html">
<img src="img/svlogo/svLogoSmallText.png" alt="...">
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right navbar-main-collapse">
<ul class="nav navbar-nav">
<!-- USER GUIDES -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b><span class="fa fa-user"></span> User Guides</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsQuickGuide.html"><b><span class="icon ion-ios7-bolt"></span> Getting Started</b></a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsModelGuide.html"><b><span class="icon ion-settings"></span> Modeling</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsMeshing.html"><b><span class="icon ion-ios7-keypad"></span> Meshing</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsFlowSolver.html"><b><span class="icon ion-play"></span> Simulation</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docssvFSI.html"><b><span class="icon ion-plus-round"></span> svFSI</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsSimCardio.html"><b><span class="icon ion-plus-round"></span> SimCardio</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsROMSimulation.html"><b><span class="icon ion-plus-round"></span> ROM Simulation</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsGenBC.html"><b><span class="icon ion-refresh"></span> GenBC</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsPythonInterface.html"><b><span class="icon ion-refresh"></span> Python Interface</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsReferences.html"><b><span class="icon ion-refresh"></span> References </b></a></li>
</ul>
</li>
<!-- CLINCAL CASES -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b><i class="fa fa-stethoscope"></i> Clinical Cases</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="clinicalCase3.html"><b><span class="fa fa-user-md"></span> Coronary Normal</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="clinicalCase1.html"><b><span class="fa fa-user-md"></span> Aortofemoral Normal - 1</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="clinicalCase2.html"><b><span class="fa fa-user-md"></span> Aortofemoral Normal - 2</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="clinicalCase4.html"><b><span class="fa fa-user-md"></span> Healthy Pulmonary</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://simtk.org/projects/sv_tests"><b><span class="fa fa-user-md"></span> All demo projects</b></a></li>
</ul>
</li>
<!-- DEVELOPER GUIDES -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b><span class="fa fa-caret-square-o-right"></span> Developer Guides</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/SimVascular/SimVascular/wiki/wiki_for_developers"><b><span class="fa fa-file-text-o"></span> Compile Source Code</b></a></li>
</ul>
</li>
<!-- svCOMMUNITY -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b><i class="fa fa-users"></i> svCommunity</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://simtk.org/forums/viewforum.php?f=188"><b><span class="fa fa-users"></span> Public Forum</b></a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/SimVascular/SimVascular/wiki/"><b><span class="fa fa-file-text-o"></span> Wiki</b></a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://simtk.org/mailman/listinfo/simvascular-news"><b><span class="fa fa-sign-in"></span> Join News Mailing List</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://simtk.org/pipermail/simvascular-news/"><b><span class="fa fa-pencil-square-o"></span> News Mailing List Archive</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/SimVascular/SimVascular/issues"><b><span class="fa fa-bug"></span> Report bugs and request features</b></a></li>
</ul>
</li>
<!-- REFERENCES -->
<li>
<a href="docsRefs.html" id="dropdownMenu1" >
<b><span class="icon ion-document-text"></span>References</b>
</a>
</li>
<!-- Archives -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b> Archives</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="archiveQuickGuideSV2.html"><b>SimVascular 2.0</b></a></li>
</ul>
</li>
<!-- <li><a href="docsQuickGuide.html" id="btnQuickGuide"><b><span class="icon ion-ios7-bolt"></span> Quick Guide</b></a></li>
<li><a href="docsModelGuide.html" id="btnModelGuide"><b><span class="icon ion-settings"></span> Modeling</b></a></li>
<li><a href="docsMeshing.html" id="btnMeshing"><b><span class="icon ion-ios7-keypad"></span> Meshing</b></a></li>
<li><a href="docsPresolver.html" id="btnPresolver"><b><span class="icon ion-log-in"></span> svPre</b></a></li>
<li><a href="docsFlowSolver.html" id="btnFlowSolver"><b><span class="icon ion-play"></span> svSolver</b></a></li>
<li><a href="docsRefs.html" id="btnRefs"><b><span class="icon ion-document-text"></span> References</b></a></li>
<li><a href="clinicalCase1.html" id="btnRefs"><b>Case Studies</b></a></li> -->
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<!--Nav Bar -->
<div class="row">
<div class="col-xs-1 col-sm-1 hidden-md hidden-lg">
</div>
<!-- ONE COLUMN OF SPACE -->
<nav class="hidden-xs hidden-sm col-md-2 col-lg-2 bs-docs-sidebar">
<ul id="sidebar" class="nav nav-stacked fixed manModelGuide"> <!--Nav Bar -->
<p><h3>Modeling Guide</h3></p>
<li><a href="#modelingIntro">Introduction</a></li>
<li><a href="#modelingPathPlanning">Path Planning</a>
<ul class="nav nav-stacked">
<li><a href="#modelingCreatingPath">Creating a Path</a></li>
<li><a href="#modelingSmoothingPath">Smoothing a Path</a></li>
<li><a href="#modelingImportingExportingPaths">Importing/Exporting Paths</a></li>
</ul>
</li>
<li><a href="#modelingSegmentation">Segmentation</a>
<ul class="nav nav-stacked">
<li><a href="#modelingUsingGroups">Using Groups</a></li>
<li><a href="#modelingThresholding">Using Thresholding <br>to Define a Countour</a></li>
<li><a href="#modelingLevelSet">Using Level Sets <br>to Define a Countour</a></li>
<li><a href="#modelingMachineLearning">Automatic <br>Machine Learning</br> Segmentations</li>
<li><a href="#modelingManual">Segmenting an Image <br>Manually</a></li>
<li><a href="#modelingCopyingPastingContours">Copying and Pasting <br>Contours</a></li>
<li><a href="#modelingLoftingPreview">Lofting Preview</a></li>
<li><a href="#modelingImportingExportingGroups">Importing/Exporting Segmentations</a></li>
<li><a href="#modeling3DSeg">3D Level Set Segmentation</a></li>
</ul>
</li>
<li><a href="#modelingSolidModelingPolyData">Solid Modeling (PolyData)</a>
<ul class="nav nav-stacked">
<li><a href="#modelingCreatingModelsPolyData">Creating Models <br>from 2D Segmentations</a></li>
<li><a href="#modelingPolyDataFaces">Face Operations</a></li>
<li><a href="#modelingEditingPolyData">Global/Local Operations</a></li>
<li><a href="#modelingCenterlinesPolyData">Extracting Centerlines</a></li>
<li><a href="#modelingImportingExportingModels">Importing/Exporting Models</a></li>
</ul>
</li>
<li><a href="#modelingSolidModelingAnalytic">Solic Modeling (Analytic)</a>
<ul class="nav nav-stacked">
<li><a href="#modelingCreatingModelsAnalytic">Creating Solid Models</a></li>
<li><a href="#modelingBlendingAnalytic">Blending the Junction of <br>Two Vessels</a></li>
</ul>
</li>
<h3>Download</h3>
<a href="https://simtk.org/frs/download_confirm.php/file/5113/DemoProject.zip?group_id=930">Demo Project</a>
</ul>
</nav>
<!--Main Content -->
<div class="col-xs-10 col-sm-10 col-md-9 col-lg-9" id="manualContent">
<!-- ACTUAL CONTENT -->
<div class="manModelGuide"><section id="modelingIntro" class="group"><h1>Creating Geometric Models from Medical Imaging Data</h1>
<p>Our eye is able to distinguish different objects within an image, but to the computer, the image is just a group of numbers to be displayed in a grid format. It is not able to distinguish what parts of the image correspond to a specific object. </p>
<p>One way to describe an object within a computing environment is with geometric solid models.
SimVascular is one system that allows users to generate geometric models from medical imaging data. The first step is to segment the medical imaging data and identify what parts of the image describe the object of interest. While 3D segmentation methods are being developed, this document only details using SimVascular with the 2D segmentation method. The information from the segmentations is then transformed into a solid model.</p>
<p>The figure that follows describes the process in more detail. For the segmentation step, paths along the vessels of interest need to be specified first (See <a href="#modelingPathPlanning">Path Planning</a>). 2D segmentations are then generated along each of the paths (See <a href="#modelingSegmentation">Segmentation</a>) These segmentations can then be lofted together to create a solid model. A separate solid model is created for each vessel, and these are all unioned together to create the final model. The last step is to blend the vessel junctions so that they are smoother (see <a href="#modelingSolidModelingPolyData">Solid Modeling (PolyData)</a> and <a href="#modelingSolidModelingAnalytic">Solid Modeling (Analytic)</a>).</p>
<figure>
<img class="svImg svImgLg" src="documentation/modeling/imgs/modelingpipeline.jpg">
<figcaption class="svCaption" ></figcaption>
</figure>
</section>
<section id="modelingPathPlanning" class="group"><h2>Path Planning</h2>
<p><a href="#modelingCreatingPath">Section: Creating a path</a> shows you how to generate a path. <a href="#modelingSmoothingPath">Section: Smoothing a path</a> shows you how to smooth a path. Lastly, <a href="#modelingImportingExportingPaths">Section Importing and Export Legacy Paths</a>, will explain how to save your work, and then load it again after restarting SimVascular.</p>
<p>Some tips to keep in mind as you are constructing paths.</p>
<ol>
<li><p>The paths you create determine where you will be able to perform segmentations. Make sure your paths cover the entire distance of the vessel that you’re interested in modeling. In general, it is a good idea to make your paths as long as possible. It is much easier to make a path a little longer in both directions than to try to “add on” to a path later.</p></li>
<li><p>The paths are also important in determining how individual vessels can be joined together. It’s generally helpful if there is some overlap in the paths. This will ensure that the inlet of the branch vessel will fit entirely inside of the main vessel.</p></li>
<li><p>Lastly, it’s easier if the paths pass near the center of the vessel lumens. This makes it easier for the segmentation part of the process.</p></li>
</ol>
<figure>
<img class="svImg svImgMd" src="documentation/modeling/imgs/path_planning/pathplanningtips.jpg">
<figcaption class="svCaption" ></figcaption>
</figure>
</section>
<section id="modelingCreatingPath" class="subgroup"><h3>Creating a Path</h3>
<p>The goal of this exercise is to create a path for the abdominal aorta and the left common and external iliac. As you will see, you need to create a path (centerline) for each vessel of interest. In <strong>SimVascular</strong>, a path contains two ordered sets of points. One set is “Control Points”; the other set is “Path Points” which define a vessel and are calculated using a spline based on the control points.</p>
<figure>
<img class="svImg svImgMd" src="documentation/modeling/imgs/path_planning/pathdefinition.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p><strong>To create a path (empty):</strong></p>
<pre class="highlight plaintext"><code>Right click the data node "Paths" in the SV project in Data Manager
Click "Create Path" in the popup menu
Path Name: aorta
Subdivision Type: "Spacing Based"
Click "OK"
</code></pre>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/path_planning/createemptypath.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/path_planning/createpathdialog.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>There are three options for Subdivision Type. Each option uses a different way to calculate the number (n) of path points between two adjacent control points. Assume the total number of control points is Nc.</p>
<p><strong>Total Number</strong> (Np): appoximate total number of path points. n=[(Np-1)/(Nc-1)]-1; the actual total number of path points Npa=(n+1)*(Nc-1)+1 <br></p>
<p><strong>Subdivision Number</strong> (Ns): n=Ns-1; Npa=(n+1)*(Nc-1)+1 <br></p>
<p><strong>Spacing Based</strong>: Assume s is the spacing; l is the distance between two adjacent control points. n= [l/s]-1; Npa=(n+1)*(Nc-1)+1</p>
<p>Now a new data node “aorta” for the path is created under the data node “Paths” in Data Manager. Double click the data node “aorta" and the tool “SV Path Planning” automatically shows up. The new path is empty and has no control or path points so far. </p>
<p><strong>To add a control point:</strong></p>
<pre class="highlight plaintext"><code>Adding Mode: Smart
Move the cursor to Axial view in Display
Move the slice to position 475: by scrolling center mouse button or moving Axial slider (in Image Navigator) to 475
Right press and move to zoom in to enlarge the vessel cross section
Method 1: Click at the center of the vessel; Ctrl+A or click the button "Add Smart"
Method 2(interactive): Move the cursor to the center of the vessel; Ctrl + Left Click
</code></pre>
<p>A control point is added for the path and should appear under the Control Point List. In Display, the point is shown as a blue or red point, depending on if the point is selected. </p>
<p><strong>To move a control point (interactively):</strong></p>
<pre class="highlight plaintext"><code>Move the cursor to the control point; it becomes red(selected) if not selected yet
Left press on the point and move
</code></pre>
<p><font color="red"><strong>HELPFUL HINT:</strong> </font> Use the three 2D views at the same time to check if the control point is really located at the center of the vessel.</p>
<p><font color="red"><strong>HELPFUL HINT:</strong> </font> The control points may look too large or small in 2D/3D-view windows. You can change the size, to do it:</p>
<pre class="highlight plaintext"><code>Select all the paths you want to change in Data Manager
Right Click and click "Point 2D Size" or "Point 3D Size"
Give new size in the popup dialog
</code></pre>
<figure>
<img class="svImg svImgXl" src="documentation/modeling/imgs/path_planning/addpoint.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p><font color="red"><strong>HELPFUL HINT:</strong> </font> It is generally a good practice to create paths that extend beyond where you may plan to create a model.</p>
<p>Continue to move down the aorta inferiorly in the Axial 2D View in increments of 25-50 using the Axial slider in Image Navigator or scrolling the center mouse button, and similarly add the center points to the path. When you reach the bifurcation (the aorta splits into the two iliac arteries), continue your path down the LEFT iliac artery. At the same you can see the path in the 3D View. </p>
<figure>
<img class="svImg svImgXl" src="documentation/modeling/imgs/path_planning/addpoint2.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p><strong>More Options to add a control point:</strong></p>
<p>Normally SimVascular will insert a control to the path in the right order, but sometimes a user may need to explicitly insert a control point in a specific location. You can change the "Adding Mode”.</p>
<pre class="highlight plaintext"><code>Smart: add the point according to the distance to other points
Begining: add the point to the beginning
End: add the point to the end
Before: add the point just before the selected point
After: add the point just after the selected point
</code></pre>
<p>You can also add a point by manually inputting coordinates:</p>
<pre class="highlight plaintext"><code>Click the button "Add Manually"
Input coordinates in the popup dialog using the suggested format
Click "OK"
</code></pre>
<p><strong>To Delete a control point:</strong></p>
<pre class="highlight plaintext"><code>Method 1: select the one you want to remove in the Control Point List and click the button "Delete"
Method 2(interactive): Move the cursor to the point you want to remove and Ctrl + Right Click
</code></pre>
<p>After a complete path is created, you can check the quality by reslicing the image along the path.</p>
<pre class="highlight plaintext"><code>Toggle on the checkbox "Turn on Reslicing"
</code></pre>
<figure>
<img class="svImg svImgXl" src="documentation/modeling/imgs/path_planning/pathreslicing.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>A slider appears. You can move the slider to change reslice position. Click the button “Size” to change the reslice size to make the whole vessel cross section is inside the reslice. Now, the layout of Display is changed, which has tree windows:</p>
<ul>
<li><strong>The right window (3D view)</strong>: shows a 2D slice plane (outlined in a red square in reslice size) ,call “intensity probe”. it is image data that is reconstructed perpendicular to your path.</li>
<li><strong>The left top window (2D view)</strong>: displays the intensities of the slice plane that is perpendicular to the path. This is the same image as that displayed in the intensity probe. </li>
<li><strong>The left bottom window (2D view)</strong>: shows the magnitude of the image intensity gradients, again in the slice plane perpendicular to the path. This means that large changes in intensity values, such as that at the edge of vessels, are very bright in this view, and locations with small changes in intensity values, such as in the vessel lumen, are dark, as shown below.</li>
</ul>
<p>To adjust the position of a control point in the reslice:</p>
<pre class="highlight plaintext"><code>Select a control point in Control Point List
Move the cursor to the control point in a 2D view
Left press on the point and move
</code></pre>
<p>To add a new control point in the reslice:</p>
<pre class="highlight plaintext"><code>Move the cursor to a 2D view in Display
Move the cursor to the center of the vessle; Shift+Left Click
</code></pre>
<p>Every time a point is changed/added, the reslice will updated according the changed path.</p>
<p>You can change the type of path after created. </p>
<pre class="highlight plaintext"><code>Click the button "Change"
</code></pre>
</section>
<section id="modelingSmoothingPath" class="subgroup"><h3>Smoothing a Path</h3>
<p>If your resultant path appears jagged, you may want to smooth your path. <strong>SimVascular</strong> provides several parameters for smoothing the path.</p>
<pre class="highlight plaintext"><code>Click the button "Smooth"
Subsample: 1
Based on: Control Points
Fourier Mode Number: 15
Click the button "OK
</code></pre>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/path_planning/pathsmoothdialog.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>You should see a much smoother path. “Subsample: 1” means Subsample every 1 point. Depending on how many points you had in your original path, you may find that the smoothing may make the path deviate from the vessel! This is why smoothing should be used with caution.</p>
<figure>
<img class="svImg svImgLg" src="documentation/modeling/imgs/path_planning/pathsmooth1.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>Let’s examine these parameters more closely.</p>
<p>“Subsample”: This parameter specifies which points will be used in the smoothing. If you enter “5,” then only every 5th point will be used.</p>
<p>“Based on”: Choose to use control points or path points to smooth the path</p>
<p>“Fourier Mode Number”: Fourier smoothing generates a path using only a subset of the modes that describe your original path. High modes correspond to very sharp changes in your path, while low modes describe the smoother parts of your path. The fewer modes your path has, the smoother it will be.</p>
<p>Try this exercise using the following options:</p>
<pre class="highlight plaintext"><code>Subsample: 2
Based on: Control Points
Fourier Mode Number: 5
</code></pre>
<p>You should see a very smooth line with few to no kinks. Does this ultra-smooth path still fit inside the boundaries of the vessel?</p>
<figure>
<img class="svImg svImgLg" src="documentation/modeling/imgs/path_planning/pathsmooth2.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p><font color="red"><strong>Save the path:</strong> </font> When the data in the project change, remember to save the project by:</p>
<pre class="highlight plaintext"><code>Click "Save SV Projects" on the tool bar
</code></pre>
<p>The path will be saved to a file inside the project folder.</p>
</section>
<section id="modelingImportingExportingPaths" class="subgroup"><h3>Importing and Exporting Paths</h3>
<p><strong>Importing Paths:</strong></p>
<pre class="highlight plaintext"><code>Right click the data node "Paths" in the SV project in Data Manager
Click "Import Paths" in the popup menu
Select a .paths file (in legacy format) or a .pth file you would like to load, and click on the “Open” button.
</code></pre>
<p><strong>Exporting Paths:</strong></p>
<pre class="highlight plaintext"><code>Right click the data node "Paths" in the SV project in Data Manager
Click "Export All as Legacy Paths" in the popup menu
Enter the desired name for the file under “File name:” with the ending “.paths” and click on the “Save” button.
</code></pre>
</section>
<section id="modelingSegmentation" class="group"><h2>Segmentation</h2>
<p>Extensive research has been conducted in the field of image segmentation, and as a result, many different techniques have been proposed. The goal of all these techniques is to identify objects or structures within an image in an automated fashion. For our purposes, we want to find the vessel lumen.</p>
<p>Currently, only 2D segmentation methods have been incorporated into <strong>SimVascular</strong>. That means that the segmentations are performed in a plane. So if we want to create a 3D model from our 3D imaging data, we generate a set of 2D segmentations along a given path (See <a href="#modelingPathPlanning">Path Planning</a>). These 2D segmentations can be stitched together later to create a 3D model.</p>
<p>We use groups to organize these 2D segmentations, and in <a href="#modelingUsingGroups">Section: Using Groups</a>, we will show you how to work with groups. You, the user, must determine the acceptability of a given segmentation. Look at the image below. Is the segmentation, show in blue, good or bad? You really can’t answer that question without more information about the object. The semi-automated segmentation methods provided within <strong>SimVascular</strong> save you the work of generating the segmented contours, but you must decide if the segmentations are suitable for your purposes. </p>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/segmentation/segexample.jpg">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>The following sections teach you about the different techniques available for producing and modifying a 2D contour. One basic segmentation technique available in SimVascular is thresholding, which uses the image intensities to define a shape (<a href="#modelingThresholding">Using Thresholding to Define a Contour</a>). The level set method uses both image intensity values and geometric constraints to generate a segmentation (<a href="#modelingLevelSet">Using Level Sets to Define a Contour</a>). You can draw the segmentation by hand (<a href="#modelingManual">Segmenting an Image Manually</a>). </p>
<!-- Or you may have to copy and paste a shape ([ Copying and Pasting Contours](#modelingCopyingPastingContours)). -->
<p>In the end, you will be using a level-set technique to build the abdominal aorta, and you will be drawing segmentations (like circles, ellipses, etc.) to build the branch vessels. Keep this in mind as you work through the exercises. </p>
</section>
<section id="modelingUsingGroups" class="subgroup"><h3>Using Groups</h3>
<p>Groups are used to organize the 2D segmentations or contours that you create. You want to have a different group for each vessel that you are creating. In addition, you might only use a subset of the 2D contours for producing the solid model of the vessel, so for future reference, it’s helpful to save that subset of contours to a new group.</p>
<p>In <strong>SimVascular</strong>, similar to a path, a contour contains two ordered sets of points. One set is “Control Points”; the other set is “Contour Points” which define a contour and are calculated using a closed spline based on the control points.</p>
<figure>
<img class="svImg svImgMd" src="documentation/modeling/imgs/segmentation/contourdefinition.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p><strong>To create a contour group (empty):</strong></p>
<pre class="highlight plaintext"><code>Right click the data node "Segmentations" in the SV project in Data Manager
Click "Create Contour Group" in the popup menu
Select Path: aorta
Group Name: (if blank, use path name by default)
Click "OK"
</code></pre>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/segmentation/createemptygroup.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/segmentation/creategroupdialog.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>Now a new data node “aorta” for the contour group is created under the data node “Segmentations” in Data Manager. Double click the data node “aorta" and the tool “SV 2D Segmentation” automatically shows up. The new group is empty and has no contours so far. At the same time, the layout of Display is changed, which has tree windows, and the image is resliced along the path. The left top window shows image reslices in intensity; the left bottom one shows reslices in the magnitude of intensity gradient; the right one shows intensity probe in 3D view. You can move the slider "Reslice:” to change reslice position. Click the button “Size” to change the reslice size to make the whole vessel cross section is inside the reslice.</p>
<figure>
<img class="svImg svImgXl" src="documentation/modeling/imgs/segmentation/emptygroup.png">
<figcaption class="svCaption" ></figcaption>
</figure>
</section>
<section id="modelingThresholding" class="subgroup"><h3>Using Thresholding to Define a Contour</h3>
<p>Now let’s use the threshold method to create and add contours to the group.</p>
<pre class="highlight plaintext"><code>Click the button "Threshold"
Two new panels show inside the tool
</code></pre>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/segmentation/thresholdpanel.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>The top new panel is to set a preset threshold value. The other new panel is for post-processing and batch segmentation.</p>
<p>To create a contour using Threshold (interactively):</p>
<pre class="highlight plaintext"><code>Make sure toggle off the checkbox "Preset"
Click the button "Threshold" when the threshold panel already shows.
The button is highlighted in light blue, which means the method is activated for interaction.
Move the cursor to a 2D view window
Press and hold the left mouse button at the center of vessel
Move the cursor up/down. Up: decrease threshold value, down: increase threshold value.
Relsease the left mouse button when you feel the contour (in yellow) matches the vessel lumen best
</code></pre>
<figure>
<img class="svImg svImgLg" src="documentation/modeling/imgs/segmentation/thresholdinteractive.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>Notice when you move up/down, the slider “Preset” slider displays the threshold value used to create the contour. After releasing the mouse, the contour is finalized (in red) and added to the group. In this example, the preset value is 62.8. Under Contour List, the new contour is listed with the type and method used for it.</p>
<figure>
<img class="svImg svImgLg" src="documentation/modeling/imgs/segmentation/thresholdinteractive2.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>When this contour is finalized, two control points are created inside it for shifting and scaling the contour.</p>
<p>To shift a contour (interactively):</p>
<pre class="highlight plaintext"><code>Move the cursor to the central control point and it becomes red (activted)
Press and hold the left mouse button at the point
Move the mouse to shift the contour
</code></pre>
<p>To scale a contour (interactively):</p>
<pre class="highlight plaintext"><code>Move the cursor to the other control point (connected to the central point by a short line)
Press and hold the left mouse button at the point
Move the mouse to scale the contour
</code></pre>
<p><font color="red"><strong>HELPFUL HINT:</strong> </font> The control points may look too large or small in 2D/3D-view windows. You can change the size, to do it:</p>
<pre class="highlight plaintext"><code>Select all the contour groups you want to change in Data Manager
Right Click and click "Point 2D Size" or "Point 3D Size"
Give new size in the popup dialog
</code></pre>
<p>The contour may look a little jagged, you can select the contour from the list and click the button “Smooth” to get a smoother contour.</p>
<p><figure>
<img class="svImg svImgMd" src="documentation/modeling/imgs/segmentation/smoothedcontour.png">
<figcaption class="svCaption" ></figcaption>
</figure></p>
<p>With the only two control points, we can’t change the shape of the contour. Now we move the reslice position to 30 and create another contour using the same method as above. The only differences are:</p>
<pre class="highlight plaintext"><code>Move the reslice position to 30
Toggle on the checkbox "Convert to Spline" in the threshold panel.
Ctrl No.: 12
</code></pre>
<figure>
<img class="svImg svImgMd" src="documentation/modeling/imgs/segmentation/thresholdinteractive3.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>This time the finalized contour is converted a closed spline with 12 (Ctrl No.) control points along the contour, with two extra control points inside. Now you have several ways to change the contour shape.</p>
<p>To move a control point (interactively):</p>
<pre class="highlight plaintext"><code>Move the cursor to a control point on the contour and it becomes red (activated)
Press and hold the left mouse button at the point
Move the cursor to adjust the point position on the reslice plane
</code></pre>
<p>To delete a control point (interactively):</p>
<pre class="highlight plaintext"><code>Move the cursor to a control point on the contour and it becomes red (activated)
Right click
</code></pre>
<p>To add a new control point (interactively):</p>
<pre class="highlight plaintext"><code>Move the cursor to the contour line (but not on any control points)
A green control point is created
Left click and the point is inserted into the contour.
</code></pre>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/segmentation/addcontrolpoint.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>We can also create a contour using a preset threshold value, without interaction.</p>
<pre class="highlight plaintext"><code>Move the reslice position to 60
Toggle on the checkbox "Preset" and set the value to 75, in the threshold panel.
Toggle on the checkbox "Convert to Spline" in the threshold panel.
Ctrl No.: 12
Click the button "Threshold"
</code></pre>
<figure>
<img class="svImg svImgLg" src="documentation/modeling/imgs/segmentation/thresholdpreset.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<h4>Batch Segmentation</h4>
<p>Now let’s try create contours in batch model using a preset threshold value.This approach involves pre-selecting the locations for the segmentations, so that only a handful of locations get segmented. This will be faster than generating all of the segmented contours at once. However, it requires user knowledge about which locations are important for the modeling, and it can be especially tedious for vessels with large curvature and/or radius changes. It may also require going back and segmenting other locations later in the process.</p>
<pre class="highlight plaintext"><code>Toggle on the checkbox "Preset" and set the value to 75, in the threshold panel.
Toggle on the checkbox "Convert to Spline" in the threshold panel.
Ctrl No.: 12
Toggle on the checkbox "Batch Mode", List: 80,100,130
Click the button "Threshold"
</code></pre>
<figure>
<img class="svImg svImgLg" src="documentation/modeling/imgs/segmentation/thresholdbatch.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>Three more contours are created for reslice positions: 80,100,130. </p>
</section>
<section id="modelingLevelSet" class="subgroup"><h3>Using Level Sets to Define a Contour</h3>
<p>Thresholding is very dependent on the user-specified parameters and does not always result in a closed contour. An alternate method that’s been implemented within <strong>SimVascular</strong> is the level set method. <strong>SimVascular</strong> utilizes a specialized level set method built specifically for 2D vascular modeling. These level sets use to intensity image data and geometric constraints to produce a smooth contour of the vascular wall in 2D cross sections. <strong>SimVascular</strong>‘s level set method is initialized with a seed and then performs segmentation in two stages. Details of these stages are outlined below.</p>
<h4>Seed Parameters</h4>
<p>These parameters modify the size of the starting seed. The size is standardized, and will be the same across all images. The location of the seed is fixed at the image center (path point)T</p>
<ul>
<li><strong>Radius</strong> controls the radius of the seed (an initialization circle or sphere). Making sure the radius within the lumen of the vessel.</li>
</ul>
<h4>Stage 1 Parameters</h4>
<p>These parameters control the growth and stop criteria of the first stage levelset. Stage 1 levelset is meant to arrive at a approximate solution to initialize stage 2. </p>
<ul>
<li><strong>Blur</strong> parameters control the image blur on the feature image and the advection image. If your image has a lot of noise, increasing these values can improve accuracy. Increased image blur will decrease precision, however.</li>
<li><strong>Kthr</strong> is the equilibrium curvature value of the level set. A higher value will result in less curvature smoothing.</li>
</ul>
<h5>Advanced Features</h5>
<ul>
<li><strong>Exponent Factor Rise and Fall</strong> affect the speed of of the level set when rising on an image gradient, or falling. A ratio of 1:2 is recommended.</li>
<li><strong>Max Iterations</strong> specifies the maximum number of iterations that can be complete before levelset is halted.</li>
<li><strong>Max Error</strong> specifies the maximum RMS error for the levelset stop criteria.</li>
</ul>
<h4>Stage 2 Parameters</h4>
<p>Stage 2 level set is intended to provide a smooth, accurate contour based on the results of stage 1.</p>
<ul>
<li><strong>Blur</strong> parameters control the image blur on the feature image and the advection image. Similar to what discussed for stage 1, increasing this value on images subject to a significant noise level may improve the accuracy of the resulting segmentation. Increased image blur will decrease precision, for this reason it is recommended that blur settings be lower in stage 2 than in stage 1.</li>
<li><strong>Kupp</strong> and <strong>Klow</strong> specifies the maximum tolerable curvature. Unlike stage 1, where there is a equilibrium curvature, stage 2 has a specific allowable range for curvature. When the curvature is too low the level set will grow/shrink the front to obtain a allowable curvature. <font color="orange"><strong>WARNING:</strong></font> If Klow is set too high, it may result in overshoot.</li>
</ul>
<h5>Advanced Features</h5>
<ul>
<li><strong>Max Iterations</strong> specifies the maximum number of iterations that can be complete before levelset is halted.</li>
<li><strong>Max Error</strong> specifies the maximum RMS error for the levelset stop criteria.</li>
</ul>
<p>Now let’s use the levelset method to create and add contours to the group.</p>
<pre class="highlight plaintext"><code>Click the button "LevelSet"
A new panel shows inside the tool
</code></pre>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/segmentation/levelsetpanel.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>The new panel is to set parameters for the levelset.</p>
<p>To create a contour using Levelset:</p>
<pre class="highlight plaintext"><code>Move the reslice position to 158
Use default levelset paramters
Toggle on the checkbox "Convert to Spline" in the threshold panel.
Ctrl No.: 12
Toggle off the checkbox "Batch Mode"
Click the button "LevelSet"
</code></pre>
<figure>
<img class="svImg svImgLg" src="documentation/modeling/imgs/segmentation/levelset.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>Now a new contour is created and added to the group.</p>
<h4>Batch Segmentation</h4>
<p>In general, you should go with the normal approach above: making more segmentations than you will need and then selecting a subset to define the vessel. However, in the following exercise, we will try to gain some intuition that makes batch level set segmentation possible and efficient.</p>
<p><font color="red"><strong>HELPFUL HINT:</strong></font> Finding suitable level set parameters based on a few cross sections and then doing batch segmentation can dramatically speed up model building. Make sure the seed fits within the lumen of the vessel for all the positions we’d like to segment in the batch. </p>
<p>Now let’s try to create contours in batch model using levelset. </p>
<pre class="highlight plaintext"><code>Toggle on the checkbox "Convert to Spline" in the threshold panel.
Ctrl No.: 12
Toggle on the checkbox "Batch Mode", List: 180:30:600
Click the button "LevelSet"
</code></pre>
<figure>
<img class="svImg svImgLg" src="documentation/modeling/imgs/segmentation/levelsetbatch.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>Three more contours are created for reslice positions: 180,210,240,270,300,330,…,600. After batch segmentation, it is good practice to quickly check through them paying attention to possibly open and inaccurate segmentations.</p>
<p>Here are some helpful hints for checking out your contours that you have created in batch mode:</p>
<p>First, check to see that the contours are in the center of the “donut” in the potential window. An example of a contour that is in the center of the potential window “donut” is shown below:</p>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/segmentation/batchexample1.jpg">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>If the contour is not exactly in the center of the donut (like the example shown below), you can scale it using the control point.</p>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/segmentation/batchexample2.jpg">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>Secondly, you want to check to make sure that the segmentation does not include a branch vessel, like the example shown below. Although the level set method can segment these, including these in your final model will cause an artificial geometry know as a “lofting artifact.” </p>
<!-- You can fix these types of segmentations using the techniques described in [Section: Copying and Pasting Contours](#modelingCopyingPastingContours). -->
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/segmentation/batchexample3.jpg">
<figcaption class="svCaption" ></figcaption>
</figure>
<p><font color="red"><strong>HELPFUL HINT:</strong> </font> You want the spacing between locations to be sufficient to capture the curvature and other changes in the vessel. If the vessel is relatively straight, as is the case in this the abdominal aorta for this dataset, you can space the segmentations relatively far apart.</p>
</section>
<section id="modelingMachineLearning" class="subgroup"><h3>Automatic Machine Learning Segmentation</h3>
<p>SimVascular has recently added the capability to automatically generate segmentations using pretrained convolutional neural networks.</p>
<h4>Multi path segmentation</h4>
<p>With SimVascular’s machine learning segmentation it is possible to compute segmentations at multiple path points for multiple paths simultaneously.</p>
<p>To use multi path segmentation:</p>
<pre class="highlight plaintext"><code>Click the multi path tab within the segmentation window.
Select the paths you want to segment (or click *select all paths* to select all paths)
In the **Interval** input box enter the interval at which you want segmentations to be computed (e.g. once every 10 path points)
In the **Fourier Modes** input box, enter the number of fourier modes you want to use to smooth the segmentations, a lower number means more smoothing.
Click the segment button and wait for the segmentations to be computed (roughly one second per segmentation).
</code></pre>
<figure>
<img class="svImg svImgXl" src="documentation/modeling/imgs/segmentation/ml_multi.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<h4>Single path segmentation</h4>
<p>To create a segmentation using machine learning for a single path point (interactively):</p>
<pre class="highlight plaintext"><code>Click the button "NN" (this stands for Neural Network)
An options tab will appear, which means the method is activated for interaction.
Enter the values you want for the options.
Click on the NN button again and the segmentation will be computed.
To compute segmentations for other locations simply change the reslice slider and click the NN button again.
</code></pre>
<figure>
<img class="svImg svImgXl" src="documentation/modeling/imgs/segmentation/ml_single.png">
<figcaption class="svCaption" ></figcaption>
</figure>
</section>
<section id="modelingManual" class="subgroup"><h3>Segmenting an Image Manually</h3>
<p>Sometimes it is not possible to use automated techniques to segment an image. Other times, automatic techniques work, but yield poor contours. In these situations, you may need to segment the image manually. SimVascular provide several options: circle, ellipse, spline polygon, polygon.</p>
<h4>Circle</h4>
<p>To create a circle (interactively):</p>
<pre class="highlight plaintext"><code>Click the button "Circle"
The button is highlighted in light blue, which means the method is activated for interaction.
Move the cursor to a 2D view window
Left click at the vessel center
Move the cursor away from the center.
A circle shows up. It keeps changing the radius as you move the cursor.
Left click again. The circle is placed.
</code></pre>
<figure>
<img class="svImg svImgXl" src="documentation/modeling/imgs/segmentation/circle.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>To create a circle (manually):</p>
<pre class="highlight plaintext"><code>RIGHT Click the button "Circle"
A dialog pops up.
Provide values in the suggested format.
</code></pre>
<p>The circular contour has only two control points, one is for shifting and the other is for changing radius.</p>
<h4>Ellipse</h4>
<p>To create an ellipse (interactively):</p>
<pre class="highlight plaintext"><code>Click the button "Ellipse"
The button is highlighted in light blue, which means the method is activated for interaction.
Move the cursor to a 2D view window
Left click at the vessel center
Move the cusor away from the center.
An ellipse shows up as a circle initially. It keeps changing the radius as you move the cursor.
Left click again. The ellipse is placed.
</code></pre>
<figure>
<img class="svImg svImgMd" src="documentation/modeling/imgs/segmentation/ellipse.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>To create an ellipse (manually):</p>
<pre class="highlight plaintext"><code>RIGHT Click the button "Ellipse"
A dialog pops up.
Provide values in the suggested format.
</code></pre>
<p>The elliptical contour has four control points. The two points on the contour line are for adjusting the orientation and size of the major and minor axes.</p>
<h4>Spline Polygon</h4>
<p>A spline polygon is composed of multiple points and the adjacent points are connected by a closed spline.</p>
<p>To create a polygon with a spline (interactively):</p>
<pre class="highlight plaintext"><code>Click the button "SplinePoly"
The button is highlighted in light blue, which means the method is activated for interaction.
Move the cursor to a 2D view window
Left click at the vessel edge and a control point is added.
Move the cusor clockwise or anticlockwise along the edget and left click; a second control point is added.
Repeat the step above before the last point.
Double click for the last point. The contour is completed and placed.
</code></pre>
<figure>
<img class="svImg svImgXl" src="documentation/modeling/imgs/segmentation/splinepoly.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>To create a polygon with a spline (manually):</p>
<pre class="highlight plaintext"><code>RIGHT Click the button "SplinePoly"
A dialog pops up.
Provide values in the suggested format.
</code></pre>
<p>After the contour is finished. You can continue to modify it, by shifting, scaling, or moving/adding/deleting points.</p>
<p>To create a normal polygon, use the same way as above. The only difference is that the adjacent points are connected by straight lines. </p>
</section>
<section id="modeling3DSeg" class="subgroup"><h2>3D Level Set Segmentation</h2>
<h3>Introduction</h3>
<p>SimVascular provides a 3D level set method <a href="#ref-1">[1]</a> that can be used to generate segmentation surfaces for anatomical structures
difficult to segment using the lofted 2D segmentation approach discussed above. The level set method is a mathematical framework
used to represent implicit deformable surfaces described by a 3D image volume, the level set function, evolving in time. The geometry
of the segmentation surface is defined by the zero isolevel of the level set function. The final surface will be located at the
regions corresponding to the steepest change (gradient magnitude) of image intensity. The surface can be imported into a SimVascular
Modeling tool after preprocessing.</p>
<p>The level set segmentation algorithm requires initializing the level set function. The best results are obtained when the
initialization produces a surface that is close to the desired segmentation surface. SimVascular uses the colliding fronts
algorithm <a href="#ref-2">[2]</a> to initialize the level set function. The user first defines groups of start and end
seed points placed at the extremities of the image region to be segmented. A wavefront is then propagated from each seed with
speeds proportional to the image intensity. The initial level set deformable surface is defined as the region where fronts collide.
Define a several groups of seed points to initialize a large region of the image requires the specification of an image threshold to
constrain the propagation of the wavefront.</p>
<p>The temporal evolution of the level set function is described by a partial differential equation containing the following three terms </p>
<ol>
<li> Advection term that expands the surface towards the ridges of the image gradient magnitude
<li> Propagation term that governs the expansion speed
<li> Smoothness constraint for the mean curvature of the surface </li>
</ol>
<p>Weights are assigned to regulate the influence of each term on surface evolution. Weights may need to be adjusted for different image modalities
with different properties (e.g. signal to noise ratio).</p>
<p>The level set formulation requires computing an image gradient. Derivatives are computed for the image data by applying using a<br>
Gaussian smoothing filter with a user defined value for the standard deviation. Applying a smoothing filter decreases the effect of
image noise on derivative computation but may remove image features below the scale corresponding to the standard deviation used.</p>
<p>The level set equation is solved numerically for a number of iterations (time steps) incrementally updating the level set function and implicitly
the segmentation surface. Enough iterations need to be performed so that the surface expands close to the boundaries of the anatomical structures
that are being segmented. The result of the level set computation is the level set function representing a segmentation image. The geometry
of the segmentation surface, a triangle mesh, is then extracted from this image at the zero isolevel. </p>
<p>After a segmentation surface has been extracted centerlines and SimVascular paths can be then computed for it. The path files can be
imported into SimVascular and used to automatically generate a model using the machine learning capability in the SimVascular Segmentation
tool. This may be useful when building models of complex vascular anatomy.</p>
<p>The segmentation surface does not have the planar caps needed for SimVascular models. However, the SimVascular Modeling tool can use paths
to trim the surface at its ends. Caps can then be created for the trimmed model using the Modeling tool <b>Fill Holes w/o ID</b> operation
(see <a href="http://simvascular.github.io/docsModelGuide.html#modelingEditingPolyData">Modeling Guide - Global/Local Operations</a>). </p>
<!-- ====================================== Level Set Tool ================================= -->
<h3>Level Set Tool</h3>
<p>The SimVascular <strong>3D Level Set Tool</strong> is used to interactively generate 3D segmentations from volumetric imaging data using the
level set method with colliding fronts initialization. The tool uses the image data read in by SimVascular and stored under the
SV Data Manager <i>Images</i> node. </p>
<p>The <strong>3D Level Set Tool</strong> is opened by selecting the
<img src="documentation/modeling/imgs/3d-level-set/level-set-icon.png" width="20" height="20"> icon located at the top of the
SimVascular toolbar. This displays the <strong>3D Level Set Tool</strong> panel. </p>
<p><br>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/3d-level-set/seeds-panel.png">
<figcaption class="svCaption"> The 3D Level Set Tool panel. </figcaption>
</figure>
<br></p>
<p>The panel contains four sub-panels used to create seed positions and execute a level set computation, and operations on segmentation surfaces.
<ul style="list-style-type:none;">
<li> <b> Seeds </b> </li>
<li> <b> Level Set </b> </li>
<li> <b> Surface </b> </li>
<li> <b> Paths </b> </li>
</ul></p>
<p>A selecting a sub-panel name brings up the sub-panel’s widgets. The following sections describe how each of the sub-panels are used.</p>
<p><br>
<div style="background-color: #F0F0F0; padding: 10px; border: 1px solid #e6e600; border-left: 6px solid #e6e600">
If the <b>3D Level Set Tool</b> has been previously used the panel (greyed out) is sometimes displayed when SimVascular starts.
Close the panel before creating or opening a SimVascular project.
</div></p>
<p><br>
The <strong>3D Level Set Tool</strong> creates a <strong>level-set</strong> node under the SV Data Manager <i>Images</i> node. The <strong>level-set</strong> node
itself has four sub-nodes used to store and display geometry created by each of the panels</p>
<ul style="list-style-type:none;">
<li> <b>seed-points</b> - Seed points, displayed as green or red spheres. </li>
<li> <b>centerlines</b> - Centerline geometry, displayed as green lines. </li>
<li> <b>paths</b> - Path points, displayed as yellow spheres. </li>
<li> <b>surface</b> - Segmentation surface, created only after a level set computation has been performed. </li>
</ul>
<figure>
<img class="svImg svImgSm" src="documentation/modeling/imgs/3d-level-set/data-manager-panel.png">
<figcaption class="svCaption"> The 3D Level Set Tool data nodes. </figcaption>
</figure>
<p><br></p>
<p>Data created by the <b>3D Level Set Tool</b> is stored in files under a project’s <i>Images/level-set</i> directory.
The details of each file is described in the sections below for the panel that creates it.</p>
<p><br>
<div style="background-color: #F0F0F0; padding: 10px; border: 1px solid #e6e600; border-left: 6px solid #e6e600">
Unlike other SimVascular plugins the <b>3D Level Set Tool</b> does not currently save the values of the parameters set in the
panels nor does it store seed positions. The capability to restore the tool’s state will be added in a future SimVascular release.
</div></p>
<!-- ====================================== Seeds Panel ================================= -->
<p><br></p>
<h4>Seeds Panel</h4>
<p>The Seeds panel is used to create groups of start and end seed points for initializing the level set function. Seed groups and
image threshold values (set in the Level Set panel) determine which regions of the image are segmented. Each seed group consists
of a single start seed and one or more end seeds.</p>
<p>Seeds are interactively positioned at the current location of the 2D cursor in the axial, coronal and sagittal 2D image windows.
Seeds are added using GUI buttons and the keyboard keys. Additional operations, like setting the active seed group and deleting seeds
are performed using the keyboard keys.</p>
<p><b> Adding Seeds </b>
<ul>
<li> A seed group is created when adding a start seed by pressing the <i>S</i> key or the <i>Add Start</i> button (see below) </li>
<li> An end seed is added to the active seed group by pressing the <i>E</i> key or the <i>Add End</i> button (see below) </li>
<li> Moving the mouse cursor over a seed changes its color to yellow, it can then be made active or deleted </li>
<li> A seed group is selected as active by moving the mouse cursor over a seed in the group and pressing the <i>A</i> key </li>
<li> The active seed group is highlighted
</ul></p>
<p><b> Deleting Seeds </b>
<ul>
<li> An end seed is deleted by moving the mouse cursor over the seed and pressing the <i>D</i> key </li>
<li> A seed group is deleted by moving the mouse cursor over the start seed and pressing the <i>D</i> key </li>
<li> All seed groups are deleted by the pressing the <i>Clear</i> button (see below) </li>
</ul></p>