petersaj / neuropixels_trajectory_explorer

Neuropixels trajectory explorer with the Allen CCF mouse atlas
GNU General Public License v3.0
62 stars 21 forks source link

Saving .mat file that includes full list of brain regions across the probe trajectory, not just with bank 0 #20

Closed codylslater closed 5 months ago

codylslater commented 5 months ago

I have been doing implants using the MPM micromanipulator system, while streaming brain regions to SpikeGLX. I perform an acute recording at the time of implant, but actually head fix the probe and longitudinally record for several weeks. Right now when I save the probe positions to load into the explorer later - it only saves region positions for the bottom bank of the probe. I am actually inserting >3.84 mm, and later configure the .imro file for custom recording up and down the probe. I would like to be able to load the positions from the original acute recording at implant, and it would be easier if these were in the .mat file output by Neuropixels Trajectory Explorer, perhaps with a mask for whether or not the region is aligned with Bank 0. Is this something that would be useful to add into the saved .mat file for positions or would you recommend I proceed recovering the regions from meta data saved in SpikeGLX?

Thanks for the great tool!

petersaj commented 5 months ago

Hi Cody - I'll have to change the way NTE saves in the (hopefully) near future to work with 4-shank probes, but in the meantime: can I check how you'll be using the data? If SpikeGLX saves the regional metadata (I haven't used it myself) then that seems like a good option for quick analyses during ongoing experiments, and ideally the planner/recording anatomy would be replaced with histology once you have it.

codylslater commented 5 months ago

Yes, definitely. Right now, I use the MPM system and NTE to align trajectories to targeted brain regions as closely as possible during the implant. After verifying everything during a brief acute recording, I save a variety of meta data for each animal, including the best guess estimate of brain region each channel of the probe is in. Since these are chronic implants it can be weeks (up to months) before an animal makes it through experiments and histological validation (at which point all probe locations are updated). Right now I would like to use the probe_position.mat file saved by NTE to give the best guess location of brain regions along the probe. As is, NTE works perfectly if the implant is less than 3.84 mm deep. All regions stay within the bottom bank on the probe and all regions are saved within the .mat file generated by NTE. However, if you implant deeper than that, the file will only show the region alignment from the bottom of the probe to the top of the bottom bank of recording sites. Ideally, it would save from the tip of the probe all the way to the top (~2.5 banks total), with portions of the probe not in the brain marked as NA or something similar.

petersaj commented 5 months ago

Makes sense, that's a better way to save things. I've just made these changes:

Do you want to try this out and see if it hits your needs?

(I've also updated the 'save' portion of the wiki: https://github.com/petersaj/neuropixels_trajectory_explorer/wiki/General-use, also added a note in the change log: https://github.com/petersaj/neuropixels_trajectory_explorer/wiki/Major-change-log)

codylslater commented 5 months ago

Sorry for the delayed reply. The new saving method is great - gives exactly what we need. Thank you!