simonavrillon / MUedit

App to decompose electromyographic signals and manually edit the motor unit pulse trains
GNU General Public License v3.0
25 stars 9 forks source link

Out of bounds error on ROI selection #3

Closed jesse-gilmer closed 9 months ago

jesse-gilmer commented 11 months ago

Hello Dr. Avrillon (@simonavrillon),

This project is great. I'm excited to continue to use it in EMG unit processing. I'm especially glad for the very thorough user's manual. It was a breeze to get this set up for my work.

My particular use case for the software involves selecting essentially the entire epoch of recorded data, and during the ROI selection phase of data importing I noticed that I either need to be very precise or, more realistically, implement a limit on the ROI based on the length of the data. Please see the changes in this pull request for one potential fix.

Feel free to dismiss it or implement the changes, I just wanted to inform you. I think it might be nice to have a "Use entire timeseries" toggle in the menu. I'd be happy to implement that if you think it would be useful.

Thank you for your work, J. Gilmer

jesse-gilmer commented 11 months ago

Oh, and it's also possible to accidentally set the first ROI value to 0 if the user selects right to left, so I would also suggest: x(1) = max([1 x(1)]); in that code block too.

Thanks again, JG

simonavrillon commented 9 months ago

Hi Jesse, thanks for your feedback. This issue has been resolved in the new version of MUedit. The ROI is now limited to the boundaries of the plot, and the coordinates are sorted and corrected if outside of the range of the signal. Cheers, Simon