Skip to content

Arjun ccf qc update#1

Open
arjunsridhar12345 wants to merge 14 commits into
mainfrom
arjun-ccf-qc-update
Open

Arjun ccf qc update#1
arjunsridhar12345 wants to merge 14 commits into
mainfrom
arjun-ccf-qc-update

Conversation

@arjunsridhar12345
Copy link
Copy Markdown
Contributor

@arjunsridhar12345 arjunsridhar12345 commented Mar 20, 2026

This PR attempts to update the ccf qc, by adding the LFP correlation plot and scale factor between anchors. I tried to add some comments in the code and clean up some stuff. This seems to do something for recordings without surface findings. The default scaling of 1.06 at the end seemed to be confirmed in a teams message from Corbett: "since the CCF is actually LARGER than in vivo brains, by a factor of... drumroll... 1.06!"

I had claude help do some stuff and tried to review it, so hopefully there's nothing super embarassing. Claude said the qc plot looked good and is "quite information rich". It also said this: "The alignment looks reasonable here — the MOp/CP boundary at ~300µm on the histology lines up with the transition in the correlation matrix block structure, and the unit density has a visible change around that boundary too."

image

The LFP correlation is currently using the epochs from the session object, and then looking at the onset of the DynamicRouting1 task, and then using the first 300 seconds of the task. Also just doing a basic cmr. The LFP data is currently fetched from the session object by using this session._raw_lfp.

For recordings with surface finding, when trying to get the raw_lfp data with the session object, there was an error saying no sync file was present. I think it tries to align the timestamps when getting the lfp data, so this makes sense since the surface findings only have the ephys data uploaded. Not sure how hard it would be to modify the session object to handle this

Adding the logic for concatenating the correlation matrix from the surface with the main still needs to be added once the above gets resolved.

I think that's it, let me know if I missed something!

@bjhardcastle
Copy link
Copy Markdown
Member

Thanks a lot! I'll check it out and try to run on all sessions.

Regarding the raw data for surface channel recordings, I thought I had fixed that here, released in v0.0.277:
AllenInstitute/npc_sessions@c5a4f83
Are you uv synced? Would be good to know whether or not that fix is sufficient...

@arjunsridhar12345
Copy link
Copy Markdown
Contributor Author

Thanks a lot! I'll check it out and try to run on all sessions.

Regarding the raw data for surface channel recordings, I thought I had fixed that here, released in v0.0.277: AllenInstitute/npc_sessions@c5a4f83 Are you uv synced? Would be good to know whether or not that fix is sufficient...

ah I think what happened was I was uv synced but not updated. I think the lock file has v0.0.276
image

I'll try and updating and see!

@arjunsridhar12345 arjunsridhar12345 marked this pull request as ready for review March 23, 2026 19:59
- Add surface_timeseries parameter to _plot_ephys_noise for concurrent surface/probe data plotting
- Extract timestamp/data extraction logic into get_ts_data helper function
- New _plot_structure_areas_ccb function for CCF area coloring on plot background
- Update _plot_structure_areas signature to accept ccfAreas parameter
- Handle surface channels in _plot_ephys_noise_with_unit_density_areas when available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants