-
Notifications
You must be signed in to change notification settings - Fork 46
Integration with NWB #12
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
Comments
About the ndx-franklab-novela I will use lots of fields propose by this project. |
ndx-spatial-coordinates is a work-in-progress. It's a project with the Allen Institute that encompasses several related topics: probe configuration, anatomical atlas, and spatial transformations. We have started thinking about how to define objects in 2 and 3 d, so I thought it might be relevant for you. It's still a work-in-progress though, is likely to change, and currently has no documentation. |
Is it with Luke Campagnola ? |
Hi @bendichter. |
@D1o0g9s will be helping with this task Some pseudo-code design for reading NWB without the use of the extension @D1o0g9s is putting together, as well as a modular step-by-step bite-size tasklist 1read stuff in probeinterface.io def read_from_nwb(nwbfile_path : str) -> Probe: # or w/e name you want
with NWBHDF5IO(file, "r") as io:
nwbfile = io.read()
# figure out num_dims and num_contaacts,
shape = nwbfile.electrodes.get("shape")
# shape_params only necessary if shape is not None
probe_object = Probe(ndim = num_dims, si_units="um")
poisitions_2d = np.empty(shape=(num_contacts, num_dims))
for j, column_name in enumerate(["rel_x", "rel_y", "rel_z"]):
poisitions_2d[, j] = nwbfile.electrodes[column_name]
probe_object.set_contacts(positioned_2d, shapes=shape, shape_params=shape_params)
return probe_object 2In neuroconv.tools.probeinterface def add_probe_info(nwbfile : NWBFile):
# map all probeinterface.Probe fields to electrode columns + use the ndx-probe extension for nicely describing probe geometry in the new Device object
def write_probe(probe: Probe, nwbfile_path : str, metadata : dict, overwrite : bool = False):
with NWBHDF5IO(path=nwbfile_path, mode="w" if overwrite else "r+") as io:
nwbfile = make_nwbfile_from_metadata(metadata) if overwrite else io.read() # this is typical basic neuroconv metadata strcture, mainly for session_start_time
add_probe_info(nwbfile=nwbfile)
io.write(nwbfile) 3read more complete information (if available) in probeinterface.io def read_from_nwb(): # or w/e name you want
with NWBHDF5IO(file, "r") as io:
nwbfile = io.read()
# all the previous stuff from #1
# then read in all that stuff was that newly written through the use of # 2
# goal being to be capable of a full roundtrip without any loss in information when using neuroconv.tools.probeinterface.write_probe to write a nwbfile, then using probe=read_from_nwb(nwbfile_path) to read it back |
@lfrank @bendichter
You both mention NWB backend for handling probe geometry description.
I have NOT studied then yet.
I will.
Are theses two codes linked somehow ?
https://github.com/NovelaNeuro/ndx-franklab-novela
this seams to be a description of in house data management for recordings that also include probes description (with multi shank)
https://github.com/catalystneuro/ndx-spatial-coordinates/blob/main/src/spec/create_extension_spec.py
being unfamilir wuth nwb I get the purposed on this, could you explain more ?
Would be a way to define some kind of offcial to describe probes in NWB.
Maybe my question is naive because I am not aware of what have already been done.
The text was updated successfully, but these errors were encountered: