KVSlab / morphMan

A collection of tools for manipulation of morphological features in patient-specific geometries
https://morphman.readthedocs.io/en/latest/
Other
30 stars 12 forks source link

TypeError in estimate_alpha_and_beta #80

Open SMSadat98 opened 2 years ago

SMSadat98 commented 2 years ago

Hello @hkjeldsberg ,

while trying to compute alpha/beta values, my arguments were:

default_values["quantity_to_compute"] = "angle" default_values["region_points"] = [] default_values["value-change"] = 10 default_values["grid-size"] = 25

Set region of interest

default_values["region_of_interest"] = "manual" default_values["region_points"] = []

Run manipulation

estimate_alpha_and_beta(**default_values)

But I get the error:

Traceback (most recent call last): File "C:\Users\user\Desktop\morphman_dev2\estimate_curve_angle.py", line 29, in estimate_alpha_and_beta(**default_values) TypeError: estimate_alpha_and_beta() got an unexpected keyword argument 'smooth'

Best Regards, Sadat

hkjeldsberg commented 2 years ago

HI @SMSadat98 ,

Thanks for reporting this! The error is likely caused by estimate_alpha_and_beta() not following the standard way (in morphman) of fetching the default arguments, thus the default parameter smooth is not required for this method. Instead, you can get the default parameters for this particular method by importing them directly in your script. As an example, consider the following script – run_estimate.py:

from morphman.misc.estimate_alpha_and_beta import read_command_line, estimate_alpha_and_beta

# Get default command line arguments
default_values = read_command_line()

# Overwrite default arguments
default_values["region_points"] = []
default_values["value_change"] = 10
default_values["grid_size"] = 25
default_values["region_of_interest"] = "manual"
default_values["region_points"] = []

# Call method
estimate_alpha_and_beta(**default_values)

And this can be run with the following command (with angle as the quantity of interest):

python run_estimate.py --ifile my_model.vtp --quantity angle

Hope this helps!

Best, Henrik