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

Error calculating skeleton from contour #185

Open
MichaelCurrie opened this issue Apr 16, 2016 · 0 comments
Open

Error calculating skeleton from contour #185

MichaelCurrie opened this issue Apr 16, 2016 · 0 comments

Comments

@MichaelCurrie
Copy link

MichaelCurrie commented Apr 16, 2016

Line 52 of WCON demo.py:

'skeleton': bw.h_dorsal_contour}  # DEBUG

... uses the dorsal contour in place of the skeleton, because of an error in calculating the skeleton from the contour. If we replace the above with:

'skeleton': bw.h_skeleton}  # DEBUG

We get this error:

RUNNING TEST WCON demo.py:
Traceback (most recent call last):
  File "../open_worm_analysis_toolbox/prefeatures/basic_worm.py", line 447, in h_skeleton
    return self._h_skeleton
AttributeError: 'BasicWorm' object has no attribute '_h_skeleton'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "WCON demo.py", line 83, in <module>
    w = schafer_to_WCON(schafer_bw_file_path)
  File "WCON demo.py", line 52, in schafer_to_WCON
    'skeleton': bw.h_skeleton}  # DEBUG
  File "../open_worm_analysis_toolbox/prefeatures/basic_worm.py", line 452, in h_skeleton
    self.h_ventral_contour, self.h_dorsal_contour)[1]
  File "../open_worm_analysis_toolbox/prefeatures/pre_features.py", line 96, in compute_skeleton_and_widths
    frames_to_plot=[])
  File "../open_worm_analysis_toolbox/prefeatures/skeleton_calculator1.py", line 124, in compute_skeleton_and_widths
    polyorder=SMOOTHING_ORDER)
  File "/home/ubuntu/miniconda3/lib/python3.5/site-packages/scipy/signal/_savitzky_golay.py", line 344, in savgol_filter
    _fit_edges_polyfit(x, window_length, polyorder, deriv, delta, axis, y)
  File "/home/ubuntu/miniconda3/lib/python3.5/site-packages/scipy/signal/_savitzky_golay.py", line 222, in _fit_edges_polyfit
    polyorder, deriv, delta, y)
  File "/home/ubuntu/miniconda3/lib/python3.5/site-packages/scipy/signal/_savitzky_golay.py", line 180, in _fit_edge
    x_edge = axis_slice(x, start=window_start, stop=window_stop, axis=axis)
  File "/home/ubuntu/miniconda3/lib/python3.5/site-packages/scipy/signal/_arraytools.py", line 45, in axis_slice
    b = a[a_slice]
IndexError: invalid slice

@JimHokanson does this error ring any bells for you? Otherwise I will investigate. Thanks

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

No branches or pull requests

1 participant