Skip to content

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

@embaker

Description

@embaker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions