AllenSDK
AllenSDK copied to clipboard
NaturalScenes get_response broken
Describe the bug A summary of what the bug is. When using the NaturalScenes analysis object, I'm unable to access the response or the peak objects. Both appear to stem from a bug in the get_response function.
To Reproduce Steps to reproduce the behavior. Please include all relevant code! session_id = 504625475 dataset = boc.get_ophys_experiment_data(session_id) ns = NaturalScenes(dataset) response = ns.response
Expected behavior What you expected to happen. This should return an array of all the responses of all the neurons in the experiment
Actual Behavior What actually happened. If the bug produced an error message or incorrect values, please include them here!
ValueError Traceback (most recent call last)
~/anaconda3/lib/python3.7/site-packages/allensdk/brain_observatory/stimulus_analysis.py in response(self) 127 def response(self): 128 if self._response is StimulusAnalysis._PRELOAD: --> 129 self._response = self.get_response() 130 131 return self._response
~/anaconda3/lib/python3.7/site-packages/allensdk/brain_observatory/natural_scenes.py in get_response(self) 120 self.stim_table.frame == (ns - 1)] 121 subset_pval = self.pval[self.stim_table.frame == (ns - 1)] --> 122 response[ns, :, 0] = subset_response.mean(axis=0) 123 response[ns, :, 1] = subset_response.std( 124 axis=0) / np.sqrt(len(subset_response))
ValueError: could not broadcast input array from shape (157) into shape (156)
Environment (please complete the following information):
- OS & version: [e.g. Ubuntu 18.04]
- Python version [e.g. 3.7]
- AllenSDK version [e.g. v1.0.0]
Additional context Add any other context about the problem here.
Do you want to work on this issue? Are you willing and able to fix this bug? If so, let us know here (and see the guide). Thank you!