Skip to content

Commit a5baa45

Browse files
author
Peelle Lab
committed
apply heuristics to outstream names
1 parent 0a0fc8a commit a5baa45

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

‎aa_modules/aamod_epifromnifti.m‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
%% Select
1818
series = horzcat(aap.acq_details.subjects(subj).seriesnumbers{:});
1919
if ~iscell(series) ...
20-
|| (~isstruct(series{sess}) ... % hdr+fname
21-
&& ~ischar(series{sess}) ... % fname
22-
&& ~iscell(series{sess})) % fname (4D)
20+
|| (~isstruct(series{1}) ... % hdr+fname
21+
&& ~ischar(series{1}) ... % fname
22+
&& ~iscell(series{1})) % fname (4D)
2323
aas_log(aap,true,['ERROR: Was expecting list of struct(s) of fname+hdr or fname in cell array\n' help('aas_addsubject')]);
2424
end
2525
series = series{sess};
@@ -145,18 +145,28 @@
145145
if iscell(V), V = cell2mat(V); end
146146
spm_file_merge(char({V(numdummies+1:end).fname}),finalepis,0,DICOMHEADERS{1}.volumeTR);
147147
end
148-
149-
150-
% And describe outputs
148+
149+
% Describe outputs
151150

152151
% new: output streams are renameable so that other modalities
153152
% (e.g., dot) can reuse aamod_epifromnifti w/ just a header alias
154153

154+
% we assume the first output streamname defines the modality;
155+
% the remaining outstream names are derived from it
156+
155157
outputstreams = aas_getstreams(aap,'output');
156158

157159
ostream_01 = outputstreams{1};
158-
ostream_02 = outputstreams{2};
159-
ostream_03 = outputstreams{3};
160+
161+
ostream_02 = 'dummyscans';
162+
163+
if strcmp(ostream_01,'epi')
164+
ostream_03 = 'epi_dicom_header';
165+
elseif strcmp(ostream_01,'dot')
166+
ostream_03 = 'dot_header';
167+
else
168+
ostream_03 = 'functional_header';
169+
end
160170

161171
if comp, rmdir(fullfile(sesspth,'temp'),'s'); end
162172
aap=aas_desc_outputs(aap,subj,sess, ostream_01,finalepis);

0 commit comments

Comments
 (0)