Skip to content

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

Merged
alejoe91 merged 9 commits into
SpikeInterface:mainfrom
nikhilchandra:issue_3704
Apr 17, 2025
Merged

alejoe91 merged 9 commits into
SpikeInterface:mainfrom
nikhilchandra:issue_3704

Conversation

@nikhilchandra

Copy link
Copy Markdown
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

@alejoe91 alejoe91 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @nikhilchandra

See comments

@zm711 zm711 left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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.

@alejoe91 alejoe91 left a comment

Copy link
Copy Markdown
Member

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
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