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

import xml info to bz_LoadBinary when user specs are missing #360

Open
samamckenzie opened this issue Oct 30, 2019 · 11 comments
Open

import xml info to bz_LoadBinary when user specs are missing #360

samamckenzie opened this issue Oct 30, 2019 · 11 comments
Assignees

Comments

@samamckenzie
Copy link
Collaborator

the defaults make the function work but give you garbage if you are not recording a single channel at 20kHz (is this anybody's default?)

I propose loading in from the xml when user specs are omitted

@brendonw1
Copy link
Collaborator

brendonw1 commented Oct 30, 2019 via email

@samamckenzie
Copy link
Collaborator Author

We can either have bz_loadbinary and sessionInfo always yoked together, which means adding fields to sessionInfo for each dat file (time, auxiliary, analogin, digitalin, intracellular, juxtacellular, extracellular, ??), or we can make bz_loadbinary a more flexible function and have it read from the xml, since these always exist if the file was used in neuroscope.

I vote the latter.

I also vote to get rid of these defaults and let the function throw an error if the sessioninfo,/XML/user spec is omitted

I

@brendonw1
Copy link
Collaborator

brendonw1 commented Oct 30, 2019 via email

@samamckenzie
Copy link
Collaborator Author

How about these options

A) You and Peter integrate how sessioninfo handles all the meta data for the dat files and if the user asks to import a dat file for which an XML exists but a field in the sessionInfo does not, then we can make a new field based off the name of the dat file and re-save the meta data to the sessionInfo file.

For this to work we need a naming convention for the dat files, I suggest basename_fieldName.dat (e.g. basename_analogin.dat)

B) Alternatively, we can uncouple the two functions (bz_loadbinary and sessionInfo) and just load from the xml. I still prefer this option

C) Or we can force the user to provide channel number and Fs, but this decreases batch functionality when that data is already saved in the XML.

D) build a more general purpose wrapper that loads from the XML

@dlevenstein
Copy link
Collaborator

I think pulling from metadata as default is a good idea.

Whatever the format of the metadata file, I think we should call it the same way from within all functions in the repo. That way any changes to the metadata system can be made to that function.

Currently, metadata is called via bz_getSessionInfo, which does read from the xml if there's no sessionInfo file. So from my point of view, any calls to metadata should be made via bz_getSessionInfo, and updates to the metadata system should be made via updates to bz_getSessionInfo (which should be improved so it fits everyone's needs).

So, I vote A

@samamckenzie
Copy link
Collaborator Author

it currently reads from one XML, but not all of the XMLs.

Most of us never make an XML for time.dat nor auxiliary.dat, but one day we may want to read those files and make those XMLs. The question is do we force the user to do that every time for every session (even when that data is almost never used), or do we wait until the user wants to read in that data, then look for the XML and update the metadata. In which case, at some later point, the attempt at using bz_loadbinary will try to pull from the sessionInfo and find there is not field, then in bz_getsessioninfo there will be a flag to grab the relevant XML, which will then generate a new field. if no xml exists, then bz_getsessioninfo throws an error. under this framework, every dat file that is read by bz_loadbinary needs to be married to a field in sessionInfo - is this what we want? this sounds a bit onerous to me.

@brendonw1
Copy link
Collaborator

brendonw1 commented Oct 30, 2019 via email

@samamckenzie
Copy link
Collaborator Author

this is perfect, better than reading from the XML
https://github.com/buzsakilab/buzcode/blob/master/preprocessing/bz_DatFileMetadata.m

it just isn't integrated into the bz_loadbinary file.

we can adopt this standard rather than put this in sessionInfo. Up to you. But then this function needs to be read at the outset of the preprocessing pipeline, likely by bz_getsessioninfo

@brendonw1
Copy link
Collaborator

brendonw1 commented Oct 30, 2019 via email

@evilrobotxoxo
Copy link
Collaborator

evilrobotxoxo commented Oct 30, 2019 via email

@brendonw1
Copy link
Collaborator

brendonw1 commented Oct 31, 2019 via email

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

No branches or pull requests

5 participants