From d33157bad77bc44d0751867c51a4e7ccf751ba5c Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Tue, 31 Jan 2023 16:03:33 +0000 Subject: [PATCH] MNT: Fixes to a few feedsRun scripts --- unit_tests/avwutils/fix_orient/feedsRun | 2 +- unit_tests/avwutils/fslcomplex/feedsRun | 2 +- unit_tests/fdt/dtifit/feedsRun | 8 +------- unit_tests/fugue/applywarp/feedsRun | 4 ++-- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/unit_tests/avwutils/fix_orient/feedsRun b/unit_tests/avwutils/fix_orient/feedsRun index fceddda..0e0e575 100755 --- a/unit_tests/avwutils/fix_orient/feedsRun +++ b/unit_tests/avwutils/fix_orient/feedsRun @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env fslpython """Test the standard recipe for fixing a broken orientation, from "The labels in FSLView are wrong or missing and no conversion to NIfTI can fix this", on this page: diff --git a/unit_tests/avwutils/fslcomplex/feedsRun b/unit_tests/avwutils/fslcomplex/feedsRun index 23986f7..a84cc1d 100755 --- a/unit_tests/avwutils/fslcomplex/feedsRun +++ b/unit_tests/avwutils/fslcomplex/feedsRun @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env fslpython """Test that fslcomplex produces correct outputs. Specifically tests that the output files have orientation info that matches that of the input files. """ diff --git a/unit_tests/fdt/dtifit/feedsRun b/unit_tests/fdt/dtifit/feedsRun index a0b3c18..08d8799 100755 --- a/unit_tests/fdt/dtifit/feedsRun +++ b/unit_tests/fdt/dtifit/feedsRun @@ -132,7 +132,7 @@ def gen_data(): nib.Nifti1Image(S0, affine=affine).to_filename(f'{fdir}/ref_S0.nii.gz') nib.Nifti1Image(data, affine=affine).to_filename(f'{fdir}/ref_data.nii.gz') - nib.Nifti1Image(np.ones(data.shape[:3], dtype=int), affine=affine).to_filename(f'{fdir}/nodif_brain_mask.nii.gz') + nib.Nifti1Image(np.ones(data.shape[:3], dtype=np.int32), affine=affine).to_filename(f'{fdir}/nodif_brain_mask.nii.gz') tensor_components = diffusion_tensor[:, :, :, [0, 0, 0, 1, 1, 2], [0, 1, 2, 1, 2, 2]] nib.Nifti1Image(tensor_components, affine=affine).to_filename(f'{fdir}/ref_tensor.nii.gz') @@ -260,9 +260,3 @@ for directory, multi_shell, kurt in gen_data(): ref = nib.load(f'{directory}/ref_L1.nii.gz').get_fdata() fit = nib.load(f'{base_output}_L1.nii.gz').get_fdata() assert not np.allclose(ref, fit, rtol=1e-3, atol=1e-6) - - - - - - diff --git a/unit_tests/fugue/applywarp/feedsRun b/unit_tests/fugue/applywarp/feedsRun index 0bba649..f990735 100755 --- a/unit_tests/fugue/applywarp/feedsRun +++ b/unit_tests/fugue/applywarp/feedsRun @@ -1,8 +1,8 @@ #!/usr/bin/env fslpython -import os +import os import shlex -import sys +import sys import subprocess as sp import numpy as np import nibabel as nib -- GitLab