Skip to content

Updated KilosortBase's channel map generation to support json probe maps with kcoord information. #3852

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

Merged
merged 9 commits into from
Apr 17, 2025

Conversation

nikhilchandra
Copy link
Contributor

Fixes #3704

@nikhilchandra nikhilchandra marked this pull request as ready for review April 9, 2025 21:54
@alejoe91 alejoe91 added the sorters Related to sorters module label Apr 10, 2025
Copy link
Member

@alejoe91 alejoe91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nikhilchandra

See comments

Copy link
Member

@zm711 zm711 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks nice to me :)

Comment on lines 398 to 400
xcoords = ([p[0] for p in positions],)
ycoords = ([p[1] for p in positions],)
kcoords = (groups,)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikhilchandra why do you need to make tuples here when later you're making an array and squeezing it?

Couldn't you do this directly?

xcoords = positions[:, 0]
ycoords = positions[:, 1]
kcoords = groups

These are already 1d arrays, so then you could just do:

probe = {
            "chanMap": np.arange(nchan),
            "xc": xcoords,
            "yc": ycoords,
            "kcoords": kcoords,
            "n_chan": nchan,
        }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. I have made the necessary changes.

Copy link
Member

@alejoe91 alejoe91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikhilchandra one final comment :)

@alejoe91 alejoe91 merged commit d06beb2 into SpikeInterface:main Apr 17, 2025
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sorters Related to sorters module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

group_mode="by_shank" does not propagate to .mat probe file generated for Kilosort4
3 participants