|
26 | 26 | from nipype.utils.filemanip import (
|
27 | 27 | list_to_filename, filename_to_list, fname_presuffix)
|
28 | 28 | from nibabel import load
|
| 29 | +from nipype.utils.misc import human_order_sorted |
29 | 30 |
|
30 | 31 | warn = warnings.warn
|
31 | 32 | warnings.filterwarnings('always', category=UserWarning)
|
@@ -734,51 +735,51 @@ def _list_outputs(self):
|
734 | 735 | outputs = self._outputs().get()
|
735 | 736 | pth = os.path.join(os.getcwd(), self.inputs.log_dir)
|
736 | 737 |
|
737 |
| - pes = glob(os.path.join(pth, 'pe[0-9]*.*')) |
| 738 | + pes = human_order_sorted(glob(os.path.join(pth, 'pe[0-9]*.*'))) |
738 | 739 | assert len(pes) >= 1, 'No pe volumes generated by FSL Estimate'
|
739 | 740 | outputs['pes'] = pes
|
740 | 741 |
|
741 |
| - res4d = glob(os.path.join(pth, 'res4d.*')) |
| 742 | + res4d = human_order_sorted(glob(os.path.join(pth, 'res4d.*'))) |
742 | 743 | assert len(res4d) == 1, 'No residual volume generated by FSL Estimate'
|
743 | 744 | outputs['res4d'] = res4d[0]
|
744 | 745 |
|
745 |
| - copes = glob(os.path.join(pth, 'cope[0-9]*.*')) |
| 746 | + copes = human_order_sorted(glob(os.path.join(pth, 'cope[0-9]*.*'))) |
746 | 747 | assert len(copes) >= 1, 'No cope volumes generated by FSL CEstimate'
|
747 | 748 | outputs['copes'] = copes
|
748 | 749 |
|
749 |
| - var_copes = glob(os.path.join(pth, 'varcope[0-9]*.*')) |
| 750 | + var_copes = human_order_sorted(glob(os.path.join(pth, 'varcope[0-9]*.*'))) |
750 | 751 | assert len(
|
751 | 752 | var_copes) >= 1, 'No varcope volumes generated by FSL CEstimate'
|
752 | 753 | outputs['var_copes'] = var_copes
|
753 | 754 |
|
754 |
| - zstats = glob(os.path.join(pth, 'zstat[0-9]*.*')) |
| 755 | + zstats = human_order_sorted(glob(os.path.join(pth, 'zstat[0-9]*.*'))) |
755 | 756 | assert len(zstats) >= 1, 'No zstat volumes generated by FSL CEstimate'
|
756 | 757 | outputs['zstats'] = zstats
|
757 | 758 |
|
758 | 759 |
|
759 | 760 | if isdefined(self.inputs.f_con_file):
|
760 |
| - zfstats = glob(os.path.join(pth, 'zfstat[0-9]*.*')) |
| 761 | + zfstats = human_order_sorted(glob(os.path.join(pth, 'zfstat[0-9]*.*'))) |
761 | 762 | assert len(zfstats) >= 1, 'No zfstat volumes generated by FSL CEstimate'
|
762 | 763 | outputs['zfstats'] = zfstats
|
763 | 764 |
|
764 |
| - fstats = glob(os.path.join(pth, 'fstat[0-9]*.*')) |
| 765 | + fstats = human_order_sorted(glob(os.path.join(pth, 'fstat[0-9]*.*'))) |
765 | 766 | assert len(fstats) >= 1, 'No fstat volumes generated by FSL CEstimate'
|
766 | 767 | outputs['fstats'] = fstats
|
767 | 768 |
|
768 |
| - tstats = glob(os.path.join(pth, 'tstat[0-9]*.*')) |
| 769 | + tstats = human_order_sorted(glob(os.path.join(pth, 'tstat[0-9]*.*'))) |
769 | 770 | assert len(tstats) >= 1, 'No tstat volumes generated by FSL CEstimate'
|
770 | 771 | outputs['tstats'] = tstats
|
771 | 772 |
|
772 |
| - mrefs = glob(os.path.join(pth, 'mean_random_effects_var[0-9]*.*')) |
| 773 | + mrefs = human_order_sorted(glob(os.path.join(pth, 'mean_random_effects_var[0-9]*.*'))) |
773 | 774 | assert len(
|
774 | 775 | mrefs) >= 1, 'No mean random effects volumes generated by FLAMEO'
|
775 | 776 | outputs['mrefvars'] = mrefs
|
776 | 777 |
|
777 |
| - tdof = glob(os.path.join(pth, 'tdof_t[0-9]*.*')) |
| 778 | + tdof = human_order_sorted(glob(os.path.join(pth, 'tdof_t[0-9]*.*'))) |
778 | 779 | assert len(tdof) >= 1, 'No T dof volumes generated by FLAMEO'
|
779 | 780 | outputs['tdof'] = tdof
|
780 | 781 |
|
781 |
| - weights = glob(os.path.join(pth, 'weights[0-9]*.*')) |
| 782 | + weights = human_order_sorted(glob(os.path.join(pth, 'weights[0-9]*.*'))) |
782 | 783 | assert len(weights) >= 1, 'No weight volumes generated by FLAMEO'
|
783 | 784 | outputs['weights'] = weights
|
784 | 785 |
|
@@ -1486,7 +1487,7 @@ def _list_outputs(self):
|
1486 | 1487 | suffix='_' + suffix,
|
1487 | 1488 | change_ext=change_ext)
|
1488 | 1489 | else:
|
1489 |
| - outputs[outkey] = os.pardir.abspath(inval) |
| 1490 | + outputs[outkey] = os.path.abspath(inval) |
1490 | 1491 | return outputs
|
1491 | 1492 |
|
1492 | 1493 | def _format_arg(self, name, spec, value):
|
|
0 commit comments