Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion from strand to casx can result in the ouput arc_diameters containing NaN values #6

Open
embaker opened this issue Jun 22, 2024 · 0 comments

Comments

@embaker
Copy link

embaker commented Jun 22, 2024

The returned arc_diameters from the strand2casx function can contain NaN values when the arc radius index for both the endpoints of an arc happen to be the highest index in the range of arc radius indices. In this situation, the computed arc radius for the arc can be slightly above the last index due to numerical error. Then in interpolating the radius index to a length, the interp1 function returns NaN values for these radii because they are outside the interpolation bounds and no extrapolation method has been defined.

Proposed solution is enable extrapolation in line 93:

arc_radii = exp( interp1( 1 : length( lumen_radius_in_microns_range ), log( lumen_radius_in_microns_range ), arc_radius_indices, 'linear', 'extrap' ));

This will eliminate the current source of NaN values, and small extrapolation outside of the radius index range should not produce inaccurate values for the arc radius.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant