Skip to content

Commit 779fd01

Browse files
committed
ENH: Add column headers, rename basis file
1 parent b5dd10a commit 779fd01

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nipype/algorithms/confounds.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,9 @@ def _run_interface(self, runtime):
442442

443443
if self.inputs.save_hpf_basis:
444444
hpf_basis_file = self._list_outputs()['hpf_basis_file']
445-
np.savetxt(hpf_basis_file, hpf_basis, fmt=b'%.10f', delimiter='\t')
445+
header = ['cos{:02d}'.format(i) for i in range(hpf_basis.shape[1])]
446+
np.savetxt(hpf_basis_file, hpf_basis, fmt=b'%.10f', delimiter='\t',
447+
header=header, comments='')
446448

447449
return runtime
448450

@@ -456,7 +458,7 @@ def _list_outputs(self):
456458
save_hpf_basis = self.inputs.save_hpf_basis
457459
if save_hpf_basis:
458460
if isinstance(save_hpf_basis, bool):
459-
save_hpf_basis = os.path.abspath('hpf_basis.txt')
461+
save_hpf_basis = os.path.abspath('hpf_basis.tsv')
460462
outputs['hpf_basis_file'] = save_hpf_basis
461463

462464
return outputs

0 commit comments

Comments
 (0)