magland / mountainlab

spike sorting software
25 stars 22 forks source link

Switching from Pyclust (semi-automated spike sorting) to Mountainlab #189

Closed duytran1125 closed 6 years ago

duytran1125 commented 7 years ago

Hi. We are currently using Pyclust (a semi-automated spike sorting program) whose input files are .spike. We want to switch to Mountainlab as it is a reliable and efficient. Currently, we're using 128-channel silicon microprobe and implementing a combination of MATLAB and Labview for data acquisition. Our raw data is multiplexed (a way of sending multiple signals from many channels in the form of a single, complex signal) and is in the format .mux. We are able to de-multiplex this raw data and get .mat files for each channel. However, we are having trouble converting this raw data into the .mda files that the program requires. Is there a Matlab code for this? Also how do we acquire the geometry file? Thanks in advance!

magland commented 7 years ago

There are writemda*.m files in the mountainlab/matlab directory. You can use that to generate the .mda files.

The geom.csv file should be a text file like for example:

0,0 1,0 0,1 1,1

where each row is a channel, and its a comma-separated list of coordinates for the electrode location.

duytran1125 commented 7 years ago

Based on the example above, channels 0 and 1 both have coordinate of 0 and 1?

duytran1125 commented 7 years ago

If we have 128 channels and each has 1 electrode, then we should have 128 rows in the file, correct? How is the coordinate coded? Is 0 coded for the most top channel, then 1, 2, 3... toward the tip of the probe?

magland commented 7 years ago

Sorry, I was using "channel" and "electrode" interchangeably.

Each row is a different electrode (or electrode-channel).

0,0 means it is positioned at the origin 1,0 means that it is positioned at (1,0) in 2-d cartesian space

There are no assumed units or orientation. It only affects the neighborhoods for the sorting (with adjacency_radius)

does it help?

duytran1125 commented 7 years ago

yeah it makes sense! thanks. Where is the geom.csv file located? should we create one? And what is the structure of .mda file?

duytran1125 commented 7 years ago

In the example folder, there are firings_true.mda, raw.mda, and waveforms.mda. We're wondering what these files are and how they're structured...

magland commented 7 years ago

Thanks for asking. Those are generated by the simulator. Like all .mda files, they can be read into matlab using readmda.m script. We also have io routines for reading into python and C++. There's info about this format on the github README.

The dimensions of these files are

raw.mda: MxN waveforms: MxTxK firings_true: RxL

M=#elec channels N=#timepoints in simulated raw timeseries T=clip size for the waveforms (true spike shapes in the simulator) R=3 I believe (second row are event timestamps, third row are integers) L=number of simulated events