Spaces:
Sleeping
Sleeping
Upload centerline_extraction.py
Browse files- centerline_extraction.py +3 -3
centerline_extraction.py
CHANGED
|
@@ -137,12 +137,12 @@ def compute_centerlines_network(
|
|
| 137 |
aorta_iliac_endpoints_ras = lps_endpoints_to_ras(aorta_iliac_endpoints)
|
| 138 |
|
| 139 |
# Decimate the surface by reducing surface mesh points before voronoi centerline extraction as it scales badly with large surfaces
|
| 140 |
-
surface_for_centerline = decimate_surface_for_voronoi(surface_polydata_ras, target_points=50000)
|
| 141 |
|
| 142 |
# Extract main aorta→iliacs centerline via Voronoi method
|
| 143 |
try:
|
| 144 |
print("Extracting main centerline...")
|
| 145 |
-
centerline_polydata = extract_centerline_from_surface(
|
| 146 |
print(f"Main centerline: {centerline_polydata.GetNumberOfCells()} cells, {centerline_polydata.GetNumberOfPoints()} points")
|
| 147 |
except Exception as e:
|
| 148 |
print(f"Main centerline extraction failed: {type(e).__name__}: {e}")
|
|
@@ -153,7 +153,7 @@ def compute_centerlines_network(
|
|
| 153 |
branch_bifurcations = []
|
| 154 |
if centerline_polydata and branch_endpoints:
|
| 155 |
try:
|
| 156 |
-
branch_centerlines, branch_bifurcations = process_all_branches(branch_endpoints, centerline_polydata,
|
| 157 |
except Exception as e:
|
| 158 |
print(f"Branch extraction failed: {type(e).__name__}: {e}")
|
| 159 |
|
|
|
|
| 137 |
aorta_iliac_endpoints_ras = lps_endpoints_to_ras(aorta_iliac_endpoints)
|
| 138 |
|
| 139 |
# Decimate the surface by reducing surface mesh points before voronoi centerline extraction as it scales badly with large surfaces
|
| 140 |
+
#surface_for_centerline = decimate_surface_for_voronoi(surface_polydata_ras, target_points=50000)
|
| 141 |
|
| 142 |
# Extract main aorta→iliacs centerline via Voronoi method
|
| 143 |
try:
|
| 144 |
print("Extracting main centerline...")
|
| 145 |
+
centerline_polydata = extract_centerline_from_surface(surface_polydata_ras, aorta_iliac_endpoints_ras, curve_sampling_distance, smooth_iterations=0)
|
| 146 |
print(f"Main centerline: {centerline_polydata.GetNumberOfCells()} cells, {centerline_polydata.GetNumberOfPoints()} points")
|
| 147 |
except Exception as e:
|
| 148 |
print(f"Main centerline extraction failed: {type(e).__name__}: {e}")
|
|
|
|
| 153 |
branch_bifurcations = []
|
| 154 |
if centerline_polydata and branch_endpoints:
|
| 155 |
try:
|
| 156 |
+
branch_centerlines, branch_bifurcations = process_all_branches(branch_endpoints, centerline_polydata, surface_polydata_ras, curve_sampling_distance)
|
| 157 |
except Exception as e:
|
| 158 |
print(f"Branch extraction failed: {type(e).__name__}: {e}")
|
| 159 |
|