-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathya_brainreg.m
More file actions
31 lines (24 loc) · 945 Bytes
/
ya_brainreg.m
File metadata and controls
31 lines (24 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
%% run brainreg
function [status, result] = ya_brainreg(channelToRegister, outputDir, probeTrackChannel, orientationType, atlas)
if atlas == 10
atlasString = 'allen_mouse_10um';
elseif atlas == 25
atlasString = 'allen_mouse_25um';
end
%brainreg command . more details here: https://docs.brainglobe.info/brainreg/user-guide
CMD = sprintf('brainreg %s %s --downsample %s -v 25 25 25 --orientation %s --atlas %s', ...
channelToRegister, outputDir, probeTrackChannel, orientationType, atlasString);
%store a copy of the command to the directory
mkdir(outputDir)
cmdFid = fopen(fullfile(outputDir, 'CMD'), 'w');
fprintf(cmdFid, '%s\n', CMD);
fclose(cmdFid);
% Run the command and report back if it failed
fprintf('Running: %s\n', CMD)
[status, result] = system(CMD);
if status ~= 0
error('error: brain registration failed ')
end
% ouput file information :
% https://docs.brainglobe.info/brainreg/user-guide/output-files
end