From b9444d1b532437e3ddec6cf9d33d5288f1435cb5 Mon Sep 17 00:00:00 2001 From: Simone Date: Mon, 8 Jan 2024 15:16:11 +0100 Subject: [PATCH] adapted for hfe-accurate branch merge --- src/pyhexspline/gmsh_mesh_builder.py | 2 +- src/pyhexspline/spline_volume.py | 4 ++++ standalone.py | 14 ++++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/pyhexspline/gmsh_mesh_builder.py b/src/pyhexspline/gmsh_mesh_builder.py index 01edc38..352172b 100644 --- a/src/pyhexspline/gmsh_mesh_builder.py +++ b/src/pyhexspline/gmsh_mesh_builder.py @@ -1170,7 +1170,7 @@ def sort_trab_coords(self, point_tags): ) # split every x, y, z coordinate # sort the sub-arrays in counterclockwise order - point_tags_sorted0 = self.sort_ccw(coords_split[0]) # ! HERE + point_tags_sorted0 = self.sort_ccw(coords_split[0]) # for each sub-array point_tags, sort the points with point_tags_sorted0 point_tags_sorted = [ point_tags[point_tags_sorted0] for point_tags in point_tags diff --git a/src/pyhexspline/spline_volume.py b/src/pyhexspline/spline_volume.py index 14bb631..13dcebf 100644 --- a/src/pyhexspline/spline_volume.py +++ b/src/pyhexspline/spline_volume.py @@ -12,10 +12,14 @@ import SimpleITK as sitk from mpl_toolkits.axes_grid1 import make_axes_locatable from scipy.interpolate import splev, splprep +import matplotlib + LOGGING_NAME = "MESHING" # flake8: noqa: E203 +matplotlib.use("TkAgg") + class OCC_volume: def __init__( diff --git a/standalone.py b/standalone.py index 4d9f822..a4e3691 100644 --- a/standalone.py +++ b/standalone.py @@ -4,13 +4,15 @@ Date: 09.2022 - Ongoing """ -import os import logging -from src.pyhexspline.spline_mesher import HexMesh -import hfe_input_transformer as transformer +import os + import coloredlogs import numpy as np +import hfe_input_transformer as transformer +from src.pyhexspline.spline_mesher import HexMesh + # flake8: noqa: E501 @@ -51,9 +53,9 @@ def main(): "thickness_tol": 5e-1, # minimum cortical thickness tolerance: 3 * XCTII voxel size "phases": 2, # 1: only external contour, 2: external and internal contour "center_square_length_factor": 0.4, # size ratio of the refinement square: 0 < l_f < 1 - "n_elms_longitudinal": 4, # number of elements in the longitudinal direction - "n_elms_transverse_trab": 12, # number of elements in the transverse direction for the trabecular compartment - "n_elms_transverse_cort": 3, # number of elements in the transverse direction for the cortical compartment + "n_elms_longitudinal": 3, # number of elements in the longitudinal direction + "n_elms_transverse_trab": 10, # number of elements in the transverse direction for the trabecular compartment + "n_elms_transverse_cort": 4, # number of elements in the transverse direction for the cortical compartment "n_elms_radial": 10, # number of elements in the radial direction # ! Should be 10 if trab_refinement is True "mesh_order": 1, # set order of the mesh (1: linear, 2: quadratic) "ellipsoid_fitting": True, # True: perform ellipsoid fitting