1313from morphman .common .vessel_reconstruction_tools import *
1414
1515
16- def manipulate_bifurcation (input_filepath , output_filepath , smooth , smooth_factor , angle ,
17- keep_fixed_1 , keep_fixed_2 , bif , lower , no_smooth , no_smooth_point ,
18- poly_ball_size , cylinder_factor , resampling_step ,
16+ def manipulate_bifurcation (input_filepath , output_filepath , smooth , smooth_factor , angle , keep_fixed_1 , keep_fixed_2 ,
17+ bif , lower , no_smooth , no_smooth_point , poly_ball_size , cylinder_factor , resampling_step ,
1918 region_of_interest , region_points , tension , continuity ):
2019 """
2120 Objective rotation of daughter branches, by rotating
@@ -27,6 +26,8 @@ def manipulate_bifurcation(input_filepath, output_filepath, smooth, smooth_facto
2726 Includes the option to rotate only one of the daughter branches.
2827
2928 Args:
29+ tension (float): Tension parameter of Kochanek splines
30+ continuity (float): Continuity parameter of Kochanek splines
3031 input_filepath (str): Path to input surface.
3132 output_filepath (str): Path to output surface.
3233 smooth (bool): Determine if the voronoi diagram should be smoothed.
@@ -144,8 +145,7 @@ def manipulate_bifurcation(input_filepath, output_filepath, smooth, smooth_facto
144145
145146 # Clip the voronoi diagram
146147 print ("-- Clipping Voronoi diagram" )
147- voronoi_clipped , voronoi_bifurcation = get_split_voronoi_diagram (voronoi , [patch_cl ,
148- clipped_centerline ])
148+ voronoi_clipped , voronoi_bifurcation = get_split_voronoi_diagram (voronoi , [patch_cl , clipped_centerline ])
149149 write_polydata (voronoi_clipped , voronoi_clipped_path )
150150 write_polydata (voronoi_bifurcation , voronoi_bifurcation_path )
151151
@@ -284,7 +284,7 @@ def rotate_voronoi(clipped_voronoi, patch_cl, div_points, m, R):
284284 for i in range (1 , patch_cl .GetNumberOfCells ()):
285285 pnt = cell_line [i ].GetPoints ().GetPoint (0 )
286286 new = cell_line [0 ].GetPoints ().GetPoint (locator [0 ].FindClosestPoint (pnt ))
287- if get_distance (pnt , new ) < tolerance * 10 :
287+ if get_distance (pnt , new ) < tolerance * 10 :
288288 not_rotate .append (i )
289289
290290 def check_rotate (point ):
@@ -369,7 +369,7 @@ def rotate_cl(patch_cl, div_points, rotation_matrices, R):
369369
370370 start = cell .GetPoint (0 )
371371 dist = line0 .GetPoint (locator0 .FindClosestPoint (start ))
372- test = get_distance (start , dist ) > tolerance * 10
372+ test = get_distance (start , dist ) > tolerance * 10
373373
374374 if test or len (div_points ) == 2 :
375375 locator = get_vtk_point_locator (cell )
@@ -615,7 +615,6 @@ def read_command_line_bifurcation(input_path=None, output_path=None):
615615 parser .add_argument ("-c" , "--continuity" , type = float , default = 0.8 ,
616616 help = "Set continuity of the KochanekSpline from -1 to 1" )
617617
618-
619618 # Bifurcation reconstruction arguments
620619 parser .add_argument ("--bif" , type = str2bool , default = False ,
621620 help = "interpolate bif as well" )
@@ -638,7 +637,6 @@ def read_command_line_bifurcation(input_path=None, output_path=None):
638637 if not (- 1 <= args .continuity <= 1 ):
639638 raise ValueError ("Tension has to be between -1 and 1, not {}" .format (args .continuity ))
640639
641-
642640 return dict (input_filepath = args .ifile , smooth = args .smooth , output_filepath = args .ofile ,
643641 smooth_factor = args .smooth_factor , angle = ang_ ,
644642 keep_fixed_1 = args .keep_fixed_1 , keep_fixed_2 = args .keep_fixed_2 ,
0 commit comments