Add documentation to handle (physical) units of recording channels#3844
Conversation
|
Looks great - doc was super clear and easy to read! |
Co-authored-by: Chris Halcrow <57948917+chrishalcrow@users.noreply.github.com>
zm711
left a comment
There was a problem hiding this comment.
Before being really careful my one concern with this doc as written is that for the average user we don't need to scale_to_uV. It happens with argument flags in various functions. The way this documentation works it sounds like I always have to create a scaled recording rather than keep my unscaled and scale at the function level. I think the doc about other physical units is great, but I'm worried that this might actually confuse users on how to use the library since the scaling for uV is baked in to other functions the class is for people that just need their recording scaled for other purposes right?
what would be the confusion exactly? |
|
The confusion is do I need to do a recording = read_intan()
scaled_rec = scale_to_uV(recording)
sorting = run_sorter(xx)
# or spikeglx
recording = read_spikeglx()
scaled_rec= scale_to_uV(recording)
sorting=run_sorter()The scaling is not required in a pipeline. But when I read these docs I feel like I have to explicitly run this step no matter what. I think it is helpful for people to know scaling is important but the main way the library has people interact with ephys scaling is with the |
Thanks.
This is not clear to me either. Is it to you?
I don't agree with this or want it. Yes, I think we should discuss this on the meeting tomorrow. I am fine if you want add a list of pipes/algorithms where the units don't matter and an explanation on why they don't but I don't have that knowledge and I users are in a better position to understand if they want to run their algorithms on raw data or in units. |
|
@yger it seems like maybe some changes to SC2 broke testing? |
|
Ok @zm711 I added some notes in the direction that you wanted. Check it out and let me know what you think. I still think that this is a good topic to discuss on the next meeting. |
| SpikeInterface provides tools to handle both situations. | ||
|
|
||
| It's important to note that **most spike sorters work fine on raw digital (ADC) units** and not scaling is needed. | ||
| Many preprocessing tools are also linear transformations, and if the ADC is implemented as a linear transformation, the overall effect can be preserved. |
There was a problem hiding this comment.
we could say that is relatively common here to be a linear transformation (although you discuss gain/offset later on).
There was a problem hiding this comment.
I added a comment on this direction.
Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com>
| self.set_channel_offsets(offsets=0.0) | ||
|
|
||
|
|
||
| scale_to_physical_units = ScaleToPhysicalUnits |
There was a problem hiding this comment.
Hello, could you change this to
from spikeinterface.core.core_tools import define_function_handling_dict_from_class
scale_to_physical_units = define_function_handling_dict_from_class(ScaleToPhysicalUnits, name="scale_to_physical_units")then will works with dicts of recs
There was a problem hiding this comment.
Done
This function define_function_handling_dict_from_class needs way more documentation of what it has now.
Co-authored-by: Chris Halcrow <57948917+chrishalcrow@users.noreply.github.com>
Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com>
zm711
left a comment
There was a problem hiding this comment.
I have reread this I request two minor changes and then I feel good about this.
Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com>
|
OK, I implemented changed based on the last round of review @zm711 . |
zm711
left a comment
There was a problem hiding this comment.
Two grammar fixes :)
still slight preference for a mentioned of return_scaled but after merging the grammar fixes I'm fine with approving and then if we have user issues/confusion we can adjust to what they need.
Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com>
Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com>
I don't want to mention this until #3794 is done. |
Yeah I forgot about that until you pushed another commit :) That works for me! |
Ok guys, I will need your feedback. I am also adding another preprocessor wrapper that handles this for the user.