cardiac-geometriesx 0.6.2__py3-none-any.whl → 0.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cardiac-geometriesx might be problematic. Click here for more details.
- cardiac_geometries/cli.py +72 -394
- cardiac_geometries/gui.py +0 -2
- cardiac_geometries/mesh.py +59 -303
- cardiac_geometries/utils.py +1 -1
- {cardiac_geometriesx-0.6.2.dist-info → cardiac_geometriesx-0.7.0.dist-info}/METADATA +5 -2
- {cardiac_geometriesx-0.6.2.dist-info → cardiac_geometriesx-0.7.0.dist-info}/RECORD +10 -10
- {cardiac_geometriesx-0.6.2.dist-info → cardiac_geometriesx-0.7.0.dist-info}/WHEEL +0 -0
- {cardiac_geometriesx-0.6.2.dist-info → cardiac_geometriesx-0.7.0.dist-info}/entry_points.txt +0 -0
- {cardiac_geometriesx-0.6.2.dist-info → cardiac_geometriesx-0.7.0.dist-info}/licenses/LICENSE +0 -0
- {cardiac_geometriesx-0.6.2.dist-info → cardiac_geometriesx-0.7.0.dist-info}/top_level.txt +0 -0
cardiac_geometries/cli.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import logging
|
|
1
2
|
import math
|
|
2
3
|
from importlib.metadata import metadata
|
|
3
4
|
from pathlib import Path
|
|
@@ -6,6 +7,8 @@ import rich_click as click
|
|
|
6
7
|
|
|
7
8
|
from . import mesh
|
|
8
9
|
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
9
12
|
meta = metadata("cardiac-geometriesx")
|
|
10
13
|
__version__ = meta["Version"]
|
|
11
14
|
__author__ = meta["Author-email"]
|
|
@@ -14,6 +17,13 @@ __email__ = meta["Author-email"]
|
|
|
14
17
|
__program_name__ = meta["Name"]
|
|
15
18
|
|
|
16
19
|
|
|
20
|
+
def init_logging(verbose: bool = False):
|
|
21
|
+
loglevel = logging.DEBUG if verbose else logging.INFO
|
|
22
|
+
logging.basicConfig(level=loglevel)
|
|
23
|
+
for name in ["numba"]:
|
|
24
|
+
logging.getLogger(name).setLevel(logging.WARNING)
|
|
25
|
+
|
|
26
|
+
|
|
17
27
|
@click.group()
|
|
18
28
|
@click.version_option(__version__, prog_name="cardiac_geometriesx")
|
|
19
29
|
def app():
|
|
@@ -301,129 +311,80 @@ def lv_ellipsoid(
|
|
|
301
311
|
show_default=True,
|
|
302
312
|
)
|
|
303
313
|
@click.option(
|
|
304
|
-
"--
|
|
305
|
-
default=0.0,
|
|
306
|
-
type=float,
|
|
307
|
-
help="X-coordinate for the center of the lv",
|
|
308
|
-
show_default=True,
|
|
309
|
-
)
|
|
310
|
-
@click.option(
|
|
311
|
-
"--center-lv-y",
|
|
312
|
-
default=0.0,
|
|
313
|
-
type=float,
|
|
314
|
-
help="Y-coordinate for the center of the lv",
|
|
315
|
-
show_default=True,
|
|
316
|
-
)
|
|
317
|
-
@click.option(
|
|
318
|
-
"--center-lv-z",
|
|
319
|
-
default=0.0,
|
|
320
|
-
type=float,
|
|
321
|
-
help="Z-coordinate for the center of the lv",
|
|
322
|
-
show_default=True,
|
|
323
|
-
)
|
|
324
|
-
@click.option(
|
|
325
|
-
"--a-endo-lv",
|
|
314
|
+
"--base-cut-z",
|
|
326
315
|
default=2.5,
|
|
327
316
|
type=float,
|
|
328
|
-
help="
|
|
329
|
-
show_default=True,
|
|
330
|
-
)
|
|
331
|
-
@click.option(
|
|
332
|
-
"--b-endo-lv",
|
|
333
|
-
default=1.0,
|
|
334
|
-
type=float,
|
|
335
|
-
help="Dilation of lv endo ellipsoid in the y-direction",
|
|
317
|
+
help="Z-coordinate of the base cut",
|
|
336
318
|
show_default=True,
|
|
337
319
|
)
|
|
338
320
|
@click.option(
|
|
339
|
-
"--
|
|
340
|
-
default=
|
|
321
|
+
"--box-size",
|
|
322
|
+
default=15.0,
|
|
341
323
|
type=float,
|
|
342
|
-
help="
|
|
324
|
+
help="Size of the cutting box",
|
|
343
325
|
show_default=True,
|
|
344
326
|
)
|
|
345
327
|
@click.option(
|
|
346
|
-
"--
|
|
347
|
-
default=
|
|
328
|
+
"--rv-wall-thickness",
|
|
329
|
+
default=0.4,
|
|
348
330
|
type=float,
|
|
349
|
-
help="
|
|
331
|
+
help="Thickness of the right ventricle wall",
|
|
350
332
|
show_default=True,
|
|
351
333
|
)
|
|
352
334
|
@click.option(
|
|
353
|
-
"--
|
|
354
|
-
default=1.5,
|
|
355
|
-
type=float,
|
|
356
|
-
help="Dilation of lv epi ellipsoid in the y-direction",
|
|
357
|
-
show_default=True,
|
|
358
|
-
)
|
|
359
|
-
@click.option(
|
|
360
|
-
"--c-epi-lv",
|
|
361
|
-
default=1.5,
|
|
362
|
-
type=float,
|
|
363
|
-
help="Dilation of lv epi ellipsoid in the y-direction",
|
|
364
|
-
show_default=True,
|
|
365
|
-
)
|
|
366
|
-
@click.option(
|
|
367
|
-
"--center-rv-x",
|
|
368
|
-
default=0.0,
|
|
369
|
-
type=float,
|
|
370
|
-
help="X-coordinate for the center of the rv",
|
|
371
|
-
show_default=True,
|
|
372
|
-
)
|
|
373
|
-
@click.option(
|
|
374
|
-
"--center-rv-y",
|
|
335
|
+
"--lv-wall-thickness",
|
|
375
336
|
default=0.5,
|
|
376
337
|
type=float,
|
|
377
|
-
help="
|
|
338
|
+
help="Thickness of the left ventricle wall",
|
|
378
339
|
show_default=True,
|
|
379
340
|
)
|
|
380
341
|
@click.option(
|
|
381
|
-
"--
|
|
382
|
-
default=
|
|
342
|
+
"--rv-offset-x",
|
|
343
|
+
default=3.0,
|
|
383
344
|
type=float,
|
|
384
|
-
help="
|
|
345
|
+
help="X-offset of the right ventricle",
|
|
385
346
|
show_default=True,
|
|
386
347
|
)
|
|
387
348
|
@click.option(
|
|
388
|
-
"--
|
|
389
|
-
default=
|
|
349
|
+
"--lv-radius-x",
|
|
350
|
+
default=2.0,
|
|
390
351
|
type=float,
|
|
391
|
-
help="
|
|
352
|
+
help="X-radius of the left ventricle",
|
|
392
353
|
show_default=True,
|
|
393
354
|
)
|
|
394
355
|
@click.option(
|
|
395
|
-
"--
|
|
396
|
-
default=1.
|
|
356
|
+
"--lv-radius-y",
|
|
357
|
+
default=1.8,
|
|
397
358
|
type=float,
|
|
398
|
-
help="
|
|
359
|
+
help="Y-radius of the left ventricle",
|
|
399
360
|
show_default=True,
|
|
400
361
|
)
|
|
401
362
|
@click.option(
|
|
402
|
-
"--
|
|
403
|
-
default=
|
|
363
|
+
"--lv-radius-z",
|
|
364
|
+
default=3.25,
|
|
404
365
|
type=float,
|
|
405
|
-
help="
|
|
366
|
+
help="Z-radius of the left ventricle",
|
|
406
367
|
show_default=True,
|
|
407
368
|
)
|
|
408
369
|
@click.option(
|
|
409
|
-
"--
|
|
410
|
-
default=
|
|
370
|
+
"--rv-radius-x",
|
|
371
|
+
default=1.9,
|
|
411
372
|
type=float,
|
|
412
|
-
help="
|
|
373
|
+
help="X-radius of the right ventricle",
|
|
413
374
|
show_default=True,
|
|
414
375
|
)
|
|
415
376
|
@click.option(
|
|
416
|
-
"--
|
|
377
|
+
"--rv-radius-y",
|
|
417
378
|
default=2.5,
|
|
418
379
|
type=float,
|
|
419
|
-
help="
|
|
380
|
+
help="Y-radius of the right ventricle",
|
|
420
381
|
show_default=True,
|
|
421
382
|
)
|
|
422
383
|
@click.option(
|
|
423
|
-
"--
|
|
424
|
-
default=
|
|
384
|
+
"--rv-radius-z",
|
|
385
|
+
default=3.0,
|
|
425
386
|
type=float,
|
|
426
|
-
help="
|
|
387
|
+
help="Z-radius of the right ventricle",
|
|
427
388
|
show_default=True,
|
|
428
389
|
)
|
|
429
390
|
@click.option(
|
|
@@ -454,340 +415,58 @@ def lv_ellipsoid(
|
|
|
454
415
|
help="Function space for fibers of the form family_degree",
|
|
455
416
|
show_default=True,
|
|
456
417
|
)
|
|
457
|
-
def biv_ellipsoid(
|
|
458
|
-
outdir: Path,
|
|
459
|
-
char_length: float = 0.5,
|
|
460
|
-
center_lv_x: float = 0.0,
|
|
461
|
-
center_lv_y: float = 0.0,
|
|
462
|
-
center_lv_z: float = 0.0,
|
|
463
|
-
a_endo_lv: float = 2.5,
|
|
464
|
-
b_endo_lv: float = 1.0,
|
|
465
|
-
c_endo_lv: float = 1.0,
|
|
466
|
-
a_epi_lv: float = 3.0,
|
|
467
|
-
b_epi_lv: float = 1.5,
|
|
468
|
-
c_epi_lv: float = 1.5,
|
|
469
|
-
center_rv_x: float = 0.0,
|
|
470
|
-
center_rv_y: float = 0.5,
|
|
471
|
-
center_rv_z: float = 0.0,
|
|
472
|
-
a_endo_rv: float = 3.0,
|
|
473
|
-
b_endo_rv: float = 1.5,
|
|
474
|
-
c_endo_rv: float = 1.5,
|
|
475
|
-
a_epi_rv: float = 4.0,
|
|
476
|
-
b_epi_rv: float = 2.5,
|
|
477
|
-
c_epi_rv: float = 2.0,
|
|
478
|
-
create_fibers: bool = False,
|
|
479
|
-
fiber_angle_endo: float = -60,
|
|
480
|
-
fiber_angle_epi: float = +60,
|
|
481
|
-
fiber_space: str = "P_1",
|
|
482
|
-
):
|
|
483
|
-
outdir = Path(outdir)
|
|
484
|
-
outdir.mkdir(exist_ok=True)
|
|
485
|
-
|
|
486
|
-
geo = mesh.biv_ellipsoid(
|
|
487
|
-
outdir=outdir,
|
|
488
|
-
char_length=char_length,
|
|
489
|
-
center_lv_x=center_lv_x,
|
|
490
|
-
center_lv_y=center_lv_y,
|
|
491
|
-
center_lv_z=center_lv_z,
|
|
492
|
-
a_endo_lv=a_endo_lv,
|
|
493
|
-
b_endo_lv=b_endo_lv,
|
|
494
|
-
c_endo_lv=c_endo_lv,
|
|
495
|
-
a_epi_lv=a_epi_lv,
|
|
496
|
-
b_epi_lv=b_epi_lv,
|
|
497
|
-
c_epi_lv=c_epi_lv,
|
|
498
|
-
center_rv_x=center_rv_x,
|
|
499
|
-
center_rv_y=center_rv_y,
|
|
500
|
-
center_rv_z=center_rv_z,
|
|
501
|
-
a_endo_rv=a_endo_rv,
|
|
502
|
-
b_endo_rv=b_endo_rv,
|
|
503
|
-
c_endo_rv=c_endo_rv,
|
|
504
|
-
a_epi_rv=a_epi_rv,
|
|
505
|
-
b_epi_rv=b_epi_rv,
|
|
506
|
-
c_epi_rv=c_epi_rv,
|
|
507
|
-
create_fibers=create_fibers,
|
|
508
|
-
fiber_angle_endo=fiber_angle_endo,
|
|
509
|
-
fiber_angle_epi=fiber_angle_epi,
|
|
510
|
-
fiber_space=fiber_space,
|
|
511
|
-
)
|
|
512
|
-
geo.save(outdir / "biv_ellipsoid.bp")
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
@click.command(help="Create BiV ellipsoidal geometry embedded in a torso")
|
|
516
|
-
@click.argument(
|
|
517
|
-
"outdir",
|
|
518
|
-
required=True,
|
|
519
|
-
type=click.Path(
|
|
520
|
-
file_okay=False,
|
|
521
|
-
dir_okay=True,
|
|
522
|
-
writable=True,
|
|
523
|
-
readable=True,
|
|
524
|
-
resolve_path=True,
|
|
525
|
-
),
|
|
526
|
-
)
|
|
527
|
-
@click.option(
|
|
528
|
-
"--char-length",
|
|
529
|
-
default=0.5,
|
|
530
|
-
type=float,
|
|
531
|
-
help="Characteristic length of mesh",
|
|
532
|
-
show_default=True,
|
|
533
|
-
)
|
|
534
|
-
@click.option(
|
|
535
|
-
"--heart-as-surface/--heart-as-volume",
|
|
536
|
-
default=False,
|
|
537
|
-
help="Whether the heart should be a surface of a volume inside the torso",
|
|
538
|
-
show_default=True,
|
|
539
|
-
)
|
|
540
|
-
@click.option(
|
|
541
|
-
"--torso-length",
|
|
542
|
-
default=20,
|
|
543
|
-
type=float,
|
|
544
|
-
help="Length of torso in the x-direction",
|
|
545
|
-
show_default=True,
|
|
546
|
-
)
|
|
547
|
-
@click.option(
|
|
548
|
-
"--torso-width",
|
|
549
|
-
default=20,
|
|
550
|
-
type=float,
|
|
551
|
-
help="Length of torso in the y-direction",
|
|
552
|
-
show_default=True,
|
|
553
|
-
)
|
|
554
|
-
@click.option(
|
|
555
|
-
"--torso-height",
|
|
556
|
-
default=20,
|
|
557
|
-
type=float,
|
|
558
|
-
help="Length of torso in the z-direction",
|
|
559
|
-
show_default=True,
|
|
560
|
-
)
|
|
561
|
-
@click.option(
|
|
562
|
-
"--rotation-angle",
|
|
563
|
-
default=math.pi / 6,
|
|
564
|
-
type=float,
|
|
565
|
-
help=(
|
|
566
|
-
"Angle to rotate the torso in order to object realistic position of the heart in a torso"
|
|
567
|
-
),
|
|
568
|
-
show_default=True,
|
|
569
|
-
)
|
|
570
|
-
@click.option(
|
|
571
|
-
"--center-lv-x",
|
|
572
|
-
default=0.0,
|
|
573
|
-
type=float,
|
|
574
|
-
help="X-coordinate for the center of the lv",
|
|
575
|
-
show_default=True,
|
|
576
|
-
)
|
|
577
418
|
@click.option(
|
|
578
|
-
"
|
|
579
|
-
|
|
580
|
-
type=float,
|
|
581
|
-
help="Y-coordinate for the center of the lv",
|
|
582
|
-
show_default=True,
|
|
583
|
-
)
|
|
584
|
-
@click.option(
|
|
585
|
-
"--center-lv-z",
|
|
586
|
-
default=0.0,
|
|
587
|
-
type=float,
|
|
588
|
-
help="Z-coordinate for the center of the lv",
|
|
589
|
-
show_default=True,
|
|
590
|
-
)
|
|
591
|
-
@click.option(
|
|
592
|
-
"--a-endo-lv",
|
|
593
|
-
default=2.5,
|
|
594
|
-
type=float,
|
|
595
|
-
help="Dilation of lv endo ellipsoid in the x-direction",
|
|
596
|
-
show_default=True,
|
|
597
|
-
)
|
|
598
|
-
@click.option(
|
|
599
|
-
"--b-endo-lv",
|
|
600
|
-
default=1.0,
|
|
601
|
-
type=float,
|
|
602
|
-
help="Dilation of lv endo ellipsoid in the y-direction",
|
|
603
|
-
show_default=True,
|
|
604
|
-
)
|
|
605
|
-
@click.option(
|
|
606
|
-
"--c-endo-lv",
|
|
607
|
-
default=1.0,
|
|
608
|
-
type=float,
|
|
609
|
-
help="Dilation of lv endo ellipsoid in the y-direction",
|
|
610
|
-
show_default=True,
|
|
611
|
-
)
|
|
612
|
-
@click.option(
|
|
613
|
-
"--a-epi-lv",
|
|
614
|
-
default=3.0,
|
|
615
|
-
type=float,
|
|
616
|
-
help="Dilation of lv epi ellipsoid in the x-direction",
|
|
617
|
-
show_default=True,
|
|
618
|
-
)
|
|
619
|
-
@click.option(
|
|
620
|
-
"--b-epi-lv",
|
|
621
|
-
default=1.5,
|
|
622
|
-
type=float,
|
|
623
|
-
help="Dilation of lv epi ellipsoid in the y-direction",
|
|
624
|
-
show_default=True,
|
|
625
|
-
)
|
|
626
|
-
@click.option(
|
|
627
|
-
"--c-epi-lv",
|
|
628
|
-
default=1.5,
|
|
629
|
-
type=float,
|
|
630
|
-
help="Dilation of lv epi ellipsoid in the y-direction",
|
|
631
|
-
show_default=True,
|
|
632
|
-
)
|
|
633
|
-
@click.option(
|
|
634
|
-
"--center-rv-x",
|
|
635
|
-
default=0.0,
|
|
636
|
-
type=float,
|
|
637
|
-
help="X-coordinate for the center of the rv",
|
|
638
|
-
show_default=True,
|
|
639
|
-
)
|
|
640
|
-
@click.option(
|
|
641
|
-
"--center-rv-y",
|
|
642
|
-
default=0.5,
|
|
643
|
-
type=float,
|
|
644
|
-
help="Y-coordinate for the center of the rv",
|
|
645
|
-
show_default=True,
|
|
646
|
-
)
|
|
647
|
-
@click.option(
|
|
648
|
-
"--center-rv-z",
|
|
649
|
-
default=0.0,
|
|
650
|
-
type=float,
|
|
651
|
-
help="Z-coordinate for the center of the rv",
|
|
652
|
-
show_default=True,
|
|
653
|
-
)
|
|
654
|
-
@click.option(
|
|
655
|
-
"--a-endo-rv",
|
|
656
|
-
default=3.0,
|
|
657
|
-
type=float,
|
|
658
|
-
help="Dilation of rv endo ellipsoid in the x-direction",
|
|
659
|
-
show_default=True,
|
|
660
|
-
)
|
|
661
|
-
@click.option(
|
|
662
|
-
"--b-endo-rv",
|
|
663
|
-
default=1.5,
|
|
664
|
-
type=float,
|
|
665
|
-
help="Dilation of rv endo ellipsoid in the y-direction",
|
|
666
|
-
show_default=True,
|
|
667
|
-
)
|
|
668
|
-
@click.option(
|
|
669
|
-
"--c-endo-rv",
|
|
670
|
-
default=1.5,
|
|
671
|
-
type=float,
|
|
672
|
-
help="Dilation of rv endo ellipsoid in the y-direction",
|
|
673
|
-
show_default=True,
|
|
674
|
-
)
|
|
675
|
-
@click.option(
|
|
676
|
-
"--a-epi-rv",
|
|
677
|
-
default=4.0,
|
|
678
|
-
type=float,
|
|
679
|
-
help="Dilation of rv epi ellipsoid in the x-direction",
|
|
680
|
-
show_default=True,
|
|
681
|
-
)
|
|
682
|
-
@click.option(
|
|
683
|
-
"--b-epi-rv",
|
|
684
|
-
default=2.5,
|
|
685
|
-
type=float,
|
|
686
|
-
help="Dilation of rv epi ellipsoid in the y-direction",
|
|
687
|
-
show_default=True,
|
|
688
|
-
)
|
|
689
|
-
@click.option(
|
|
690
|
-
"--c-epi-rv",
|
|
691
|
-
default=2.0,
|
|
692
|
-
type=float,
|
|
693
|
-
help="Dilation of rv epi ellipsoid in the z-direction",
|
|
694
|
-
show_default=True,
|
|
695
|
-
)
|
|
696
|
-
@click.option(
|
|
697
|
-
"--create-fibers",
|
|
698
|
-
default=False,
|
|
419
|
+
"-v",
|
|
420
|
+
"--verbose",
|
|
699
421
|
is_flag=True,
|
|
700
|
-
help="
|
|
701
|
-
show_default=True,
|
|
702
|
-
)
|
|
703
|
-
@click.option(
|
|
704
|
-
"--fiber-angle-endo",
|
|
705
|
-
default=-60,
|
|
706
|
-
type=float,
|
|
707
|
-
help="Angle for the endocardium",
|
|
708
|
-
show_default=True,
|
|
709
|
-
)
|
|
710
|
-
@click.option(
|
|
711
|
-
"--fiber-angle-epi",
|
|
712
|
-
default=+60,
|
|
713
|
-
type=float,
|
|
714
|
-
help="Angle for the epicardium",
|
|
715
|
-
show_default=True,
|
|
716
|
-
)
|
|
717
|
-
@click.option(
|
|
718
|
-
"--fiber-space",
|
|
719
|
-
default="P_1",
|
|
720
|
-
type=str,
|
|
721
|
-
help="Function space for fibers of the form family_degree",
|
|
422
|
+
help="Enable verbose output",
|
|
722
423
|
show_default=True,
|
|
723
424
|
)
|
|
724
|
-
def
|
|
425
|
+
def biv_ellipsoid(
|
|
725
426
|
outdir: Path,
|
|
726
|
-
char_length: float = 0.
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
a_epi_lv: float = 3.0,
|
|
739
|
-
b_epi_lv: float = 1.5,
|
|
740
|
-
c_epi_lv: float = 1.5,
|
|
741
|
-
center_rv_x: float = 0.0,
|
|
742
|
-
center_rv_y: float = 0.5,
|
|
743
|
-
center_rv_z: float = 0.0,
|
|
744
|
-
a_endo_rv: float = 3.0,
|
|
745
|
-
b_endo_rv: float = 1.5,
|
|
746
|
-
c_endo_rv: float = 1.5,
|
|
747
|
-
a_epi_rv: float = 4.0,
|
|
748
|
-
b_epi_rv: float = 2.5,
|
|
749
|
-
c_epi_rv: float = 2.0,
|
|
427
|
+
char_length: float = 0.4, # cm
|
|
428
|
+
base_cut_z: float = 2.5,
|
|
429
|
+
box_size: float = 15.0, # Size of the cutting box
|
|
430
|
+
rv_wall_thickness: float = 0.4, # cm
|
|
431
|
+
lv_wall_thickness: float = 0.5, # cm
|
|
432
|
+
rv_offset_x: float = 3.0,
|
|
433
|
+
lv_radius_x: float = 2.0,
|
|
434
|
+
lv_radius_y: float = 1.8,
|
|
435
|
+
lv_radius_z: float = 3.25,
|
|
436
|
+
rv_radius_x: float = 1.9,
|
|
437
|
+
rv_radius_y: float = 2.5,
|
|
438
|
+
rv_radius_z: float = 3.0,
|
|
750
439
|
create_fibers: bool = False,
|
|
751
440
|
fiber_angle_endo: float = -60,
|
|
752
441
|
fiber_angle_epi: float = +60,
|
|
753
442
|
fiber_space: str = "P_1",
|
|
443
|
+
verbose: bool = False,
|
|
754
444
|
):
|
|
445
|
+
init_logging(verbose=verbose)
|
|
755
446
|
outdir = Path(outdir)
|
|
756
447
|
outdir.mkdir(exist_ok=True)
|
|
757
448
|
|
|
758
|
-
geo = mesh.
|
|
449
|
+
geo = mesh.biv_ellipsoid(
|
|
759
450
|
outdir=outdir,
|
|
760
451
|
char_length=char_length,
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
a_epi_lv=a_epi_lv,
|
|
773
|
-
b_epi_lv=b_epi_lv,
|
|
774
|
-
c_epi_lv=c_epi_lv,
|
|
775
|
-
center_rv_x=center_rv_x,
|
|
776
|
-
center_rv_y=center_rv_y,
|
|
777
|
-
center_rv_z=center_rv_z,
|
|
778
|
-
a_endo_rv=a_endo_rv,
|
|
779
|
-
b_endo_rv=b_endo_rv,
|
|
780
|
-
c_endo_rv=c_endo_rv,
|
|
781
|
-
a_epi_rv=a_epi_rv,
|
|
782
|
-
b_epi_rv=b_epi_rv,
|
|
783
|
-
c_epi_rv=c_epi_rv,
|
|
452
|
+
base_cut_z=base_cut_z,
|
|
453
|
+
box_size=box_size,
|
|
454
|
+
rv_wall_thickness=rv_wall_thickness,
|
|
455
|
+
lv_wall_thickness=lv_wall_thickness,
|
|
456
|
+
rv_offset_x=rv_offset_x,
|
|
457
|
+
lv_radius_x=lv_radius_x,
|
|
458
|
+
lv_radius_y=lv_radius_y,
|
|
459
|
+
lv_radius_z=lv_radius_z,
|
|
460
|
+
rv_radius_x=rv_radius_x,
|
|
461
|
+
rv_radius_y=rv_radius_y,
|
|
462
|
+
rv_radius_z=rv_radius_z,
|
|
784
463
|
create_fibers=create_fibers,
|
|
785
464
|
fiber_angle_endo=fiber_angle_endo,
|
|
786
465
|
fiber_angle_epi=fiber_angle_epi,
|
|
787
466
|
fiber_space=fiber_space,
|
|
467
|
+
verbose=verbose,
|
|
788
468
|
)
|
|
789
|
-
|
|
790
|
-
geo.save(outdir / "biv_ellipsoid_torso.bp")
|
|
469
|
+
geo.save(outdir / "biv_ellipsoid.bp")
|
|
791
470
|
|
|
792
471
|
|
|
793
472
|
@click.command(help="Create slab geometry")
|
|
@@ -1310,7 +989,6 @@ def gui():
|
|
|
1310
989
|
|
|
1311
990
|
app.add_command(lv_ellipsoid)
|
|
1312
991
|
app.add_command(biv_ellipsoid)
|
|
1313
|
-
app.add_command(biv_ellipsoid_torso)
|
|
1314
992
|
app.add_command(slab)
|
|
1315
993
|
app.add_command(slab_in_bath)
|
|
1316
994
|
app.add_command(gui)
|
cardiac_geometries/gui.py
CHANGED
cardiac_geometries/mesh.py
CHANGED
|
@@ -211,27 +211,29 @@ def ukb(
|
|
|
211
211
|
return geo
|
|
212
212
|
|
|
213
213
|
|
|
214
|
+
def transform_biv_markers(markers: dict[str, tuple[int, int]]) -> dict[str, list[int]]:
|
|
215
|
+
return {
|
|
216
|
+
"base": [markers["BASE"][0]],
|
|
217
|
+
"lv": [markers["LV_ENDO_FW"][0], markers["LV_SEPTUM"][0]],
|
|
218
|
+
"rv": [markers["RV_ENDO_FW"][0], markers["RV_SEPTUM"][0]],
|
|
219
|
+
"epi": [markers["LV_EPI_FW"][0], markers["RV_EPI_FW"][0]],
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
|
|
214
223
|
def biv_ellipsoid(
|
|
215
224
|
outdir: str | Path,
|
|
216
225
|
char_length: float = 0.5,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
center_rv_z: float = 0.0,
|
|
229
|
-
a_endo_rv: float = 3.0,
|
|
230
|
-
b_endo_rv: float = 1.5,
|
|
231
|
-
c_endo_rv: float = 1.5,
|
|
232
|
-
a_epi_rv: float = 4.0,
|
|
233
|
-
b_epi_rv: float = 2.5,
|
|
234
|
-
c_epi_rv: float = 2.0,
|
|
226
|
+
base_cut_z: float = 2.5,
|
|
227
|
+
box_size: float = 15.0, # Size of the cutting box
|
|
228
|
+
rv_wall_thickness: float = 0.4, # cm
|
|
229
|
+
lv_wall_thickness: float = 0.5, # cm
|
|
230
|
+
rv_offset_x: float = 2.5,
|
|
231
|
+
lv_radius_x: float = 2.0,
|
|
232
|
+
lv_radius_y: float = 1.8,
|
|
233
|
+
lv_radius_z: float = 3.25,
|
|
234
|
+
rv_radius_x: float = 1.9,
|
|
235
|
+
rv_radius_y: float = 2.5,
|
|
236
|
+
rv_radius_z: float = 3.0,
|
|
235
237
|
create_fibers: bool = False,
|
|
236
238
|
fiber_angle_endo: float = 60,
|
|
237
239
|
fiber_angle_epi: float = -60,
|
|
@@ -247,42 +249,20 @@ def biv_ellipsoid(
|
|
|
247
249
|
Directory where to save the results.
|
|
248
250
|
char_length : float, optional
|
|
249
251
|
Characteristic length of mesh, by default 0.5
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
b_epi_lv : float, optional
|
|
265
|
-
Dilation of lv epi ellipsoid in the y-direction, by default 1.5
|
|
266
|
-
c_epi_lv : float, optional
|
|
267
|
-
Dilation of lv epi ellipsoid in the z-direction, by default 1.5
|
|
268
|
-
center_rv_x : float, optional
|
|
269
|
-
X-coordinate for the center of the rv, by default 0.0
|
|
270
|
-
center_rv_y : float, optional
|
|
271
|
-
Y-coordinate for the center of the rv, by default 0.5
|
|
272
|
-
center_rv_z : float, optional
|
|
273
|
-
Z-coordinate for the center of the rv, by default 0.0
|
|
274
|
-
a_endo_rv : float, optional
|
|
275
|
-
Dilation of rv endo ellipsoid in the x-direction, by default 3.0
|
|
276
|
-
b_endo_rv : float, optional
|
|
277
|
-
Dilation of rv endo ellipsoid in the y-direction, by default 1.5
|
|
278
|
-
c_endo_rv : float, optional
|
|
279
|
-
Dilation of rv endo ellipsoid in the z-direction, by default 1.5
|
|
280
|
-
a_epi_rv : float, optional
|
|
281
|
-
Dilation of rv epi ellipsoid in the x-direction, by default 4.0
|
|
282
|
-
b_epi_rv : float, optional
|
|
283
|
-
Dilation of rv epi ellipsoid in the y-direction, by default 2.5
|
|
284
|
-
c_epi_rv : float, optional
|
|
285
|
-
Dilation of rv epi ellipsoid in the z-direction, by default 2.0
|
|
252
|
+
box_size : float, optional
|
|
253
|
+
Size of the cutting box, by default 15.0
|
|
254
|
+
lv_radius_x : float, optional
|
|
255
|
+
Radius of the left ventricle in the x-direction, by default 2.0
|
|
256
|
+
lv_radius_y : float, optional
|
|
257
|
+
Radius of the left ventricle in the y-direction, by default 1.8
|
|
258
|
+
lv_radius_z : float, optional
|
|
259
|
+
Radius of the left ventricle in the z-direction, by default 3.25
|
|
260
|
+
rv_radius_x : float, optional
|
|
261
|
+
Radius of the right ventricle in the x-direction, by default 1.9
|
|
262
|
+
rv_radius_y : float, optional
|
|
263
|
+
Radius of the right ventricle in the y-direction, by default 2.5
|
|
264
|
+
rv_radius_z : float, optional
|
|
265
|
+
Radius of the right ventricle in the z-direction, by default 3.0
|
|
286
266
|
create_fibers : bool, optional
|
|
287
267
|
If True create analytic fibers, by default False
|
|
288
268
|
fiber_angle_endo : float, optional
|
|
@@ -311,24 +291,17 @@ def biv_ellipsoid(
|
|
|
311
291
|
json.dump(
|
|
312
292
|
{
|
|
313
293
|
"char_length": char_length,
|
|
314
|
-
"
|
|
315
|
-
"
|
|
316
|
-
"
|
|
317
|
-
"
|
|
318
|
-
"
|
|
319
|
-
"
|
|
320
|
-
"
|
|
321
|
-
"
|
|
322
|
-
"
|
|
323
|
-
"
|
|
324
|
-
"
|
|
325
|
-
"center_rv_z": center_rv_z,
|
|
326
|
-
"a_endo_rv": a_endo_rv,
|
|
327
|
-
"b_endo_rv": b_endo_rv,
|
|
328
|
-
"c_endo_rv": c_endo_rv,
|
|
329
|
-
"a_epi_rv": a_epi_rv,
|
|
330
|
-
"b_epi_rv": b_epi_rv,
|
|
331
|
-
"c_epi_rv": c_epi_rv,
|
|
294
|
+
"base_cut_z": base_cut_z,
|
|
295
|
+
"box_size": box_size,
|
|
296
|
+
"rv_wall_thickness": rv_wall_thickness,
|
|
297
|
+
"lv_wall_thickness": lv_wall_thickness,
|
|
298
|
+
"rv_offset_x": rv_offset_x,
|
|
299
|
+
"lv_radius_x": lv_radius_x,
|
|
300
|
+
"lv_radius_y": lv_radius_y,
|
|
301
|
+
"lv_radius_z": lv_radius_z,
|
|
302
|
+
"rv_radius_x": rv_radius_x,
|
|
303
|
+
"rv_radius_y": rv_radius_y,
|
|
304
|
+
"rv_radius_z": rv_radius_z,
|
|
332
305
|
"create_fibers": create_fibers,
|
|
333
306
|
"fiber_angle_endo": fiber_angle_endo,
|
|
334
307
|
"fiber_angle_epi": fiber_angle_epi,
|
|
@@ -345,24 +318,17 @@ def biv_ellipsoid(
|
|
|
345
318
|
cgc.biv_ellipsoid(
|
|
346
319
|
mesh_name=mesh_name.as_posix(),
|
|
347
320
|
char_length=char_length,
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
center_rv_z=center_rv_z,
|
|
360
|
-
a_endo_rv=a_endo_rv,
|
|
361
|
-
b_endo_rv=b_endo_rv,
|
|
362
|
-
c_endo_rv=c_endo_rv,
|
|
363
|
-
a_epi_rv=a_epi_rv,
|
|
364
|
-
b_epi_rv=b_epi_rv,
|
|
365
|
-
c_epi_rv=c_epi_rv,
|
|
321
|
+
base_cut_z=base_cut_z,
|
|
322
|
+
box_size=box_size,
|
|
323
|
+
rv_wall_thickness=rv_wall_thickness,
|
|
324
|
+
lv_wall_thickness=lv_wall_thickness,
|
|
325
|
+
rv_offset_x=rv_offset_x,
|
|
326
|
+
lv_radius_x=lv_radius_x,
|
|
327
|
+
lv_radius_y=lv_radius_y,
|
|
328
|
+
lv_radius_z=lv_radius_z,
|
|
329
|
+
rv_radius_x=rv_radius_x,
|
|
330
|
+
rv_radius_y=rv_radius_y,
|
|
331
|
+
rv_radius_z=rv_radius_z,
|
|
366
332
|
verbose=verbose,
|
|
367
333
|
)
|
|
368
334
|
comm.barrier()
|
|
@@ -382,10 +348,12 @@ def biv_ellipsoid(
|
|
|
382
348
|
)
|
|
383
349
|
raise ImportError(msg)
|
|
384
350
|
|
|
351
|
+
ldrb_markers = transform_biv_markers(geometry.markers)
|
|
352
|
+
|
|
385
353
|
system = ldrb.dolfinx_ldrb(
|
|
386
354
|
mesh=geometry.mesh,
|
|
387
355
|
ffun=geometry.ffun,
|
|
388
|
-
markers=
|
|
356
|
+
markers=ldrb_markers,
|
|
389
357
|
alpha_endo_lv=fiber_angle_endo,
|
|
390
358
|
alpha_epi_lv=fiber_angle_epi,
|
|
391
359
|
beta_endo_lv=0,
|
|
@@ -403,218 +371,6 @@ def biv_ellipsoid(
|
|
|
403
371
|
return geo
|
|
404
372
|
|
|
405
373
|
|
|
406
|
-
def biv_ellipsoid_torso(
|
|
407
|
-
outdir: str | Path,
|
|
408
|
-
char_length: float = 0.5,
|
|
409
|
-
heart_as_surface: bool = False,
|
|
410
|
-
torso_length: float = 20.0,
|
|
411
|
-
torso_width: float = 20.0,
|
|
412
|
-
torso_height: float = 20.0,
|
|
413
|
-
rotation_angle: float = math.pi / 6,
|
|
414
|
-
center_lv_x: float = 0.0,
|
|
415
|
-
center_lv_y: float = 0.0,
|
|
416
|
-
center_lv_z: float = 0.0,
|
|
417
|
-
a_endo_lv: float = 2.5,
|
|
418
|
-
b_endo_lv: float = 1.0,
|
|
419
|
-
c_endo_lv: float = 1.0,
|
|
420
|
-
a_epi_lv: float = 3.0,
|
|
421
|
-
b_epi_lv: float = 1.5,
|
|
422
|
-
c_epi_lv: float = 1.5,
|
|
423
|
-
center_rv_x: float = 0.0,
|
|
424
|
-
center_rv_y: float = 0.5,
|
|
425
|
-
center_rv_z: float = 0.0,
|
|
426
|
-
a_endo_rv: float = 3.0,
|
|
427
|
-
b_endo_rv: float = 1.5,
|
|
428
|
-
c_endo_rv: float = 1.5,
|
|
429
|
-
a_epi_rv: float = 4.0,
|
|
430
|
-
b_epi_rv: float = 2.5,
|
|
431
|
-
c_epi_rv: float = 2.0,
|
|
432
|
-
create_fibers: bool = False,
|
|
433
|
-
fiber_angle_endo: float = 60,
|
|
434
|
-
fiber_angle_epi: float = -60,
|
|
435
|
-
fiber_space: str = "P_1",
|
|
436
|
-
verbose: bool = False,
|
|
437
|
-
comm: MPI.Comm = MPI.COMM_WORLD,
|
|
438
|
-
) -> Geometry:
|
|
439
|
-
"""Create BiV ellipsoidal geometry
|
|
440
|
-
|
|
441
|
-
Parameters
|
|
442
|
-
----------
|
|
443
|
-
outdir : str | Path
|
|
444
|
-
Directory where to save the results.
|
|
445
|
-
char_length : float, optional
|
|
446
|
-
Characteristic length of mesh, by default 0.5
|
|
447
|
-
heart_as_surface: bool
|
|
448
|
-
If true, create the heart as a a surface inside the torso,
|
|
449
|
-
otherwise let the heart be a volume, by default True.
|
|
450
|
-
torso_length : float, optional
|
|
451
|
-
Length of torso in the x-direction, by default 20.0
|
|
452
|
-
torso_width : float, optional
|
|
453
|
-
Length of torso in the y-direction, by default 20.0
|
|
454
|
-
torso_height : float, optional
|
|
455
|
-
Length of torso in the z-direction, by default 20.0
|
|
456
|
-
rotation_angle: float, optional
|
|
457
|
-
Angle to rotate the torso in order to object realistic position of
|
|
458
|
-
the heart in a torso, by default pi / 6
|
|
459
|
-
center_lv_x : float, optional
|
|
460
|
-
X-coordinate for the center of the lv, by default 0.0
|
|
461
|
-
center_lv_y : float, optional
|
|
462
|
-
Y-coordinate for the center of the lv, by default 0.0
|
|
463
|
-
center_lv_z : float, optional
|
|
464
|
-
Z-coordinate for the center of the lv, by default 0.0
|
|
465
|
-
a_endo_lv : float, optional
|
|
466
|
-
Dilation of lv endo ellipsoid in the x-direction, by default 2.5
|
|
467
|
-
b_endo_lv : float, optional
|
|
468
|
-
Dilation of lv endo ellipsoid in the y-direction, by default 1.0
|
|
469
|
-
c_endo_lv : float, optional
|
|
470
|
-
Dilation of lv endo ellipsoid in the z-direction, by default 1.0
|
|
471
|
-
a_epi_lv : float, optional
|
|
472
|
-
Dilation of lv epi ellipsoid in the x-direction, by default 3.0
|
|
473
|
-
b_epi_lv : float, optional
|
|
474
|
-
Dilation of lv epi ellipsoid in the y-direction, by default 1.5
|
|
475
|
-
c_epi_lv : float, optional
|
|
476
|
-
Dilation of lv epi ellipsoid in the z-direction, by default 1.5
|
|
477
|
-
center_rv_x : float, optional
|
|
478
|
-
X-coordinate for the center of the rv, by default 0.0
|
|
479
|
-
center_rv_y : float, optional
|
|
480
|
-
Y-coordinate for the center of the rv, by default 0.5
|
|
481
|
-
center_rv_z : float, optional
|
|
482
|
-
Z-coordinate for the center of the rv, by default 0.0
|
|
483
|
-
a_endo_rv : float, optional
|
|
484
|
-
Dilation of rv endo ellipsoid in the x-direction, by default 3.0
|
|
485
|
-
b_endo_rv : float, optional
|
|
486
|
-
Dilation of rv endo ellipsoid in the y-direction, by default 1.5
|
|
487
|
-
c_endo_rv : float, optional
|
|
488
|
-
Dilation of rv endo ellipsoid in the z-direction, by default 1.5
|
|
489
|
-
a_epi_rv : float, optional
|
|
490
|
-
Dilation of rv epi ellipsoid in the x-direction, by default 4.0
|
|
491
|
-
b_epi_rv : float, optional
|
|
492
|
-
Dilation of rv epi ellipsoid in the y-direction, by default 2.5
|
|
493
|
-
c_epi_rv : float, optional
|
|
494
|
-
Dilation of rv epi ellipsoid in the z-direction, by default 2.0
|
|
495
|
-
create_fibers : bool, optional
|
|
496
|
-
If True create analytic fibers, by default False
|
|
497
|
-
fiber_angle_endo : float, optional
|
|
498
|
-
Angle for the endocardium, by default 60
|
|
499
|
-
fiber_angle_epi : float, optional
|
|
500
|
-
Angle for the epicardium, by default -60
|
|
501
|
-
fiber_space : str, optional
|
|
502
|
-
Function space for fibers of the form family_degree, by default "P_1"
|
|
503
|
-
verbose : bool, optional
|
|
504
|
-
If True print information from gmsh, by default False
|
|
505
|
-
comm : MPI.Comm, optional
|
|
506
|
-
MPI communicator, by default MPI.COMM_WORLD
|
|
507
|
-
|
|
508
|
-
Returns
|
|
509
|
-
-------
|
|
510
|
-
cardiac_geometries.geometry.Geometry
|
|
511
|
-
A Geometry with the mesh, markers, markers functions and fibers.
|
|
512
|
-
|
|
513
|
-
"""
|
|
514
|
-
outdir = Path(outdir)
|
|
515
|
-
mesh_name = outdir / "biv_ellipsoid_torso.msh"
|
|
516
|
-
if comm.rank == 0:
|
|
517
|
-
outdir.mkdir(exist_ok=True, parents=True)
|
|
518
|
-
|
|
519
|
-
with open(outdir / "info.json", "w") as f:
|
|
520
|
-
json.dump(
|
|
521
|
-
{
|
|
522
|
-
"char_length": char_length,
|
|
523
|
-
"heart_as_surface": heart_as_surface,
|
|
524
|
-
"torso_length": torso_length,
|
|
525
|
-
"torso_width": torso_width,
|
|
526
|
-
"torso_height": torso_height,
|
|
527
|
-
"rotation_angle": rotation_angle,
|
|
528
|
-
"center_lv_x": center_lv_x,
|
|
529
|
-
"center_lv_y": center_lv_y,
|
|
530
|
-
"center_lv_z": center_lv_z,
|
|
531
|
-
"a_endo_lv": a_endo_lv,
|
|
532
|
-
"b_endo_lv": b_endo_lv,
|
|
533
|
-
"c_endo_lv": c_endo_lv,
|
|
534
|
-
"a_epi_lv": a_epi_lv,
|
|
535
|
-
"b_epi_lv": b_epi_lv,
|
|
536
|
-
"c_epi_lv": c_epi_lv,
|
|
537
|
-
"center_rv_x": center_rv_x,
|
|
538
|
-
"center_rv_y": center_rv_y,
|
|
539
|
-
"center_rv_z": center_rv_z,
|
|
540
|
-
"a_endo_rv": a_endo_rv,
|
|
541
|
-
"b_endo_rv": b_endo_rv,
|
|
542
|
-
"c_endo_rv": c_endo_rv,
|
|
543
|
-
"a_epi_rv": a_epi_rv,
|
|
544
|
-
"b_epi_rv": b_epi_rv,
|
|
545
|
-
"c_epi_rv": c_epi_rv,
|
|
546
|
-
"create_fibers": create_fibers,
|
|
547
|
-
"fiber_angle_endo": fiber_angle_endo,
|
|
548
|
-
"fiber_angle_epi": fiber_angle_epi,
|
|
549
|
-
"fiber_space": fiber_space,
|
|
550
|
-
"mesh_type": "biv",
|
|
551
|
-
"cardiac_geometry_version": __version__,
|
|
552
|
-
"timestamp": datetime.datetime.now().isoformat(),
|
|
553
|
-
},
|
|
554
|
-
f,
|
|
555
|
-
indent=2,
|
|
556
|
-
default=utils.json_serial,
|
|
557
|
-
)
|
|
558
|
-
|
|
559
|
-
cgc.biv_ellipsoid_torso(
|
|
560
|
-
mesh_name=mesh_name.as_posix(),
|
|
561
|
-
char_length=char_length,
|
|
562
|
-
heart_as_surface=heart_as_surface,
|
|
563
|
-
torso_length=torso_length,
|
|
564
|
-
torso_height=torso_height,
|
|
565
|
-
torso_width=torso_width,
|
|
566
|
-
rotation_angle=rotation_angle,
|
|
567
|
-
center_lv_x=center_lv_x,
|
|
568
|
-
center_lv_y=center_lv_y,
|
|
569
|
-
center_lv_z=center_lv_z,
|
|
570
|
-
a_endo_lv=a_endo_lv,
|
|
571
|
-
b_endo_lv=b_endo_lv,
|
|
572
|
-
c_endo_lv=c_endo_lv,
|
|
573
|
-
a_epi_lv=a_epi_lv,
|
|
574
|
-
b_epi_lv=b_epi_lv,
|
|
575
|
-
c_epi_lv=c_epi_lv,
|
|
576
|
-
center_rv_x=center_rv_x,
|
|
577
|
-
center_rv_y=center_rv_y,
|
|
578
|
-
center_rv_z=center_rv_z,
|
|
579
|
-
a_endo_rv=a_endo_rv,
|
|
580
|
-
b_endo_rv=b_endo_rv,
|
|
581
|
-
c_endo_rv=c_endo_rv,
|
|
582
|
-
a_epi_rv=a_epi_rv,
|
|
583
|
-
b_epi_rv=b_epi_rv,
|
|
584
|
-
c_epi_rv=c_epi_rv,
|
|
585
|
-
verbose=verbose,
|
|
586
|
-
)
|
|
587
|
-
comm.barrier()
|
|
588
|
-
|
|
589
|
-
geometry = utils.gmsh2dolfin(comm=comm, msh_file=mesh_name)
|
|
590
|
-
|
|
591
|
-
if comm.rank == 0:
|
|
592
|
-
with open(outdir / "markers.json", "w") as f:
|
|
593
|
-
json.dump(geometry.markers, f, default=utils.json_serial)
|
|
594
|
-
comm.barrier()
|
|
595
|
-
|
|
596
|
-
if create_fibers:
|
|
597
|
-
if heart_as_surface:
|
|
598
|
-
logger.warning("Can only create fibers when heart is a volume.")
|
|
599
|
-
else:
|
|
600
|
-
raise NotImplementedError("Fibers not implemented yet for biv ellipsoid.")
|
|
601
|
-
# from .fibers._biv_ellipsoid import create_biv_in_torso_fibers
|
|
602
|
-
|
|
603
|
-
# create_biv_in_torso_fibers(
|
|
604
|
-
# mesh=geometry.mesh,
|
|
605
|
-
# ffun=geometry.marker_functions.ffun,
|
|
606
|
-
# cfun=geometry.marker_functions.cfun,
|
|
607
|
-
# markers=geometry.markers,
|
|
608
|
-
# fiber_space=fiber_space,
|
|
609
|
-
# alpha_endo=fiber_angle_endo,
|
|
610
|
-
# alpha_epi=fiber_angle_epi,
|
|
611
|
-
# outdir=outdir,
|
|
612
|
-
# )
|
|
613
|
-
|
|
614
|
-
geo = Geometry.from_folder(comm=comm, folder=outdir)
|
|
615
|
-
return geo
|
|
616
|
-
|
|
617
|
-
|
|
618
374
|
def lv_ellipsoid(
|
|
619
375
|
outdir: Path | str,
|
|
620
376
|
r_short_endo: float = 7.0,
|
cardiac_geometries/utils.py
CHANGED
|
@@ -286,7 +286,7 @@ def parse_element(
|
|
|
286
286
|
"""
|
|
287
287
|
|
|
288
288
|
family_str, degree_str = space_string.split("_")
|
|
289
|
-
kwargs = {"degree": int(degree_str), "cell": mesh.
|
|
289
|
+
kwargs = {"degree": int(degree_str), "cell": mesh.basix_cell()}
|
|
290
290
|
if dim > 1:
|
|
291
291
|
if family_str in quads:
|
|
292
292
|
kwargs["value_shape"] = (dim,)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cardiac-geometriesx
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: A python library for cardiac geometries
|
|
5
5
|
Author-email: Henrik Finsberg <henriknf@simula.no>
|
|
6
6
|
License: MIT
|
|
@@ -29,11 +29,14 @@ Provides-Extra: docs
|
|
|
29
29
|
Requires-Dist: jupyter-book; extra == "docs"
|
|
30
30
|
Requires-Dist: jupytext; extra == "docs"
|
|
31
31
|
Requires-Dist: jupyter; extra == "docs"
|
|
32
|
-
Requires-Dist: pyvista[all]>=0.
|
|
32
|
+
Requires-Dist: pyvista[all]>=0.45.0; extra == "docs"
|
|
33
|
+
Requires-Dist: vtk>=9.5.0; extra == "docs"
|
|
33
34
|
Requires-Dist: trame-vuetify; extra == "docs"
|
|
34
35
|
Requires-Dist: ipywidgets; extra == "docs"
|
|
35
36
|
Requires-Dist: fenicsx-ldrb; extra == "docs"
|
|
36
37
|
Requires-Dist: ukb-atlas; extra == "docs"
|
|
38
|
+
Requires-Dist: sphinx-codeautolink; extra == "docs"
|
|
39
|
+
Requires-Dist: sphinx-copybutton; extra == "docs"
|
|
37
40
|
Provides-Extra: test
|
|
38
41
|
Requires-Dist: pre-commit; extra == "test"
|
|
39
42
|
Requires-Dist: pytest; extra == "test"
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
cardiac_geometries/__init__.py,sha256=2W_ywAeLjyRk5MqSPAodHa4UN2lOnW1h8tmGLQ3gaJ0,150
|
|
2
|
-
cardiac_geometries/cli.py,sha256=
|
|
2
|
+
cardiac_geometries/cli.py,sha256=kVNlPm0GKXolYrqCLyNYEtdCmSmm9mitTYPTbo_84TA,21854
|
|
3
3
|
cardiac_geometries/geometry.py,sha256=b-JbxV1wTgrjgQaNNG4NiGmXLs3nqRabsUUtYDnyKKA,13616
|
|
4
|
-
cardiac_geometries/gui.py,sha256=
|
|
5
|
-
cardiac_geometries/mesh.py,sha256=
|
|
6
|
-
cardiac_geometries/utils.py,sha256=
|
|
4
|
+
cardiac_geometries/gui.py,sha256=v4NcZij_RVYz4UPSq8LvQHvXha6kHtWzjAmkYCRdMrs,8355
|
|
5
|
+
cardiac_geometries/mesh.py,sha256=mIvMkLqQJoEgjg6Ikbpx06iOdkkOXHT3WO0GGcRygkE,38768
|
|
6
|
+
cardiac_geometries/utils.py,sha256=HrhRoaLwJF80mLFyMabdVGVFGhvj7SrwqUe4ENzJqK4,22202
|
|
7
7
|
cardiac_geometries/fibers/__init__.py,sha256=iggELqJBQySc6ihph1-yaweOfxNvvTE2670RnUnOgDw,2229
|
|
8
8
|
cardiac_geometries/fibers/cylinder.py,sha256=Q1GIuVvntPQ7pW6Z4UYSC8-8WfkClbakiW81Fl9dvk0,3345
|
|
9
9
|
cardiac_geometries/fibers/cylinder_flat.py,sha256=h8ZeyQdZJAOTU456TIumh3eWkZkhzf7R7CpKki5HNrk,5304
|
|
10
10
|
cardiac_geometries/fibers/lv_ellipsoid.py,sha256=KMVOHg2VPg1tF2R9TKIX-vQr6dDM4HThh12WW_diNfU,6024
|
|
11
11
|
cardiac_geometries/fibers/slab.py,sha256=vQ9nYoAnoeBevEYkY3Hsy7o4tZ_gfBWaZI_p5UH_PgM,4805
|
|
12
12
|
cardiac_geometries/fibers/utils.py,sha256=Uy0xWpQXNpOLqCYaSFmJ2rKcCeP3lXCLlQnZR1S2KKQ,3852
|
|
13
|
-
cardiac_geometriesx-0.
|
|
14
|
-
cardiac_geometriesx-0.
|
|
15
|
-
cardiac_geometriesx-0.
|
|
16
|
-
cardiac_geometriesx-0.
|
|
17
|
-
cardiac_geometriesx-0.
|
|
18
|
-
cardiac_geometriesx-0.
|
|
13
|
+
cardiac_geometriesx-0.7.0.dist-info/licenses/LICENSE,sha256=lo5K2rJPZOSv6luutGHbzzi3IpXNaB9E2UWq60qvNx0,1111
|
|
14
|
+
cardiac_geometriesx-0.7.0.dist-info/METADATA,sha256=Ub7TlNxeMtlDRghvu_Qb5edAQGH7qOZjktPQwyZ2STE,4535
|
|
15
|
+
cardiac_geometriesx-0.7.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
16
|
+
cardiac_geometriesx-0.7.0.dist-info/entry_points.txt,sha256=xOBnlc6W-H9oCDYLNz3kpki26OmpfYSoFSrmi_4V-Ec,52
|
|
17
|
+
cardiac_geometriesx-0.7.0.dist-info/top_level.txt,sha256=J0gQxkWR2my5Vf7Qt8buDY8ZOjYdVfIweVunCGXWKNE,19
|
|
18
|
+
cardiac_geometriesx-0.7.0.dist-info/RECORD,,
|
|
File without changes
|
{cardiac_geometriesx-0.6.2.dist-info → cardiac_geometriesx-0.7.0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{cardiac_geometriesx-0.6.2.dist-info → cardiac_geometriesx-0.7.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|