Skip to content

Commit 8d6de2c

Browse files
committed
update first_pass_map with flipped cerebellum
1 parent ea25e5a commit 8d6de2c

File tree

4 files changed

+506
-299
lines changed

4 files changed

+506
-299
lines changed

needles/Run_Needles.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
function Run_Needles
1+
function h = Run_Needles
22

33
cwd = fileparts(mfilename('fullpath'));
44
addpath(genpath(strrep( cwd, 'needles', 'ibllib')))
55
addpath(genpath(cwd))
66

7-
Needles
7+
h = Needles;

needles/insert_electrodes_new_1.m

Lines changed: 183 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,190 @@
329329

330330
end
331331

332+
%% version 6: switching cerebellum/medulla to right hemi
333+
e.removeAll();
334+
335+
useExclusions = true;
336+
337+
tilt1 = 10;
338+
tilt2 = 15;
339+
spacing = 0.5; % mm
340+
341+
angle = 90+tilt1; dep = 14e-3; minLR = 0.8;
342+
% apOffset = spacing/2; nspx = 6; nspy = 8;
343+
apOffset = 0; nspx = 4; nspy = 6;
344+
345+
exclSites = [...
346+
2.5 -1; ...
347+
2.5 minLR+spacing*0; ...
348+
2.5 minLR+spacing*1; ...
349+
2 -1; ...
350+
2 minLR+spacing*0; ...
351+
2 minLR+spacing*1; ...
352+
2 minLR+spacing*2; ...
353+
1.5 minLR+spacing*1; ...
354+
1.5 minLR+spacing*2; ...
355+
-4 minLR+spacing*3; ...
356+
-4 minLR+spacing*4; ...
357+
-4.5 minLR+spacing*2; ...
358+
% -5 minLR+spacing*0; ...
359+
% -5 minLR+spacing*1; ...
360+
-5.5 minLR+spacing*1; ...
361+
-5.5 minLR+spacing*4; ...
362+
% -5.5 minLR+spacing*5; ...
363+
-6 minLR+spacing*2; ...
364+
-6 minLR+spacing*5; ...
365+
-6.5 minLR+spacing*2; ...
366+
-6.5 minLR+spacing*3; ...
367+
-7 minLR+spacing*2; ...
368+
-7.5 minLR+spacing*1; ...
369+
];
370+
371+
xPos = -5.5:spacing:2.5;
372+
yPos = [-1.0 -0.5 minLR:spacing:4];
373+
for xidx = 1:numel(xPos)
374+
xx = xPos(xidx);
375+
for yidx = 1:numel(yPos)
376+
yy = yPos(yidx);
377+
378+
if useExclusions && ismember([xx yy], exclSites, 'rows')
379+
continue;
380+
end
381+
382+
if yy<0
383+
useAngle = 90+17;
384+
useYY = yy;
385+
else
386+
useAngle = angle;
387+
useYY = yy;
388+
end
389+
e.add_probe_by_start_angles(...
390+
[dvTopForAPslice(ba, xx*1e-3) -useYY*1e-3 (xx+apOffset)*1e-3], ...
391+
[90 useAngle], dep, ba, xidx-16, -(yidx-2));
392+
end
393+
end
394+
395+
exclSites = [0 0];
396+
397+
xPos = -7.5:spacing:-5.6;
398+
yPos = [minLR:spacing:4];
399+
for xidx = 1:numel(xPos)
400+
xx = xPos(xidx);
401+
for yidx = 1:numel(yPos)
402+
yy = yPos(yidx);
403+
404+
if useExclusions && ismember([xx yy], exclSites, 'rows')
405+
continue;
406+
end
407+
408+
useAngle = angle;
409+
useYY = yy;
410+
411+
e.add_probe_by_start_angles(...
412+
[dvTopForAPslice(ba, xx*1e-3) useYY*1e-3 (xx+apOffset)*1e-3], ...
413+
[90 useAngle], dep, ba, xidx-16, -(yidx-2));
414+
end
415+
end
416+
417+
n1 = e.n;
418+
419+
420+
angle = 90-tilt2; dep = 4e-3; minLR = 0.8;
421+
422+
exclSites = [...
423+
1 minLR+spacing*5; ...
424+
1 minLR+spacing*6; ...
425+
1 minLR+spacing*7; ...
426+
0.5 minLR+spacing*6; ...
427+
0.5 minLR+spacing*7; ...
428+
0.5 minLR+spacing*8; ...
429+
0 minLR+spacing*6; ...
430+
0 minLR+spacing*7; ...
431+
0 minLR+spacing*8; ...
432+
-0.5 minLR+spacing*6; ...
433+
-0.5 minLR+spacing*7; ...
434+
-0.5 minLR+spacing*8; ...
435+
-1 minLR+spacing*7; ...
436+
-1 minLR+spacing*8; ...
437+
-1.5 minLR+spacing*7; ...
438+
-1.5 minLR+spacing*8; ...
439+
-2 minLR+spacing*7; ...
440+
-2 minLR+spacing*8; ...
441+
-2.5 minLR+spacing*7; ...
442+
-2.5 minLR+spacing*8; ...
443+
-3 minLR+spacing*7; ...
444+
-3 minLR+spacing*8; ...
445+
-3.5 minLR+spacing*7; ...
446+
-3.5 minLR+spacing*8; ...
447+
-4.5 minLR+spacing*5; ...
448+
-4.5 minLR+spacing*6; ...
449+
-4.5 minLR+spacing*7; ...
450+
-5 minLR+spacing*6; ...
451+
-5.5 minLR+spacing*6; ...
452+
];
453+
xPos = -5.5:spacing:3;
454+
yPos = minLR:spacing:5.0;
455+
for xidx = 1:numel(xPos)
456+
xx = xPos(xidx);
457+
for yidx = 1:numel(yPos)
458+
yy = yPos(yidx);
459+
460+
if useExclusions && ismember([xx yy], exclSites, 'rows')
461+
continue;
462+
end
463+
464+
e.add_probe_by_start_angles(...
465+
[dvTopForAPslice(ba, xx*1e-3) -yy*1e-3 xx*1e-3], ...
466+
[90 angle], dep, ba, xidx-16, -yidx);
467+
end
468+
end
469+
470+
exclSites = [0 0];
471+
xPos = -7.5:spacing:-5.6;
472+
yPos = 0.3:spacing:5.0;
473+
for xidx = 1:numel(xPos)
474+
xx = xPos(xidx);
475+
for yidx = 1:numel(yPos)
476+
yy = yPos(yidx);
477+
478+
if useExclusions && ismember([xx yy], exclSites, 'rows')
479+
continue;
480+
end
481+
482+
e.add_probe_by_start_angles(...
483+
[dvTopForAPslice(ba, xx*1e-3) yy*1e-3 xx*1e-3], ...
484+
[90 angle], dep, ba, xidx-16, -yidx);
485+
end
486+
end
487+
488+
fprintf('n penetrations = %d (%d and %d)\n', e.n, n1, e.n-n1);
489+
490+
nPerMouse = 10;
491+
% N = (e.n-3)*2 + 3*5 + (M*2/3-5)
492+
% M = N/nPerMouse
493+
% so -
494+
% N - N/nPerMouse*2/3 = 2*e.n + 4
495+
N = (2*e.n + 4) / (1-2/nPerMouse/3);
496+
M = N/nPerMouse;
497+
498+
fprintf(1, 'total N = %d, M = %d (at %d pens per mouse)\n', round(N), round(M), nPerMouse);
499+
500+
% plot1: by AP position
501+
f = figure; f.Color = 'w'; f.Position = [17 42 1239 656];
502+
503+
uAP = unique(e.dvmlap_entry(:,3));
504+
for a = 1:numel(uAP)
505+
ax = subtightplot(nspx,nspy,a, 0.01, 0.01, 0.01);
506+
h = e.plot_probes_at_slice(ba, ax, uAP(a));
507+
set(h, 'LineWidth', 2.0);
508+
title(sprintf('%.2f', uAP(a)*1e3))
509+
drawnow;
510+
511+
end
512+
332513
%% gif to compare the previous full map to the cut-down one
333514

334-
filename = 'mapCompare.gif';
515+
filename = 'mapCompare2.gif';
335516

336517
frame = getframe(fCut);
337518
im = frame2im(frame);
@@ -426,7 +607,7 @@
426607

427608
%% plot: recording locations top down
428609

429-
% av = readNPY('/Users/nick/Documents/allenCCFdata/annotation_volume_10um_by_index.npy');
610+
av = readNPY('/Users/nick/Documents/allenCCFdata/annotation_volume_10um_by_index.npy');
430611
szAV = [1320 800 1140];
431612
mlCoords = (1:szAV(3))*10+ba.brain_coor.x0*1e6;
432613
apCoords = (1:szAV(1))*10*1.087-max(ba.brain_coor.yscale)*1e6;

0 commit comments

Comments
 (0)