-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdp_node_fsl_flirt.m
executable file
·44 lines (34 loc) · 1.12 KB
/
dp_node_fsl_flirt.m
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
32
33
34
35
36
37
38
39
40
41
42
43
44
classdef dp_node_fsl_flirt < dp_node
% coregistration using flirt
%
% expecting
%
% input.nii_fn
% input.target_fn
%
% yields
%
% output.nii_fn
% output.matrix_fn
% output.target_fn
methods
function obj = dp_node_fsl_flirt()
obj.output_test = {'nii_fn', 'matrix_fn'};
end
function output = i2o(obj, input)
output.nii_fn = fullfile(input.op, 'fa_registered.nii.gz');
output.matrix_fn = fullfile(input.op, 'fa_to_template.mat');
% Pass info about the target
output.target_fn = input.target_fn;
output.original_nii_fn = input.nii_fn;
end
function output = execute(obj, input, output)
% Build the flirt command
flirt_cmd = sprintf('flirt -in %s -ref %s -out %s -omat %s', ...
input.nii_fn, input.target_fn, ...
output.nii_fn, output.matrix_fn);
msf_mkdir(fileparts(output.nii_fn));
system(flirt_cmd); % Execute the flirt command
end
end
end