From 074f2fcdd63a3748f53b90a6ae5401327f4ce4c8 Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 24 Oct 2024 16:33:57 -0400 Subject: [PATCH 01/90] Working version and pep8 --- scilpy/image/labels.py | 117 +++++++++++++++++++++++ scripts/scil_lesions_harmonize_labels.py | 83 ++++++++++++++++ 2 files changed, 200 insertions(+) create mode 100644 scripts/scil_lesions_harmonize_labels.py diff --git a/scilpy/image/labels.py b/scilpy/image/labels.py index 98b97a989..81eea148d 100644 --- a/scilpy/image/labels.py +++ b/scilpy/image/labels.py @@ -4,11 +4,14 @@ import json import logging import os +import tqdm import numpy as np from scipy import ndimage as ndi from scipy.spatial import cKDTree +from scilpy.tractanalysis.reproducibility_measures import compute_bundle_adjacency_voxel + def load_wmparc_labels(): """ @@ -494,3 +497,117 @@ def merge_labels_into_mask(atlas, filtering_args): mask[atlas == int(filtering_args)] = 1 return mask + + +def harmonize_labels(original_data, min_voxel_overlap=1, max_adjacency=1e2): + """ + Harmonize lesion labels across multiple 3D volumes by ensuring consistent + labeling. + + This function takes multiple 3D NIfTI volumes with labeled regions + (e.g., lesions) and harmonizes the labels so that regions that are the same + across different volumes are assigned a consistent label. It operates by + iteratively comparing labels in each volume to those in previous volumes + and matching them based on spatial proximity and overlap. + + Parameters + ---------- + original_data : list of numpy.ndarray + A list of 3D numpy arrays where each array contains labeled regions. + Labels should be non-zero integers, where each unique integer represents + a different region or lesion. + min_voxel_overlap : int, optional + Minimum number of overlapping voxels required for two regions (lesions) + from different volumes to be considered as potentially the same lesion. + Default is 1. + max_adjacency : float, optional + Maximum distance allowed between the centroids of two regions for them + to be considered as the same lesion. Default is 1e2 (infinite). + + Returns + ------- + list of numpy.ndarray + A list of 3D numpy arrays with the same shape as `original_data`, where + labels have been harmonized across all volumes. Each region across + volumes that is identified as the same will have the same label. + """ + + relabeled_data = [np.zeros_like(data) for data in original_data] + relabeled_data[0] = original_data[0] + labels = np.unique(original_data)[1:] + + # We will iterate over all possible combinations of labels + N = len(original_data) + total_iteration = ((N * (N - 1)) // 2) + tqdm_bar = tqdm.tqdm(total=total_iteration, desc="Harmonizing labels") + + # We want to label images in order + for first_pass in range(len(original_data)): + unmatched_labels = np.unique(original_data[first_pass])[1:].tolist() + best_match_score = {label: 999999 for label in labels} + best_match_pos = {label: None for label in labels} + + # We iterate over all previous images to find the best match + for second_pass in range(0, first_pass): + tqdm_bar.update(1) + + # We check all existing labels in relabeled data + for label_ind_1 in range(len(labels)): + label_1 = labels[label_ind_1] + + if label_1 not in original_data[first_pass]: + continue + + # This check requires to at least overlap by N voxel + coord_1 = np.where(original_data[first_pass] == label_1) + overlap_labels_count = np.unique(relabeled_data[second_pass][coord_1], + return_counts=True) + + potential_labels_val = overlap_labels_count[0].tolist() + potential_labels_count = overlap_labels_count[1].tolist() + potential_labels = [] + for val, count in zip(potential_labels_val, + potential_labels_count): + if val != 0 and count > min_voxel_overlap: + potential_labels.append(val) + + # We check all labels touching the previous label + for label_2 in potential_labels: + tmp_data_1 = np.zeros_like(original_data[0]) + tmp_data_2 = np.zeros_like(original_data[0]) + + # We always compare the previous relabeled data with the next + # original data + tmp_data_1[original_data[first_pass] == label_1] = 1 + tmp_data_2[relabeled_data[second_pass] == label_2] = 1 + + # They should have a similar shape (TODO: parameters) + adjacency = compute_bundle_adjacency_voxel( + tmp_data_1, tmp_data_2) + if adjacency > max_adjacency: + continue + + if adjacency < best_match_score[label_1]: + best_match_score[label_1] = adjacency + best_match_pos[label_1] = label_2 + + # We relabel the data and keep track of the unmatched labels + for label in labels: + if best_match_pos[label] is not None: + old_label = label + new_label = best_match_pos[label] + relabeled_data[first_pass][original_data[first_pass] + == old_label] = new_label + if old_label in unmatched_labels: + unmatched_labels.remove(old_label) + + # Anything that is left should be given a new label + if first_pass == 0: + continue + next_label = np.max(relabeled_data[:first_pass]) + 1 + for label in unmatched_labels: + relabeled_data[first_pass][original_data[first_pass] + == label] = next_label + next_label += 1 + + return relabeled_data diff --git a/scripts/scil_lesions_harmonize_labels.py b/scripts/scil_lesions_harmonize_labels.py new file mode 100644 index 000000000..80b23e911 --- /dev/null +++ b/scripts/scil_lesions_harmonize_labels.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +This script harmonizes labels across a set of lesion files represented in +NIfTI format. It ensures that labels are consistent across multiple input +images by matching labels between images based on spatial proximity and +overlap criteria. + +The script works iteratively, so the multiple inputs should be in chronological +order (and changing the order affects the output). All images should be +co-registered. +""" + +import argparse +import os + +import nibabel as nib +import numpy as np + +from scilpy.image.labels import get_data_as_labels, harmonize_labels +from scilpy.io.utils import (add_overwrite_arg, + assert_inputs_exist, + assert_output_dirs_exist_and_empty, + assert_headers_compatible) + +EPILOG = """ +Reference: + [1] Köhler, Caroline, et al. "Exploring individual multiple sclerosis + lesion volume change over time: development of an algorithm for the + analyses of longitudinal quantitative MRI measures." + NeuroImage: Clinical 21 (2019): 101623. +""" + + +def _build_arg_parser(): + p = argparse.ArgumentParser( + description=__doc__, formatter_class=argparse.RawTextHelpFormatter) + p.add_argument('in_images', nargs='+', + help='Input file name, in nifti format.') + p.add_argument('out_dir', + help='Output directory.') + p.add_argument('--max_adjacency', type=float, default=5.0, + help='Maximum adjacency distance between lesions for ' + 'them to be considered as the potential match ' + '[%(default)s].') + p.add_argument('--min_voxel_overlap', type=int, default=1, + help='Minimum number of overlapping voxels between ' + 'lesions for them to be considered as the potential ' + 'match [%(default)s].') + p.add_argument('--debug_mode', action='store_true', + help='Add a fake voxel to the corner to ensure consistent ' + 'colors in MI-Brain.') + + add_overwrite_arg(p) + return p + + +def main(): + parser = _build_arg_parser() + args = parser.parse_args() + + assert_inputs_exist(parser, args.in_images) + assert_output_dirs_exist_and_empty(parser, args, args.out_dir) + assert_headers_compatible(parser, args.in_images) + + imgs = [nib.load(filename) for filename in args.in_images] + original_data = [get_data_as_labels(img) for img in imgs] + + relabeled_data = harmonize_labels(original_data, + args.min_voxel_overlap, + max_adjacency=args.max_adjacency) + + max_label = np.max(relabeled_data) + 1 + for i, img in enumerate(imgs): + if args.debug_mode: + relabeled_data[i][0, 0, 0] = max_label # To force identical color + nib.save(nib.Nifti1Image(relabeled_data[i], img.affine), + os.path.join(args.out_dir, os.path.basename(args.in_images[i]))) + + +if __name__ == "__main__": + main() From 34b73b374a9230e174591c84f5eba3d355dacec7 Mon Sep 17 00:00:00 2001 From: frheault Date: Tue, 29 Oct 2024 11:43:15 -0400 Subject: [PATCH 02/90] Fix incremental lesions --- scilpy/image/labels.py | 2 +- scripts/scil_lesions_harmonize_labels.py | 27 +++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/scilpy/image/labels.py b/scilpy/image/labels.py index 81eea148d..72cb4d8d0 100644 --- a/scilpy/image/labels.py +++ b/scilpy/image/labels.py @@ -610,4 +610,4 @@ def harmonize_labels(original_data, min_voxel_overlap=1, max_adjacency=1e2): == label] = next_label next_label += 1 - return relabeled_data + return relabeled_data.astype(np.uint16) diff --git a/scripts/scil_lesions_harmonize_labels.py b/scripts/scil_lesions_harmonize_labels.py index 80b23e911..713dacb35 100644 --- a/scripts/scil_lesions_harmonize_labels.py +++ b/scripts/scil_lesions_harmonize_labels.py @@ -10,6 +10,13 @@ The script works iteratively, so the multiple inputs should be in chronological order (and changing the order affects the output). All images should be co-registered. + +To obtain labels from binary mask use scil_labels_from_mask.py + +WARNING: this script requires all files to have all lesions segmented. +If your data only show new lesions at each timepoints (common in manual +segmentation), use the option --incremental_lesions to merge past timepoints. + T1 = T1, T2 = T1 + T2, T3 = T1 + T2 + T3 """ import argparse @@ -18,7 +25,8 @@ import nibabel as nib import numpy as np -from scilpy.image.labels import get_data_as_labels, harmonize_labels +from scilpy.image.labels import (get_data_as_labels, harmonize_labels, + get_labels_from_mask) from scilpy.io.utils import (add_overwrite_arg, assert_inputs_exist, assert_output_dirs_exist_and_empty, @@ -48,6 +56,10 @@ def _build_arg_parser(): help='Minimum number of overlapping voxels between ' 'lesions for them to be considered as the potential ' 'match [%(default)s].') + + p.add_argument('--incremental_lesions', action='store_true', + help='If lesions files only show new lesions at each ' + 'timepoint, this will merge past timepoints.') p.add_argument('--debug_mode', action='store_true', help='Add a fake voxel to the corner to ensure consistent ' 'colors in MI-Brain.') @@ -67,6 +79,19 @@ def main(): imgs = [nib.load(filename) for filename in args.in_images] original_data = [get_data_as_labels(img) for img in imgs] + masks = [] + if args.incremental_lesions: + for i, data in enumerate(original_data): + mask = np.zeros_like(data) + mask[data > 0] = 1 + masks.append(mask) + if i > 0: + new_data = np.sum(masks, axis=0) + new_data[new_data > 0] = 1 + else: + new_data = mask + original_data[i] = get_labels_from_mask(new_data) + relabeled_data = harmonize_labels(original_data, args.min_voxel_overlap, max_adjacency=args.max_adjacency) From 44c2184a83ee6a4e95d50f44e643a503a9f7dc3e Mon Sep 17 00:00:00 2001 From: Francois Rheault Date: Wed, 5 Feb 2025 12:07:30 -0500 Subject: [PATCH 03/90] Fix list of list --- scilpy/image/labels.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scilpy/image/labels.py b/scilpy/image/labels.py index 72cb4d8d0..84a9bad5e 100644 --- a/scilpy/image/labels.py +++ b/scilpy/image/labels.py @@ -610,4 +610,4 @@ def harmonize_labels(original_data, min_voxel_overlap=1, max_adjacency=1e2): == label] = next_label next_label += 1 - return relabeled_data.astype(np.uint16) + return [data.astype(np.uint16) for data in relabeled_data] From 16d8d8072a8929069d7c2e5994477f0893f60ecf Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 10 Jul 2025 09:14:49 -0400 Subject: [PATCH 04/90] feat: Upgrade to Python 3.12 --- .python-version | 4 +-- pyproject.toml | 2 +- requirements.txt | 89 +++++++++++++++++++++++------------------------- 3 files changed, 46 insertions(+), 49 deletions(-) diff --git a/.python-version b/.python-version index f4c127663..4ff528a2f 100644 --- a/.python-version +++ b/.python-version @@ -1,2 +1,2 @@ -3.10 ->=3.9,<3.11 +3.12 +>=3.11, < 3.13 diff --git a/pyproject.toml b/pyproject.toml index 791959734..d84246b8a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,5 +5,5 @@ requires = [ "setuptools >= 64", "Cython==3.0.*", - "numpy==1.25.*" + "numpy==1.26.*" ] diff --git a/requirements.txt b/requirements.txt index 702e0c1b1..fa37d3191 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,52 +1,49 @@ -bids-validator==1.11.* -bctpy==0.5.* -bz2file==0.98.* +bctpy==0.6.* +bids-validator==1.14.* +bz2file==0.98 coloredlogs==15.0.* -cvxpy==1.4.* -cycler==0.11.* -#Cython==0.29.*, !=0.29.29 -Cython==3.0.* -dipy==1.10.* -deepdiff==6.3.0 -dmri-amico==2.0.3 -dmri-commit==2.3.0 +cvxpy==1.6.* +cycler==0.12.* +# Cython==3.0.* +deepdiff==8.1.* +dipy==1.11.* +dmri-amico==2.1.* +dmri-commit==2.3.* docopt==0.6.* -dvc==3.48.* -dvc-http==2.32.* -formulaic==0.3.* -fury==0.11.* -future==0.18.* +dvc==3.59.* +formulaic==0.5.* +fury==0.9.* +future==1.0.* GitPython==3.1.* -h5py==3.10.* -joblib==1.2.* +h5py==3.12.* +joblib==1.4.* kiwisolver==1.4.* -matplotlib==3.6.* +matplotlib==3.10.* +nibabel==5.3.* +nilearn==0.11.* +nltk==3.9.* +numba==0.61.* +numba-kdtree==0.4.* +numpy==1.26.* +openpyxl==3.1.* +packaging==24.* +pybids==0.18.* PyMCubes==0.1.* -nibabel==5.2.* -nilearn==0.9.* -numba==0.59.1 -numba-kdtree==0.4.0 -nltk==3.8.* -numpy==1.25.* -openpyxl==3.0.* -packaging == 23.2.* -Pillow==10.2.* -pybids==0.16.* -pyparsing==3.0.* +pyparsing==3.2.* PySocks==1.7.* -pytest==7.2.* -pytest-console-scripts==1.3.* -pytest-cov==4.1.0 -pytest-html==4.1.1 -pytest-mock==3.10.* -python-dateutil==2.8.* -pytz==2022.6.* -requests==2.28.* -scikit-learn==1.2.* -scikit-image==0.22.* -scipy==1.11.* -six==1.16.* -spams==2.6.* -statsmodels==0.13.* -trimeshpy==0.0.4 -vtk==9.2.* +pytest==8.3.* +pytest-console-scripts==1.4.* +pytest-cov==6.0.* +pytest-html==4.1.* +pytest-metadata==3.1.* +pytest-mock==3.14.* +python-dateutil==2.9.* +pytz==2024.2 +requests==2.32.* +scikit-image==0.25.* +scikit-learn==1.6.* +scipy==1.15.* +six==1.17.* +statsmodels==0.14.* +trimeshpy==0.0.* +vtk==9.3.* From 389b67796a23a32087d4e73b03183d4d7ccdc6ed Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 10 Jul 2025 09:17:53 -0400 Subject: [PATCH 05/90] feat: Add surface feature and StatefulSurface support --- README.md | 4 +- scilpy/io/utils.py | 45 +++++- .../tests/test_reproducibility_measures.py | 10 +- scilpy/tractograms/streamline_operations.py | 2 + .../tests/test_dps_and_dpp_management.py | 4 +- .../test_streamline_and_mask_operations.py | 5 +- .../tests/test_tractogram_operations.py | 2 +- scilpy/tractograms/tractogram_operations.py | 3 +- scilpy/utils/scilpy_bot.py | 7 +- scilpy/utils/tests/test_scilpy_bot.py | 22 +++ scripts/scil_surface_assign_custom_color.py | 104 +++++++++++++ scripts/scil_surface_assign_uniform_color.py | 140 ++++++++++++++++++ scripts/scil_surface_convert.py | 61 +++++--- .../scil_tractogram_assign_uniform_color.py | 1 + 14 files changed, 369 insertions(+), 41 deletions(-) create mode 100755 scripts/scil_surface_assign_custom_color.py create mode 100755 scripts/scil_surface_assign_uniform_color.py diff --git a/README.md b/README.md index 60413369c..08634dfd3 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ **Scilpy** mainly comprises tools and utilities to quickly work with diffusion MRI. Most of the tools are based on or are wrappers of the [DIPY] library, and most of them will eventually be migrated to [DIPY]. Those tools implement the recommended workflows and parameters used in the lab. -The library is now built for Python 3.10 so be sure to create a virtual environnement for Python 3.10. If this version is not installed on your computer: +The library is now built for Python 3.12 so be sure to create a virtual environnement for Python 3.12. If this version is not installed on your computer: ``` sudo add-apt-repository ppa:deadsnakes/ppa -sudo apt-get install python3.10 python3.10-dev python3.10-venv python3.10-minimal python3.10-tk +sudo apt-get install python3.12 python3.12-dev python3.12-venv python3.12-minimal python3.12-tk ``` Make sure your pip is up-to-date before trying to install: diff --git a/scilpy/io/utils.py b/scilpy/io/utils.py index e4dba15cf..7b5ce5ee2 100644 --- a/scilpy/io/utils.py +++ b/scilpy/io/utils.py @@ -13,7 +13,7 @@ import nibabel as nib import numpy as np from dipy.data import SPHERE_FILES -from dipy.io.utils import is_header_compatible +from dipy.io.utils import is_header_compatible, Space, Origin from scipy.io import loadmat import six @@ -307,6 +307,29 @@ def add_bbox_arg(parser): 'streamlines).') +def add_surface_spatial_arg(parser): + SPACES = ['vox', 'voxmm', 'rasmm', 'lpsmm'] + ORIGINS = ['corner', 'center'] + surf = parser.add_argument_group(title='Surface spatial options') + surf.add_argument('--source_space', + default='rasmm', choices=SPACES, + help='Source space of the input surface [%(default)s].') + surf.add_argument('--destination_space', + default='rasmm', choices=SPACES, + help='Destination space of the output surface [%(default)s].') + surf.add_argument('--source_origin', + default='center', choices=ORIGINS, + help='Source origin of the input surface [%(default)s].') + surf.add_argument('--destination_origin', + default='center', choices=ORIGINS, + help='Destination origin of the output surface [%(default)s].') + + +def add_vtk_legacy_arg(parser): + parser.add_argument('--legacy_vtk_format', action='store_true', + help='Save the VTK file in the legacy format.') + + def add_sh_basis_args(parser, mandatory=False, input_output=False): """ Add spherical harmonics (SH) bases argument. For more information about @@ -525,14 +548,14 @@ def add_volume_screenshot_args(parser, input_name, mandatory=True, cmap_parsing_group.add_argument(f"--{input_name}_cmap_name", default=default_cmap, help=f"Colormap name for the {descriptor} " - f"image data. [%(default)s]") + f"image data. [%(default)s]") opacity_parsing_group.add_argument(f"--{input_name}_opacity", type=ranged_type(float, 0., 1.), default=default_alpha, help=f"Opacity value for the " - f"{descriptor} image data. " - f"[%(default)s]") + f"{descriptor} image data. " + f"[%(default)s]") def add_default_screenshot_args(parser, slice_ids_mandatory=True, @@ -1249,3 +1272,17 @@ def get_default_screenshotting_data(args, peaks=True): ovl_imgs, ovl_colors, peaks_imgs) + + +def convert_stateful_str_to_enum(args): + """ + Convert spatial arguments from string to enum for stateful operations. + """ + + for space in ['source_space', 'destination_space']: + if hasattr(args, space): + setattr(args, space, Space(args.__getattribute__(space))) + + for origin in ['source_origin', 'destination_origin']: + if hasattr(args, origin): + setattr(args, origin, Origin(args.__getattribute__(origin))) diff --git a/scilpy/tractanalysis/tests/test_reproducibility_measures.py b/scilpy/tractanalysis/tests/test_reproducibility_measures.py index f1e3ed335..8d0596037 100644 --- a/scilpy/tractanalysis/tests/test_reproducibility_measures.py +++ b/scilpy/tractanalysis/tests/test_reproducibility_measures.py @@ -64,15 +64,15 @@ def test_tractogram_pairwise_comparison(): # Comparing with values obtained when creating this test. np.testing.assert_almost_equal(np.mean(acc_norm[~np.isnan(acc_norm)]), - 0.6590763379712203, decimal=6) + 0.659076, decimal=3) np.testing.assert_almost_equal(np.mean(corr_norm[~np.isnan(corr_norm)]), - 0.6263207793235779, decimal=6) + 0.626320, decimal=3) np.testing.assert_almost_equal(np.max(corr_norm[~np.isnan(corr_norm)]), - 0.99676438850212097, decimal=6) + 0.996764, decimal=3) np.testing.assert_almost_equal(np.mean(diff_norm[~np.isnan(diff_norm)]), - 0.7345049471266359, decimal=6) + 0.734504, decimal=3) np.testing.assert_almost_equal(np.mean(heatmap[~np.isnan(heatmap)]), - 0.7395923591441349, decimal=6) + 0.739592, decimal=3) # Supervise the number of NaNs in each output. # Note. Not the same because: diff --git a/scilpy/tractograms/streamline_operations.py b/scilpy/tractograms/streamline_operations.py index 6e244af92..b3d4f487e 100644 --- a/scilpy/tractograms/streamline_operations.py +++ b/scilpy/tractograms/streamline_operations.py @@ -586,6 +586,8 @@ def resample_streamlines_step_size(sft, step_size): # Return to original space resampled_sft.to_space(orig_space) + resampled_sft.streamlines._data = resampled_sft.streamlines._data.astype( + np.float32) return resampled_sft diff --git a/scilpy/tractograms/tests/test_dps_and_dpp_management.py b/scilpy/tractograms/tests/test_dps_and_dpp_management.py index c32f2eace..2df398b8e 100644 --- a/scilpy/tractograms/tests/test_dps_and_dpp_management.py +++ b/scilpy/tractograms/tests/test_dps_and_dpp_management.py @@ -70,7 +70,7 @@ def test_add_data_as_color_dpp(): def test_convert_dps_to_dpp(): fake_sft = _get_small_sft() - fake_sft.data_per_streamline['my_dps'] = [5, 6] + fake_sft.data_per_streamline['my_dps'] = np.array([5, 6]) # Converting fake_sft = convert_dps_to_dpp(fake_sft, 'my_dps') @@ -78,7 +78,7 @@ def test_convert_dps_to_dpp(): assert list(fake_sft.data_per_point.keys()) == ['my_dps'] # Add again, will fail. Allow overwrite. - fake_sft.data_per_streamline['my_dps'] = [5, 6] + fake_sft.data_per_streamline['my_dps'] = np.array([5, 6]) failed = False try: _ = convert_dps_to_dpp(fake_sft, 'my_dps') diff --git a/scilpy/tractograms/tests/test_streamline_and_mask_operations.py b/scilpy/tractograms/tests/test_streamline_and_mask_operations.py index 772c41a6a..b8f287820 100644 --- a/scilpy/tractograms/tests/test_streamline_and_mask_operations.py +++ b/scilpy/tractograms/tests/test_streamline_and_mask_operations.py @@ -56,6 +56,7 @@ def _setup_files(): # Load sft sft = load_tractogram(in_sft, reference) + sft.streamlines._data = sft.streamlines._data.astype(np.float32) return sft, reference, head_tail_rois, head_tail_offset_rois, center_roi @@ -82,7 +83,7 @@ def test_get_endpoints_density_map_five_points(): """ sft, reference, *_ = _setup_files() - + print(sft.streamlines._data.dtype) endpoints_map = get_endpoints_density_map( sft, point_to_select=5, to_millimeters=True) @@ -326,7 +327,7 @@ def test_compute_streamline_segment(): streamline between two rois. """ - sft, reference, _, head_tail_offset_rois, _ = _setup_files() + sft, _, _, head_tail_offset_rois, _ = _setup_files() sft.to_vox() sft.to_corner() diff --git a/scilpy/tractograms/tests/test_tractogram_operations.py b/scilpy/tractograms/tests/test_tractogram_operations.py index fb8112cd7..9d4ef40b4 100644 --- a/scilpy/tractograms/tests/test_tractogram_operations.py +++ b/scilpy/tractograms/tests/test_tractogram_operations.py @@ -38,7 +38,7 @@ sft = load_tractogram(in_sft, 'same')[0:4] # Faking data_per_streamline -sft.data_per_streamline['test'] = [1] * len(sft) +sft.data_per_streamline['test'] = np.ones(len(sft)) sft.data_per_point['test2'] = [[[1, 2, 3]] * len(s) for s in sft.streamlines] diff --git a/scilpy/tractograms/tractogram_operations.py b/scilpy/tractograms/tractogram_operations.py index ef71b29be..0688f91c0 100644 --- a/scilpy/tractograms/tractogram_operations.py +++ b/scilpy/tractograms/tractogram_operations.py @@ -55,7 +55,8 @@ def shuffle_streamlines(sft, rng_seed=None): The shuffled tractogram. """ indices = np.arange(len(sft.streamlines)) - random.shuffle(indices, random=rng_seed) + random.seed(rng_seed) + random.shuffle(indices) streamlines = sft.streamlines[indices] data_per_streamline = sft.data_per_streamline[indices] diff --git a/scilpy/utils/scilpy_bot.py b/scilpy/utils/scilpy_bot.py index 0bd3563e0..dae900ee5 100644 --- a/scilpy/utils/scilpy_bot.py +++ b/scilpy/utils/scilpy_bot.py @@ -5,19 +5,20 @@ import re import subprocess -import nltk -from nltk.stem import PorterStemmer + from tqdm import tqdm SPACING_LEN = 80 -stemmer = PorterStemmer() try: + import nltk + from nltk.stem import PorterStemmer nltk.download('punkt', quiet=True) nltk.download('wordnet', quiet=True) except ImportError: raise ImportError("You must install the 'nltk' package to use this script." "Please run 'pip install nltk'.") +stemmer = PorterStemmer() # Path to the JSON file containing script information and keywords VOCAB_FILE_PATH = pathlib.Path( diff --git a/scilpy/utils/tests/test_scilpy_bot.py b/scilpy/utils/tests/test_scilpy_bot.py index 9d3ee5303..10f6d6bc9 100644 --- a/scilpy/utils/tests/test_scilpy_bot.py +++ b/scilpy/utils/tests/test_scilpy_bot.py @@ -1,3 +1,4 @@ +import pytest from scilpy.utils.scilpy_bot import ( _make_title, _get_docstring_from_script_path, @@ -6,12 +7,24 @@ _extract_keywords_and_phrases, _calculate_score ) +try: + import nltk + nltk.download('punkt_tab', quiet=True) + nltk.download('wordnet', quiet=True) + have_nltk = True +except ImportError: + have_nltk = False +print(have_nltk) + + +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_make_title(): result = _make_title("Test Title") assert "Test Title" in result +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_get_docstring_from_script_path(tmp_path): script_content = '"""This is a test docstring."""' script_path = tmp_path / "test_script.py" @@ -20,6 +33,7 @@ def test_get_docstring_from_script_path(tmp_path): assert result == "This is a test docstring." +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_split_first_sentence(): text = "This is the first sentence. This is the second sentence." first, remaining = _split_first_sentence(text) @@ -27,24 +41,28 @@ def test_split_first_sentence(): assert remaining == " This is the second sentence." +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_stem_keywords(): keywords = ["running", "jumps"] result = _stem_keywords(keywords) assert result == ["run", "jump"] +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_stem_text(): text = "Running and jumping." result = _stem_text(text) assert result == "run and jump ." +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_stem_phrase(): phrase = "Running quickly" result = _stem_phrase(phrase) assert result == "run quickli" +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_highlight_keywords(): text = "Running and jumping." stemmed_keywords = ["run"] @@ -52,6 +70,7 @@ def test_highlight_keywords(): assert "Running" in result +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_get_synonyms(): synonyms_data = [["run", "sprint"], ["jump", "leap"]] result = _get_synonyms("run", synonyms_data) @@ -59,6 +78,7 @@ def test_get_synonyms(): assert len(result) == 2 +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_extract_keywords_and_phrases(): keywords = ["running", "jumps", "quick run"] result_keywords, result_phrases = _extract_keywords_and_phrases(keywords) @@ -72,6 +92,7 @@ def test_extract_keywords_and_phrases(): assert "quick run" in result_phrases +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_stem_word_specific(): result = _stem_word("streamlines") assert result == "streamlin" @@ -86,6 +107,7 @@ def test_stem_word_specific(): assert result == "tractometri" +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_calculate_score(): keywords = ["run"] phrases = ["quick run"] diff --git a/scripts/scil_surface_assign_custom_color.py b/scripts/scil_surface_assign_custom_color.py new file mode 100755 index 000000000..92e879120 --- /dev/null +++ b/scripts/scil_surface_assign_custom_color.py @@ -0,0 +1,104 @@ +""" + +""" + +import argparse +import logging + +from dipy.io.surface import load_surface, save_surface +import nibabel as nib +import numpy as np +from scipy.ndimage import map_coordinates + +from scilpy.io.utils import (assert_inputs_exist, + assert_outputs_exist, + add_overwrite_arg, + add_verbose_arg, + add_reference_arg, + add_surface_spatial_arg, + add_vtk_legacy_arg, + convert_stateful_str_to_enum, + load_matrix_in_any_format) +from scilpy.viz.color import get_lookup_table + + +def _build_arg_parser(): + p = argparse.ArgumentParser( + description=__doc__, + formatter_class=argparse.RawTextHelpFormatter) + + p.add_argument('in_surface', + help='Input surface(s) (VTK + PIAL + GII supported).') + p.add_argument('out_surface', + help='Output surface(s) (VTK supported).') + + g1 = p.add_argument_group(title='Coloring method') + p1 = g1.add_mutually_exclusive_group(required=True) + p1.add_argument('--load_dpp', metavar='DPP_FILE', + help='Load data per point (scalar) for coloring') + p1.add_argument('--from_anatomy', metavar='FILE', + help='Use the voxel data for coloring,\n' + 'linear scaling from minmax.') + + g2 = p.add_argument_group(title='Coloring options') + g2.add_argument('--colormap', default='jet', + help='Select the colormap for colored trk (dps/dpp) ' + '[%(default)s].\nUse two Matplotlib named color separeted ' + 'by a - to create your own colormap.') + g2.add_argument('--log', action='store_true', + help='Apply a base 10 logarithm for colored trk (dps/dpp).') + + add_surface_spatial_arg(p) + add_vtk_legacy_arg(p) + add_reference_arg(p) + add_verbose_arg(p) + add_overwrite_arg(p) + + return p + + +def main(): + parser = _build_arg_parser() + args = parser.parse_args() + logging.getLogger().setLevel(logging.getLevelName(args.verbose)) + + # Verifications + assert_inputs_exist(parser, args.in_surface, args.reference) + assert_outputs_exist(parser, args, args.out_surface) + convert_stateful_str_to_enum(args) + + # Loading + sfs = load_surface(args.in_surface, args.reference, + from_space=args.source_space, + from_origin=args.source_origin) + + cmap = get_lookup_table(args.colormap) + + expected_shape = len(sfs.vertices) + if args.load_dpp: + data = np.squeeze(load_matrix_in_any_format(args.load_dpp)) + if len(data) != expected_shape: + parser.error('Wrong dpp size! Expected a total of {} points, ' + 'but got {}'.format(expected_shape, len(data))) + else: # args.from_anatomy: + data = nib.load(args.from_anatomy).get_fdata() + sfs.to_vox() + data = map_coordinates(data, sfs.vertices.T, order=0) + + # Simple post-processing + if args.log: + data = np.log10(data + 1e-3) + data -= data.min() + data /= data.max() + data = cmap(data) * 255 + data = data.astype(np.uint8) + + sfs.data_per_point['RGB'] = data + save_surface(sfs, args.out_surface, + to_space=args.destination_space, + to_origin=args.destination_origin, + legacy_vtk_format=args.legacy_vtk_format) + + +if __name__ == '__main__': + main() diff --git a/scripts/scil_surface_assign_uniform_color.py b/scripts/scil_surface_assign_uniform_color.py new file mode 100755 index 000000000..9dc7eaed5 --- /dev/null +++ b/scripts/scil_surface_assign_uniform_color.py @@ -0,0 +1,140 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" + +""" + +import argparse +import json +import logging +import os + +from dipy.io.surface import load_surface, save_surface +import numpy as np + +from scilpy.io.utils import (assert_inputs_exist, + assert_outputs_exist, + add_overwrite_arg, + add_verbose_arg, + add_reference_arg, + add_surface_spatial_arg, + add_vtk_legacy_arg, + convert_stateful_str_to_enum) +from scilpy.viz.color import format_hexadecimal_color_to_rgb + + +def _build_arg_parser(): + p = argparse.ArgumentParser( + description=__doc__, + formatter_class=argparse.RawTextHelpFormatter) + + p.add_argument('in_surfaces', nargs='+', + help='Input surface(s) (VTK + PIAL + GII supported).') + + g1 = p.add_argument_group(title='Coloring Methods') + p1 = g1.add_mutually_exclusive_group(required=True) + p1.add_argument('--fill_color', metavar='str', + help='Can be hexadecimal (ie. either "#RRGGBB" ' + 'or 0xRRGGBB).') + p1.add_argument('--dict_colors', metavar='file.json', + help="Json file: dictionnary mapping each tractogram's " + "basename to a color.\nDo not put your file's " + "extension in your dict.\n" + "Same convention as --fill_color.") + + g2 = p.add_argument_group(title='Output options') + p2 = g2.add_mutually_exclusive_group(required=True) + p2.add_argument('--out_suffix', nargs='?', const='colored', + metavar='suffix', + help='Specify suffix to append to input basename.\n' + 'Mandatory choice if you run this script on multiple ' + 'tractograms.\nMandatory choice with --dict_colors.\n' + '[%(default)s]') + p2.add_argument('--out_surface', metavar='FILE', + help='Output filename of colored Surface (VTK supported).') + + add_surface_spatial_arg(p) + add_vtk_legacy_arg(p) + add_reference_arg(p) + add_verbose_arg(p) + add_overwrite_arg(p) + + return p + + +def main(): + parser = _build_arg_parser() + args = parser.parse_args() + + logging.getLogger().setLevel(logging.getLevelName(args.verbose)) + + # Verifications + if len(args.in_surfaces) > 1 and args.out_surface: + parser.error('Using multiple inputs, use --out_suffix.') + if args.dict_colors and args.out_surface: + parser.error('Using --dict_colors, use --out_suffix.') + + assert_inputs_exist(parser, args.in_surfaces, args.reference) + convert_stateful_str_to_enum(args) + + if args.reference is None: + parser.error('A reference file is required to determine the space.\n' + 'Please provide one using --reference') + + if args.out_suffix and args.out_suffix[0] != '_': + args.out_suffix = '_' + args.out_suffix + + if args.out_surface: + out_filenames = [args.out_surface] + _, ext = os.path.splitext(args.out_surface) + else: # args.out_suffix + out_filenames = [] + for filename in args.in_surfaces: + base, ext = os.path.splitext(filename) + out_filenames.append('{}{}{}' + .format(base, args.out_suffix, ext)) + assert_outputs_exist(parser, args, out_filenames) + + # Loading (except tractograms, in loop) + dict_colors = None + if args.dict_colors: + with open(args.dict_colors, 'r') as data: + dict_colors = json.load(data) + + # Processing + for i, filename in enumerate(args.in_surfaces): + color = None + + sfs = load_surface(filename, args.reference, + from_space=args.source_space, + from_origin=args.source_origin) + + if args.dict_colors: + base, ext = os.path.splitext(filename) + base = os.path.basename(base) + pos = base.index('__') if '__' in base else -2 + base = base[pos + 2:] + + for key in dict_colors.keys(): + if key in base: + color = dict_colors[key] + if color is None: + parser.error("Basename of file {} ({}) not found in your " + "dict_colors keys.".format(filename, base)) + else: # args.fill_color is not None: + color = args.fill_color + + red, green, blue = format_hexadecimal_color_to_rgb(color) + + colors = np.tile([red, green, blue], (len(sfs.vertices), 1)) + + sfs.data_per_point['RGB'] = colors + save_surface(sfs, out_filenames[i], + to_space=args.destination_space, + to_origin=args.destination_origin, + legacy_vtk_format=args.legacy_vtk_format) + + +if __name__ == '__main__': + main() diff --git a/scripts/scil_surface_convert.py b/scripts/scil_surface_convert.py index 303e05de9..60d0e0b8a 100755 --- a/scripts/scil_surface_convert.py +++ b/scripts/scil_surface_convert.py @@ -16,16 +16,15 @@ import logging import os -from trimeshpy.vtk_util import (load_polydata, - save_polydata) +from dipy.io.surface import load_surface, save_surface -from scilpy.surfaces.utils import (convert_freesurfer_into_polydata, - flip_surfaces_axes) - -from scilpy.io.utils import (add_overwrite_arg, +from scilpy.io.utils import (add_vtk_legacy_arg, + add_overwrite_arg, + add_surface_spatial_arg, add_verbose_arg, assert_inputs_exist, - assert_outputs_exist) + assert_outputs_exist, + convert_stateful_str_to_enum) EPILOG = """ References: @@ -43,13 +42,20 @@ def _build_arg_parser(): p.add_argument('out_surface', help='Output surface (formats supported by VTK).\n' 'Recommended extension: .vtk or .ply') - - p.add_argument('--flip_axes', default=[-1, -1, 1], type=int, nargs=3, - help='Flip axes for RAS or LPS convention. ' - 'Default is LPS convention (MI-Brain) %(default)s.') p.add_argument('--reference', - help='Reference image to extract the transformation matrix ' + help='Reference image to extract the transformation matrix\n' 'to align the freesurfer surface with the T1.') + + r = p.add_mutually_exclusive_group() + r.add_argument('--ref_pial', + help='Reference pial surface to extract the transformation\n' + 'matrix to align the freesurfer surface with the T1.') + r.add_argument('--ref_gii', + help='Reference gii surface to extract the header ' + 'information to be valid') + + add_vtk_legacy_arg(p) + add_surface_spatial_arg(p) add_verbose_arg(p) add_overwrite_arg(p) @@ -61,8 +67,10 @@ def main(): args = parser.parse_args() logging.getLogger().setLevel(logging.getLevelName(args.verbose)) - assert_inputs_exist(parser, args.in_surface, optional=args.reference) + assert_inputs_exist(parser, args.in_surface, + optional=[args.reference, args.ref_pial, args.ref_gii]) assert_outputs_exist(parser, args, args.out_surface) + convert_stateful_str_to_enum(args) _, ext = os.path.splitext(args.in_surface) # FreeSurfer surfaces have no extension, verify if the input has one of the @@ -72,15 +80,26 @@ def main(): parser.error('The reference image is required for FreeSurfer ' 'surfaces.') - polydata = convert_freesurfer_into_polydata(args.in_surface, - args.reference) - else: - polydata = load_polydata(args.in_surface) - - if args.flip_axes: - polydata = flip_surfaces_axes(polydata, args.flip_axes) + if args.source_space or args.source_origin: + print('The source space and source origin can not be changed for ' + 'FreeSurfer surfaces. Will be ignored.') - save_polydata(polydata, args.out_surface, legacy_vtk_format=True) + _, ext = os.path.splitext(args.out_surface) + if ext not in ['.vtk', '.vtp', '.fib', '.ply', '.stl', '.xml', '.obj']: + if args.destination_space or args.destination_origin: + parser.error('The destination space and destination origin can ' + 'not be changed for FreeSurfer surfaces') + + # Dipy takes care of Freesurfer surfaces (ignore space and origin if any) + sfs = load_surface(args.in_surface, args.reference, + from_space=args.source_space, + from_origin=args.source_origin) + + # The ref will be either None or a valid path or both None + save_surface(sfs, args.out_surface, to_space=args.destination_space, + to_origin=args.destination_origin, + legacy_vtk_format=args.legacy_vtk_format, + ref_pial=args.ref_pial, ref_gii=args.ref_gii) if __name__ == "__main__": diff --git a/scripts/scil_tractogram_assign_uniform_color.py b/scripts/scil_tractogram_assign_uniform_color.py index 6a1e15413..38273c0c4 100755 --- a/scripts/scil_tractogram_assign_uniform_color.py +++ b/scripts/scil_tractogram_assign_uniform_color.py @@ -127,6 +127,7 @@ def main(): if args.dict_colors: base, ext = os.path.splitext(filename) + base = os.path.basename(base) pos = base.index('__') if '__' in base else -2 base = base[pos + 2:] From 98baa8a2ca15a6ae408c859ad8001d0e38b55160 Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 10 Jul 2025 09:35:15 -0400 Subject: [PATCH 06/90] refactor: Remove scilpy_bot and nltk changes --- scilpy/utils/scilpy_bot.py | 7 +++---- scilpy/utils/tests/test_scilpy_bot.py | 22 ---------------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/scilpy/utils/scilpy_bot.py b/scilpy/utils/scilpy_bot.py index dae900ee5..0bd3563e0 100644 --- a/scilpy/utils/scilpy_bot.py +++ b/scilpy/utils/scilpy_bot.py @@ -5,20 +5,19 @@ import re import subprocess - +import nltk +from nltk.stem import PorterStemmer from tqdm import tqdm SPACING_LEN = 80 +stemmer = PorterStemmer() try: - import nltk - from nltk.stem import PorterStemmer nltk.download('punkt', quiet=True) nltk.download('wordnet', quiet=True) except ImportError: raise ImportError("You must install the 'nltk' package to use this script." "Please run 'pip install nltk'.") -stemmer = PorterStemmer() # Path to the JSON file containing script information and keywords VOCAB_FILE_PATH = pathlib.Path( diff --git a/scilpy/utils/tests/test_scilpy_bot.py b/scilpy/utils/tests/test_scilpy_bot.py index 10f6d6bc9..9d3ee5303 100644 --- a/scilpy/utils/tests/test_scilpy_bot.py +++ b/scilpy/utils/tests/test_scilpy_bot.py @@ -1,4 +1,3 @@ -import pytest from scilpy.utils.scilpy_bot import ( _make_title, _get_docstring_from_script_path, @@ -7,24 +6,12 @@ _extract_keywords_and_phrases, _calculate_score ) -try: - import nltk - nltk.download('punkt_tab', quiet=True) - nltk.download('wordnet', quiet=True) - have_nltk = True -except ImportError: - have_nltk = False -print(have_nltk) - - -@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_make_title(): result = _make_title("Test Title") assert "Test Title" in result -@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_get_docstring_from_script_path(tmp_path): script_content = '"""This is a test docstring."""' script_path = tmp_path / "test_script.py" @@ -33,7 +20,6 @@ def test_get_docstring_from_script_path(tmp_path): assert result == "This is a test docstring." -@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_split_first_sentence(): text = "This is the first sentence. This is the second sentence." first, remaining = _split_first_sentence(text) @@ -41,28 +27,24 @@ def test_split_first_sentence(): assert remaining == " This is the second sentence." -@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_stem_keywords(): keywords = ["running", "jumps"] result = _stem_keywords(keywords) assert result == ["run", "jump"] -@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_stem_text(): text = "Running and jumping." result = _stem_text(text) assert result == "run and jump ." -@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_stem_phrase(): phrase = "Running quickly" result = _stem_phrase(phrase) assert result == "run quickli" -@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_highlight_keywords(): text = "Running and jumping." stemmed_keywords = ["run"] @@ -70,7 +52,6 @@ def test_highlight_keywords(): assert "Running" in result -@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_get_synonyms(): synonyms_data = [["run", "sprint"], ["jump", "leap"]] result = _get_synonyms("run", synonyms_data) @@ -78,7 +59,6 @@ def test_get_synonyms(): assert len(result) == 2 -@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_extract_keywords_and_phrases(): keywords = ["running", "jumps", "quick run"] result_keywords, result_phrases = _extract_keywords_and_phrases(keywords) @@ -92,7 +72,6 @@ def test_extract_keywords_and_phrases(): assert "quick run" in result_phrases -@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_stem_word_specific(): result = _stem_word("streamlines") assert result == "streamlin" @@ -107,7 +86,6 @@ def test_stem_word_specific(): assert result == "tractometri" -@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_calculate_score(): keywords = ["run"] phrases = ["quick run"] From 5fa719ee688a6b918204932b820899da599a8671 Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 10 Jul 2025 09:36:21 -0400 Subject: [PATCH 07/90] fix: Correct Space import in scilpy.io.utils --- scilpy/io/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scilpy/io/utils.py b/scilpy/io/utils.py index 7b5ce5ee2..803bc05f2 100644 --- a/scilpy/io/utils.py +++ b/scilpy/io/utils.py @@ -13,7 +13,8 @@ import nibabel as nib import numpy as np from dipy.data import SPHERE_FILES -from dipy.io.utils import is_header_compatible, Space, Origin +from dipy.io.stateful_tractogram import Space, Origin +from dipy.io.utils import is_header_compatible from scipy.io import loadmat import six From e8f2c616dc8987e17fed61da916331823f300ca7 Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 10 Jul 2025 09:37:56 -0400 Subject: [PATCH 08/90] feat: Add scilpy_bot and nltk support --- scilpy/utils/scilpy_bot.py | 7 ++++--- scilpy/utils/tests/test_scilpy_bot.py | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/scilpy/utils/scilpy_bot.py b/scilpy/utils/scilpy_bot.py index 0bd3563e0..dae900ee5 100644 --- a/scilpy/utils/scilpy_bot.py +++ b/scilpy/utils/scilpy_bot.py @@ -5,19 +5,20 @@ import re import subprocess -import nltk -from nltk.stem import PorterStemmer + from tqdm import tqdm SPACING_LEN = 80 -stemmer = PorterStemmer() try: + import nltk + from nltk.stem import PorterStemmer nltk.download('punkt', quiet=True) nltk.download('wordnet', quiet=True) except ImportError: raise ImportError("You must install the 'nltk' package to use this script." "Please run 'pip install nltk'.") +stemmer = PorterStemmer() # Path to the JSON file containing script information and keywords VOCAB_FILE_PATH = pathlib.Path( diff --git a/scilpy/utils/tests/test_scilpy_bot.py b/scilpy/utils/tests/test_scilpy_bot.py index 9d3ee5303..1b77d182e 100644 --- a/scilpy/utils/tests/test_scilpy_bot.py +++ b/scilpy/utils/tests/test_scilpy_bot.py @@ -1,3 +1,4 @@ +import pytest from scilpy.utils.scilpy_bot import ( _make_title, _get_docstring_from_script_path, @@ -6,12 +7,24 @@ _extract_keywords_and_phrases, _calculate_score ) +try: + import nltk + nltk.download('punkt_tab', quiet=True) + nltk.download('wordnet', quiet=True) + have_nltk = True +except ImportError: + have_nltk = False + + + +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_make_title(): result = _make_title("Test Title") assert "Test Title" in result +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_get_docstring_from_script_path(tmp_path): script_content = '"""This is a test docstring."""' script_path = tmp_path / "test_script.py" @@ -20,6 +33,7 @@ def test_get_docstring_from_script_path(tmp_path): assert result == "This is a test docstring." +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_split_first_sentence(): text = "This is the first sentence. This is the second sentence." first, remaining = _split_first_sentence(text) @@ -27,24 +41,28 @@ def test_split_first_sentence(): assert remaining == " This is the second sentence." +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_stem_keywords(): keywords = ["running", "jumps"] result = _stem_keywords(keywords) assert result == ["run", "jump"] +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_stem_text(): text = "Running and jumping." result = _stem_text(text) assert result == "run and jump ." +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_stem_phrase(): phrase = "Running quickly" result = _stem_phrase(phrase) assert result == "run quickli" +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_highlight_keywords(): text = "Running and jumping." stemmed_keywords = ["run"] @@ -52,6 +70,7 @@ def test_highlight_keywords(): assert "Running" in result +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_get_synonyms(): synonyms_data = [["run", "sprint"], ["jump", "leap"]] result = _get_synonyms("run", synonyms_data) @@ -59,6 +78,7 @@ def test_get_synonyms(): assert len(result) == 2 +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_extract_keywords_and_phrases(): keywords = ["running", "jumps", "quick run"] result_keywords, result_phrases = _extract_keywords_and_phrases(keywords) @@ -72,6 +92,7 @@ def test_extract_keywords_and_phrases(): assert "quick run" in result_phrases +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_stem_word_specific(): result = _stem_word("streamlines") assert result == "streamlin" @@ -86,6 +107,7 @@ def test_stem_word_specific(): assert result == "tractometri" +@pytest.mark.skipif(not have_nltk, reason="Requires NLTK") def test_calculate_score(): keywords = ["run"] phrases = ["quick run"] From 9b310937bd0f1fbfc35f06b7c61334f635d9d6a8 Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 10 Jul 2025 09:50:00 -0400 Subject: [PATCH 09/90] Fix peaks directions --- scilpy/reconst/sh.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scilpy/reconst/sh.py b/scilpy/reconst/sh.py index 45f8dea67..0ef1828d6 100644 --- a/scilpy/reconst/sh.py +++ b/scilpy/reconst/sh.py @@ -212,9 +212,9 @@ def _peaks_from_sh_loop(shm_coeff, B, sphere, relative_peak_threshold, odf[odf < absolute_threshold] = 0. dirs, peaks, ind = peak_directions(odf, sphere, - relative_peak_threshold, - min_separation_angle, - is_symmetric) + relative_peak_threshold=relative_peak_threshold, + min_separation_angle=min_separation_angle, + is_symmetric=is_symmetric) if peaks.shape[0] != 0: n = min(npeaks, peaks.shape[0]) From 9d3246f11d12d6b816e2f06f085887c82dd1cb18 Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 10 Jul 2025 09:53:35 -0400 Subject: [PATCH 10/90] revert convert --- scripts/scil_surface_convert.py | 78 +++++++++++++-------------------- 1 file changed, 30 insertions(+), 48 deletions(-) diff --git a/scripts/scil_surface_convert.py b/scripts/scil_surface_convert.py index 60d0e0b8a..253afbe02 100755 --- a/scripts/scil_surface_convert.py +++ b/scripts/scil_surface_convert.py @@ -11,51 +11,46 @@ > scil_surface_convert.py surf.vtk converted_surf.ply Formerly: scil_convert_surface.py +----------------------------------------------------------------- +Reference: +[1] St-Onge, E., Daducci, A., Girard, G. and Descoteaux, M. 2018. + Surface-enhanced tractography (SET). NeuroImage. +----------------------------------------------------------------- """ import argparse import logging import os -from dipy.io.surface import load_surface, save_surface +from trimeshpy.vtk_util import (load_polydata, + save_polydata) + +from scilpy.surfaces.utils import (convert_freesurfer_into_polydata, + flip_surfaces_axes) -from scilpy.io.utils import (add_vtk_legacy_arg, - add_overwrite_arg, - add_surface_spatial_arg, +from scilpy.io.utils import (add_overwrite_arg, add_verbose_arg, assert_inputs_exist, - assert_outputs_exist, - convert_stateful_str_to_enum) - -EPILOG = """ -References: -[1] St-Onge, E., Daducci, A., Girard, G. and Descoteaux, M. 2018. - Surface-enhanced tractography (SET). NeuroImage. -""" + assert_outputs_exist) +from scilpy.version import version_string def _build_arg_parser(): - p = argparse.ArgumentParser(description=__doc__, epilog=EPILOG, - formatter_class=argparse.RawTextHelpFormatter) + p = argparse.ArgumentParser(description=__doc__, + formatter_class=argparse.RawTextHelpFormatter, + epilog=version_string) p.add_argument('in_surface', help='Input a surface (FreeSurfer or supported by VTK).') p.add_argument('out_surface', help='Output surface (formats supported by VTK).\n' 'Recommended extension: .vtk or .ply') + + p.add_argument('--flip_axes', default=[-1, -1, 1], type=int, nargs=3, + help='Flip axes for RAS or LPS convention. ' + 'Default is LPS convention (MI-Brain) %(default)s.') p.add_argument('--reference', - help='Reference image to extract the transformation matrix\n' + help='Reference image to extract the transformation matrix ' 'to align the freesurfer surface with the T1.') - - r = p.add_mutually_exclusive_group() - r.add_argument('--ref_pial', - help='Reference pial surface to extract the transformation\n' - 'matrix to align the freesurfer surface with the T1.') - r.add_argument('--ref_gii', - help='Reference gii surface to extract the header ' - 'information to be valid') - - add_vtk_legacy_arg(p) - add_surface_spatial_arg(p) add_verbose_arg(p) add_overwrite_arg(p) @@ -67,10 +62,8 @@ def main(): args = parser.parse_args() logging.getLogger().setLevel(logging.getLevelName(args.verbose)) - assert_inputs_exist(parser, args.in_surface, - optional=[args.reference, args.ref_pial, args.ref_gii]) + assert_inputs_exist(parser, args.in_surface, optional=args.reference) assert_outputs_exist(parser, args, args.out_surface) - convert_stateful_str_to_enum(args) _, ext = os.path.splitext(args.in_surface) # FreeSurfer surfaces have no extension, verify if the input has one of the @@ -80,26 +73,15 @@ def main(): parser.error('The reference image is required for FreeSurfer ' 'surfaces.') - if args.source_space or args.source_origin: - print('The source space and source origin can not be changed for ' - 'FreeSurfer surfaces. Will be ignored.') + polydata = convert_freesurfer_into_polydata(args.in_surface, + args.reference) + else: + polydata = load_polydata(args.in_surface) - _, ext = os.path.splitext(args.out_surface) - if ext not in ['.vtk', '.vtp', '.fib', '.ply', '.stl', '.xml', '.obj']: - if args.destination_space or args.destination_origin: - parser.error('The destination space and destination origin can ' - 'not be changed for FreeSurfer surfaces') - - # Dipy takes care of Freesurfer surfaces (ignore space and origin if any) - sfs = load_surface(args.in_surface, args.reference, - from_space=args.source_space, - from_origin=args.source_origin) - - # The ref will be either None or a valid path or both None - save_surface(sfs, args.out_surface, to_space=args.destination_space, - to_origin=args.destination_origin, - legacy_vtk_format=args.legacy_vtk_format, - ref_pial=args.ref_pial, ref_gii=args.ref_gii) + if args.flip_axes: + polydata = flip_surfaces_axes(polydata, args.flip_axes) + + save_polydata(polydata, args.out_surface, legacy_vtk_format=True) if __name__ == "__main__": From 7443b779db43718dd400e2a16f8612eee592aa99 Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 10 Jul 2025 10:15:23 -0400 Subject: [PATCH 11/90] Update fury --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fa37d3191..18ea1681f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ dmri-commit==2.3.* docopt==0.6.* dvc==3.59.* formulaic==0.5.* -fury==0.9.* +fury==0.12.* future==1.0.* GitPython==3.1.* h5py==3.12.* From 35697a1d47a59bb84f45adfb5174294a3f7fffa9 Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 10 Jul 2025 10:28:26 -0400 Subject: [PATCH 12/90] Remove warnings ! --- scilpy/io/varian_fdf.py | 6 +- scripts/tests/test_NODDI_maps.py | 10 +-- scripts/tests/test_NODDI_priors.py | 6 +- scripts/tests/test_aodf_metrics.py | 22 +++--- scripts/tests/test_bids_validate.py | 18 ++--- scripts/tests/test_bingham_metrics.py | 16 ++-- scripts/tests/test_btensor_metrics.py | 26 +++---- .../tests/test_bundle_alter_to_target_dice.py | 22 +++--- .../tests/test_bundle_clean_qbx_clusters.py | 2 +- scripts/tests/test_bundle_compute_centroid.py | 6 +- .../test_bundle_compute_endpoints_map.py | 10 +-- scripts/tests/test_bundle_diameter.py | 6 +- .../tests/test_bundle_explore_bundleseg.py | 2 +- .../tests/test_bundle_filter_by_occurence.py | 6 +- scripts/tests/test_bundle_fixel_analysis.py | 14 ++-- scripts/tests/test_bundle_generate_priors.py | 6 +- scripts/tests/test_bundle_label_map.py | 10 +-- scripts/tests/test_bundle_mean_fixel_afd.py | 6 +- .../test_bundle_mean_fixel_afd_from_hdf5.py | 8 +- .../test_bundle_mean_fixel_bingham_metric.py | 8 +- .../test_bundle_mean_fixel_mrds_metric.py | 4 +- scripts/tests/test_bundle_mean_std.py | 10 +-- .../tests/test_bundle_pairwise_comparison.py | 24 +++--- scripts/tests/test_bundle_reject_outliers.py | 6 +- ...undle_score_many_bundles_one_tractogram.py | 8 +- ...le_score_same_bundle_many_segmentations.py | 8 +- scripts/tests/test_bundle_shape_measures.py | 6 +- .../tests/test_bundle_uniformize_endpoints.py | 12 +-- scripts/tests/test_bundle_volume_per_label.py | 8 +- .../test_connectivity_compare_populations.py | 8 +- .../test_connectivity_compute_matrices.py | 6 +- .../tests/test_connectivity_compute_pca.py | 6 +- ...test_connectivity_compute_simple_matrix.py | 8 +- scripts/tests/test_connectivity_filter.py | 6 +- .../tests/test_connectivity_graph_measures.py | 6 +- ...t_connectivity_hdf5_average_density_map.py | 12 +-- scripts/tests/test_connectivity_math.py | 14 ++-- scripts/tests/test_connectivity_normalize.py | 6 +- .../test_connectivity_pairwise_agreement.py | 8 +- .../test_connectivity_print_filenames.py | 6 +- .../tests/test_connectivity_reorder_rois.py | 10 +-- scripts/tests/test_denoising_nlmeans.py | 18 ++--- scripts/tests/test_dki_metrics.py | 6 +- scripts/tests/test_dti_convert_tensors.py | 10 +-- scripts/tests/test_dti_metrics.py | 26 +++---- scripts/tests/test_dwi_apply_bias_field.py | 6 +- scripts/tests/test_dwi_compute_snr.py | 6 +- scripts/tests/test_dwi_concatenate.py | 6 +- scripts/tests/test_dwi_convert_FDF.py | 2 +- .../tests/test_dwi_detect_volume_outliers.py | 10 +-- scripts/tests/test_dwi_extract_b0.py | 10 +-- scripts/tests/test_dwi_extract_shell.py | 14 ++-- scripts/tests/test_dwi_powder_average.py | 6 +- .../tests/test_dwi_prepare_eddy_command.py | 2 +- .../tests/test_dwi_prepare_topup_command.py | 2 +- scripts/tests/test_dwi_reorder_philips.py | 14 ++-- scripts/tests/test_dwi_split_by_indices.py | 14 ++-- scripts/tests/test_dwi_to_sh.py | 10 +-- .../tests/test_fibertube_compute_density.py | 10 +-- .../tests/test_fibertube_score_tractogram.py | 6 +- scripts/tests/test_fibertube_tracking.py | 42 +++++------ scripts/tests/test_fodf_bundleparc.py | 18 ++--- scripts/tests/test_fodf_max_in_ventricles.py | 6 +- scripts/tests/test_fodf_memsmt.py | 14 ++-- scripts/tests/test_fodf_metrics.py | 6 +- scripts/tests/test_fodf_msmt.py | 6 +- scripts/tests/test_fodf_ssst.py | 10 +-- scripts/tests/test_fodf_to_bingham.py | 12 +-- scripts/tests/test_freewater_maps.py | 6 +- scripts/tests/test_freewater_priors.py | 2 +- scripts/tests/test_frf_mean.py | 12 +-- scripts/tests/test_frf_memsmt.py | 34 ++++----- scripts/tests/test_frf_msmt.py | 34 ++++----- scripts/tests/test_frf_set_diffusivities.py | 18 ++--- scripts/tests/test_frf_ssst.py | 34 ++++----- .../tests/test_gradients_apply_transform.py | 6 +- scripts/tests/test_gradients_convert.py | 24 +++--- .../tests/test_gradients_generate_sampling.py | 6 +- scripts/tests/test_gradients_modify_axes.py | 10 +-- .../tests/test_gradients_normalize_bvecs.py | 8 +- scripts/tests/test_gradients_round_bvals.py | 8 +- .../tests/test_gradients_validate_correct.py | 14 ++-- .../test_gradients_validate_correct_eddy.py | 12 +-- .../tests/test_gradients_validate_sampling.py | 8 +- scripts/tests/test_header_print_info.py | 6 +- .../test_header_validate_compatibility.py | 6 +- .../test_json_convert_entries_to_xlsx.py | 6 +- scripts/tests/test_json_harmonize_entries.py | 2 +- scripts/tests/test_json_merge_entries.py | 6 +- scripts/tests/test_labels_combine.py | 10 +-- scripts/tests/test_labels_dilate.py | 6 +- scripts/tests/test_labels_from_mask.py | 26 +++---- scripts/tests/test_labels_remove.py | 6 +- .../tests/test_labels_split_volume_by_ids.py | 6 +- .../test_labels_split_volume_from_lut.py | 6 +- scripts/tests/test_lesions_generate_nawm.py | 6 +- scripts/tests/test_lesions_info.py | 2 +- scripts/tests/test_mrds_metrics.py | 10 +-- .../test_mrds_select_number_of_tensors.py | 10 +-- scripts/tests/test_mti_adjust_B1_header.py | 6 +- scripts/tests/test_mti_maps_MT.py | 54 +++++++------- scripts/tests/test_mti_maps_ihMT.py | 54 +++++++------- scripts/tests/test_plot_stats_per_point.py | 6 +- scripts/tests/test_qball_metrics.py | 14 ++-- scripts/tests/test_rgb_convert.py | 6 +- scripts/tests/test_search_keywords.py | 8 +- scripts/tests/test_sh_convert.py | 6 +- scripts/tests/test_sh_fusion.py | 4 +- scripts/tests/test_sh_to_aodf.py | 18 ++--- scripts/tests/test_sh_to_rish.py | 4 +- scripts/tests/test_sh_to_sf.py | 18 ++--- scripts/tests/test_stats_group_comparison.py | 8 +- scripts/tests/test_surface_apply_transform.py | 6 +- scripts/tests/test_surface_convert.py | 10 +-- scripts/tests/test_surface_create.py | 22 +++--- scripts/tests/test_surface_flip.py | 6 +- scripts/tests/test_surface_smooth.py | 6 +- scripts/tests/test_tracking_local.py | 58 +++++++-------- scripts/tests/test_tracking_local_dev.py | 16 ++-- scripts/tests/test_tracking_pft.py | 8 +- scripts/tests/test_tracking_pft_maps.py | 8 +- scripts/tests/test_tracking_pft_maps_edit.py | 6 +- .../tests/test_tractogram_apply_transform.py | 6 +- ...test_tractogram_apply_transform_to_hdf5.py | 8 +- .../test_tractogram_assign_custom_color.py | 16 ++-- .../test_tractogram_assign_uniform_color.py | 16 ++-- scripts/tests/test_tractogram_commit.py | 10 +-- scripts/tests/test_tractogram_compress.py | 6 +- scripts/tests/test_tractogram_compute_TODI.py | 10 +-- .../test_tractogram_compute_density_map.py | 12 +-- scripts/tests/test_tractogram_convert.py | 6 +- .../test_tractogram_convert_hdf5_to_trk.py | 18 ++--- .../test_tractogram_convert_trk_to_hdf5.py | 10 +-- .../test_tractogram_count_streamlines.py | 4 +- .../tests/test_tractogram_cut_streamlines.py | 36 ++++----- scripts/tests/test_tractogram_detect_loops.py | 6 +- scripts/tests/test_tractogram_dpp_math.py | 22 +++--- scripts/tests/test_tractogram_dps_math.py | 48 ++++++------ .../tests/test_tractogram_extract_ushape.py | 8 +- .../test_tractogram_filter_by_anatomy.py | 16 ++-- .../tests/test_tractogram_filter_by_length.py | 16 ++-- .../test_tractogram_filter_by_orientation.py | 8 +- .../tests/test_tractogram_filter_by_roi.py | 14 ++-- .../test_tractogram_filter_collisions.py | 30 ++++---- scripts/tests/test_tractogram_flip.py | 6 +- scripts/tests/test_tractogram_math.py | 74 +++++++++---------- .../test_tractogram_pairwise_comparison.py | 12 +-- scripts/tests/test_tractogram_print_info.py | 4 +- ...t_tractogram_project_map_to_streamlines.py | 24 +++--- ...t_tractogram_project_streamlines_to_map.py | 32 ++++---- scripts/tests/test_tractogram_qbx.py | 6 +- scripts/tests/test_tractogram_register.py | 6 +- .../tests/test_tractogram_remove_invalid.py | 6 +- scripts/tests/test_tractogram_resample.py | 22 +++--- .../test_tractogram_resample_nb_points.py | 6 +- .../tests/test_tractogram_seed_density_map.py | 6 +- ...ctogram_segment_connections_from_labels.py | 8 +- ...t_tractogram_segment_with_ROI_and_score.py | 8 +- .../test_tractogram_segment_with_bundleseg.py | 8 +- ...est_tractogram_segment_with_recobundles.py | 8 +- scripts/tests/test_tractogram_shuffle.py | 6 +- scripts/tests/test_tractogram_smooth.py | 6 +- scripts/tests/test_tractogram_split.py | 14 ++-- scripts/tests/test_viz_bingham_fit.py | 6 +- scripts/tests/test_viz_bundle.py | 6 +- .../tests/test_viz_bundle_screenshot_mni.py | 2 +- .../test_viz_bundle_screenshot_mosaic.py | 2 +- scripts/tests/test_viz_connectivity.py | 6 +- scripts/tests/test_viz_dti_screenshot.py | 2 +- scripts/tests/test_viz_fodf.py | 8 +- .../tests/test_viz_gradients_screenshot.py | 2 +- .../tests/test_viz_tractogram_collisions.py | 2 +- scripts/tests/test_viz_tractogram_seeds.py | 2 +- scripts/tests/test_viz_tractogram_seeds_3d.py | 2 +- scripts/tests/test_viz_volume_histogram.py | 6 +- scripts/tests/test_viz_volume_scatterplot.py | 26 +++---- scripts/tests/test_viz_volume_screenshot.py | 6 +- .../test_viz_volume_screenshot_mosaic.py | 2 +- scripts/tests/test_volume_apply_transform.py | 14 ++-- scripts/tests/test_volume_b0_synthesis.py | 6 +- .../test_volume_count_non_zero_voxels.py | 12 +-- scripts/tests/test_volume_crop.py | 10 +-- scripts/tests/test_volume_distance_map.py | 6 +- scripts/tests/test_volume_flip.py | 6 +- scripts/tests/test_volume_math.py | 22 +++--- .../tests/test_volume_pairwise_comparison.py | 26 +++---- .../test_volume_remove_outliers_ransac.py | 6 +- scripts/tests/test_volume_resample.py | 18 ++--- scripts/tests/test_volume_reshape.py | 22 +++--- .../tests/test_volume_reslice_to_reference.py | 10 +-- scripts/tests/test_volume_stats_in_ROI.py | 22 +++--- scripts/tests/test_volume_stats_in_labels.py | 14 ++-- 192 files changed, 1124 insertions(+), 1124 deletions(-) diff --git a/scilpy/io/varian_fdf.py b/scilpy/io/varian_fdf.py index 7736d42a7..aa77f7d40 100644 --- a/scilpy/io/varian_fdf.py +++ b/scilpy/io/varian_fdf.py @@ -101,11 +101,11 @@ def read_file(file_path): # Extracts floating point numbers # ex: 'float roi[] = {3.840000,3.840000,0.035000};' # returns ['3.840000', '3.840000', '0.035000'] - float_regex = '[-+]?[0-9]*\.?[0-9]+' + float_regex = r'[-+]?[0-9]*\.?[0-9]+' # Extracts value of a line of the type: # 'int slice_no = 1;' would return '1' - named_value_regex = '= *\"*(.*[^\"])\"* *;' + named_value_regex = r'= *\"*(.*[^\"])\"* *;' # (tag_in_file, tag_in_header) find_values = (('echos', 'nechoes'), @@ -172,7 +172,7 @@ def read_file(file_path): # Extracts digits. # ex: 'float matrix[] = {128, 128};' # returns ['128', '128'] - m = re.findall('(\d+)', line.rstrip()) + m = re.findall(r'(\d+)', line.rstrip()) raw_header['shape'] = np.array([int(x) for x in m]) # Total number of data pixels diff --git a/scripts/tests/test_NODDI_maps.py b/scripts/tests/test_NODDI_maps.py index ed7e66b9f..05b646d2b 100644 --- a/scripts/tests/test_NODDI_maps.py +++ b/scripts/tests/test_NODDI_maps.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_NODDI_maps.py', '--help') + ret = script_runner.run(['scil_NODDI_maps.py', '--help']) assert ret.success @@ -28,12 +28,12 @@ def test_execution_commit_amico(script_runner, monkeypatch): 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_NODDI_maps.py', in_dwi, + ret = script_runner.run(['scil_NODDI_maps.py', in_dwi, in_bval, in_bvec, '--mask', mask, '--out_dir', 'noddi', '--tol', '30', '--para_diff', '0.0017', '--iso_diff', '0.003', '--lambda1', '0.5', '--lambda2', '0.001', - '--processes', '1', '-f') + '--processes', '1', '-f']) assert ret.success @@ -45,10 +45,10 @@ def test_single_shell_fail(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_NODDI_maps.py', in_dwi, + ret = script_runner.run(['scil_NODDI_maps.py', in_dwi, in_bval, in_bvec, '--out_dir', 'noddi', '--tol', '30', '--para_diff', '0.0017', '--iso_diff', '0.003', '--lambda1', '0.5', '--lambda2', '0.001', - '--processes', '1', '-f') + '--processes', '1', '-f']) assert not ret.success diff --git a/scripts/tests/test_NODDI_priors.py b/scripts/tests/test_NODDI_priors.py index 11bfd29d4..7b7ae918e 100644 --- a/scripts/tests/test_NODDI_priors.py +++ b/scripts/tests/test_NODDI_priors.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_NODDI_priors.py', '--help') + ret = script_runner.run(['scil_NODDI_priors.py', '--help']) assert ret.success @@ -27,10 +27,10 @@ def test_execution_commit_amico(script_runner, monkeypatch): 'md.nii.gz') in_rd = os.path.join(SCILPY_HOME, 'processing', 'rd.nii.gz') - ret = script_runner.run('scil_NODDI_priors.py', in_fa, in_ad, in_rd, in_md, + ret = script_runner.run(['scil_NODDI_priors.py', in_fa, in_ad, in_rd, in_md, '--out_txt_1fiber_para', '1fiber_para.txt', '--out_txt_1fiber_perp', '1fiber_perp.txt', '--out_mask_1fiber', '1fiber.nii.gz', '--out_txt_ventricles', 'ventricules.txt', - '--out_mask_ventricles', 'ventricules.nii.gz') + '--out_mask_ventricles', 'ventricules.nii.gz']) assert ret.success diff --git a/scripts/tests/test_aodf_metrics.py b/scripts/tests/test_aodf_metrics.py index a242e060b..c6623ee44 100644 --- a/scripts/tests/test_aodf_metrics.py +++ b/scripts/tests/test_aodf_metrics.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_aodf_metrics.py', '--help') + ret = script_runner.run(['scil_aodf_metrics.py', '--help']) assert ret.success @@ -24,8 +24,8 @@ def test_execution(script_runner, monkeypatch): f"{test_data_root}/fodf_descoteaux07_sub_unified_asym.nii.gz") # Using a low resolution sphere for peak extraction reduces process time - ret = script_runner.run('scil_aodf_metrics.py', in_fodf, - '--sphere', 'repulsion100', '--processes', '1') + ret = script_runner.run(['scil_aodf_metrics.py', in_fodf, + '--sphere', 'repulsion100', '--processes', '1']) assert ret.success @@ -34,8 +34,8 @@ def test_assert_not_all(script_runner, monkeypatch): in_fodf = os.path.join( f"{test_data_root}/fodf_descoteaux07_sub_unified_asym.nii.gz") - ret = script_runner.run('scil_aodf_metrics.py', in_fodf, - '--not_all', '--processes', '1') + ret = script_runner.run(['scil_aodf_metrics.py', in_fodf, + '--not_all', '--processes', '1']) assert not ret.success @@ -44,10 +44,10 @@ def test_execution_not_all(script_runner, monkeypatch): in_fodf = os.path.join( f"{test_data_root}/fodf_descoteaux07_sub_unified_asym.nii.gz") - ret = script_runner.run('scil_aodf_metrics.py', in_fodf, + ret = script_runner.run(['scil_aodf_metrics.py', in_fodf, '--not_all', '--asi_map', 'asi_map.nii.gz', '-f', - '--processes', '1') + '--processes', '1']) assert ret.success @@ -57,9 +57,9 @@ def test_assert_symmetric_input(script_runner, monkeypatch): f"{test_data_root}/fodf_descoteaux07_sub.nii.gz") # Using a low resolution sphere for peak extraction reduces process time - ret = script_runner.run('scil_aodf_metrics.py', in_fodf, + ret = script_runner.run(['scil_aodf_metrics.py', in_fodf, '--sphere', 'repulsion100', - '--processes', '1') + '--processes', '1']) assert not ret.success @@ -70,8 +70,8 @@ def test_execution_symmetric_input(script_runner, monkeypatch): # Using a low resolution sphere for peak extraction reduces process time # Using multiprocessing to test this option. - ret = script_runner.run('scil_aodf_metrics.py', in_fodf, + ret = script_runner.run(['scil_aodf_metrics.py', in_fodf, '--sphere', 'repulsion100', '--not_all', '--nufid', 'nufid.nii.gz', - '--processes', '4') + '--processes', '4']) assert not ret.success diff --git a/scripts/tests/test_bids_validate.py b/scripts/tests/test_bids_validate.py index 09e9765c5..b3422caba 100644 --- a/scripts/tests/test_bids_validate.py +++ b/scripts/tests/test_bids_validate.py @@ -327,7 +327,7 @@ def compare_jsons(json_output, test_dir): def test_help_option(script_runner): - ret = script_runner.run('scil_bids_validate.py', '--help') + ret = script_runner.run(['scil_bids_validate.py', '--help']) assert ret.success @@ -345,10 +345,10 @@ def test_bids_epi(tmpdir, script_runner, dwi_is_complex, json_output): gen_epi=True, complex_dwi=dwi_is_complex) - ret = script_runner.run( + ret = script_runner.run([ 'scil_bids_validate.py', test_dir, - os.path.join(test_dir, json_output), + os.path.join(test_dir, json_output]), '-f', '-v') if ret.success: @@ -372,10 +372,10 @@ def test_bids_sbref( complex_dwi=dwi_is_complex, complex_sbref=sbref_is_complex) - ret = script_runner.run( + ret = script_runner.run([ 'scil_bids_validate.py', test_dir, - os.path.join(test_dir, json_output), + os.path.join(test_dir, json_output]), '-f', '-v') if ret.success: @@ -398,10 +398,10 @@ def test_bids_rev_dwi( complex_dwi=dwi_is_complex, complex_rev_dwi=rev_is_complex) - ret = script_runner.run( + ret = script_runner.run([ 'scil_bids_validate.py', test_dir, - os.path.join(test_dir, json_output), + os.path.join(test_dir, json_output]), '-f', '-v') if ret.success: @@ -426,10 +426,10 @@ def test_bids_rev_dwi_sbref( complex_dwi=dwi_is_complex, complex_rev_dwi=rev_is_complex) - ret = script_runner.run( + ret = script_runner.run([ 'scil_bids_validate.py', test_dir, - os.path.join(test_dir, json_output), + os.path.join(test_dir, json_output]), '-f', '-v') if ret.success: diff --git a/scripts/tests/test_bingham_metrics.py b/scripts/tests/test_bingham_metrics.py index d46b533d9..bf70502f1 100644 --- a/scripts/tests/test_bingham_metrics.py +++ b/scripts/tests/test_bingham_metrics.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bingham_metrics.py', - '--help') + ret = script_runner.run(['scil_bingham_metrics.py', + '--help']) assert ret.success @@ -23,9 +23,9 @@ def test_execution_processing(script_runner, monkeypatch): in_bingham = os.path.join(SCILPY_HOME, 'processing', 'fodf_bingham.nii.gz') - ret = script_runner.run('scil_bingham_metrics.py', + ret = script_runner.run(['scil_bingham_metrics.py', in_bingham, '--nbr_integration_steps', '10', - '--processes', '1') + '--processes', '1']) assert ret.success @@ -37,9 +37,9 @@ def test_execution_processing_mask(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') - ret = script_runner.run('scil_bingham_metrics.py', + ret = script_runner.run(['scil_bingham_metrics.py', in_bingham, '--nbr_integration_steps', '10', - '--processes', '1', '--mask', in_mask, '-f') + '--processes', '1', '--mask', in_mask, '-f']) assert ret.success @@ -49,9 +49,9 @@ def test_execution_processing_not_all(script_runner, monkeypatch): in_bingham = os.path.join(SCILPY_HOME, 'processing', 'fodf_bingham.nii.gz') - ret = script_runner.run('scil_bingham_metrics.py', + ret = script_runner.run(['scil_bingham_metrics.py', in_bingham, '--nbr_integration_steps', '10', '--processes', '1', '--not_all', '--out_fs', - 'fs.nii.gz', '-f') + 'fs.nii.gz', '-f']) assert ret.success diff --git a/scripts/tests/test_btensor_metrics.py b/scripts/tests/test_btensor_metrics.py index e79e1ce0b..40f22e2ad 100644 --- a/scripts/tests/test_btensor_metrics.py +++ b/scripts/tests/test_btensor_metrics.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_btensor_metrics.py', '--help') + ret = script_runner.run(['scil_btensor_metrics.py', '--help']) assert ret.success @@ -33,21 +33,21 @@ def test_nb_btensors_check(script_runner, monkeypatch): fa = os.path.join(SCILPY_HOME, 'btensor', 'fa.nii.gz') - ret = script_runner.run('scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run(['scil_btensor_metrics.py', '--in_dwis', in_dwi_lin, '--in_bvals', in_bval_lin, '--in_bvecs', in_bvec_lin, '--in_bdeltas', '1', '--fa', fa, '--do_weight_bvals', '--do_weight_pa', '--do_multiple_s0', - '--processes', '1', '-f') + '--processes', '1', '-f']) assert (not ret.success) - ret = script_runner.run('scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run(['scil_btensor_metrics.py', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', '1', '--fa', fa, '--do_weight_bvals', '--do_weight_pa', '--do_multiple_s0', - '--processes', '1', '-f') + '--processes', '1', '-f']) assert (not ret.success) @@ -68,30 +68,30 @@ def test_inputs_check(script_runner, monkeypatch): fa = os.path.join(SCILPY_HOME, 'btensor', 'fa.nii.gz') - ret = script_runner.run('scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run(['scil_btensor_metrics.py', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, '--in_bvecs', in_bvec_lin, '--in_bdeltas', '1', '--fa', fa, '--do_weight_bvals', '--do_weight_pa', '--do_multiple_s0', - '--processes', '1', '-f') + '--processes', '1', '-f']) assert (not ret.success) - ret = script_runner.run('scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run(['scil_btensor_metrics.py', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', '-0.5', '0', '--fa', fa, '--do_weight_bvals', '--do_weight_pa', '--do_multiple_s0', - '--processes', '1', '-f') + '--processes', '1', '-f']) assert (not ret.success) - ret = script_runner.run('scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run(['scil_btensor_metrics.py', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', '-0.5', '--op', fa, '--do_weight_bvals', '--do_weight_pa', '--do_multiple_s0', - '--processes', '1', '-f') + '--processes', '1', '-f']) assert (not ret.success) @@ -118,12 +118,12 @@ def test_execution_processing(script_runner, monkeypatch): fa = os.path.join(SCILPY_HOME, 'btensor_testdata', 'fa.nii.gz') - ret = script_runner.run('scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run(['scil_btensor_metrics.py', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, '--in_bvecs', in_bvec_lin, in_bvec_plan, in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', '--fa', fa, '--do_weight_bvals', '--do_weight_pa', '--do_multiple_s0', - '--processes', '1', '-f') + '--processes', '1', '-f']) assert (ret.success) diff --git a/scripts/tests/test_bundle_alter_to_target_dice.py b/scripts/tests/test_bundle_alter_to_target_dice.py index c2e476787..827d0ecb5 100644 --- a/scripts/tests/test_bundle_alter_to_target_dice.py +++ b/scripts/tests/test_bundle_alter_to_target_dice.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_alter_to_target_dice.py', '--help') + ret = script_runner.run(['scil_bundle_alter_to_target_dice.py', '--help']) assert ret.success @@ -21,10 +21,10 @@ def test_execution_subsample(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_alter_to_target_dice.py', + ret = script_runner.run(['scil_bundle_alter_to_target_dice.py', in_bundle, 'out_tractogram_subsample.trk', '--min_dice', '0.75', '--epsilon', '0.01', - '--subsample', '--shuffle', '-v') + '--subsample', '--shuffle', '-v']) assert ret.success @@ -32,10 +32,10 @@ def test_execution_trim(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_alter_to_target_dice.py', + ret = script_runner.run(['scil_bundle_alter_to_target_dice.py', in_bundle, 'out_tractogram_trim.trk', '--min_dice', '0.75', '--epsilon', '0.01', - '--trim', '-v') + '--trim', '-v']) assert ret.success @@ -43,10 +43,10 @@ def test_execution_cut(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_alter_to_target_dice.py', + ret = script_runner.run(['scil_bundle_alter_to_target_dice.py', in_bundle, 'out_tractogram_cut.trk', '--min_dice', '0.75', '--epsilon', '0.01', - '--cut', '-v', 'DEBUG') + '--cut', '-v', 'DEBUG']) assert ret.success @@ -54,10 +54,10 @@ def test_execution_replace(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_alter_to_target_dice.py', + ret = script_runner.run(['scil_bundle_alter_to_target_dice.py', in_bundle, 'out_tractogram_replace.trk', '--min_dice', '0.75', '--epsilon', '0.01', - '--replace', '-v') + '--replace', '-v']) assert ret.success @@ -65,10 +65,10 @@ def test_execution_transform(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_alter_to_target_dice.py', + ret = script_runner.run(['scil_bundle_alter_to_target_dice.py', in_bundle, 'out_tractogram_transform.trk', '--min_dice', '0.75', '--epsilon', '0.01', '--transform', '--save_transform', - 'transform.txt', '-v') + 'transform.txt', '-v']) assert ret.success assert os.path.isfile('transform.txt') diff --git a/scripts/tests/test_bundle_clean_qbx_clusters.py b/scripts/tests/test_bundle_clean_qbx_clusters.py index 53df060a1..770d187d8 100644 --- a/scripts/tests/test_bundle_clean_qbx_clusters.py +++ b/scripts/tests/test_bundle_clean_qbx_clusters.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_clean_qbx_clusters.py', '--help') + ret = script_runner.run(['scil_bundle_clean_qbx_clusters.py', '--help']) assert ret.success diff --git a/scripts/tests/test_bundle_compute_centroid.py b/scripts/tests/test_bundle_compute_centroid.py index 227354517..51eed2c36 100644 --- a/scripts/tests/test_bundle_compute_centroid.py +++ b/scripts/tests/test_bundle_compute_centroid.py @@ -13,13 +13,13 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_compute_centroid.py', '--help') + ret = script_runner.run(['scil_bundle_compute_centroid.py', '--help']) assert ret.success def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_compute_centroid.py', - in_bundle, 'IFGWM_uni_c.trk') + ret = script_runner.run(['scil_bundle_compute_centroid.py', + in_bundle, 'IFGWM_uni_c.trk']) assert ret.success diff --git a/scripts/tests/test_bundle_compute_endpoints_map.py b/scripts/tests/test_bundle_compute_endpoints_map.py index 041a9f436..ec638613a 100644 --- a/scripts/tests/test_bundle_compute_endpoints_map.py +++ b/scripts/tests/test_bundle_compute_endpoints_map.py @@ -13,15 +13,15 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_compute_endpoints_map.py', '--help') + ret = script_runner.run(['scil_bundle_compute_endpoints_map.py', '--help']) assert ret.success def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_compute_endpoints_map.py', in_bundle, - 'head.nii.gz', 'tail.nii.gz', '--binary', '-f') + ret = script_runner.run(['scil_bundle_compute_endpoints_map.py', in_bundle, + 'head.nii.gz', 'tail.nii.gz', '--binary', '-f']) assert ret.success @@ -29,8 +29,8 @@ def test_execution_tractometry(script_runner, monkeypatch): def test_execution_tractometry_mm_distance5(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_compute_endpoints_map.py', in_bundle, + ret = script_runner.run(['scil_bundle_compute_endpoints_map.py', in_bundle, 'head.nii.gz', 'tail.nii.gz', '--binary', - '--distance', '5', '--unit', 'mm', '-f') + '--distance', '5', '--unit', 'mm', '-f']) assert ret.success diff --git a/scripts/tests/test_bundle_diameter.py b/scripts/tests/test_bundle_diameter.py index 172a09270..440dec81b 100644 --- a/scripts/tests/test_bundle_diameter.py +++ b/scripts/tests/test_bundle_diameter.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_diameter.py', '--help') + ret = script_runner.run(['scil_bundle_diameter.py', '--help']) assert ret.success @@ -22,6 +22,6 @@ def test_execution_tractometry(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') in_labels = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run('scil_bundle_diameter.py', in_bundle, in_labels, - '--wireframe', '--fitting_func', 'lin_up') + ret = script_runner.run(['scil_bundle_diameter.py', in_bundle, in_labels, + '--wireframe', '--fitting_func', 'lin_up']) assert ret.success diff --git a/scripts/tests/test_bundle_explore_bundleseg.py b/scripts/tests/test_bundle_explore_bundleseg.py index 397d593ed..0ffdca08b 100644 --- a/scripts/tests/test_bundle_explore_bundleseg.py +++ b/scripts/tests/test_bundle_explore_bundleseg.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_bundle_screenshot_mni.py', '--help') + ret = script_runner.run(['scil_viz_bundle_screenshot_mni.py', '--help']) assert ret.success diff --git a/scripts/tests/test_bundle_filter_by_occurence.py b/scripts/tests/test_bundle_filter_by_occurence.py index 89386a49c..e5163914d 100644 --- a/scripts/tests/test_bundle_filter_by_occurence.py +++ b/scripts/tests/test_bundle_filter_by_occurence.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_filter_by_occurence.py', '--help') + ret = script_runner.run(['scil_bundle_filter_by_occurence.py', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution(script_runner, monkeypatch): 'bundle_4_filtered_no_loops.trk') prefix = 'test_voting_' - ret = script_runner.run('scil_bundle_filter_by_occurence.py', in_1, in_2, + ret = script_runner.run(['scil_bundle_filter_by_occurence.py', in_1, in_2, in_3, prefix, '--ratio_streamlines', '0.5', - '--ratio_voxels', '0.5') + '--ratio_voxels', '0.5']) assert ret.success diff --git a/scripts/tests/test_bundle_fixel_analysis.py b/scripts/tests/test_bundle_fixel_analysis.py index 21101de10..d8789b20a 100644 --- a/scripts/tests/test_bundle_fixel_analysis.py +++ b/scripts/tests/test_bundle_fixel_analysis.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_fixel_analysis.py', '--help') + ret = script_runner.run(['scil_bundle_fixel_analysis.py', '--help']) assert ret.success @@ -22,9 +22,9 @@ def test_default_parameters(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'commit_amico', 'tracking.trk') # Using multiprocessing in this test, single in following tests. - ret = script_runner.run('scil_bundle_fixel_analysis.py', in_peaks, + ret = script_runner.run(['scil_bundle_fixel_analysis.py', in_peaks, '--in_bundles', in_bundle, - '--processes', '4', '-f') + '--processes', '4', '-f']) assert ret.success @@ -33,7 +33,7 @@ def test_all_parameters(script_runner, monkeypatch): in_peaks = os.path.join(SCILPY_HOME, 'commit_amico', 'peaks.nii.gz') in_bundle = os.path.join(SCILPY_HOME, 'commit_amico', 'tracking.trk') - ret = script_runner.run('scil_bundle_fixel_analysis.py', in_peaks, + ret = script_runner.run(['scil_bundle_fixel_analysis.py', in_peaks, '--in_bundles', in_bundle, '--in_bundles_names', 'test', '--abs_thr', '5', @@ -41,7 +41,7 @@ def test_all_parameters(script_runner, monkeypatch): '--norm', 'fixel', '--split_bundles', '--split_fixels', '--single_bundle', - '--processes', '1', '-f') + '--processes', '1', '-f']) assert ret.success @@ -50,7 +50,7 @@ def test_multiple_norm(script_runner, monkeypatch): in_peaks = os.path.join(SCILPY_HOME, 'commit_amico', 'peaks.nii.gz') in_bundle = os.path.join(SCILPY_HOME, 'commit_amico', 'tracking.trk') - ret = script_runner.run('scil_bundle_fixel_analysis.py', in_peaks, + ret = script_runner.run(['scil_bundle_fixel_analysis.py', in_peaks, '--in_bundles', in_bundle, '--in_bundles_names', 'test', '--abs_thr', '5', @@ -59,7 +59,7 @@ def test_multiple_norm(script_runner, monkeypatch): '--split_bundles', '--split_fixels', '--single_bundle', '--out_dir', '.', - '--processes', '1', '-f') + '--processes', '1', '-f']) assert ret.success assert os.path.isfile('bundles_LUT.txt') for n in ['voxel', 'fixel', 'none']: diff --git a/scripts/tests/test_bundle_generate_priors.py b/scripts/tests/test_bundle_generate_priors.py index 426bef83d..98af75d49 100644 --- a/scripts/tests/test_bundle_generate_priors.py +++ b/scripts/tests/test_bundle_generate_priors.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_generate_priors.py', '--help') + ret = script_runner.run(['scil_bundle_generate_priors.py', '--help']) assert ret.success @@ -22,8 +22,8 @@ def test_execution_bst(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'bst', 'rpt_m_lin.trk') in_fodf = os.path.join(SCILPY_HOME, 'bst', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') - ret = script_runner.run('scil_bundle_generate_priors.py', + ret = script_runner.run(['scil_bundle_generate_priors.py', in_bundle, in_fodf, in_mask, '--todi_sigma', '1', '--out_prefix', 'rpt_m', - '--sh_basis', 'descoteaux07') + '--sh_basis', 'descoteaux07']) assert ret.success diff --git a/scripts/tests/test_bundle_label_map.py b/scripts/tests/test_bundle_label_map.py index 797ec6f39..6c8fa220f 100644 --- a/scripts/tests/test_bundle_label_map.py +++ b/scripts/tests/test_bundle_label_map.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_label_map.py', '--help') + ret = script_runner.run(['scil_bundle_label_map.py', '--help']) assert ret.success @@ -24,10 +24,10 @@ def test_execution_tractometry_euclidian(script_runner, monkeypatch): 'IFGWM.trk') in_centroid = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni_c_10.trk') - ret = script_runner.run('scil_bundle_label_map.py', + ret = script_runner.run(['scil_bundle_label_map.py', in_bundle, in_centroid, 'results_euc/', - '--colormap', 'viridis') + '--colormap', 'viridis']) assert ret.success @@ -37,9 +37,9 @@ def test_execution_tractometry_hyperplane(script_runner, monkeypatch): 'IFGWM.trk') in_centroid = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni_c_10.trk') - ret = script_runner.run('scil_bundle_label_map.py', + ret = script_runner.run(['scil_bundle_label_map.py', in_bundle, in_centroid, 'results_man/', '--colormap', 'viridis', - '--hyperplane', '--use_manhattan') + '--hyperplane', '--use_manhattan']) assert ret.success diff --git a/scripts/tests/test_bundle_mean_fixel_afd.py b/scripts/tests/test_bundle_mean_fixel_afd.py index b9877ff3e..e09524156 100644 --- a/scripts/tests/test_bundle_mean_fixel_afd.py +++ b/scripts/tests/test_bundle_mean_fixel_afd.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_mean_fixel_afd.py', '--help') + ret = script_runner.run(['scil_bundle_mean_fixel_afd.py', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_processing(script_runner, monkeypatch): in_tracking = os.path.join(SCILPY_HOME, 'processing', 'tracking.trk') in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf_descoteaux07.nii.gz') - ret = script_runner.run('scil_bundle_mean_fixel_afd.py', in_tracking, + ret = script_runner.run(['scil_bundle_mean_fixel_afd.py', in_tracking, in_fodf, 'afd_test.nii.gz', - '--sh_basis', 'descoteaux07', '--length_weighting') + '--sh_basis', 'descoteaux07', '--length_weighting']) assert ret.success diff --git a/scripts/tests/test_bundle_mean_fixel_afd_from_hdf5.py b/scripts/tests/test_bundle_mean_fixel_afd_from_hdf5.py index 000699955..e88d34ac9 100644 --- a/scripts/tests/test_bundle_mean_fixel_afd_from_hdf5.py +++ b/scripts/tests/test_bundle_mean_fixel_afd_from_hdf5.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_mean_fixel_afd_from_hdf5.py', - '--help') + ret = script_runner.run(['scil_bundle_mean_fixel_afd_from_hdf5.py', + '--help']) assert ret.success @@ -22,8 +22,8 @@ def test_execution_connectivity(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_h5 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose.h5') in_fodf = os.path.join(SCILPY_HOME, 'connectivity', 'fodf.nii.gz') - ret = script_runner.run('scil_bundle_mean_fixel_afd_from_hdf5.py', + ret = script_runner.run(['scil_bundle_mean_fixel_afd_from_hdf5.py', in_h5, in_fodf, 'decompose_afd.nii.gz', '--length_weighting', '--sh_basis', 'descoteaux07', - '--processes', '1') + '--processes', '1']) assert ret.success diff --git a/scripts/tests/test_bundle_mean_fixel_bingham_metric.py b/scripts/tests/test_bundle_mean_fixel_bingham_metric.py index 929cef9c2..1dce2e9c2 100644 --- a/scripts/tests/test_bundle_mean_fixel_bingham_metric.py +++ b/scripts/tests/test_bundle_mean_fixel_bingham_metric.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run( - 'scil_bundle_mean_fixel_bingham_metric.py', '--help') + ret = script_runner.run([ + 'scil_bundle_mean_fixel_bingham_metric.py', '--help']) assert ret.success @@ -25,9 +25,9 @@ def test_execution_processing(script_runner, monkeypatch): in_metric = os.path.join(SCILPY_HOME, 'processing', 'fd.nii.gz') in_bundles = os.path.join(SCILPY_HOME, 'processing', 'tracking.trk') - ret = script_runner.run( + ret = script_runner.run([ 'scil_bundle_mean_fixel_bingham_metric.py', in_bundles, in_bingham, in_metric, - 'fixel_mean_fd.nii.gz', '--length_weighting') + 'fixel_mean_fd.nii.gz', '--length_weighting']) assert ret.success diff --git a/scripts/tests/test_bundle_mean_fixel_mrds_metric.py b/scripts/tests/test_bundle_mean_fixel_mrds_metric.py index efe916c2e..de4836e56 100644 --- a/scripts/tests/test_bundle_mean_fixel_mrds_metric.py +++ b/scripts/tests/test_bundle_mean_fixel_mrds_metric.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- def test_help_option(script_runner): - ret = script_runner.run( - 'scil_bundle_mean_fixel_mrds_metric.py', '--help') + ret = script_runner.run([ + 'scil_bundle_mean_fixel_mrds_metric.py', '--help']) assert ret.success diff --git a/scripts/tests/test_bundle_mean_std.py b/scripts/tests/test_bundle_mean_std.py index bbd484cd0..0202f66a4 100644 --- a/scripts/tests/test_bundle_mean_std.py +++ b/scripts/tests/test_bundle_mean_std.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_mean_std.py', '--help') + ret = script_runner.run(['scil_bundle_mean_std.py', '--help']) assert ret.success @@ -21,8 +21,8 @@ def test_execution_tractometry_whole(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') in_ref = os.path.join(SCILPY_HOME, 'tractometry', 'mni_masked.nii.gz') - ret = script_runner.run('scil_bundle_mean_std.py', in_bundle, in_ref, - '--density_weighting', '--include_dps') + ret = script_runner.run(['scil_bundle_mean_std.py', in_bundle, in_ref, + '--density_weighting', '--include_dps']) assert ret.success @@ -32,7 +32,7 @@ def test_execution_tractometry_per_point(script_runner, monkeypatch): in_label = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') in_ref = os.path.join(SCILPY_HOME, 'tractometry', 'mni_masked.nii.gz') - ret = script_runner.run('scil_bundle_mean_std.py', in_bundle, in_ref, - '--per_point', in_label, '--density_weighting') + ret = script_runner.run(['scil_bundle_mean_std.py', in_bundle, in_ref, + '--per_point', in_label, '--density_weighting']) assert ret.success diff --git a/scripts/tests/test_bundle_pairwise_comparison.py b/scripts/tests/test_bundle_pairwise_comparison.py index 131980840..ddc12c865 100644 --- a/scripts/tests/test_bundle_pairwise_comparison.py +++ b/scripts/tests/test_bundle_pairwise_comparison.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run( - 'scil_bundle_pairwise_comparison.py', '--help') + ret = script_runner.run([ + 'scil_bundle_pairwise_comparison.py', '--help']) assert ret.success @@ -24,11 +24,11 @@ def test_execution_bundles(script_runner, monkeypatch): in_2 = os.path.join(SCILPY_HOME, 'bundles', 'voting_results', 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') - ret = script_runner.run( + ret = script_runner.run([ 'scil_bundle_pairwise_comparison.py', in_1, in_2, 'AF_L_similarity.json', '--streamline_dice', '--reference', in_ref, - '--processes', '1') + '--processes', '1']) assert ret.success @@ -38,12 +38,12 @@ def test_single(script_runner, monkeypatch): in_2 = os.path.join(SCILPY_HOME, 'bundles', 'voting_results', 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') - ret = script_runner.run( + ret = script_runner.run([ 'scil_bundle_pairwise_comparison.py', in_2, 'AF_L_similarity_single.json', '--streamline_dice', '--reference', in_ref, '--single_compare', in_1, - '--processes', '1') + '--processes', '1']) assert ret.success @@ -53,12 +53,12 @@ def test_no_overlap(script_runner, monkeypatch): in_2 = os.path.join(SCILPY_HOME, 'bundles', 'voting_results', 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') - ret = script_runner.run( + ret = script_runner.run([ 'scil_bundle_pairwise_comparison.py', in_1, in_2, 'AF_L_similarity_no_overlap.json', '--streamline_dice', '--reference', in_ref, '--ignore_zeros_in_BA', - '--processes', '1') + '--processes', '1']) assert ret.success @@ -68,13 +68,13 @@ def test_ratio(script_runner, monkeypatch): in_2 = os.path.join(SCILPY_HOME, 'bundles', 'voting_results', 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') - ret = script_runner.run( + ret = script_runner.run([ 'scil_bundle_pairwise_comparison.py', in_2, 'AF_L_similarity_ratio.json', '--streamline_dice', '--reference', in_ref, '--single_compare', in_1, '--processes', '1', - '--ratio') + '--ratio']) assert ret.success @@ -87,10 +87,10 @@ def test_ratio_fail(script_runner, monkeypatch): in_2 = os.path.join(SCILPY_HOME, 'bundles', 'voting_results', 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') - ret = script_runner.run( + ret = script_runner.run([ 'scil_bundle_pairwise_comparison.py', in_1, in_2, 'AF_L_similarity_fail.json', '--streamline_dice', '--reference', in_ref, '--processes', '1', - '--ratio') + '--ratio']) assert not ret.success diff --git a/scripts/tests/test_bundle_reject_outliers.py b/scripts/tests/test_bundle_reject_outliers.py index 47f3f4d51..0611d32a7 100644 --- a/scripts/tests/test_bundle_reject_outliers.py +++ b/scripts/tests/test_bundle_reject_outliers.py @@ -13,16 +13,16 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_reject_outliers.py', '--help') + ret = script_runner.run(['scil_bundle_reject_outliers.py', '--help']) assert ret.success def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') - ret = script_runner.run('scil_bundle_reject_outliers.py', in_bundle, + ret = script_runner.run(['scil_bundle_reject_outliers.py', in_bundle, 'inliers.trk', '--alpha', '0.6', '--remaining_bundle', 'outliers.trk', '--display_counts', '--indent', '4', - '--sort_keys') + '--sort_keys']) assert ret.success diff --git a/scripts/tests/test_bundle_score_many_bundles_one_tractogram.py b/scripts/tests/test_bundle_score_many_bundles_one_tractogram.py index 82cd62c37..2aed03209 100644 --- a/scripts/tests/test_bundle_score_many_bundles_one_tractogram.py +++ b/scripts/tests/test_bundle_score_many_bundles_one_tractogram.py @@ -12,8 +12,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_score_many_bundles_one_tractogram.py', - '--help') + ret = script_runner.run(['scil_bundle_score_many_bundles_one_tractogram.py', + '--help']) assert ret.success @@ -42,7 +42,7 @@ def test_score_bundles(script_runner, monkeypatch): with open(os.path.join("config_file.json"), "w") as f: json.dump(json_contents, f) - ret = script_runner.run('scil_bundle_score_many_bundles_one_tractogram.py', - "config_file.json", "./", '--no_bbox_check') + ret = script_runner.run(['scil_bundle_score_many_bundles_one_tractogram.py', + "config_file.json", "./", '--no_bbox_check']) assert ret.success diff --git a/scripts/tests/test_bundle_score_same_bundle_many_segmentations.py b/scripts/tests/test_bundle_score_same_bundle_many_segmentations.py index 784a7c414..fe3ab96df 100644 --- a/scripts/tests/test_bundle_score_same_bundle_many_segmentations.py +++ b/scripts/tests/test_bundle_score_same_bundle_many_segmentations.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run( - 'scil_bundle_score_same_bundle_many_segmentations.py', '--help') + ret = script_runner.run([ + 'scil_bundle_score_same_bundle_many_segmentations.py', '--help']) assert ret.success @@ -27,8 +27,8 @@ def test_execution_bundles(script_runner, monkeypatch): in_tractogram = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.trk') in_model = os.path.join(SCILPY_HOME, 'bundles', 'fibercup_atlas', 'subj_1', 'bundle_0.trk') - ret = script_runner.run( + ret = script_runner.run([ 'scil_bundle_score_same_bundle_many_segmentations.py', in_1, in_2, 'AF_L_binary.json', '--streamlines_measures', in_model, - in_tractogram, '--processes', '1', '--reference', in_ref) + in_tractogram, '--processes', '1', '--reference', in_ref]) assert ret.success diff --git a/scripts/tests/test_bundle_shape_measures.py b/scripts/tests/test_bundle_shape_measures.py index 10e29331d..2256d4004 100644 --- a/scripts/tests/test_bundle_shape_measures.py +++ b/scripts/tests/test_bundle_shape_measures.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_shape_measures.py', '--help') + ret = script_runner.run(['scil_bundle_shape_measures.py', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_bundles(script_runner, monkeypatch): in_2 = os.path.join(SCILPY_HOME, 'bundles', 'voting_results', 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') - ret = script_runner.run('scil_bundle_shape_measures.py', + ret = script_runner.run(['scil_bundle_shape_measures.py', in_1, in_2, '--out_json', 'AF_L_measures.json', - '--reference', in_ref, '--processes', '1') + '--reference', in_ref, '--processes', '1']) assert ret.success diff --git a/scripts/tests/test_bundle_uniformize_endpoints.py b/scripts/tests/test_bundle_uniformize_endpoints.py index d022be7ce..4f9628610 100644 --- a/scripts/tests/test_bundle_uniformize_endpoints.py +++ b/scripts/tests/test_bundle_uniformize_endpoints.py @@ -13,16 +13,16 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_uniformize_endpoints.py', - '--help') + ret = script_runner.run(['scil_bundle_uniformize_endpoints.py', + '--help']) assert ret.success def test_execution_auto(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') - ret = script_runner.run('scil_bundle_uniformize_endpoints.py', - in_bundle, 'IFGWM_uni.trk', '--auto') + ret = script_runner.run(['scil_bundle_uniformize_endpoints.py', + in_bundle, 'IFGWM_uni.trk', '--auto']) assert ret.success @@ -30,7 +30,7 @@ def test_execution_target_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') label = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run('scil_bundle_uniformize_endpoints.py', + ret = script_runner.run(['scil_bundle_uniformize_endpoints.py', in_bundle, 'IFGWM_uni2.trk', '--target_roi', label, - '3', '10') + '3', '10']) assert ret.success diff --git a/scripts/tests/test_bundle_volume_per_label.py b/scripts/tests/test_bundle_volume_per_label.py index 13d836c0a..f75bb2e8c 100644 --- a/scripts/tests/test_bundle_volume_per_label.py +++ b/scripts/tests/test_bundle_volume_per_label.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_volume_per_label.py', - '--help') + ret = script_runner.run(['scil_bundle_volume_per_label.py', + '--help']) assert ret.success @@ -22,6 +22,6 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_label_map = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run('scil_bundle_volume_per_label.py', - in_label_map, 'IFGWM') + ret = script_runner.run(['scil_bundle_volume_per_label.py', + in_label_map, 'IFGWM']) assert ret.success diff --git a/scripts/tests/test_connectivity_compare_populations.py b/scripts/tests/test_connectivity_compare_populations.py index c66b812b0..7e2ac7879 100644 --- a/scripts/tests/test_connectivity_compare_populations.py +++ b/scripts/tests/test_connectivity_compare_populations.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_compare_populations.py', - '--help') + ret = script_runner.run(['scil_connectivity_compare_populations.py', + '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_connectivity(script_runner, monkeypatch): in_1 = os.path.join(SCILPY_HOME, 'connectivity', 'sc.npy') in_2 = os.path.join(SCILPY_HOME, 'connectivity', 'sc_norm.npy') in_mask = os.path.join(SCILPY_HOME, 'connectivity', 'mask.npy') - ret = script_runner.run('scil_connectivity_compare_populations.py', + ret = script_runner.run(['scil_connectivity_compare_populations.py', 'pval.npy', '--in_g1', in_1, '--in_g2', in_2, - '--filtering_mask', in_mask) + '--filtering_mask', in_mask]) assert ret.success diff --git a/scripts/tests/test_connectivity_compute_matrices.py b/scripts/tests/test_connectivity_compute_matrices.py index becb1ed7d..e2e358680 100644 --- a/scripts/tests/test_connectivity_compute_matrices.py +++ b/scripts/tests/test_connectivity_compute_matrices.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_compute_matrices.py', '--help') + ret = script_runner.run(['scil_connectivity_compute_matrices.py', '--help']) assert ret.success @@ -24,12 +24,12 @@ def test_execution_connectivity(script_runner, monkeypatch): 'endpoints_atlas.nii.gz') in_avg = os.path.join(SCILPY_HOME, 'connectivity', 'avg_density_maps/') in_afd = os.path.join(SCILPY_HOME, 'connectivity', 'afd_max.nii.gz') - ret = script_runner.run('scil_connectivity_compute_matrices.py', in_h5, + ret = script_runner.run(['scil_connectivity_compute_matrices.py', in_h5, in_atlas, '--volume', 'vol.npy', '--streamline_count', 'sc.npy', '--length', 'len.npy', '--similarity', in_avg, 'sim.npy', '--metrics', in_afd, 'afd_max.npy', '--density_weighting', '--no_self_connection', - '--processes', '1') + '--processes', '1']) assert ret.success diff --git a/scripts/tests/test_connectivity_compute_pca.py b/scripts/tests/test_connectivity_compute_pca.py index d0dbe381b..ded0fb8f4 100644 --- a/scripts/tests/test_connectivity_compute_pca.py +++ b/scripts/tests/test_connectivity_compute_pca.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_compute_pca.py', '--help') + ret = script_runner.run(['scil_connectivity_compute_pca.py', '--help']) assert ret.success @@ -22,8 +22,8 @@ def test_execution_pca(script_runner, monkeypatch): input_folder = os.path.join(SCILPY_HOME, 'stats/pca') output_folder = os.path.join(SCILPY_HOME, 'stats/pca_out') ids = os.path.join(SCILPY_HOME, 'stats/pca', 'list_id.txt') - ret = script_runner.run( + ret = script_runner.run([ 'scil_connectivity_compute_pca.py', input_folder, output_folder, '--metrics', 'ad', 'fa', 'md', 'rd', 'nufo', 'afd_total', 'afd_fixel', - '--list_ids', ids, '-f') + '--list_ids', ids, '-f']) assert ret.success diff --git a/scripts/tests/test_connectivity_compute_simple_matrix.py b/scripts/tests/test_connectivity_compute_simple_matrix.py index 33411c60e..1c305cb83 100644 --- a/scripts/tests/test_connectivity_compute_simple_matrix.py +++ b/scripts/tests/test_connectivity_compute_simple_matrix.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run( - 'scil_connectivity_compute_simple_matrix.py', '--help') + ret = script_runner.run([ + 'scil_connectivity_compute_simple_matrix.py', '--help']) assert ret.success @@ -24,8 +24,8 @@ def test_script(script_runner, monkeypatch): 'IFGWM_labels_map.nii.gz') in_sft = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') - ret = script_runner.run( + ret = script_runner.run([ 'scil_connectivity_compute_simple_matrix.py', in_sft, in_labels, 'out_matrix.npy', 'out_labels.txt', '--hide_labels', '10', - '--percentage', '--hide_fig', '--out_fig', 'matrices.png') + '--percentage', '--hide_fig', '--out_fig', 'matrices.png']) assert ret.success diff --git a/scripts/tests/test_connectivity_filter.py b/scripts/tests/test_connectivity_filter.py index cb365d93b..aeb235d57 100644 --- a/scripts/tests/test_connectivity_filter.py +++ b/scripts/tests/test_connectivity_filter.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_filter.py', '--help') + ret = script_runner.run(['scil_connectivity_filter.py', '--help']) assert ret.success @@ -23,8 +23,8 @@ def test_execution_connectivity(script_runner, monkeypatch): 'sc.npy') in_sim = os.path.join(SCILPY_HOME, 'connectivity', 'len.npy') - ret = script_runner.run('scil_connectivity_filter.py', 'mask.npy', + ret = script_runner.run(['scil_connectivity_filter.py', 'mask.npy', '--greater_than', in_sc, '5', '1', '--greater_than', in_sim, '0', '1', - '--keep_condition_count') + '--keep_condition_count']) assert ret.success diff --git a/scripts/tests/test_connectivity_graph_measures.py b/scripts/tests/test_connectivity_graph_measures.py index faf836476..0275d5b99 100644 --- a/scripts/tests/test_connectivity_graph_measures.py +++ b/scripts/tests/test_connectivity_graph_measures.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_graph_measures.py', '--help') + ret = script_runner.run(['scil_connectivity_graph_measures.py', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_connectivity(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(SCILPY_HOME, 'connectivity', 'sc_norm.npy') in_len = os.path.join(SCILPY_HOME, 'connectivity', 'len.npy') - ret = script_runner.run('scil_connectivity_graph_measures.py', in_sc, + ret = script_runner.run(['scil_connectivity_graph_measures.py', in_sc, in_len, 'gtm.json', '--avg_node_wise', - '--small_world') + '--small_world']) assert ret.success diff --git a/scripts/tests/test_connectivity_hdf5_average_density_map.py b/scripts/tests/test_connectivity_hdf5_average_density_map.py index f059f909f..9fe063886 100644 --- a/scripts/tests/test_connectivity_hdf5_average_density_map.py +++ b/scripts/tests/test_connectivity_hdf5_average_density_map.py @@ -13,17 +13,17 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_hdf5_average_density_map.py', - '--help') + ret = script_runner.run(['scil_connectivity_hdf5_average_density_map.py', + '--help']) assert ret.success def test_execution_connectivity(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_h5 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose.h5') - ret = script_runner.run('scil_connectivity_hdf5_average_density_map.py', + ret = script_runner.run(['scil_connectivity_hdf5_average_density_map.py', in_h5, 'avg_density_map/', '--binary', - '--processes', '1') + '--processes', '1']) assert ret.success @@ -31,7 +31,7 @@ def test_execution_connectivity_(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_h5_1 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose.h5') in_h5_2 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose_afd_rd.h5') - ret = script_runner.run('scil_connectivity_hdf5_average_density_map.py', + ret = script_runner.run(['scil_connectivity_hdf5_average_density_map.py', in_h5_1, in_h5_2, 'avg_density_maps/', - '--processes', '1') + '--processes', '1']) assert ret.success diff --git a/scripts/tests/test_connectivity_math.py b/scripts/tests/test_connectivity_math.py index bd640349c..c1aed6d59 100644 --- a/scripts/tests/test_connectivity_math.py +++ b/scripts/tests/test_connectivity_math.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_math.py', '--help') + ret = script_runner.run(['scil_connectivity_math.py', '--help']) assert ret.success @@ -23,8 +23,8 @@ def test_execution_connectivity_div(script_runner, monkeypatch): 'sc.npy') in_vol = os.path.join(SCILPY_HOME, 'connectivity', 'vol.npy') - ret = script_runner.run('scil_connectivity_math.py', 'division', - in_sc, in_vol, 'sc_norm_vol.npy') + ret = script_runner.run(['scil_connectivity_math.py', 'division', + in_sc, in_vol, 'sc_norm_vol.npy']) assert ret.success @@ -32,8 +32,8 @@ def test_execution_connectivity_add(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(SCILPY_HOME, 'connectivity', 'sc.npy') - ret = script_runner.run('scil_connectivity_math.py', 'addition', - in_sc, '10', 'sc_add_10.npy') + ret = script_runner.run(['scil_connectivity_math.py', 'addition', + in_sc, '10', 'sc_add_10.npy']) assert ret.success @@ -41,6 +41,6 @@ def test_execution_connectivity_lower_threshold(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(SCILPY_HOME, 'connectivity', 'sc.npy') - ret = script_runner.run('scil_connectivity_math.py', 'lower_threshold', - in_sc, '5', 'sc_lower_threshold.npy') + ret = script_runner.run(['scil_connectivity_math.py', 'lower_threshold', + in_sc, '5', 'sc_lower_threshold.npy']) assert ret.success diff --git a/scripts/tests/test_connectivity_normalize.py b/scripts/tests/test_connectivity_normalize.py index 0a32e26d6..8c059835d 100644 --- a/scripts/tests/test_connectivity_normalize.py +++ b/scripts/tests/test_connectivity_normalize.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_normalize.py', '--help') + ret = script_runner.run(['scil_connectivity_normalize.py', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_connectivity(script_runner, monkeypatch): 'endpoints_atlas.nii.gz') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run('scil_connectivity_normalize.py', in_sc, + ret = script_runner.run(['scil_connectivity_normalize.py', in_sc, 'sc_norm.npy', '--length', in_len, - '--parcel_volume', in_atlas, in_labels_list) + '--parcel_volume', in_atlas, in_labels_list]) assert ret.success diff --git a/scripts/tests/test_connectivity_pairwise_agreement.py b/scripts/tests/test_connectivity_pairwise_agreement.py index 0a271c637..6f64e76a7 100644 --- a/scripts/tests/test_connectivity_pairwise_agreement.py +++ b/scripts/tests/test_connectivity_pairwise_agreement.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_pairwise_agreement.py', - '--help') + ret = script_runner.run(['scil_connectivity_pairwise_agreement.py', + '--help']) assert ret.success @@ -22,6 +22,6 @@ def test_execution_connectivity(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(SCILPY_HOME, 'connectivity', 'sc_norm.npy') in_len = os.path.join(SCILPY_HOME, 'connectivity', 'len.npy') - ret = script_runner.run('scil_connectivity_pairwise_agreement.py', in_sc, - in_len, 'diff.json', '--single_compare', in_sc) + ret = script_runner.run(['scil_connectivity_pairwise_agreement.py', in_sc, + in_len, 'diff.json', '--single_compare', in_sc]) assert ret.success diff --git a/scripts/tests/test_connectivity_print_filenames.py b/scripts/tests/test_connectivity_print_filenames.py index 24d01ea8d..7a5680e66 100644 --- a/scripts/tests/test_connectivity_print_filenames.py +++ b/scripts/tests/test_connectivity_print_filenames.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_print_filenames.py', '--help') + ret = script_runner.run(['scil_connectivity_print_filenames.py', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_connectivity(script_runner, monkeypatch): 'sc_norm.npy') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run('scil_connectivity_print_filenames.py', in_sc, - in_labels_list, 'success.txt') + ret = script_runner.run(['scil_connectivity_print_filenames.py', in_sc, + in_labels_list, 'success.txt']) assert ret.success diff --git a/scripts/tests/test_connectivity_reorder_rois.py b/scripts/tests/test_connectivity_reorder_rois.py index 0d2e37269..bf9ed8699 100644 --- a/scripts/tests/test_connectivity_reorder_rois.py +++ b/scripts/tests/test_connectivity_reorder_rois.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_reorder_rois.py', '--help') + ret = script_runner.run(['scil_connectivity_reorder_rois.py', '--help']) assert ret.success @@ -26,9 +26,9 @@ def test_execution_compute_OLO(script_runner, monkeypatch): 'sc_norm.npy') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run('scil_connectivity_reorder_rois.py', in_sc, + ret = script_runner.run(['scil_connectivity_reorder_rois.py', in_sc, '--optimal_leaf_ordering', 'OLO.txt', - '--out_dir', os.path.expanduser(tmp_dir.name), + '--out_dir', os.path.expanduser(tmp_dir.name]), '--labels_list', in_labels_list, '-f') assert ret.success @@ -39,9 +39,9 @@ def test_execution_apply_ordering(script_runner, monkeypatch): in_txt = os.path.join(SCILPY_HOME, 'connectivity', 'reorder.txt') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run('scil_connectivity_reorder_rois.py', in_sc, + ret = script_runner.run(['scil_connectivity_reorder_rois.py', in_sc, '--in_ordering', in_txt, '--out_suffix', '_sc_reo', - '--out_dir', os.path.expanduser(tmp_dir.name), + '--out_dir', os.path.expanduser(tmp_dir.name]), '--labels_list', in_labels_list, '-f') assert ret.success diff --git a/scripts/tests/test_denoising_nlmeans.py b/scripts/tests/test_denoising_nlmeans.py index 45e0ffacb..a1c6144c0 100644 --- a/scripts/tests/test_denoising_nlmeans.py +++ b/scripts/tests/test_denoising_nlmeans.py @@ -13,27 +13,27 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_denoising_nlmeans.py', '--help') + ret = script_runner.run(['scil_denoising_nlmeans.py', '--help']) assert ret.success def test_execution_user_sigma(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 't1_resample.nii.gz') - ret = script_runner.run('scil_denoising_nlmeans.py', in_img, + ret = script_runner.run(['scil_denoising_nlmeans.py', in_img, 'denoised.nii.gz', '--processes', '1', '--sigma', '8', '--number_coils', 0, - '--gaussian') + '--gaussian']) assert ret.success def test_execution_basic_3d(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 't1_resample.nii.gz') - ret = script_runner.run('scil_denoising_nlmeans.py', in_img, + ret = script_runner.run(['scil_denoising_nlmeans.py', in_img, 't1_denoised.nii.gz', '--processes', '1', '--basic_sigma', '--number_coils', 0, - '--gaussian') + '--gaussian']) assert ret.success @@ -41,17 +41,17 @@ def test_execution_basic_4d_mask(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop_1000.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'processing', 'fa_thr.nii.gz') - ret = script_runner.run('scil_denoising_nlmeans.py', in_img, + ret = script_runner.run(['scil_denoising_nlmeans.py', in_img, 't1_denoised2.nii.gz', '--processes', '1', '--basic_sigma', '--number_coils', 0, - '--gaussian', '--mask_sigma', in_mask) + '--gaussian', '--mask_sigma', in_mask]) assert ret.success def test_execution_piesno(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'processing', 'dwi.nii.gz') - ret = script_runner.run('scil_denoising_nlmeans.py', in_img, + ret = script_runner.run(['scil_denoising_nlmeans.py', in_img, 'dwi_denoised.nii.gz', '--processes', '1', - '--piesno', '--number_coils', '4') + '--piesno', '--number_coils', '4']) assert ret.success diff --git a/scripts/tests/test_dki_metrics.py b/scripts/tests/test_dki_metrics.py index 617c1b7af..d2dc9aad1 100644 --- a/scripts/tests/test_dki_metrics.py +++ b/scripts/tests/test_dki_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dki_metrics.py', '--help') + ret = script_runner.run(['scil_dki_metrics.py', '--help']) assert ret.success @@ -25,11 +25,11 @@ def test_execution_processing(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dki_metrics.py', in_dwi, + ret = script_runner.run(['scil_dki_metrics.py', in_dwi, in_bval, in_bvec, '--not_all', '--dki_fa', 'dki_fa.nii.gz', '--dki_md', 'dki_md.nii.gz', '--dki_rd', 'dki_rd.nii.gz', '--dki_ad', 'dki_ad.nii.gz', - '--dki_residual', 'dki_res.nii.gz') + '--dki_residual', 'dki_res.nii.gz']) assert ret.success diff --git a/scripts/tests/test_dti_convert_tensors.py b/scripts/tests/test_dti_convert_tensors.py index 9d66d8345..ad5e0bdc0 100644 --- a/scripts/tests/test_dti_convert_tensors.py +++ b/scripts/tests/test_dti_convert_tensors.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dti_convert_tensors.py', '--help') + ret = script_runner.run(['scil_dti_convert_tensors.py', '--help']) assert ret.success @@ -25,11 +25,11 @@ def test_execution_processing(script_runner, monkeypatch): in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop_1000.nii.gz') in_bval = os.path.join(SCILPY_HOME, 'processing', '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - script_runner.run('scil_dti_metrics.py', in_dwi, + script_runner.run(['scil_dti_metrics.py', in_dwi, in_bval, in_bvec, '--not_all', - '--tensor', 'tensors.nii.gz', '--tensor_format', 'fsl') + '--tensor', 'tensors.nii.gz', '--tensor_format', 'fsl']) - ret = script_runner.run('scil_dti_convert_tensors.py', 'tensors.nii.gz', - 'converted_tensors.nii.gz', 'fsl', 'mrtrix') + ret = script_runner.run(['scil_dti_convert_tensors.py', 'tensors.nii.gz', + 'converted_tensors.nii.gz', 'fsl', 'mrtrix']) assert ret.success diff --git a/scripts/tests/test_dti_metrics.py b/scripts/tests/test_dti_metrics.py index 96c002ea5..fd9ae2f2d 100644 --- a/scripts/tests/test_dti_metrics.py +++ b/scripts/tests/test_dti_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dti_metrics.py', '--help') + ret = script_runner.run(['scil_dti_metrics.py', '--help']) assert ret.success @@ -26,17 +26,17 @@ def test_execution_processing_diff_metrics(script_runner, monkeypatch): # No mask fitting with this data? Creating our own. mask = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') mask_uint8 = os.path.join('mask_uint8.nii.gz') - script_runner.run('scil_volume_math.py', 'convert', - mask, mask_uint8, '--data_type', 'uint8') + script_runner.run(['scil_volume_math.py', 'convert', + mask, mask_uint8, '--data_type', 'uint8']) - ret = script_runner.run('scil_dti_metrics.py', in_dwi, + ret = script_runner.run(['scil_dti_metrics.py', in_dwi, in_bval, in_bvec, '--not_all', '--fa', 'fa.nii.gz', '--md', 'md.nii.gz', '--ad', 'ad.nii.gz', '--rd', 'rd.nii.gz', '--residual', 'residual.nii.gz', - '--mask', mask_uint8) + '--mask', mask_uint8]) assert ret.success @@ -49,12 +49,12 @@ def test_execution_processing_b0_threshold(script_runner, monkeypatch): # No mask fitting with this data? Creating our own. mask = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') mask_uint8 = os.path.join('mask_uint8.nii.gz') - script_runner.run('scil_volume_math.py', 'convert', - mask, mask_uint8, '--data_type', 'uint8') + script_runner.run(['scil_volume_math.py', 'convert', + mask, mask_uint8, '--data_type', 'uint8']) - ret = script_runner.run('scil_dti_metrics.py', in_dwi, + ret = script_runner.run(['scil_dti_metrics.py', in_dwi, in_bval, in_bvec, '--not_all', - '--fa', 'fa.nii.gz', '--b0_threshold', '1', '-f') + '--fa', 'fa.nii.gz', '--b0_threshold', '1', '-f']) assert not ret.success @@ -67,10 +67,10 @@ def test_execution_processing_rgb(script_runner, monkeypatch): # No mask fitting with this data? Creating our own. mask = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') mask_uint8 = os.path.join('mask_uint8.nii.gz') - script_runner.run('scil_volume_math.py', 'convert', - mask, mask_uint8, '--data_type', 'uint8') + script_runner.run(['scil_volume_math.py', 'convert', + mask, mask_uint8, '--data_type', 'uint8']) - ret = script_runner.run('scil_dti_metrics.py', in_dwi, + ret = script_runner.run(['scil_dti_metrics.py', in_dwi, in_bval, in_bvec, '--not_all', - '--rgb', 'rgb.nii.gz', '-f') + '--rgb', 'rgb.nii.gz', '-f']) assert ret.success diff --git a/scripts/tests/test_dwi_apply_bias_field.py b/scripts/tests/test_dwi_apply_bias_field.py index c3b91993d..765b28a3d 100644 --- a/scripts/tests/test_dwi_apply_bias_field.py +++ b/scripts/tests/test_dwi_apply_bias_field.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_apply_bias_field.py', '--help') + ret = script_runner.run(['scil_dwi_apply_bias_field.py', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_processing(script_runner, monkeypatch): 'dwi_crop.nii.gz') in_bias = os.path.join(SCILPY_HOME, 'processing', 'bias_field_b0.nii.gz') - ret = script_runner.run('scil_dwi_apply_bias_field.py', in_dwi, - in_bias, 'dwi_crop_n4.nii.gz') + ret = script_runner.run(['scil_dwi_apply_bias_field.py', in_dwi, + in_bias, 'dwi_crop_n4.nii.gz']) assert ret.success diff --git a/scripts/tests/test_dwi_compute_snr.py b/scripts/tests/test_dwi_compute_snr.py index 1bfad3352..7b1799f08 100644 --- a/scripts/tests/test_dwi_compute_snr.py +++ b/scripts/tests/test_dwi_compute_snr.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_compute_snr.py', '--help') + ret = script_runner.run(['scil_dwi_compute_snr.py', '--help']) assert ret.success @@ -29,8 +29,8 @@ def test_snr(script_runner, monkeypatch): noise_mask = os.path.join(SCILPY_HOME, 'processing', 'small_roi_gm_mask.nii.gz') - ret = script_runner.run('scil_dwi_compute_snr.py', in_dwi, + ret = script_runner.run(['scil_dwi_compute_snr.py', in_dwi, in_bval, in_bvec, in_mask, '--noise_mask', noise_mask, - '--b0_thr', '10') + '--b0_thr', '10']) assert ret.success diff --git a/scripts/tests/test_dwi_concatenate.py b/scripts/tests/test_dwi_concatenate.py index 743e8a014..ebc536ff1 100644 --- a/scripts/tests/test_dwi_concatenate.py +++ b/scripts/tests/test_dwi_concatenate.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_concatenate.py', '--help') + ret = script_runner.run(['scil_dwi_concatenate.py', '--help']) assert ret.success @@ -25,9 +25,9 @@ def test_execution_processing_concatenate(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_concatenate.py', 'dwi_concat.nii.gz', + ret = script_runner.run(['scil_dwi_concatenate.py', 'dwi_concat.nii.gz', 'concat.bval', 'concat.bvec', '--in_dwi', in_dwi, in_dwi, '--in_bvals', in_bval, in_bval, - '--in_bvecs', in_bvec, in_bvec) + '--in_bvecs', in_bvec, in_bvec]) assert ret.success diff --git a/scripts/tests/test_dwi_convert_FDF.py b/scripts/tests/test_dwi_convert_FDF.py index 582473264..6355966f4 100644 --- a/scripts/tests/test_dwi_convert_FDF.py +++ b/scripts/tests/test_dwi_convert_FDF.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_convert_FDF.py', '--help') + ret = script_runner.run(['scil_dwi_convert_FDF.py', '--help']) assert ret.success diff --git a/scripts/tests/test_dwi_detect_volume_outliers.py b/scripts/tests/test_dwi_detect_volume_outliers.py index c32b21ede..c023db4b4 100644 --- a/scripts/tests/test_dwi_detect_volume_outliers.py +++ b/scripts/tests/test_dwi_detect_volume_outliers.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_detect_volume_outliers.py', '--help') + ret = script_runner.run(['scil_dwi_detect_volume_outliers.py', '--help']) assert ret.success @@ -25,11 +25,11 @@ def test_execution(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_detect_volume_outliers.py', in_dwi, - in_bval, in_bvec, '-v') + ret = script_runner.run(['scil_dwi_detect_volume_outliers.py', in_dwi, + in_bval, in_bvec, '-v']) assert ret.success # Test wrong b0. Current minimal b-value is 5. - ret = script_runner.run('scil_dwi_detect_volume_outliers.py', in_dwi, - in_bval, in_bvec, '--b0_threshold', '1') + ret = script_runner.run(['scil_dwi_detect_volume_outliers.py', in_dwi, + in_bval, in_bvec, '--b0_threshold', '1']) assert not ret.success diff --git a/scripts/tests/test_dwi_extract_b0.py b/scripts/tests/test_dwi_extract_b0.py index 34447870d..682982454 100644 --- a/scripts/tests/test_dwi_extract_b0.py +++ b/scripts/tests/test_dwi_extract_b0.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_extract_b0.py', '--help') + ret = script_runner.run(['scil_dwi_extract_b0.py', '--help']) assert ret.success @@ -25,11 +25,11 @@ def test_execution_processing(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_extract_b0.py', in_dwi, in_bval, in_bvec, - 'b0_mean.nii.gz', '--mean', '--b0', '20') + ret = script_runner.run(['scil_dwi_extract_b0.py', in_dwi, in_bval, in_bvec, + 'b0_mean.nii.gz', '--mean', '--b0', '20']) assert ret.success # Test wrong b0. Current minimal b-value is 5. - ret = script_runner.run('scil_dwi_extract_b0.py', in_dwi, in_bval, in_bvec, - 'b0_mean.nii.gz', '--mean', '--b0', '1', '-f') + ret = script_runner.run(['scil_dwi_extract_b0.py', in_dwi, in_bval, in_bvec, + 'b0_mean.nii.gz', '--mean', '--b0', '1', '-f']) assert not ret.success diff --git a/scripts/tests/test_dwi_extract_shell.py b/scripts/tests/test_dwi_extract_shell.py index b0a824e7c..5e38add8e 100644 --- a/scripts/tests/test_dwi_extract_shell.py +++ b/scripts/tests/test_dwi_extract_shell.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_extract_shell.py', '--help') + ret = script_runner.run(['scil_dwi_extract_shell.py', '--help']) assert ret.success @@ -25,10 +25,10 @@ def test_execution_processing_1000(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_extract_shell.py', in_dwi, + ret = script_runner.run(['scil_dwi_extract_shell.py', in_dwi, in_bval, in_bvec, '0', '1000', 'dwi_crop_1000.nii.gz', '1000.bval', '1000.bvec', - '-t', '30') + '-t', '30']) assert ret.success @@ -40,11 +40,11 @@ def test_execution_out_indices(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_extract_shell.py', in_dwi, + ret = script_runner.run(['scil_dwi_extract_shell.py', in_dwi, in_bval, in_bvec, '0', '1000', 'dwi_crop_1000__1.nii.gz', '1000__1.bval', '1000__1.bvec', '-t', '30', '--out_indices', - 'out_indices.txt') + 'out_indices.txt']) assert ret.success @@ -56,8 +56,8 @@ def test_execution_processing_3000(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_extract_shell.py', in_dwi, + ret = script_runner.run(['scil_dwi_extract_shell.py', in_dwi, in_bval, in_bvec, '0', '3000', 'dwi_crop_3000.nii.gz', '3000.bval', '3000.bvec', - '-t', '30') + '-t', '30']) assert ret.success diff --git a/scripts/tests/test_dwi_powder_average.py b/scripts/tests/test_dwi_powder_average.py index f388d9f79..8269167c7 100644 --- a/scripts/tests/test_dwi_powder_average.py +++ b/scripts/tests/test_dwi_powder_average.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_powder_average.py', '--help') + ret = script_runner.run(['scil_dwi_powder_average.py', '--help']) assert ret.success @@ -25,6 +25,6 @@ def test_execution_processing(script_runner, monkeypatch): in_bval = os.path.join(SCILPY_HOME, 'processing', '1000.bval') - ret = script_runner.run('scil_dwi_powder_average.py', in_dwi, - in_bval, 'out_pwd_avg.nii.gz', '--shells', '1000') + ret = script_runner.run(['scil_dwi_powder_average.py', in_dwi, + in_bval, 'out_pwd_avg.nii.gz', '--shells', '1000']) assert ret.success diff --git a/scripts/tests/test_dwi_prepare_eddy_command.py b/scripts/tests/test_dwi_prepare_eddy_command.py index cb5334864..2656b85db 100644 --- a/scripts/tests/test_dwi_prepare_eddy_command.py +++ b/scripts/tests/test_dwi_prepare_eddy_command.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_prepare_eddy_command.py', '--help') + ret = script_runner.run(['scil_dwi_prepare_eddy_command.py', '--help']) assert ret.success diff --git a/scripts/tests/test_dwi_prepare_topup_command.py b/scripts/tests/test_dwi_prepare_topup_command.py index e8380bbca..b251ccf4f 100644 --- a/scripts/tests/test_dwi_prepare_topup_command.py +++ b/scripts/tests/test_dwi_prepare_topup_command.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_prepare_topup_command.py', '--help') + ret = script_runner.run(['scil_dwi_prepare_topup_command.py', '--help']) assert ret.success diff --git a/scripts/tests/test_dwi_reorder_philips.py b/scripts/tests/test_dwi_reorder_philips.py index 0903d1ed0..42fd732c9 100644 --- a/scripts/tests/test_dwi_reorder_philips.py +++ b/scripts/tests/test_dwi_reorder_philips.py @@ -17,7 +17,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_reorder_philips.py', '--help') + ret = script_runner.run(['scil_dwi_reorder_philips.py', '--help']) assert ret.success @@ -35,8 +35,8 @@ def test_reorder(script_runner, monkeypatch): table[30] = tmp in_table = os.path.expanduser(tmp_dir.name) + "/in_table.txt" np.savetxt(in_table, table, header="Test") - ret = script_runner.run('scil_dwi_reorder_philips.py', in_dwi, in_bval, - in_bvec, in_table, 'out1', '-f') + ret = script_runner.run(['scil_dwi_reorder_philips.py', in_dwi, in_bval, + in_bvec, in_table, 'out1', '-f']) assert ret.success @@ -58,8 +58,8 @@ def test_reorder_w_json_old_version(script_runner, monkeypatch): info = {'SoftwareVersions': '5.5'} with open(in_json, 'w') as f: json.dump(info, f) - ret = script_runner.run('scil_dwi_reorder_philips.py', in_dwi, in_bval, - in_bvec, in_table, 'out2', '--json', in_json) + ret = script_runner.run(['scil_dwi_reorder_philips.py', in_dwi, in_bval, + in_bvec, in_table, 'out2', '--json', in_json]) assert ret.success @@ -81,6 +81,6 @@ def test_reorder_w_json_new_version(script_runner, monkeypatch): info = {'SoftwareVersions': '5.6'} with open(in_json, 'w') as f: json.dump(info, f) - ret = script_runner.run('scil_dwi_reorder_philips.py', in_dwi, in_bval, - in_bvec, in_table, 'out3', '--json', in_json) + ret = script_runner.run(['scil_dwi_reorder_philips.py', in_dwi, in_bval, + in_bvec, in_table, 'out3', '--json', in_json]) assert not ret.success diff --git a/scripts/tests/test_dwi_split_by_indices.py b/scripts/tests/test_dwi_split_by_indices.py index 9a89a14f3..980ed54e3 100644 --- a/scripts/tests/test_dwi_split_by_indices.py +++ b/scripts/tests/test_dwi_split_by_indices.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_split_by_indices.py', '--help') + ret = script_runner.run(['scil_dwi_split_by_indices.py', '--help']) assert ret.success @@ -22,8 +22,8 @@ def test_execution_processing(script_runner, monkeypatch): in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop.nii.gz') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_split_by_indices.py', in_dwi, - in_bval, in_bvec, 'dwi', '5', '15', '25') + ret = script_runner.run(['scil_dwi_split_by_indices.py', in_dwi, + in_bval, in_bvec, 'dwi', '5', '15', '25']) assert ret.success @@ -32,9 +32,9 @@ def test_execution_processing_wrong_indices_given(script_runner, monkeypatch): in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop.nii.gz') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_split_by_indices.py', in_dwi, - in_bval, in_bvec, 'dwi', '0', '15', '25') + ret = script_runner.run(['scil_dwi_split_by_indices.py', in_dwi, + in_bval, in_bvec, 'dwi', '0', '15', '25']) assert (not ret.success) - ret = script_runner.run('scil_dwi_split_by_indices.py', in_dwi, - in_bval, in_bvec, 'dwi', '5', '15', '200') + ret = script_runner.run(['scil_dwi_split_by_indices.py', in_dwi, + in_bval, in_bvec, 'dwi', '5', '15', '200']) assert (not ret.success) diff --git a/scripts/tests/test_dwi_to_sh.py b/scripts/tests/test_dwi_to_sh.py index ce417c823..53f7301c3 100644 --- a/scripts/tests/test_dwi_to_sh.py +++ b/scripts/tests/test_dwi_to_sh.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_to_sh.py', '--help') + ret = script_runner.run(['scil_dwi_to_sh.py', '--help']) assert ret.success @@ -25,12 +25,12 @@ def test_execution_processing(script_runner, monkeypatch): '3000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '3000.bvec') - ret = script_runner.run('scil_dwi_to_sh.py', in_dwi, in_bval, - in_bvec, 'sh_1000.nii.gz') + ret = script_runner.run(['scil_dwi_to_sh.py', in_dwi, in_bval, + in_bvec, 'sh_1000.nii.gz']) assert ret.success # Test wrong b0. Current minimal b-value is 5. - ret = script_runner.run('scil_dwi_to_sh.py', in_dwi, in_bval, + ret = script_runner.run(['scil_dwi_to_sh.py', in_dwi, in_bval, in_bvec, 'sh_1000.nii.gz', '--b0_threshold', '1', - '-f') + '-f']) assert not ret.success diff --git a/scripts/tests/test_fibertube_compute_density.py b/scripts/tests/test_fibertube_compute_density.py index ca05c9b0b..d2466d049 100644 --- a/scripts/tests/test_fibertube_compute_density.py +++ b/scripts/tests/test_fibertube_compute_density.py @@ -38,29 +38,29 @@ def init_data(): def test_help_option(script_runner): - ret = script_runner.run('scil_fibertube_compute_density.py', '--help') + ret = script_runner.run(['scil_fibertube_compute_density.py', '--help']) assert ret.success def test_execution_density(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_compute_density.py', + ret = script_runner.run(['scil_fibertube_compute_density.py', 'fibertubes.trk', '--out_density_map', 'density_map.nii.gz', '--out_density_measures', 'density_measures.json', - '-f') + '-f']) assert ret.success def test_execution_collisions(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_compute_density.py', + ret = script_runner.run(['scil_fibertube_compute_density.py', 'fibertubes.trk', '--out_collision_map', 'collision_map.nii.gz', '--out_collision_measures', 'collision_measures.json', - '-f') + '-f']) assert ret.success diff --git a/scripts/tests/test_fibertube_score_tractogram.py b/scripts/tests/test_fibertube_score_tractogram.py index a1632993c..0e103e349 100644 --- a/scripts/tests/test_fibertube_score_tractogram.py +++ b/scripts/tests/test_fibertube_score_tractogram.py @@ -57,14 +57,14 @@ def init_data(): def test_help_option(script_runner): - ret = script_runner.run('scil_fibertube_score_tractogram.py', '--help') + ret = script_runner.run(['scil_fibertube_score_tractogram.py', '--help']) assert ret.success def test_execution(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_score_tractogram.py', + ret = script_runner.run(['scil_fibertube_score_tractogram.py', 'fibertubes.trk', 'tracking.trk', 'config.json', - 'metrics.json', '--save_error_tractogram', '-f') + 'metrics.json', '--save_error_tractogram', '-f']) assert ret.success diff --git a/scripts/tests/test_fibertube_tracking.py b/scripts/tests/test_fibertube_tracking.py index cedcb9384..bed9dfe6b 100644 --- a/scripts/tests/test_fibertube_tracking.py +++ b/scripts/tests/test_fibertube_tracking.py @@ -38,98 +38,98 @@ def init_data(): def test_help_option(script_runner): - ret = script_runner.run('scil_fibertube_tracking.py', '--help') + ret = script_runner.run(['scil_fibertube_tracking.py', '--help']) assert ret.success def test_execution(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking.py', 'tractogram.trk', 'tracking.trk', - '--min_length', '0', '-f') + '--min_length', '0', '-f']) assert ret.success def test_execution_rk(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking.py', 'tractogram.trk', 'tracking.trk', - '--rk_order', '2', '--min_length', '0', '-f') + '--rk_order', '2', '--min_length', '0', '-f']) assert ret.success def test_execution_config(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking.py', 'tractogram.trk', 'tracking.trk', '--blur_radius', '0.3', '--step_size', '0.1', '--out_config', 'config.json', - '--min_length', '0', '-f') + '--min_length', '0', '-f']) assert ret.success def test_execution_seeding(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking.py', 'tractogram.trk', 'tracking.trk', '--nb_fibertubes', '1', '--nb_seeds_per_fibertube', '3', '--skip', '3', '--local_seeding', 'center', - '--min_length', '0', '-f') + '--min_length', '0', '-f']) assert ret.success def test_execution_FTODF(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking.py', 'tractogram.trk', 'tracking.trk', '--use_ftODF', - '--min_length', '0', '-f') + '--min_length', '0', '-f']) assert ret.success def test_execution_FTODF_rk(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking.py', 'tractogram.trk', 'tracking.trk', '--use_ftODF', - '--rk_order', '2', '--min_length', '0', '-f') + '--rk_order', '2', '--min_length', '0', '-f']) assert ret.success def test_execution_FTODF_config(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking.py', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--blur_radius', '0.3', '--step_size', '0.1', '--out_config', 'config.json', - '--min_length', '0', '-f') + '--min_length', '0', '-f']) assert ret.success def test_execution_FTODF_seeding(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking.py', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--nb_fibertubes', '1', '--nb_seeds_per_fibertube', '3', '--skip', '3', '--local_seeding', 'center', - '--min_length', '0', '-f') + '--min_length', '0', '-f']) assert ret.success def test_execution_FTODF_sphere(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking.py', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--sh_order', '4', '--sphere', 'symmetric362', @@ -137,15 +137,15 @@ def test_execution_FTODF_sphere(script_runner, monkeypatch): '--sub_sphere', '0', '--sfthres', '0.05', '--sfthres_init', '0.4', - '--min_length', '0', '-f') + '--min_length', '0', '-f']) assert ret.success def test_execution_FTODF_det(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking.py', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--algo', 'det', - '--min_length', '0', '-f') + '--min_length', '0', '-f']) assert ret.success diff --git a/scripts/tests/test_fodf_bundleparc.py b/scripts/tests/test_fodf_bundleparc.py index 0107934d6..4f2e1d08a 100644 --- a/scripts/tests/test_fodf_bundleparc.py +++ b/scripts/tests/test_fodf_bundleparc.py @@ -12,7 +12,7 @@ @pytest.mark.ml def test_help_option(script_runner, monkeypatch): - ret = script_runner.run('scil_fodf_bundleparc.py', '--help') + ret = script_runner.run(['scil_fodf_bundleparc.py', '--help']) assert ret.success @@ -21,8 +21,8 @@ def test_help_option(script_runner, monkeypatch): def test_execution(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run('scil_fodf_bundleparc.py', in_fodf, '-f', - '--bundles', 'FX_left') + ret = script_runner.run(['scil_fodf_bundleparc.py', in_fodf, '-f', + '--bundles', 'FX_left']) assert ret.success @@ -30,9 +30,9 @@ def test_execution(script_runner, monkeypatch): def test_execution_100_labels(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run('scil_fodf_bundleparc.py', in_fodf, + ret = script_runner.run(['scil_fodf_bundleparc.py', in_fodf, '--nb_pts', '100', '-f', '--bundles', - 'IFO_right') + 'IFO_right']) assert ret.success @@ -40,9 +40,9 @@ def test_execution_100_labels(script_runner, monkeypatch): def test_execution_keep_biggest_blob(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run('scil_fodf_bundleparc.py', in_fodf, + ret = script_runner.run(['scil_fodf_bundleparc.py', in_fodf, '--keep_biggest_blob', '-f', '--bundles', - 'CA') + 'CA']) assert ret.success @@ -50,6 +50,6 @@ def test_execution_keep_biggest_blob(script_runner, monkeypatch): def test_execution_invalid_bundle(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run('scil_fodf_bundleparc.py', in_fodf, - '-f', '--bundles', 'CC') + ret = script_runner.run(['scil_fodf_bundleparc.py', in_fodf, + '-f', '--bundles', 'CC']) assert not ret.success diff --git a/scripts/tests/test_fodf_max_in_ventricles.py b/scripts/tests/test_fodf_max_in_ventricles.py index 1a8b07f7c..819af4592 100644 --- a/scripts/tests/test_fodf_max_in_ventricles.py +++ b/scripts/tests/test_fodf_max_in_ventricles.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_fodf_max_in_ventricles.py', '--help') + ret = script_runner.run(['scil_fodf_max_in_ventricles.py', '--help']) assert ret.success @@ -25,6 +25,6 @@ def test_execution_processing(script_runner, monkeypatch): 'fa.nii.gz') in_md = os.path.join(SCILPY_HOME, 'processing', 'md.nii.gz') - ret = script_runner.run('scil_fodf_max_in_ventricles.py', in_fodf, - in_fa, in_md, '--sh_basis', 'tournier07') + ret = script_runner.run(['scil_fodf_max_in_ventricles.py', in_fodf, + in_fa, in_md, '--sh_basis', 'tournier07']) assert ret.success diff --git a/scripts/tests/test_fodf_memsmt.py b/scripts/tests/test_fodf_memsmt.py index 16ce86540..64130108d 100644 --- a/scripts/tests/test_fodf_memsmt.py +++ b/scripts/tests/test_fodf_memsmt.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_fodf_memsmt.py', '--help') + ret = script_runner.run(['scil_fodf_memsmt.py', '--help']) assert ret.success @@ -37,7 +37,7 @@ def test_inputs_check(script_runner, monkeypatch): in_csf_frf = os.path.join(SCILPY_HOME, 'btensor_testdata', 'csf_frf.txt') - ret = script_runner.run('scil_fodf_memsmt.py', in_wm_frf, + ret = script_runner.run(['scil_fodf_memsmt.py', in_wm_frf, in_gm_frf, in_csf_frf, '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, '--in_bvecs', in_bvec_lin, @@ -46,10 +46,10 @@ def test_inputs_check(script_runner, monkeypatch): '--gm_out_fODF', 'gm_fodf.nii.gz', '--csf_out_fODF', 'csf_fodf.nii.gz', '--vf', 'vf.nii.gz', '--sh_order', '4', '--sh_basis', - 'tournier07', '--processes', '1', '-f') + 'tournier07', '--processes', '1', '-f']) assert (not ret.success) - ret = script_runner.run('scil_fodf_memsmt.py', in_wm_frf, + ret = script_runner.run(['scil_fodf_memsmt.py', in_wm_frf, in_gm_frf, in_csf_frf, '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', @@ -59,7 +59,7 @@ def test_inputs_check(script_runner, monkeypatch): '--gm_out_fODF', 'gm_fodf.nii.gz', '--csf_out_fODF', 'csf_fodf.nii.gz', '--vf', 'vf.nii.gz', '--sh_order', '4', '--sh_basis', - 'tournier07', '--processes', '1', '-f') + 'tournier07', '--processes', '1', '-f']) assert (not ret.success) @@ -84,11 +84,11 @@ def test_execution_processing(script_runner, monkeypatch): in_csf_frf = os.path.join(SCILPY_HOME, 'btensor_testdata', 'csf_frf.txt') - ret = script_runner.run('scil_fodf_memsmt.py', in_wm_frf, + ret = script_runner.run(['scil_fodf_memsmt.py', in_wm_frf, in_gm_frf, in_csf_frf, '--in_dwis', in_dwi_lin, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_sph, '--in_bvecs', in_bvec_lin, in_bvec_sph, '--in_bdeltas', '1', '0', - '--sh_order', '8', '--processes', '8', '-f') + '--sh_order', '8', '--processes', '8', '-f']) assert ret.success diff --git a/scripts/tests/test_fodf_metrics.py b/scripts/tests/test_fodf_metrics.py index 3b1bc536e..75116b952 100644 --- a/scripts/tests/test_fodf_metrics.py +++ b/scripts/tests/test_fodf_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_fodf_metrics.py', '--help') + ret = script_runner.run(['scil_fodf_metrics.py', '--help']) assert ret.success @@ -21,10 +21,10 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf_descoteaux07.nii.gz') - ret = script_runner.run('scil_fodf_metrics.py', in_fodf, '--not_al', + ret = script_runner.run(['scil_fodf_metrics.py', in_fodf, '--not_al', '--peaks', 'peaks.nii.gz', '--afd_max', 'afd_max.nii.gz', '--afd_total', 'afd_tot.nii.gz', '--afd_sum', 'afd_sum.nii.gz', - '--nufo', 'nufo.nii.gz', '--processes', '1') + '--nufo', 'nufo.nii.gz', '--processes', '1']) assert ret.success diff --git a/scripts/tests/test_fodf_msmt.py b/scripts/tests/test_fodf_msmt.py index d2adfdab2..185479caa 100644 --- a/scripts/tests/test_fodf_msmt.py +++ b/scripts/tests/test_fodf_msmt.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_fodf_msmt.py', '--help') + ret = script_runner.run(['scil_fodf_msmt.py', '--help']) assert ret.success @@ -26,7 +26,7 @@ def test_execution_processing(script_runner, monkeypatch): in_csf_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'csf_frf.txt') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_fodf_msmt.py', in_dwi, in_bval, + ret = script_runner.run(['scil_fodf_msmt.py', in_dwi, in_bval, in_bvec, in_wm_frf, in_gm_frf, in_csf_frf, '--mask', mask, '--wm_out_fODF', 'wm_fodf.nii.gz', @@ -34,5 +34,5 @@ def test_execution_processing(script_runner, monkeypatch): '--csf_out_fODF', 'csf_fodf.nii.gz', '--vf', 'vf.nii.gz', '--sh_order', '4', '--sh_basis', 'tournier07', - '--processes', '1', '-f') + '--processes', '1', '-f']) assert ret.success diff --git a/scripts/tests/test_fodf_ssst.py b/scripts/tests/test_fodf_ssst.py index b1a79cf9b..d2ba8caf7 100644 --- a/scripts/tests/test_fodf_ssst.py +++ b/scripts/tests/test_fodf_ssst.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_fodf_ssst.py', '--help') + ret = script_runner.run(['scil_fodf_ssst.py', '--help']) assert ret.success @@ -27,14 +27,14 @@ def test_execution_processing(script_runner, monkeypatch): '3000.bvec') in_frf = os.path.join(SCILPY_HOME, 'processing', 'frf.txt') - ret = script_runner.run('scil_fodf_ssst.py', in_dwi, in_bval, + ret = script_runner.run(['scil_fodf_ssst.py', in_dwi, in_bval, in_bvec, in_frf, 'fodf.nii.gz', '--sh_order', '4', - '--sh_basis', 'tournier07', '--processes', '1') + '--sh_basis', 'tournier07', '--processes', '1']) assert ret.success # Test wrong b0. Current minimal b-value is 5. - ret = script_runner.run('scil_fodf_ssst.py', in_dwi, in_bval, + ret = script_runner.run(['scil_fodf_ssst.py', in_dwi, in_bval, in_bvec, in_frf, 'fodf.nii.gz', '--sh_order', '4', '--sh_basis', 'tournier07', '--processes', '1', - '--b0_threshold', '1', '-f') + '--b0_threshold', '1', '-f']) assert not ret.success diff --git a/scripts/tests/test_fodf_to_bingham.py b/scripts/tests/test_fodf_to_bingham.py index c0a27a667..4eef7f86f 100644 --- a/scripts/tests/test_fodf_to_bingham.py +++ b/scripts/tests/test_fodf_to_bingham.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_fodf_to_bingham.py', - '--help') + ret = script_runner.run(['scil_fodf_to_bingham.py', + '--help']) assert ret.success @@ -22,14 +22,14 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf_descoteaux07.nii.gz') - ret = script_runner.run('scil_fodf_to_bingham.py', + ret = script_runner.run(['scil_fodf_to_bingham.py', in_fodf, 'bingham.nii.gz', '--max_lobes', '1', '--at', '0.0', '--rt', '0.1', '--min_sep_angle', '25.', '--max_fit_angle', '15.', - '--processes', '1') + '--processes', '1']) assert ret.success @@ -39,7 +39,7 @@ def test_execution_processing_mask(script_runner, monkeypatch): 'fodf_descoteaux07.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') - ret = script_runner.run('scil_fodf_to_bingham.py', + ret = script_runner.run(['scil_fodf_to_bingham.py', in_fodf, 'bingham.nii.gz', '--max_lobes', '1', '--at', '0.0', @@ -47,5 +47,5 @@ def test_execution_processing_mask(script_runner, monkeypatch): '--min_sep_angle', '25.', '--max_fit_angle', '15.', '--processes', '1', - '--mask', in_mask, '-f') + '--mask', in_mask, '-f']) assert ret.success diff --git a/scripts/tests/test_freewater_maps.py b/scripts/tests/test_freewater_maps.py index 54b4f6746..c765acc3a 100644 --- a/scripts/tests/test_freewater_maps.py +++ b/scripts/tests/test_freewater_maps.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_freewater_maps.py', '--help') + ret = script_runner.run(['scil_freewater_maps.py', '--help']) assert ret.success @@ -27,12 +27,12 @@ def test_execution_commit_amico(script_runner, monkeypatch): 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_freewater_maps.py', in_dwi, + ret = script_runner.run(['scil_freewater_maps.py', in_dwi, in_bval, in_bvec, '--mask', mask, '--out_dir', 'freewater', '--b_thr', '30', '--para_diff', '0.0015', '--perp_diff_min', '0.0001', '--perp_diff_max', '0.0007', '--lambda1', '0.0', '--lambda2', '0.001', - '--processes', '1') + '--processes', '1']) assert ret.success diff --git a/scripts/tests/test_freewater_priors.py b/scripts/tests/test_freewater_priors.py index b2ff43fd6..9ed2aac80 100644 --- a/scripts/tests/test_freewater_priors.py +++ b/scripts/tests/test_freewater_priors.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_freewater_priors.py', '--help') + ret = script_runner.run(['scil_freewater_priors.py', '--help']) assert ret.success diff --git a/scripts/tests/test_frf_mean.py b/scripts/tests/test_frf_mean.py index 436d7c144..8221c2042 100644 --- a/scripts/tests/test_frf_mean.py +++ b/scripts/tests/test_frf_mean.py @@ -14,29 +14,29 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_frf_mean.py', '--help') + ret = script_runner.run(['scil_frf_mean.py', '--help']) assert ret.success def test_execution_processing_ssst(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'processing', 'frf.txt') - ret = script_runner.run('scil_frf_mean.py', in_frf, in_frf, 'mfrf1.txt') + ret = script_runner.run(['scil_frf_mean.py', in_frf, in_frf, 'mfrf1.txt']) assert ret.success def test_execution_processing_msmt(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run('scil_frf_mean.py', in_frf, in_frf, 'mfrf2.txt') + ret = script_runner.run(['scil_frf_mean.py', in_frf, in_frf, 'mfrf2.txt']) assert ret.success def test_outputs_precision(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run('scil_frf_mean.py', in_frf, in_frf, 'mfrfp.txt', - '--precision', '4') + ret = script_runner.run(['scil_frf_mean.py', in_frf, in_frf, 'mfrfp.txt', + '--precision', '4']) assert ret.success expected = [ @@ -53,5 +53,5 @@ def test_execution_processing_bad_input(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_wm_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') in_frf = os.path.join(SCILPY_HOME, 'processing', 'frf.txt') - ret = script_runner.run('scil_frf_mean.py', in_wm_frf, in_frf, 'mfrf3.txt') + ret = script_runner.run(['scil_frf_mean.py', in_wm_frf, in_frf, 'mfrf3.txt']) assert not ret.success diff --git a/scripts/tests/test_frf_memsmt.py b/scripts/tests/test_frf_memsmt.py index e60de7607..aeeed01d1 100644 --- a/scripts/tests/test_frf_memsmt.py +++ b/scripts/tests/test_frf_memsmt.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_frf_memsmt.py', '--help') + ret = script_runner.run(['scil_frf_memsmt.py', '--help']) assert ret.success @@ -37,13 +37,13 @@ def test_roi_center_shape_parameter(script_runner, monkeypatch): in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, '--in_bvecs', in_bvec_lin, in_bvec_plan, in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', - '--roi_center', '1', '--min_nvox', '1', '-f') + '--roi_center', '1', '--min_nvox', '1', '-f']) assert (not ret.success) @@ -68,33 +68,33 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): 'spherical.bvals') in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, '--in_bvecs', in_bvec_lin, in_bvec_plan, in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', - '--roi_radii', '37', '--min_nvox', '1', '-f') + '--roi_radii', '37', '--min_nvox', '1', '-f']) assert ret.success - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, '--in_bvecs', in_bvec_lin, in_bvec_plan, in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', '--roi_radii', '37', '37', '37', - '--min_nvox', '1', '-f') + '--min_nvox', '1', '-f']) assert ret.success - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, '--in_bvecs', in_bvec_lin, in_bvec_plan, in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', '--roi_radii', '37', '37', '37', '37', '37', - '--min_nvox', '1', '-f') + '--min_nvox', '1', '-f']) assert (not ret.success) @@ -114,19 +114,19 @@ def test_inputs_check(script_runner, monkeypatch): in_bvec_plan = os.path.join(SCILPY_HOME, 'btensor_testdata', 'planar.bvecs') - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, '--in_bvecs', in_bvec_lin, - '--in_bdeltas', '1', '--min_nvox', '1', '-f') + '--in_bdeltas', '1', '--min_nvox', '1', '-f']) assert (not ret.success) - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', in_bvec_lin, in_bvec_plan, '--in_bdeltas', - '1', '-0.5', '0', '--min_nvox', '1', '-f') + '1', '-0.5', '0', '--min_nvox', '1', '-f']) assert (not ret.success) @@ -150,13 +150,13 @@ def test_outputs_precision(script_runner, monkeypatch): 'spherical.bvals') in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, '--in_bvecs', in_bvec_lin, in_bvec_plan, in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', - '--min_nvox', '1', '--precision', '4', '-f') + '--min_nvox', '1', '--precision', '4', '-f']) assert ret.success @@ -186,11 +186,11 @@ def test_execution_processing(script_runner, monkeypatch): 'spherical.bvals') in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, '--in_bvecs', in_bvec_lin, in_bvec_plan, in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', - '--min_nvox', '1', '-f') + '--min_nvox', '1', '-f']) assert ret.success diff --git a/scripts/tests/test_frf_msmt.py b/scripts/tests/test_frf_msmt.py index a919e5afc..65b7e41d2 100644 --- a/scripts/tests/test_frf_msmt.py +++ b/scripts/tests/test_frf_msmt.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_frf_msmt.py', '--help') + ret = script_runner.run(['scil_frf_msmt.py', '--help']) assert ret.success @@ -25,23 +25,23 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt.py', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_center', - '15', '15', '15', '-f') + '15', '15', '15', '-f']) assert ret.success # Test wrong tolerance, leading to no b0. Current minimal b-val is 5. - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt.py', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_center', - '15', '15', '15', '-f', '--tol', '1') + '15', '15', '15', '-f', '--tol', '1']) assert not ret.success - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt.py', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_center', - '15', '-f') + '15', '-f']) assert (not ret.success) @@ -55,22 +55,22 @@ def test_roi_radii_shape_parameter2(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt.py', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_radii', - '37', '-f') + '37', '-f']) assert ret.success - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt.py', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_radii', - '37', '37', '37', '-f') + '37', '37', '37', '-f']) assert ret.success - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt.py', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_radii', - '37', '37', '37', '37', '37', '-f') + '37', '37', '37', '37', '37', '-f']) assert (not ret.success) @@ -84,10 +84,10 @@ def test_outputs_precision(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt.py', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--min_nvox', '20', - '--precision', '4', '-f') + '--precision', '4', '-f']) assert ret.success for frf_file in ['wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt']: @@ -105,8 +105,8 @@ def test_execution_processing(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt.py', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--min_nvox', '20', - '-f') + '-f']) assert ret.success diff --git a/scripts/tests/test_frf_set_diffusivities.py b/scripts/tests/test_frf_set_diffusivities.py index de40559fa..2b0c9141e 100644 --- a/scripts/tests/test_frf_set_diffusivities.py +++ b/scripts/tests/test_frf_set_diffusivities.py @@ -15,32 +15,32 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_frf_set_diffusivities.py', '--help') + ret = script_runner.run(['scil_frf_set_diffusivities.py', '--help']) assert ret.success def test_execution_processing_ssst(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'processing', 'frf.txt') - ret = script_runner.run('scil_frf_set_diffusivities.py', in_frf, - '15,4,4', 'new_frf.txt', '-f') + ret = script_runner.run(['scil_frf_set_diffusivities.py', in_frf, + '15,4,4', 'new_frf.txt', '-f']) assert ret.success def test_execution_processing_msmt(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run('scil_frf_set_diffusivities.py', in_frf, - '15,4,4,13,4,4,12,5,5', 'new_frf.txt', '-f') + ret = script_runner.run(['scil_frf_set_diffusivities.py', in_frf, + '15,4,4,13,4,4,12,5,5', 'new_frf.txt', '-f']) assert ret.success def test_outputs_precision(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run('scil_frf_set_diffusivities.py', in_frf, + ret = script_runner.run(['scil_frf_set_diffusivities.py', in_frf, '15,4,4,13,4,4,12,5,5', 'new_frf.txt', - '--precision', '4', '-f') + '--precision', '4', '-f']) assert ret.success expected = [ @@ -56,6 +56,6 @@ def test_outputs_precision(script_runner, monkeypatch): def test_execution_processing__wrong_input(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run('scil_frf_set_diffusivities.py', in_frf, - '15,4,4,13,4,4', 'new_frf.txt', '-f') + ret = script_runner.run(['scil_frf_set_diffusivities.py', in_frf, + '15,4,4,13,4,4', 'new_frf.txt', '-f']) assert not ret.success diff --git a/scripts/tests/test_frf_ssst.py b/scripts/tests/test_frf_ssst.py index 5f02d018e..1bee70d6a 100644 --- a/scripts/tests/test_frf_ssst.py +++ b/scripts/tests/test_frf_ssst.py @@ -16,55 +16,55 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_frf_ssst.py', '--help') + ret = script_runner.run(['scil_frf_ssst.py', '--help']) assert ret.success def test_roi_center_parameter(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst.py', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_center', - '15', '15', '15', '-f') + '15', '15', '15', '-f']) assert ret.success - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst.py', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_center', - '15', '-f') + '15', '-f']) assert (not ret.success) # Test wrong b0 threshold. Current minimal b-value is 5. - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst.py', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_center', - '15', '15', '15', '-f', '--b0_threshold', '1') + '15', '15', '15', '-f', '--b0_threshold', '1']) assert not ret.success def test_roi_radii_shape_parameter(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst.py', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_radii', - '37', '-f') + '37', '-f']) assert ret.success - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst.py', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_radii', - '37', '37', '37', '-f') + '37', '37', '37', '-f']) assert ret.success - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst.py', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_radii', - '37', '37', '37', '37', '37', '-f') + '37', '37', '37', '37', '37', '-f']) assert (not ret.success) def test_outputs_precision(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst.py', in_dwi, in_bval, in_bvec, 'frf.txt', - '--precision', '4', '-f') + '--precision', '4', '-f']) assert ret.success with open("frf.txt", "r") as f: @@ -74,6 +74,6 @@ def test_outputs_precision(script_runner, monkeypatch): def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_frf_ssst.py', in_dwi, - in_bval, in_bvec, 'frf.txt', '-f') + ret = script_runner.run(['scil_frf_ssst.py', in_dwi, + in_bval, in_bvec, 'frf.txt', '-f']) assert ret.success diff --git a/scripts/tests/test_gradients_apply_transform.py b/scripts/tests/test_gradients_apply_transform.py index 8d27063cb..806c65d16 100644 --- a/scripts/tests/test_gradients_apply_transform.py +++ b/scripts/tests/test_gradients_apply_transform.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_apply_transform.py', '--help') + ret = script_runner.run(['scil_gradients_apply_transform.py', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_bst(script_runner, monkeypatch): 'dwi.bvec') in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') - ret = script_runner.run('scil_gradients_apply_transform.py', + ret = script_runner.run(['scil_gradients_apply_transform.py', in_bvecs, in_aff, - 'bvecs_transformed.bvec', '--inverse') + 'bvecs_transformed.bvec', '--inverse']) assert ret.success diff --git a/scripts/tests/test_gradients_convert.py b/scripts/tests/test_gradients_convert.py index 6f4addbb8..4f302390c 100644 --- a/scripts/tests/test_gradients_convert.py +++ b/scripts/tests/test_gradients_convert.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_convert.py', - '--help') + ret = script_runner.run(['scil_gradients_convert.py', + '--help']) assert ret.success @@ -24,9 +24,9 @@ def test_execution_processing_fsl(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_gradients_convert.py', + ret = script_runner.run(['scil_gradients_convert.py', '--input_fsl', - in_bval, in_bvec, '1000') + in_bval, in_bvec, '1000']) assert ret.success @@ -34,9 +34,9 @@ def test_execution_processing_mrtrix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run('scil_gradients_convert.py', + ret = script_runner.run(['scil_gradients_convert.py', '--input_mrtrix', - in_encoding, '1000') + in_encoding, '1000']) assert ret.success @@ -46,9 +46,9 @@ def test_name_validation_mrtrix(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_gradients_convert.py', + ret = script_runner.run(['scil_gradients_convert.py', '--input_fsl', - in_bval, in_bvec, '1000_test.b') + in_bval, in_bvec, '1000_test.b']) assert ret.success wrong_path = os.path.join(tmp_dir.name, '1000_test.b.b') @@ -62,9 +62,9 @@ def test_name_validation_fsl_bval(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run('scil_gradients_convert.py', + ret = script_runner.run(['scil_gradients_convert.py', '--input_mrtrix', - in_encoding, '1000_test.bval') + in_encoding, '1000_test.bval']) assert ret.success wrong_path_bval = os.path.join(tmp_dir.name, '1000_test.bval.bval') @@ -82,9 +82,9 @@ def test_name_validation_fsl_bvec(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run('scil_gradients_convert.py', + ret = script_runner.run(['scil_gradients_convert.py', '--input_mrtrix', - in_encoding, '1000_test.bvec') + in_encoding, '1000_test.bvec']) assert ret.success wrong_path_bval = os.path.join(tmp_dir.name, '1000_test.bvec.bval') diff --git a/scripts/tests/test_gradients_generate_sampling.py b/scripts/tests/test_gradients_generate_sampling.py index 2ee25ebb4..5bbdeb18a 100644 --- a/scripts/tests/test_gradients_generate_sampling.py +++ b/scripts/tests/test_gradients_generate_sampling.py @@ -13,14 +13,14 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_generate_sampling.py', '--help') + ret = script_runner.run(['scil_gradients_generate_sampling.py', '--help']) assert ret.success def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_gradients_generate_sampling.py', + ret = script_runner.run(['scil_gradients_generate_sampling.py', '6', '6', 'encoding.b', '--mrtrix', '--eddy', '--duty', '--b0_every', '25', '--b0_end', - '--bvals', '800', '1200') + '--bvals', '800', '1200']) assert ret.success diff --git a/scripts/tests/test_gradients_modify_axes.py b/scripts/tests/test_gradients_modify_axes.py index c2b89c99b..51562186c 100644 --- a/scripts/tests/test_gradients_modify_axes.py +++ b/scripts/tests/test_gradients_modify_axes.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_modify_axes.py', '--help') + ret = script_runner.run(['scil_gradients_modify_axes.py', '--help']) assert ret.success @@ -22,12 +22,12 @@ def test_execution_processing(script_runner, monkeypatch): # mrtrix in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run('scil_gradients_modify_axes.py', in_encoding, - '1000_flip.b', '-1', '3', '2') + ret = script_runner.run(['scil_gradients_modify_axes.py', in_encoding, + '1000_flip.b', '-1', '3', '2']) assert ret.success # FSL in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_gradients_modify_axes.py', in_encoding, - '1000_flip.bvec', '1', '-3', '2') + ret = script_runner.run(['scil_gradients_modify_axes.py', in_encoding, + '1000_flip.bvec', '1', '-3', '2']) assert ret.success diff --git a/scripts/tests/test_gradients_normalize_bvecs.py b/scripts/tests/test_gradients_normalize_bvecs.py index d05c236cb..ec3998956 100644 --- a/scripts/tests/test_gradients_normalize_bvecs.py +++ b/scripts/tests/test_gradients_normalize_bvecs.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_normalize_bvecs.py', - '--help') + ret = script_runner.run(['scil_gradients_normalize_bvecs.py', + '--help']) assert ret.success @@ -22,6 +22,6 @@ def test_execution_processing_fsl(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_gradients_normalize_bvecs.py', - in_bvec, '1000_norm.bvec') + ret = script_runner.run(['scil_gradients_normalize_bvecs.py', + in_bvec, '1000_norm.bvec']) assert ret.success diff --git a/scripts/tests/test_gradients_round_bvals.py b/scripts/tests/test_gradients_round_bvals.py index 8fc930a81..173035392 100644 --- a/scripts/tests/test_gradients_round_bvals.py +++ b/scripts/tests/test_gradients_round_bvals.py @@ -13,15 +13,15 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_round_bvals.py', - '--help') + ret = script_runner.run(['scil_gradients_round_bvals.py', + '--help']) assert ret.success def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bval = os.path.join(SCILPY_HOME, 'processing', '1000.bval') - ret = script_runner.run('scil_gradients_round_bvals.py', + ret = script_runner.run(['scil_gradients_round_bvals.py', in_bval, '0', '1000', '1000_resample.b', "20", - "-v") + "-v"]) assert ret.success diff --git a/scripts/tests/test_gradients_validate_correct.py b/scripts/tests/test_gradients_validate_correct.py index 04e032dd3..968e6ad20 100644 --- a/scripts/tests/test_gradients_validate_correct.py +++ b/scripts/tests/test_gradients_validate_correct.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_validate_correct.py', '--help') + ret = script_runner.run(['scil_gradients_validate_correct.py', '--help']) assert ret.success @@ -27,12 +27,12 @@ def test_execution_processing_dti_peaks(script_runner, monkeypatch): '1000.bvec') # generate the peaks file and fa map we'll use to test our script - script_runner.run('scil_dti_metrics.py', in_dwi, in_bval, in_bvec, + script_runner.run(['scil_dti_metrics.py', in_dwi, in_bval, in_bvec, '--not_all', '--fa', 'fa.nii.gz', - '--evecs', 'evecs.nii.gz') + '--evecs', 'evecs.nii.gz']) # test the actual script - ret = script_runner.run('scil_gradients_validate_correct.py', in_bvec, - 'evecs_v1.nii.gz', 'fa.nii.gz', 'bvec_corr', '-v') + ret = script_runner.run(['scil_gradients_validate_correct.py', in_bvec, + 'evecs_v1.nii.gz', 'fa.nii.gz', 'bvec_corr', '-v']) assert ret.success @@ -46,6 +46,6 @@ def test_execution_processing_fodf_peaks(script_runner, monkeypatch): 'fa.nii.gz') # test the actual script - ret = script_runner.run('scil_gradients_validate_correct.py', in_bvec, - in_peaks, in_fa, 'bvec_corr_fodf', '-v') + ret = script_runner.run(['scil_gradients_validate_correct.py', in_bvec, + in_peaks, in_fa, 'bvec_corr_fodf', '-v']) assert ret.success diff --git a/scripts/tests/test_gradients_validate_correct_eddy.py b/scripts/tests/test_gradients_validate_correct_eddy.py index 91b36626c..4de4884a8 100644 --- a/scripts/tests/test_gradients_validate_correct_eddy.py +++ b/scripts/tests/test_gradients_validate_correct_eddy.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_validate_correct_eddy.py', - '--help') + ret = script_runner.run(['scil_gradients_validate_correct_eddy.py', + '--help']) assert ret.success @@ -22,20 +22,20 @@ def test_execution_extract_half(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') - ret = script_runner.run('scil_gradients_validate_correct_eddy.py', + ret = script_runner.run(['scil_gradients_validate_correct_eddy.py', in_bvec, in_bval, "32", 'out.bvec', 'out.bval', - '-f') + '-f']) assert ret.success def test_execution_extract_total(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') - ret = script_runner.run('scil_gradients_validate_correct_eddy.py', + ret = script_runner.run(['scil_gradients_validate_correct_eddy.py', in_bvec, in_bval, "64", 'out.bvec', 'out.bval', - '-f') + '-f']) assert ret.success diff --git a/scripts/tests/test_gradients_validate_sampling.py b/scripts/tests/test_gradients_validate_sampling.py index 59e1a4063..cda011375 100644 --- a/scripts/tests/test_gradients_validate_sampling.py +++ b/scripts/tests/test_gradients_validate_sampling.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_validate_sampling.py', '--help') + ret = script_runner.run(['scil_gradients_validate_sampling.py', '--help']) assert ret.success @@ -24,8 +24,8 @@ def test_execution_normal(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_gradients_validate_sampling.py', in_bval, - in_bvec) + ret = script_runner.run(['scil_gradients_validate_sampling.py', in_bval, + in_bvec]) assert ret.success @@ -34,5 +34,5 @@ def test_execution_mrtrix(script_runner, monkeypatch): in_b = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run('scil_gradients_validate_sampling.py', in_b) + ret = script_runner.run(['scil_gradients_validate_sampling.py', in_b]) assert ret.success diff --git a/scripts/tests/test_header_print_info.py b/scripts/tests/test_header_print_info.py index 77c9d11a0..ad4743a01 100644 --- a/scripts/tests/test_header_print_info.py +++ b/scripts/tests/test_header_print_info.py @@ -13,19 +13,19 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_header_print_info.py', '--help') + ret = script_runner.run(['scil_header_print_info.py', '--help']) assert ret.success def test_execution_img(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'fa.nii.gz') - ret = script_runner.run('scil_header_print_info.py', in_img) + ret = script_runner.run(['scil_header_print_info.py', in_img]) assert ret.success def test_execution_tractogram(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'others', 'IFGWM.trk') - ret = script_runner.run('scil_header_print_info.py', in_tracto) + ret = script_runner.run(['scil_header_print_info.py', in_tracto]) assert ret.success diff --git a/scripts/tests/test_header_validate_compatibility.py b/scripts/tests/test_header_validate_compatibility.py index eeb124a4b..768f1db3f 100644 --- a/scripts/tests/test_header_validate_compatibility.py +++ b/scripts/tests/test_header_validate_compatibility.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_header_validate_compatibility.py', '--help') + ret = script_runner.run(['scil_header_validate_compatibility.py', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') in_roi = os.path.join(SCILPY_HOME, 'filtering', 'mask.nii.gz') - ret = script_runner.run('scil_header_validate_compatibility.py', - in_bundle, in_roi) + ret = script_runner.run(['scil_header_validate_compatibility.py', + in_bundle, in_roi]) assert ret.success diff --git a/scripts/tests/test_json_convert_entries_to_xlsx.py b/scripts/tests/test_json_convert_entries_to_xlsx.py index 24bc117b7..cdd1a94a2 100644 --- a/scripts/tests/test_json_convert_entries_to_xlsx.py +++ b/scripts/tests/test_json_convert_entries_to_xlsx.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_json_convert_entries_to_xlsx.py', '--help') + ret = script_runner.run(['scil_json_convert_entries_to_xlsx.py', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_json = os.path.join(SCILPY_HOME, 'tractometry', 'length_stats_1.json') - ret = script_runner.run('scil_json_convert_entries_to_xlsx.py', in_json, - 'length_stats.xlsx') + ret = script_runner.run(['scil_json_convert_entries_to_xlsx.py', in_json, + 'length_stats.xlsx']) assert ret.success diff --git a/scripts/tests/test_json_harmonize_entries.py b/scripts/tests/test_json_harmonize_entries.py index 42be74118..3d5440c2e 100644 --- a/scripts/tests/test_json_harmonize_entries.py +++ b/scripts/tests/test_json_harmonize_entries.py @@ -2,5 +2,5 @@ # -*- coding: utf-8 -*- def test_help_option(script_runner): - ret = script_runner.run('scil_json_harmonize_entries.py', '--help') + ret = script_runner.run(['scil_json_harmonize_entries.py', '--help']) assert ret.success diff --git a/scripts/tests/test_json_merge_entries.py b/scripts/tests/test_json_merge_entries.py index 7f24c5025..0f7125b2e 100644 --- a/scripts/tests/test_json_merge_entries.py +++ b/scripts/tests/test_json_merge_entries.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_json_merge_entries.py', '--help') + ret = script_runner.run(['scil_json_merge_entries.py', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_tractometry(script_runner, monkeypatch): 'length_stats_1.json') in_json_2 = os.path.join(SCILPY_HOME, 'tractometry', 'length_stats_2.json') - ret = script_runner.run('scil_json_merge_entries.py', in_json_1, - in_json_2, 'merge.json', '--keep_separate') + ret = script_runner.run(['scil_json_merge_entries.py', in_json_1, + in_json_2, 'merge.json', '--keep_separate']) assert ret.success diff --git a/scripts/tests/test_labels_combine.py b/scripts/tests/test_labels_combine.py index 0dbbb89e6..fa7e17d91 100644 --- a/scripts/tests/test_labels_combine.py +++ b/scripts/tests/test_labels_combine.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_labels_combine.py', '--help') + ret = script_runner.run(['scil_labels_combine.py', '--help']) assert ret.success @@ -22,11 +22,11 @@ def test_execution_atlas(script_runner, monkeypatch): in_atlas_1 = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') in_brainstem = os.path.join(SCILPY_HOME, 'atlas', 'brainstem.nii.gz') - ret = script_runner.run('scil_labels_combine.py', + ret = script_runner.run(['scil_labels_combine.py', 'atlas_freesurfer_v2_single_brainstem.nii.gz', '--volume_ids', in_atlas_1, '8', '47', '251', '252', '253', '254', '1022', '1024', '2022', - '2024', '--volume_ids', in_brainstem, '16') + '2024', '--volume_ids', in_brainstem, '16']) assert ret.success @@ -35,10 +35,10 @@ def test_execution_atlas_merge(script_runner, monkeypatch): in_atlas_1 = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') in_brainstem = os.path.join(SCILPY_HOME, 'atlas', 'brainstem.nii.gz') - ret = script_runner.run('scil_labels_combine.py', + ret = script_runner.run(['scil_labels_combine.py', 'atlas_freesurfer_v2_merge_brainstem.nii.gz', '--volume_ids', in_atlas_1, '8', '47', '251', '252', '253', '254', '1022', '1024', '2022', '2024', '--volume_ids', in_brainstem, '16', - '--merge_groups') + '--merge_groups']) assert ret.success diff --git a/scripts/tests/test_labels_dilate.py b/scripts/tests/test_labels_dilate.py index eed7ec737..16cdf2051 100644 --- a/scripts/tests/test_labels_dilate.py +++ b/scripts/tests/test_labels_dilate.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_labels_dilate.py', '--help') + ret = script_runner.run(['scil_labels_dilate.py', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_single_brainstem.nii.gz') - ret = script_runner.run('scil_labels_dilate.py', in_atlas, + ret = script_runner.run(['scil_labels_dilate.py', in_atlas, 'atlas_freesurfer_v2_single_brainstem_dil.nii.gz', - '--processes', '1', '--distance', '2') + '--processes', '1', '--distance', '2']) assert ret.success diff --git a/scripts/tests/test_labels_from_mask.py b/scripts/tests/test_labels_from_mask.py index dc6cb53d7..7b39378d2 100644 --- a/scripts/tests/test_labels_from_mask.py +++ b/scripts/tests/test_labels_from_mask.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_labels_from_mask.py', '--help') + ret = script_runner.run(['scil_labels_from_mask.py', '--help']) assert ret.success @@ -22,9 +22,9 @@ def test_execution(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_labels_from_mask.py', + ret = script_runner.run(['scil_labels_from_mask.py', in_mask, 'labels_from_mask.nii.gz', - '--min_volume', '0', '-f') + '--min_volume', '0', '-f']) assert ret.success @@ -33,9 +33,9 @@ def test_execution_labels(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_labels_from_mask.py', + ret = script_runner.run(['scil_labels_from_mask.py', in_mask, 'labels_from_mask.nii.gz', - '--labels', '4', '6', '-f') + '--labels', '4', '6', '-f']) assert ret.success @@ -44,9 +44,9 @@ def test_execution_background(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_labels_from_mask.py', + ret = script_runner.run(['scil_labels_from_mask.py', in_mask, 'labels_from_mask.nii.gz', - '--background_label', '9', '-f') + '--background_label', '9', '-f']) assert ret.success @@ -55,9 +55,9 @@ def test_execution_error(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_labels_from_mask.py', + ret = script_runner.run(['scil_labels_from_mask.py', in_mask, 'labels_from_mask.nii.gz', - '--labels', '1') + '--labels', '1']) assert not ret.success @@ -66,9 +66,9 @@ def test_execution_warning(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_labels_from_mask.py', + ret = script_runner.run(['scil_labels_from_mask.py', in_mask, 'labels_from_mask.nii.gz', - '--labels', '1', '2', '3', '-f') + '--labels', '1', '2', '3', '-f']) assert ret.success assert ret.stderr # Check if there is a warning message @@ -78,8 +78,8 @@ def test_execution_background_warning(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_labels_from_mask.py', + ret = script_runner.run(['scil_labels_from_mask.py', in_mask, 'labels_from_mask.nii.gz', - '--background_label', '1', '-f') + '--background_label', '1', '-f']) assert ret.success assert ret.stderr # Check if there is a warning message diff --git a/scripts/tests/test_labels_remove.py b/scripts/tests/test_labels_remove.py index 31521bd37..83e468e5a 100644 --- a/scripts/tests/test_labels_remove.py +++ b/scripts/tests/test_labels_remove.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_labels_remove.py', '--help') + ret = script_runner.run(['scil_labels_remove.py', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run('scil_labels_remove.py', in_atlas, + ret = script_runner.run(['scil_labels_remove.py', in_atlas, 'atlas_freesurfer_v2_no_brainstem.nii.gz', - '-i', '173', '174', '175') + '-i', '173', '174', '175']) assert ret.success diff --git a/scripts/tests/test_labels_split_volume_by_ids.py b/scripts/tests/test_labels_split_volume_by_ids.py index 73c41a3e7..1dffb9cf4 100644 --- a/scripts/tests/test_labels_split_volume_by_ids.py +++ b/scripts/tests/test_labels_split_volume_by_ids.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_labels_split_volume_by_ids.py', '--help') + ret = script_runner.run(['scil_labels_split_volume_by_ids.py', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run('scil_labels_split_volume_by_ids.py', in_atlas, - '--out_prefix', 'brainstem', '-r', '173', '175') + ret = script_runner.run(['scil_labels_split_volume_by_ids.py', in_atlas, + '--out_prefix', 'brainstem', '-r', '173', '175']) assert ret.success diff --git a/scripts/tests/test_labels_split_volume_from_lut.py b/scripts/tests/test_labels_split_volume_from_lut.py index 782ed7ac8..96c5b0eea 100644 --- a/scripts/tests/test_labels_split_volume_from_lut.py +++ b/scripts/tests/test_labels_split_volume_from_lut.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_labels_split_volume_from_lut.py', '--help') + ret = script_runner.run(['scil_labels_split_volume_from_lut.py', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_atlas(script_runner, monkeypatch): 'atlas_freesurfer_v2.nii.gz') in_json = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_LUT.json') - ret = script_runner.run('scil_labels_split_volume_from_lut.py', in_atlas, + ret = script_runner.run(['scil_labels_split_volume_from_lut.py', in_atlas, '--out_prefix', 'brainstem', - '--custom_lut', in_json) + '--custom_lut', in_json]) assert ret.success diff --git a/scripts/tests/test_lesions_generate_nawm.py b/scripts/tests/test_lesions_generate_nawm.py index 9c3134d7d..2a2711db1 100644 --- a/scripts/tests/test_lesions_generate_nawm.py +++ b/scripts/tests/test_lesions_generate_nawm.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_lesions_generate_nawm.py', '--help') + ret = script_runner.run(['scil_lesions_generate_nawm.py', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_single_brainstem.nii.gz') - ret = script_runner.run('scil_lesions_generate_nawm.py', in_atlas, + ret = script_runner.run(['scil_lesions_generate_nawm.py', in_atlas, 'nawm.nii.gz', '--nb_ring', '3', - '--ring_thickness', '2') + '--ring_thickness', '2']) assert ret.success diff --git a/scripts/tests/test_lesions_info.py b/scripts/tests/test_lesions_info.py index 1c667997d..e2b0434d4 100644 --- a/scripts/tests/test_lesions_info.py +++ b/scripts/tests/test_lesions_info.py @@ -2,5 +2,5 @@ # -*- coding: utf-8 -*- def test_help_option(script_runner): - ret = script_runner.run('scil_lesions_info.py', '--help') + ret = script_runner.run(['scil_lesions_info.py', '--help']) assert ret.success diff --git a/scripts/tests/test_mrds_metrics.py b/scripts/tests/test_mrds_metrics.py index 62b4a8cfc..f38e8cea2 100644 --- a/scripts/tests/test_mrds_metrics.py +++ b/scripts/tests/test_mrds_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_mrds_metrics.py', '--help') + ret = script_runner.run(['scil_mrds_metrics.py', '--help']) assert ret.success @@ -24,9 +24,9 @@ def test_execution_mrds_all_metrics(script_runner, monkeypatch): 'mrds', 'sub-01_MRDS_eigenvalues.nii.gz') # no option - ret = script_runner.run('scil_mrds_metrics.py', + ret = script_runner.run(['scil_mrds_metrics.py', in_evals, - '-f') + '-f']) assert ret.success @@ -38,7 +38,7 @@ def test_execution_mrds_not_all_metrics(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'mrds', 'sub-01_mask.nii.gz') # no option - ret = script_runner.run('scil_mrds_metrics.py', + ret = script_runner.run(['scil_mrds_metrics.py', in_evals, '--mask', in_mask, '--not_all', @@ -46,5 +46,5 @@ def test_execution_mrds_not_all_metrics(script_runner, monkeypatch): '--ad', 'sub-01_MRDS_AD.nii.gz', '--rd', 'sub-01_MRDS_RD.nii.gz', '--md', 'sub-01_MRDS_MD.nii.gz', - '-f') + '-f']) assert ret.success diff --git a/scripts/tests/test_mrds_select_number_of_tensors.py b/scripts/tests/test_mrds_select_number_of_tensors.py index 7602c3104..7fa14453b 100644 --- a/scripts/tests/test_mrds_select_number_of_tensors.py +++ b/scripts/tests/test_mrds_select_number_of_tensors.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_mrds_select_number_of_tensors.py', '--help') + ret = script_runner.run(['scil_mrds_select_number_of_tensors.py', '--help']) assert ret.success @@ -23,10 +23,10 @@ def test_execution_mrds(script_runner, monkeypatch): in_nufo = os.path.join(SCILPY_HOME, 'mrds', 'sub-01_nufo.nii.gz') # no option - ret = script_runner.run('scil_mrds_select_number_of_tensors.py', + ret = script_runner.run(['scil_mrds_select_number_of_tensors.py', SCILPY_HOME + '/mrds/sub-01', in_nufo, - '-f') + '-f']) assert ret.success @@ -38,9 +38,9 @@ def test_execution_mrds_w_mask(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'mrds', 'sub-01_mask.nii.gz') - ret = script_runner.run('scil_mrds_select_number_of_tensors.py', + ret = script_runner.run(['scil_mrds_select_number_of_tensors.py', SCILPY_HOME + '/mrds/sub-01', in_nufo, '--mask', in_mask, - '-f') + '-f']) assert ret.success diff --git a/scripts/tests/test_mti_adjust_B1_header.py b/scripts/tests/test_mti_adjust_B1_header.py index 2770403d8..52d2abb74 100644 --- a/scripts/tests/test_mti_adjust_B1_header.py +++ b/scripts/tests/test_mti_adjust_B1_header.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_mti_adjust_B1_header.py', '--help') + ret = script_runner.run(['scil_mti_adjust_B1_header.py', '--help']) assert ret.success @@ -26,6 +26,6 @@ def test_execution_ihMT_no_option(script_runner, monkeypatch): 'MT', 'sub-001_run-01_B1map.json') # no option - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, - tmp_dir.name, in_b1_json, '-f') + ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + tmp_dir.name, in_b1_json, '-f']) assert ret.success diff --git a/scripts/tests/test_mti_maps_MT.py b/scripts/tests/test_mti_maps_MT.py index 3c893bd37..1077e8bfa 100644 --- a/scripts/tests/test_mti_maps_MT.py +++ b/scripts/tests/test_mti_maps_MT.py @@ -58,7 +58,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_mti_maps_MT.py', '--help') + ret = script_runner.run(['scil_mti_maps_MT.py', '--help']) assert ret.success @@ -66,7 +66,7 @@ def test_execution_MT_no_option(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # no option - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -75,7 +75,7 @@ def test_execution_MT_no_option(script_runner, monkeypatch): '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, in_e4_t1w, in_e5_t1w, '--in_jsons', in_mtoff_json, in_t1w_json, - '-f') + '-f']) assert ret.success @@ -83,7 +83,7 @@ def test_execution_MT_prefix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --out_prefix - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -93,7 +93,7 @@ def test_execution_MT_prefix(script_runner, monkeypatch): in_e4_t1w, in_e5_t1w, '--in_jsons', in_mtoff_json, in_t1w_json, '--out_prefix', 'sub_01', - '-f') + '-f']) assert ret.success @@ -101,7 +101,7 @@ def test_execution_MT_extended(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --extended - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -111,7 +111,7 @@ def test_execution_MT_extended(script_runner, monkeypatch): in_e4_t1w, in_e5_t1w, '--in_jsons', in_mtoff_json, in_t1w_json, '--extended', - '-f') + '-f']) assert ret.success @@ -119,7 +119,7 @@ def test_execution_MT_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --filtering - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -129,7 +129,7 @@ def test_execution_MT_filtering(script_runner, monkeypatch): in_e4_t1w, in_e5_t1w, '--in_jsons', in_mtoff_json, in_t1w_json, '--filtering', - '-f') + '-f']) assert ret.success @@ -139,11 +139,11 @@ def test_execution_MT_B1_map(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, - out_b1_map, in_b1_json, '-f') + ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + out_b1_map, in_b1_json, '-f']) # --in_B1_map - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -157,7 +157,7 @@ def test_execution_MT_B1_map(script_runner, monkeypatch): '--in_B1_map', out_b1_map, '--B1_correction_method', 'empiric', '--out_prefix', 'sub-01', - '-f') + '-f']) assert ret.success @@ -165,7 +165,7 @@ def test_execution_MT_wrong_echoes(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # Wrong number of echoes for negative - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -176,7 +176,7 @@ def test_execution_MT_wrong_echoes(script_runner, monkeypatch): '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, in_e4_t1w, in_e5_t1w, '--in_jsons', in_mtoff_json, in_t1w_json, - '-f') + '-f']) assert (not ret.success) @@ -184,14 +184,14 @@ def test_execution_MT_single_echoe(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # Single echoe - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, '--in_positive', in_e1_mton, '--in_negative', in_e1_mton, '--in_mtoff_t1', in_e1_t1w, '--in_jsons', in_mtoff_json, in_t1w_json, - '-f') + '-f']) assert ret.success @@ -201,11 +201,11 @@ def test_execution_MT_B1_not_T1(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, - out_b1_map, in_b1_json, '-f') + ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + out_b1_map, in_b1_json, '-f']) # B1 no T1 should raise warning. - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, '--in_positive', in_e1_mton, @@ -213,7 +213,7 @@ def test_execution_MT_B1_not_T1(script_runner, monkeypatch): '--in_jsons', in_mtoff_json, in_t1w_json, '--in_B1_map', out_b1_map, '--B1_correction_method', 'empiric', - '-f') + '-f']) assert ret.success @@ -223,11 +223,11 @@ def test_execution_MT_B1_no_fit(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, - out_b1_map, in_b1_json, '-f') + ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + out_b1_map, in_b1_json, '-f']) # B1 model_based but no fit values - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, '--in_positive', in_e1_mton, @@ -236,7 +236,7 @@ def test_execution_MT_B1_no_fit(script_runner, monkeypatch): '--in_jsons', in_mtoff_json, in_t1w_json, '--in_B1_map', out_b1_map, '--B1_correction_method', 'model_based', - '-f') + '-f']) assert (not ret.success) @@ -244,12 +244,12 @@ def test_execution_MT_acq_params(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # Acquisition parameters - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, '--in_positive', in_e1_mton, '--in_negative', in_e1_mton, '--in_mtoff_t1', in_e1_t1w, '--in_acq_parameters', "15", "15", "0.1", "0.1", - '-f') + '-f']) assert ret.success diff --git a/scripts/tests/test_mti_maps_ihMT.py b/scripts/tests/test_mti_maps_ihMT.py index 27476dd23..9876b2276 100644 --- a/scripts/tests/test_mti_maps_ihMT.py +++ b/scripts/tests/test_mti_maps_ihMT.py @@ -67,7 +67,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_mti_maps_ihMT.py', '--help') + ret = script_runner.run(['scil_mti_maps_ihMT.py', '--help']) assert ret.success @@ -75,7 +75,7 @@ def test_execution_ihMT_no_option(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # no option - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -89,7 +89,7 @@ def test_execution_ihMT_no_option(script_runner, monkeypatch): in_e3_mtoff_t1, '--in_jsons', in_mtoff_pd_json, in_mtoff_t1_json, - '-f') + '-f']) assert ret.success @@ -97,7 +97,7 @@ def test_execution_ihMT_prefix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --out_prefix - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -114,7 +114,7 @@ def test_execution_ihMT_prefix(script_runner, monkeypatch): '--in_jsons', in_mtoff_pd_json, in_mtoff_t1_json, '--out_prefix', 'sub_01', - '-f') + '-f']) assert ret.success @@ -122,7 +122,7 @@ def test_execution_ihMT_extended(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --extended - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -139,7 +139,7 @@ def test_execution_ihMT_extended(script_runner, monkeypatch): '--in_jsons', in_mtoff_pd_json, in_mtoff_t1_json, '--extended', - '-f') + '-f']) assert ret.success @@ -147,7 +147,7 @@ def test_execution_ihMT_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --filtering - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -163,7 +163,7 @@ def test_execution_ihMT_filtering(script_runner, monkeypatch): in_mtoff_t1_json, '--out_prefix', 'sub-01', '--filtering', - '-f') + '-f']) assert ret.success @@ -173,10 +173,10 @@ def test_execution_ihMT_B1_map(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, - out_b1_map, in_b1_json, '-f') + ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + out_b1_map, in_b1_json, '-f']) - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -193,7 +193,7 @@ def test_execution_ihMT_B1_map(script_runner, monkeypatch): '--B1_correction_method', 'empiric', '--in_jsons', in_mtoff_pd_json, in_mtoff_t1_json, - '-f') + '-f']) assert ret.success @@ -203,10 +203,10 @@ def test_execution_ihMT_B1_no_T1(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, - out_b1_map, in_b1_json, '-f') + ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + out_b1_map, in_b1_json, '-f']) - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -220,14 +220,14 @@ def test_execution_ihMT_B1_no_T1(script_runner, monkeypatch): '--B1_correction_method', 'empiric', '--in_jsons', in_mtoff_pd_json, in_mtoff_t1_json, - '-f') + '-f']) assert ret.success def test_execution_ihMT_wrong_echoes(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -240,7 +240,7 @@ def test_execution_ihMT_wrong_echoes(script_runner, monkeypatch): '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, '--in_jsons', in_mtoff_pd_json, in_mtoff_t1_json, - '-f') + '-f']) assert (not ret.success) @@ -250,10 +250,10 @@ def test_execution_ihMT_B1_no_fit(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, - out_b1_map, in_b1_json, '-f') + ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + out_b1_map, in_b1_json, '-f']) - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -270,14 +270,14 @@ def test_execution_ihMT_B1_no_fit(script_runner, monkeypatch): '--B1_correction_method', 'model_based', '--in_jsons', in_mtoff_pd_json, in_mtoff_t1_json, - '-f') + '-f']) assert (not ret.success) def test_execution_ihMT_single_echo(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, '--in_altpn', in_e1_altpn, @@ -287,14 +287,14 @@ def test_execution_ihMT_single_echo(script_runner, monkeypatch): '--in_mtoff_t1', in_e1_mtoff_t1, '--out_prefix', 'sub_01', '--in_jsons', in_mtoff_pd_json, - in_mtoff_t1_json, '-f') + in_mtoff_t1_json, '-f']) assert ret.success def test_execution_ihMT_acq_params(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, '--in_altpn', in_e1_altpn, @@ -304,5 +304,5 @@ def test_execution_ihMT_acq_params(script_runner, monkeypatch): '--in_mtoff_t1', in_e1_mtoff_t1, '--out_prefix', 'sub_01', '--in_acq_parameters', '15', '15', '0.1', '0.1', - '-f') + '-f']) assert ret.success diff --git a/scripts/tests/test_plot_stats_per_point.py b/scripts/tests/test_plot_stats_per_point.py index 3c72c7721..9e6bc54a8 100644 --- a/scripts/tests/test_plot_stats_per_point.py +++ b/scripts/tests/test_plot_stats_per_point.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_plot_stats_per_point.py', '--help') + ret = script_runner.run(['scil_plot_stats_per_point.py', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_json = os.path.join(SCILPY_HOME, 'tractometry', 'metric_label.json') - ret = script_runner.run('scil_plot_stats_per_point.py', in_json, - 'out/', '--stats_over_population') + ret = script_runner.run(['scil_plot_stats_per_point.py', in_json, + 'out/', '--stats_over_population']) assert ret.success diff --git a/scripts/tests/test_qball_metrics.py b/scripts/tests/test_qball_metrics.py index 0a44b4659..38da046c2 100644 --- a/scripts/tests/test_qball_metrics.py +++ b/scripts/tests/test_qball_metrics.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_qball_metrics.py', '--help') + ret = script_runner.run(['scil_qball_metrics.py', '--help']) assert ret.success @@ -24,8 +24,8 @@ def test_execution_processing(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_qball_metrics.py', in_dwi, - in_bval, in_bvec) + ret = script_runner.run(['scil_qball_metrics.py', in_dwi, + in_bval, in_bvec]) assert ret.success @@ -37,12 +37,12 @@ def test_execution_not_all(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_qball_metrics.py', in_dwi, - in_bval, in_bvec, "--not_all", "--sh", "2.nii.gz") + ret = script_runner.run(['scil_qball_metrics.py', in_dwi, + in_bval, in_bvec, "--not_all", "--sh", "2.nii.gz"]) assert ret.success # Test wrong b0. Current minimal b-val is 5. - ret = script_runner.run('scil_qball_metrics.py', in_dwi, + ret = script_runner.run(['scil_qball_metrics.py', in_dwi, in_bval, in_bvec, "--not_all", "--sh", "2.nii.gz", - '--b0_threshold', '1', '-f') + '--b0_threshold', '1', '-f']) assert not ret.success diff --git a/scripts/tests/test_rgb_convert.py b/scripts/tests/test_rgb_convert.py index 0936de0f0..c85f214c0 100644 --- a/scripts/tests/test_rgb_convert.py +++ b/scripts/tests/test_rgb_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_rgb_convert.py', '--help') + ret = script_runner.run(['scil_rgb_convert.py', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'rgb.nii.gz') - ret = script_runner.run('scil_rgb_convert.py', - in_img, 'rgb_4D.nii.gz') + ret = script_runner.run(['scil_rgb_convert.py', + in_img, 'rgb_4D.nii.gz']) assert ret.success diff --git a/scripts/tests/test_search_keywords.py b/scripts/tests/test_search_keywords.py index 44dd6c907..d9edfa778 100644 --- a/scripts/tests/test_search_keywords.py +++ b/scripts/tests/test_search_keywords.py @@ -3,21 +3,21 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_search_keywords.py', '--help') + ret = script_runner.run(['scil_search_keywords.py', '--help']) assert ret.success def test_search_category(script_runner): - ret = script_runner.run('scil_search_keywords.py', '--search_category', 'sh') + ret = script_runner.run(['scil_search_keywords.py', '--search_category', 'sh']) assert 'Available objects:' in ret.stdout def test_no_synonyms(script_runner): - ret = script_runner.run('scil_search_keywords.py', 'sh', '--no_synonyms') + ret = script_runner.run(['scil_search_keywords.py', 'sh', '--no_synonyms']) assert ret.success def test_not_found(script_runner): - ret = script_runner.run('scil_search_keywords.py', 'toto') + ret = script_runner.run(['scil_search_keywords.py', 'toto']) assert ret.success assert 'No results found!' in ret.stdout or 'No results found!' in ret.stderr diff --git a/scripts/tests/test_sh_convert.py b/scripts/tests/test_sh_convert.py index ca8549893..4fb9f4371 100644 --- a/scripts/tests/test_sh_convert.py +++ b/scripts/tests/test_sh_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_sh_convert.py', '--help') + ret = script_runner.run(['scil_sh_convert.py', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf.nii.gz') - ret = script_runner.run('scil_sh_convert.py', in_fodf, + ret = script_runner.run(['scil_sh_convert.py', in_fodf, 'fodf_descoteaux07.nii.gz', 'tournier07', - 'descoteaux07_legacy', '--processes', '1') + 'descoteaux07_legacy', '--processes', '1']) assert ret.success diff --git a/scripts/tests/test_sh_fusion.py b/scripts/tests/test_sh_fusion.py index dc6b07a6e..536dbfa93 100644 --- a/scripts/tests/test_sh_fusion.py +++ b/scripts/tests/test_sh_fusion.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_sh_fusion.py', '--help') + ret = script_runner.run(['scil_sh_fusion.py', '--help']) assert ret.success @@ -23,5 +23,5 @@ def test_execution_processing(script_runner, monkeypatch): 'sh_1000.nii.gz') in_sh_2 = os.path.join(SCILPY_HOME, 'processing', 'sh_3000.nii.gz') - ret = script_runner.run('scil_sh_fusion.py', in_sh_1, in_sh_2, 'sh.nii.gz') + ret = script_runner.run(['scil_sh_fusion.py', in_sh_1, in_sh_2, 'sh.nii.gz']) assert ret.success diff --git a/scripts/tests/test_sh_to_aodf.py b/scripts/tests/test_sh_to_aodf.py index 17a9c819d..18368b76f 100644 --- a/scripts/tests/test_sh_to_aodf.py +++ b/scripts/tests/test_sh_to_aodf.py @@ -17,7 +17,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_sh_to_aodf.py', '--help') + ret = script_runner.run(['scil_sh_to_aodf.py', '--help']) assert ret.success @@ -28,7 +28,7 @@ def test_help_option(script_runner): def test_asym_basis_output_gpu(script_runner, in_fodf, expected_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_sh_to_aodf.py', + ret = script_runner.run(['scil_sh_to_aodf.py', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', '--sigma_align', '0.8', @@ -39,7 +39,7 @@ def test_asym_basis_output_gpu(script_runner, in_fodf, expected_fodf, monkeypatc '--device', 'gpu', '--sh_basis', 'descoteaux07_legacy', '-f', '--include_center', - print_result=True, shell=True) + print_result=True, shell=True]) if have_opencl: # if we have opencl the script should not raise an error @@ -64,7 +64,7 @@ def test_asym_basis_output_gpu(script_runner, in_fodf, expected_fodf, monkeypatc def test_asym_basis_output(script_runner, in_fodf, expected_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_sh_to_aodf.py', + ret = script_runner.run(['scil_sh_to_aodf.py', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', '--sigma_align', '0.8', @@ -74,7 +74,7 @@ def test_asym_basis_output(script_runner, in_fodf, expected_fodf, monkeypatch): '--device', 'cpu', '--sh_basis', 'descoteaux07_legacy', '-f', '--include_center', - print_result=True, shell=True) + print_result=True, shell=True]) assert ret.success @@ -91,7 +91,7 @@ def test_asym_basis_output(script_runner, in_fodf, expected_fodf, monkeypatch): def test_asym_input(script_runner, in_fodf, expected_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_sh_to_aodf.py', + ret = script_runner.run(['scil_sh_to_aodf.py', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', '--sigma_align', '0.8', @@ -101,7 +101,7 @@ def test_asym_input(script_runner, in_fodf, expected_fodf, monkeypatch): '--device', 'cpu', '--sh_basis', 'descoteaux07_legacy', '-f', '--include_center', - print_result=True, shell=True) + print_result=True, shell=True]) assert ret.success @@ -117,12 +117,12 @@ def test_asym_input(script_runner, in_fodf, expected_fodf, monkeypatch): def test_cosine_method(script_runner, in_fodf, out_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_sh_to_aodf.py', + ret = script_runner.run(['scil_sh_to_aodf.py', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', '--method', 'cosine', '-f', '--sh_basis', 'descoteaux07_legacy', - print_result=True, shell=True) + print_result=True, shell=True]) assert ret.success diff --git a/scripts/tests/test_sh_to_rish.py b/scripts/tests/test_sh_to_rish.py index 6568c29b9..469a4ea74 100644 --- a/scripts/tests/test_sh_to_rish.py +++ b/scripts/tests/test_sh_to_rish.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_sh_to_rish.py', '--help') + ret = script_runner.run(['scil_sh_to_rish.py', '--help']) assert ret.success @@ -21,5 +21,5 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sh = os.path.join(SCILPY_HOME, 'processing', 'sh.nii.gz') - ret = script_runner.run('scil_sh_to_rish.py', in_sh, 'rish.nii.gz') + ret = script_runner.run(['scil_sh_to_rish.py', in_sh, 'rish.nii.gz']) assert ret.success diff --git a/scripts/tests/test_sh_to_sf.py b/scripts/tests/test_sh_to_sf.py index 8703876c3..adeb30760 100644 --- a/scripts/tests/test_sh_to_sf.py +++ b/scripts/tests/test_sh_to_sf.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_sh_to_sf.py', '--help') + ret = script_runner.run(['scil_sh_to_sf.py', '--help']) assert ret.success @@ -24,12 +24,12 @@ def test_execution_in_sphere(script_runner, monkeypatch): in_bval = os.path.join(SCILPY_HOME, 'processing', '1000.bval') # Required: either --sphere or --in_bvec. Here, --sphere - ret = script_runner.run('scil_sh_to_sf.py', in_sh, + ret = script_runner.run(['scil_sh_to_sf.py', in_sh, 'sf_724.nii.gz', '--in_bval', in_bval, '--in_b0', in_b0, '--out_bval', 'sf_724.bval', '--out_bvec', 'sf_724.bvec', '--sphere', 'symmetric724', '--dtype', 'float32', - '--processes', '1') + '--processes', '1']) assert ret.success @@ -40,20 +40,20 @@ def test_execution_in_bvec(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') # --in_bvec: in_bval is required. - ret = script_runner.run('scil_sh_to_sf.py', in_sh, + ret = script_runner.run(['scil_sh_to_sf.py', in_sh, 'sf_724.nii.gz', '--in_bval', in_bval, '--out_bval', 'sf_724.bval', '--out_bvec', 'sf_724.bvec', '--in_bvec', in_bvec, '--dtype', 'float32', '-f', - '--processes', '1') + '--processes', '1']) assert ret.success # Test that fails if no bvals is given. - ret = script_runner.run('scil_sh_to_sf.py', in_sh, + ret = script_runner.run(['scil_sh_to_sf.py', in_sh, 'sf_724.nii.gz', '--out_bvec', 'sf_724.bvec', '--in_bvec', in_bvec, '--dtype', 'float32', '-f', - '--processes', '1') + '--processes', '1']) assert not ret.success @@ -64,9 +64,9 @@ def test_execution_no_bval(script_runner, monkeypatch): # --sphere but no --bval # Testing multiprocessing option - ret = script_runner.run('scil_sh_to_sf.py', in_sh, + ret = script_runner.run(['scil_sh_to_sf.py', in_sh, 'sf_724.nii.gz', '--in_b0', in_b0, '--out_bvec', 'sf_724.bvec', '--b0_scaling', '--sphere', 'symmetric724', '--dtype', 'float32', - '-f', '--processes', '4') + '-f', '--processes', '4']) assert ret.success diff --git a/scripts/tests/test_stats_group_comparison.py b/scripts/tests/test_stats_group_comparison.py index 70b7a9364..4ccb475f9 100644 --- a/scripts/tests/test_stats_group_comparison.py +++ b/scripts/tests/test_stats_group_comparison.py @@ -13,9 +13,9 @@ def test_help_option(script_runner): - ret = script_runner.run( + ret = script_runner.run([ 'scil_stats_group_comparison.py', - '--help') + '--help']) assert ret.success @@ -25,11 +25,11 @@ def test_execution_bundles(script_runner, monkeypatch): in_participants = os.path.join(SCILPY_HOME, 'stats/group', 'meanstd_all.json') - ret = script_runner.run('scil_stats_group_comparison.py', + ret = script_runner.run(['scil_stats_group_comparison.py', in_participants, in_json, 'Group', '-b', 'AF_L', '-m', 'FIT_FW', '--va', 'mean', - '--gg') + '--gg']) assert ret.success diff --git a/scripts/tests/test_surface_apply_transform.py b/scripts/tests/test_surface_apply_transform.py index 80a0e6767..49182c9d1 100644 --- a/scripts/tests/test_surface_apply_transform.py +++ b/scripts/tests/test_surface_apply_transform.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_surface_apply_transform.py', '--help') + ret = script_runner.run(['scil_surface_apply_transform.py', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): 'lhpialt.vtk') in_aff = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'affine.txt') - ret = script_runner.run('scil_surface_apply_transform.py', in_surf, - in_aff, 'lhpialt_lin.vtk', '--inverse') + ret = script_runner.run(['scil_surface_apply_transform.py', in_surf, + in_aff, 'lhpialt_lin.vtk', '--inverse']) assert ret.success diff --git a/scripts/tests/test_surface_convert.py b/scripts/tests/test_surface_convert.py index d14cfc851..8e2ddbcae 100644 --- a/scripts/tests/test_surface_convert.py +++ b/scripts/tests/test_surface_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_surface_convert.py', '--help') + ret = script_runner.run(['scil_surface_convert.py', '--help']) assert ret.success @@ -21,8 +21,8 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lhpialt.vtk') - ret = script_runner.run('scil_surface_convert.py', in_surf, - 'rhpialt.ply') + ret = script_runner.run(['scil_surface_convert.py', in_surf, + 'rhpialt.ply']) assert ret.success @@ -31,7 +31,7 @@ def test_execution_surface_vtk_xfrom(script_runner, monkeypatch): in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lh.pialt_xform') ref = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') - ret = script_runner.run('scil_surface_convert.py', in_surf, + ret = script_runner.run(['scil_surface_convert.py', in_surf, 'lh.pialt_xform.vtk', '--reference', ref, - '--flip_axes', '-1', '-1', '1') + '--flip_axes', '-1', '-1', '1']) assert ret.success diff --git a/scripts/tests/test_surface_create.py b/scripts/tests/test_surface_create.py index fe15cb64f..6b08168c3 100644 --- a/scripts/tests/test_surface_create.py +++ b/scripts/tests/test_surface_create.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_surface_create.py', '--help') + ret = script_runner.run(['scil_surface_create.py', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run('scil_surface_create.py', + ret = script_runner.run(['scil_surface_create.py', '--in_labels', in_atlas, 'surface.vtk', '--list_indices', '2024:2035 1024', @@ -31,7 +31,7 @@ def test_execution_atlas(script_runner, monkeypatch): '--erosion', '1', '--dilation', '1', '--opening', '1', - '--closing', '1', '-f') + '--closing', '1', '-f']) assert ret.success @@ -39,7 +39,7 @@ def test_execution_atlas_each_index(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run('scil_surface_create.py', + ret = script_runner.run(['scil_surface_create.py', '--in_labels', in_atlas, 'surface.vtk', '--each_index', @@ -49,7 +49,7 @@ def test_execution_atlas_each_index(script_runner, monkeypatch): '--dilation', '1', '--opening', '1', '--closing', '1', - '--vtk2vox', '-f') + '--vtk2vox', '-f']) assert ret.success @@ -57,7 +57,7 @@ def test_execution_atlas_no_index(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run('scil_surface_create.py', + ret = script_runner.run(['scil_surface_create.py', '--in_labels', in_atlas, 'surface.vtk', '--fill', @@ -65,7 +65,7 @@ def test_execution_atlas_no_index(script_runner, monkeypatch): '--erosion', '1', '--dilation', '1', '--opening', '1', - '--closing', '1', '-f') + '--closing', '1', '-f']) assert ret.success @@ -73,9 +73,9 @@ def test_execution_mask(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_mask = os.path.join(SCILPY_HOME, 'atlas', 'brainstem_bin.nii.gz') - ret = script_runner.run('scil_surface_create.py', + ret = script_runner.run(['scil_surface_create.py', '--in_mask', in_mask, - 'surface.vtk', '-f') + 'surface.vtk', '-f']) assert ret.success @@ -83,8 +83,8 @@ def test_execution_volume(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_t1 = os.path.join(SCILPY_HOME, 'others', 't1.nii.gz') - ret = script_runner.run('scil_surface_create.py', + ret = script_runner.run(['scil_surface_create.py', '--in_volume', in_t1, '--value', '0.2', - 'surface.vtk', '-f') + 'surface.vtk', '-f']) assert ret.success diff --git a/scripts/tests/test_surface_flip.py b/scripts/tests/test_surface_flip.py index 6ebf77018..0b8880827 100644 --- a/scripts/tests/test_surface_flip.py +++ b/scripts/tests/test_surface_flip.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_surface_flip.py', '--help') + ret = script_runner.run(['scil_surface_flip.py', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lhpialt.vtk') - ret = script_runner.run('scil_surface_flip.py', in_surf, 'rhpialt.vtk', - 'x') + ret = script_runner.run(['scil_surface_flip.py', in_surf, 'rhpialt.vtk', + 'x']) assert ret.success diff --git a/scripts/tests/test_surface_smooth.py b/scripts/tests/test_surface_smooth.py index 11d0b8e58..3b79d4717 100644 --- a/scripts/tests/test_surface_smooth.py +++ b/scripts/tests/test_surface_smooth.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_surface_smooth.py', '--help') + ret = script_runner.run(['scil_surface_smooth.py', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lhpialt.vtk') - ret = script_runner.run('scil_surface_smooth.py', in_surf, - 'lhpialt_smooth.vtk', '-n', '5', '-s', '1') + ret = script_runner.run(['scil_surface_smooth.py', in_surf, + 'lhpialt_smooth.vtk', '-n', '5', '-s', '1']) assert ret.success diff --git a/scripts/tests/test_tracking_local.py b/scripts/tests/test_tracking_local.py index 38f89a3e9..fafd8760d 100644 --- a/scripts/tests/test_tracking_local.py +++ b/scripts/tests/test_tracking_local.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tracking_local.py', '--help') + ret = script_runner.run(['scil_tracking_local.py', '--help']) assert ret.success @@ -26,10 +26,10 @@ def test_execution_tracking_fodf_prob(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'local_prob.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200') + '--min_length', '20', '--max_length', '200']) assert ret.success @@ -38,11 +38,11 @@ def test_execution_tracking_fodf_det(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'local_det.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', - '--algo', 'det') + '--algo', 'det']) assert ret.success @@ -51,11 +51,11 @@ def test_execution_tracking_ptt(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'local_ptt.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', - '--algo', 'ptt', '-f') + '--algo', 'ptt', '-f']) assert ret.success @@ -64,12 +64,12 @@ def test_execution_sphere_subdivide(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'local_sphere.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', - '--sub_sphere', '2') + '--sub_sphere', '2']) assert ret.success @@ -78,10 +78,10 @@ def test_execution_sphere_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'sphere_gpu.trk', '--use_gpu', '--sphere', 'symmetric362', - '--npv', '1') + '--npv', '1']) assert not ret.success @@ -91,9 +91,9 @@ def test_sh_interp_without_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'nearest_interp.trk', - '--sh_interp', 'nearest', '--nt', '100') + '--sh_interp', 'nearest', '--nt', '100']) assert not ret.success @@ -103,9 +103,9 @@ def test_forward_without_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'fwd_only.trk', - '--forward_only', '--nt', '100') + '--forward_only', '--nt', '100']) assert not ret.success @@ -115,9 +115,9 @@ def test_batch_size_without_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'batch.trk', - '--batch_size', 100) + '--batch_size', 100]) assert not ret.success @@ -127,9 +127,9 @@ def test_algo_with_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'gpu_det.trk', '--algo', - 'det', '--use_gpu', '--nt', '100') + 'det', '--use_gpu', '--nt', '100']) assert not ret.success @@ -139,10 +139,10 @@ def test_execution_tracking_fodf_no_compression(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'local_prob2.trk', '--nt', '100', '--sh_basis', 'descoteaux07', - '--max_length', '200') + '--max_length', '200']) assert ret.success @@ -151,11 +151,11 @@ def test_execution_tracking_peaks(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_peaks = os.path.join(SCILPY_HOME, 'tracking', 'peaks.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_peaks, + ret = script_runner.run(['scil_tracking_local.py', in_peaks, in_mask, in_mask, 'local_eudx.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', - '--algo', 'eudx') + '--algo', 'eudx']) assert ret.success @@ -164,11 +164,11 @@ def test_execution_tracking_fodf_prob_pmf_mapping(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'local_prob3.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', - '--sh_to_pmf', '-v') + '--sh_to_pmf', '-v']) assert ret.success @@ -177,12 +177,12 @@ def test_execution_tracking_ptt_with_probe(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'local_ptt.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', '--sh_to_pmf', '-v', '--probe_length', '2', - '--probe_quality', '5', '--algo', 'ptt', '-f') + '--probe_quality', '5', '--algo', 'ptt', '-f']) assert ret.success @@ -195,9 +195,9 @@ def test_execution_tracking_fodf_custom_seeds(script_runner, monkeypatch): custom_seeds = [[1., 1., 1.], [2., 2., 2.], [3., 3., 3.]] np.save(in_custom_seeds, custom_seeds) - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local.py', in_fodf, in_mask, in_mask, 'local_prob4.trk', '--in_custom_seeds', in_custom_seeds, '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200') + '--min_length', '20', '--max_length', '200']) assert ret.success diff --git a/scripts/tests/test_tracking_local_dev.py b/scripts/tests/test_tracking_local_dev.py index 38d79d01b..460fdd139 100644 --- a/scripts/tests/test_tracking_local_dev.py +++ b/scripts/tests/test_tracking_local_dev.py @@ -14,8 +14,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tracking_local_dev.py', - '--help') + ret = script_runner.run(['scil_tracking_local_dev.py', + '--help']) assert ret.success @@ -25,13 +25,13 @@ def test_execution_tracking_fodf(script_runner, monkeypatch): 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local_dev.py', in_fodf, + ret = script_runner.run(['scil_tracking_local_dev.py', in_fodf, in_mask, in_mask, 'local_prob.trk', '--nt', '10', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', '--save_seeds', '--rng_seed', '0', '--sub_sphere', '2', - '--rk_order', '4') + '--rk_order', '4']) assert ret.success @@ -44,7 +44,7 @@ def test_execution_tracking_rap(script_runner, monkeypatch): in_rap_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local_dev.py', in_fodf, + ret = script_runner.run(['scil_tracking_local_dev.py', in_fodf, in_mask, in_mask, 'local_prob_rap.trk', '--nt', '10', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -52,7 +52,7 @@ def test_execution_tracking_rap(script_runner, monkeypatch): '--sub_sphere', '2', '--rk_order', '1', '--rap_mask', in_rap_mask, - '--rap_method', "continue") + '--rap_method', "continue"]) assert ret.success @@ -67,12 +67,12 @@ def test_execution_tracking_fodf_custom_seeds(script_runner, monkeypatch): custom_seeds = [[1., 1., 1.], [2., 2., 2.], [3., 3., 3.]] np.save(in_custom_seeds, custom_seeds) - ret = script_runner.run('scil_tracking_local_dev.py', in_fodf, + ret = script_runner.run(['scil_tracking_local_dev.py', in_fodf, in_mask, in_mask, 'local_prob2.trk', '--in_custom_seeds', in_custom_seeds, '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', '--save_seeds', '--rng_seed', '0', '--sub_sphere', '2', - '--rk_order', '4') + '--rk_order', '4']) assert ret.success diff --git a/scripts/tests/test_tracking_pft.py b/scripts/tests/test_tracking_pft.py index 08529e281..d2e221212 100644 --- a/scripts/tests/test_tracking_pft.py +++ b/scripts/tests/test_tracking_pft.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tracking_pft.py', - '--help') + ret = script_runner.run(['scil_tracking_pft.py', + '--help']) assert ret.success @@ -28,9 +28,9 @@ def test_execution_tracking(script_runner, monkeypatch): 'map_include.nii.gz') in_exclude = os.path.join(SCILPY_HOME, 'tracking', 'map_exclude.nii.gz') - ret = script_runner.run('scil_tracking_pft.py', in_fodf, + ret = script_runner.run(['scil_tracking_pft.py', in_fodf, in_interface, in_include, in_exclude, 'pft.trk', '--nt', '1000', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', - '--max_length', '200') + '--max_length', '200']) assert ret.success diff --git a/scripts/tests/test_tracking_pft_maps.py b/scripts/tests/test_tracking_pft_maps.py index a21ad0d5d..49def8ad9 100644 --- a/scripts/tests/test_tracking_pft_maps.py +++ b/scripts/tests/test_tracking_pft_maps.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tracking_pft_maps.py', - '--help') + ret = script_runner.run(['scil_tracking_pft_maps.py', + '--help']) assert ret.success @@ -26,6 +26,6 @@ def test_execution_tracking(script_runner, monkeypatch): 'map_gm.nii.gz') in_csf = os.path.join(SCILPY_HOME, 'tracking', 'map_csf.nii.gz') - ret = script_runner.run('scil_tracking_pft_maps.py', - in_wm, in_gm, in_csf) + ret = script_runner.run(['scil_tracking_pft_maps.py', + in_wm, in_gm, in_csf]) assert ret.success diff --git a/scripts/tests/test_tracking_pft_maps_edit.py b/scripts/tests/test_tracking_pft_maps_edit.py index b08fe6bac..c092e666c 100644 --- a/scripts/tests/test_tracking_pft_maps_edit.py +++ b/scripts/tests/test_tracking_pft_maps_edit.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tracking_pft_maps_edit.py', '--help') + ret = script_runner.run(['scil_tracking_pft_maps_edit.py', '--help']) assert ret.success @@ -25,8 +25,8 @@ def test_execution_tracking(script_runner, monkeypatch): 'map_exclude.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_pft_maps_edit.py', + ret = script_runner.run(['scil_tracking_pft_maps_edit.py', in_include, in_exclude, in_mask, 'map_include_corr.nii.gz', - 'map_exclude_corr.nii.gz') + 'map_exclude_corr.nii.gz']) assert ret.success diff --git a/scripts/tests/test_tractogram_apply_transform.py b/scripts/tests/test_tractogram_apply_transform.py index 475db0441..354778587 100644 --- a/scripts/tests/test_tractogram_apply_transform.py +++ b/scripts/tests/test_tractogram_apply_transform.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_apply_transform.py', '--help') + ret = script_runner.run(['scil_tractogram_apply_transform.py', '--help']) assert ret.success @@ -24,8 +24,8 @@ def test_execution_inverse(script_runner, monkeypatch): in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') in_warp = os.path.join(SCILPY_HOME, 'bst', 'output1InverseWarp.nii.gz') - ret = script_runner.run('scil_tractogram_apply_transform.py', + ret = script_runner.run(['scil_tractogram_apply_transform.py', in_model, in_fa, in_aff, 'rpt_m_warp.trk', '--inverse', '--in_deformation', in_warp, - '--cut') + '--cut']) assert ret.success diff --git a/scripts/tests/test_tractogram_apply_transform_to_hdf5.py b/scripts/tests/test_tractogram_apply_transform_to_hdf5.py index a51d7fc1c..af34790d1 100644 --- a/scripts/tests/test_tractogram_apply_transform_to_hdf5.py +++ b/scripts/tests/test_tractogram_apply_transform_to_hdf5.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_apply_transform_to_hdf5.py', - '--help') + ret = script_runner.run(['scil_tractogram_apply_transform_to_hdf5.py', + '--help']) assert ret.success @@ -28,6 +28,6 @@ def test_execution_connectivity(script_runner, monkeypatch): # toDo. Add a --in_deformation file in our test data, fitting with hdf5. # (See test_tractogram_apply_transform) # toDo. Add some dps in the hdf5's data for more line coverage. - ret = script_runner.run('scil_tractogram_apply_transform_to_hdf5.py', - in_h5, in_target, in_transfo, 'decompose_lin.h5') + ret = script_runner.run(['scil_tractogram_apply_transform_to_hdf5.py', + in_h5, in_target, in_transfo, 'decompose_lin.h5']) assert ret.success diff --git a/scripts/tests/test_tractogram_assign_custom_color.py b/scripts/tests/test_tractogram_assign_custom_color.py index 10c5887fe..bc4fa6048 100644 --- a/scripts/tests/test_tractogram_assign_custom_color.py +++ b/scripts/tests/test_tractogram_assign_custom_color.py @@ -18,8 +18,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_assign_custom_color.py', - '--help') + ret = script_runner.run(['scil_tractogram_assign_custom_color.py', + '--help']) assert ret.success @@ -28,23 +28,23 @@ def test_execution_from_anat(script_runner, monkeypatch): in_anat = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run('scil_tractogram_assign_custom_color.py', + ret = script_runner.run(['scil_tractogram_assign_custom_color.py', in_bundle, 'colored.trk', '--from_anatomy', - in_anat, '--out_colorbar', 'test_colorbar.png') + in_anat, '--out_colorbar', 'test_colorbar.png']) assert ret.success def test_execution_along_profile(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_assign_custom_color.py', - in_bundle, 'colored2.trk', '--along_profile') + ret = script_runner.run(['scil_tractogram_assign_custom_color.py', + in_bundle, 'colored2.trk', '--along_profile']) assert ret.success def test_execution_from_angle(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_assign_custom_color.py', - in_bundle, 'colored3.trk', '--local_angle') + ret = script_runner.run(['scil_tractogram_assign_custom_color.py', + in_bundle, 'colored3.trk', '--local_angle']) assert ret.success diff --git a/scripts/tests/test_tractogram_assign_uniform_color.py b/scripts/tests/test_tractogram_assign_uniform_color.py index d22d951cd..172e7efc9 100644 --- a/scripts/tests/test_tractogram_assign_uniform_color.py +++ b/scripts/tests/test_tractogram_assign_uniform_color.py @@ -16,17 +16,17 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_assign_uniform_color.py', - '--help') + ret = script_runner.run(['scil_tractogram_assign_uniform_color.py', + '--help']) assert ret.success def test_execution_fill(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_assign_uniform_color.py', + ret = script_runner.run(['scil_tractogram_assign_uniform_color.py', in_bundle, '--fill_color', '0x000000', - '--out_tractogram', 'colored.trk', '-f') + '--out_tractogram', 'colored.trk', '-f']) assert ret.success @@ -39,9 +39,9 @@ def test_execution_dict(script_runner, monkeypatch): with open(json_file, "w+") as f: json.dump(my_dict, f) - ret = script_runner.run('scil_tractogram_assign_uniform_color.py', + ret = script_runner.run(['scil_tractogram_assign_uniform_color.py', in_bundle, '--dict_colors', json_file, - '--out_suffix', 'colored', '-f') + '--out_suffix', 'colored', '-f']) assert ret.success def test_execution_dict_new_color(script_runner, monkeypatch): @@ -54,8 +54,8 @@ def test_execution_dict_new_color(script_runner, monkeypatch): json.dump(my_dict, f) shutil.copy2(in_bundle, 'dummy.trk') - ret = script_runner.run('scil_tractogram_assign_uniform_color.py', + ret = script_runner.run(['scil_tractogram_assign_uniform_color.py', in_bundle, "dummy.trk", '--dict_colors', json_file, - '--out_suffix', 'colored', '-f') + '--out_suffix', 'colored', '-f']) assert ret.success diff --git a/scripts/tests/test_tractogram_commit.py b/scripts/tests/test_tractogram_commit.py index ca67913e9..0c6ed2a74 100644 --- a/scripts/tests/test_tractogram_commit.py +++ b/scripts/tests/test_tractogram_commit.py @@ -20,7 +20,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_commit.py', '--help') + ret = script_runner.run(['scil_tractogram_commit.py', '--help']) assert ret.success @@ -28,14 +28,14 @@ def test_execution_commit_amico(script_runner, monkeypatch): tmp_dir = tempfile.TemporaryDirectory() monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run( + ret = script_runner.run([ 'scil_tractogram_commit.py', in_tracking, in_dwi, in_bval, in_bvec, 'results_bzs/', '--tol', '30', '--nbr_dir', '500', '--nbr_iter', '500', '--in_peaks', in_peaks, '--in_tracking_mask', in_mask, '--perp_diff', '1.19E-3', '0.85E-3', '0.51E-3', '0.17E-3', '--iso_diff', '1.7E-3', '3.0E-3', - '--processes', '1', '--keep_whole_tractogram') + '--processes', '1', '--keep_whole_tractogram']) assert ret.success @@ -44,12 +44,12 @@ def test_execution_commit2(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # TODO Add a HDF5 in our test data that could be used here. - ret = script_runner.run( + ret = script_runner.run([ 'scil_tractogram_commit.py', in_tracking, in_dwi, in_bval, in_bvec, 'results_bzs/', '--tol', '30', '--nbr_dir', '500', '--nbr_iter', '500', '--in_peaks', in_peaks, '--in_tracking_mask', in_mask, '--perp_diff', '1.19E-3', '0.85E-3', '0.51E-3', '0.17E-3', '--iso_diff', '1.7E-3', '3.0E-3', - '--processes', '1', '--commit2') + '--processes', '1', '--commit2']) assert not ret.success diff --git a/scripts/tests/test_tractogram_compress.py b/scripts/tests/test_tractogram_compress.py index 67d935a90..771c9be36 100644 --- a/scripts/tests/test_tractogram_compress.py +++ b/scripts/tests/test_tractogram_compress.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_compress.py', '--help') + ret = script_runner.run(['scil_tractogram_compress.py', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fib = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'gyri_fanning.trk') - ret = script_runner.run('scil_tractogram_compress.py', in_fib, - 'gyri_fanning_c.trk', '-e', '0.1') + ret = script_runner.run(['scil_tractogram_compress.py', in_fib, + 'gyri_fanning_c.trk', '-e', '0.1']) assert ret.success diff --git a/scripts/tests/test_tractogram_compute_TODI.py b/scripts/tests/test_tractogram_compute_TODI.py index f95ed1e92..55f371977 100644 --- a/scripts/tests/test_tractogram_compute_TODI.py +++ b/scripts/tests/test_tractogram_compute_TODI.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_compute_TODI.py', '--help') + ret = script_runner.run(['scil_tractogram_compute_TODI.py', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_bst(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'bst', 'rpt_m_warp.trk') in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') - ret = script_runner.run('scil_tractogram_compute_TODI.py', in_bundle, + ret = script_runner.run(['scil_tractogram_compute_TODI.py', in_bundle, '--mask', in_mask, '--out_mask', 'todi_mask.nii.gz', '--out_tdi', 'tdi.nii.gz', @@ -30,15 +30,15 @@ def test_execution_bst(script_runner, monkeypatch): '--out_todi_sf', 'todi_sf.nii.gz', '--sh_order', '6', '--normalize_per_voxel', '--smooth_todi', - '--sh_basis', 'descoteaux07') + '--sh_basis', 'descoteaux07']) assert ret.success def test_execution_asym(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'bst', 'rpt_m_warp.trk') - ret = script_runner.run('scil_tractogram_compute_TODI.py', in_bundle, + ret = script_runner.run(['scil_tractogram_compute_TODI.py', in_bundle, '--out_todi_sh', 'atodi_sh_8.nii.gz', - '--asymmetric', '--n_steps', '2') + '--asymmetric', '--n_steps', '2']) assert ret.success diff --git a/scripts/tests/test_tractogram_compute_density_map.py b/scripts/tests/test_tractogram_compute_density_map.py index 81cd495fe..b871f1b1c 100644 --- a/scripts/tests/test_tractogram_compute_density_map.py +++ b/scripts/tests/test_tractogram_compute_density_map.py @@ -13,22 +13,22 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_compute_density_map.py', - '--help') + ret = script_runner.run(['scil_tractogram_compute_density_map.py', + '--help']) assert ret.success def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'others', 'IFGWM.trk') - ret = script_runner.run('scil_tractogram_compute_density_map.py', - in_bundle, 'binary.nii.gz', '--endpoints_only') + ret = script_runner.run(['scil_tractogram_compute_density_map.py', + in_bundle, 'binary.nii.gz', '--endpoints_only']) assert ret.success def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') - ret = script_runner.run('scil_tractogram_compute_density_map.py', - in_bundle, 'IFGWM.nii.gz', '--binary') + ret = script_runner.run(['scil_tractogram_compute_density_map.py', + in_bundle, 'IFGWM.nii.gz', '--binary']) assert ret.success diff --git a/scripts/tests/test_tractogram_convert.py b/scripts/tests/test_tractogram_convert.py index 6354f15fc..cbeb6bb5e 100644 --- a/scripts/tests/test_tractogram_convert.py +++ b/scripts/tests/test_tractogram_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_convert.py', '--help') + ret = script_runner.run(['scil_tractogram_convert.py', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): 'gyri_fanning.fib') in_fa = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') - ret = script_runner.run('scil_tractogram_convert.py', in_fib, - 'gyri_fanning.trk', '--reference', in_fa) + ret = script_runner.run(['scil_tractogram_convert.py', in_fib, + 'gyri_fanning.trk', '--reference', in_fa]) assert ret.success diff --git a/scripts/tests/test_tractogram_convert_hdf5_to_trk.py b/scripts/tests/test_tractogram_convert_hdf5_to_trk.py index 720eaad1e..312eb7a72 100644 --- a/scripts/tests/test_tractogram_convert_hdf5_to_trk.py +++ b/scripts/tests/test_tractogram_convert_hdf5_to_trk.py @@ -14,14 +14,14 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk.py', '--help') + ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk.py', '--help']) assert ret.success def test_execution_all_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk.py', - in_h5, 'save_trk/') + ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk.py', + in_h5, 'save_trk/']) assert ret.success # With current test data, out directory should have 7 files @@ -31,8 +31,8 @@ def test_execution_all_keys(script_runner, monkeypatch): def test_execution_edge_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk.py', - in_h5, 'save_trk2/', '--edge_keys', '1_10', '1_7') + ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk.py', + in_h5, 'save_trk2/', '--edge_keys', '1_10', '1_7']) assert ret.success # Out directory should have 2 files @@ -42,8 +42,8 @@ def test_execution_edge_keys(script_runner, monkeypatch): def test_execution_node_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk.py', - in_h5, 'save_trk3/', '--node_keys', '7') + ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk.py', + in_h5, 'save_trk3/', '--node_keys', '7']) assert ret.success # With current test data, out directory should have 3 files @@ -58,11 +58,11 @@ def test_execution_save_empty(script_runner, monkeypatch): # connections. with open('labels_list.txt', 'w') as f: f.write('1\n10\n100') - ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk.py', + ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk.py', in_h5, 'save_trk4/', '--save_empty', 'labels_list.txt', '--edge_keys', '1_10', '1_100', - '-v', 'DEBUG') + '-v', 'DEBUG']) assert ret.success # Out directory should have 2 files diff --git a/scripts/tests/test_tractogram_convert_trk_to_hdf5.py b/scripts/tests/test_tractogram_convert_trk_to_hdf5.py index fd564f939..9a38f2b24 100644 --- a/scripts/tests/test_tractogram_convert_trk_to_hdf5.py +++ b/scripts/tests/test_tractogram_convert_trk_to_hdf5.py @@ -18,25 +18,25 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_convert_trk_to_hdf5.py', '--help') + ret = script_runner.run(['scil_tractogram_convert_trk_to_hdf5.py', '--help']) assert ret.success def test_execution_edge_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk.py', - in_h5, 'save_trk/', '--edge_keys', '1_10', '1_7') + ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk.py', + in_h5, 'save_trk/', '--edge_keys', '1_10', '1_7']) assert ret.success # Out directory should have 2 files out_files = glob.glob('save_trk/*') assert len(out_files) == 2 - ret = script_runner.run('scil_tractogram_convert_trk_to_hdf5.py', + ret = script_runner.run(['scil_tractogram_convert_trk_to_hdf5.py', 'save_trk/1_10.trk', 'save_trk/1_7.trk', 'two_edges.h5', '--stored_space', 'voxmm', - '--stored_origin', 'nifti') + '--stored_origin', 'nifti']) assert ret.success with h5py.File('two_edges.h5', 'r') as hdf5_file: diff --git a/scripts/tests/test_tractogram_count_streamlines.py b/scripts/tests/test_tractogram_count_streamlines.py index 7b2e4aa47..9561ba614 100644 --- a/scripts/tests/test_tractogram_count_streamlines.py +++ b/scripts/tests/test_tractogram_count_streamlines.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_count_streamlines.py', '--help') + ret = script_runner.run(['scil_tractogram_count_streamlines.py', '--help']) assert ret.success @@ -21,5 +21,5 @@ def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'others', 'IFGWM_sub.trk') - ret = script_runner.run('scil_tractogram_count_streamlines.py', in_bundle) + ret = script_runner.run(['scil_tractogram_count_streamlines.py', in_bundle]) assert ret.success diff --git a/scripts/tests/test_tractogram_cut_streamlines.py b/scripts/tests/test_tractogram_cut_streamlines.py index 91267c8ef..349c27810 100644 --- a/scripts/tests/test_tractogram_cut_streamlines.py +++ b/scripts/tests/test_tractogram_cut_streamlines.py @@ -14,8 +14,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_cut_streamlines.py', - '--help') + ret = script_runner.run(['scil_tractogram_cut_streamlines.py', + '--help']) assert ret.success @@ -24,11 +24,11 @@ def test_execution(script_runner, monkeypatch): in_tractogram = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') in_mask = os.path.join(SCILPY_HOME, 'filtering', 'mask.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines.py', in_tractogram, 'out_tractogram_cut.trk', '--mask', in_mask, '--min_length', '0', '-f', '--reference', in_mask, - '--resample', '0.2', '--compress', '0.1') + '--resample', '0.2', '--compress', '0.1']) assert ret.success @@ -40,12 +40,12 @@ def test_execution_two_rois(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines.py', in_tractogram, '--mask', in_mask, 'out_tractogram_cut.trk', '-f', '--mask', in_mask, '--min_length', '0', '--reference', in_mask, - '--resample', '0.2', '--compress', '0.1') + '--resample', '0.2', '--compress', '0.1']) assert ret.success @@ -57,13 +57,13 @@ def test_execution_keep_longest(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines.py', in_tractogram, '--mask', in_mask, 'out_tractogram_cut.trk', '-f', '--keep_longest', '--mask', in_mask, '--min_length', '0', '--resample', '0.2', '--reference', in_mask, - '--compress', '0.1') + '--compress', '0.1']) assert ret.success @@ -75,13 +75,13 @@ def test_execution_trim_endpoints(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines.py', in_tractogram, '--mask', in_mask, 'out_tractogram_cut.trk', '-f', '--trim_endpoints', '--mask', in_mask, '--min_length', '0', '--resample', '0.2', '--reference', in_mask, - '--compress', '0.1') + '--compress', '0.1']) assert ret.success @@ -91,11 +91,11 @@ def test_execution_labels(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines.py', in_tractogram, '--labels', in_labels, 'out_tractogram_cut.trk', '-f', '--label_ids', '1', '10', - '--resample', '0.2', '--compress', '0.1') + '--resample', '0.2', '--compress', '0.1']) assert ret.success @@ -105,12 +105,12 @@ def test_execution_labels_error_trim(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines.py', in_tractogram, '--labels', in_labels, 'out_tractogram_cut2.trk', '-f', '--label_ids', '1', '10', '--resample', '0.2', '--compress', '0.1' - '--trim_endpoints') + '--trim_endpoints']) assert not ret.success @@ -120,10 +120,10 @@ def test_execution_labels_no_point(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines.py', in_tractogram, '--labels', in_labels, 'out_tractogram_cut.trk', '-f', - '--no_point_in_roi', '--label_ids', '1', '10') + '--no_point_in_roi', '--label_ids', '1', '10']) assert ret.success @@ -133,8 +133,8 @@ def test_execution_labels_one_point(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines.py', in_tractogram, '--labels', in_labels, 'out_tractogram_cut.trk', '-f', - '--one_point_in_roi', '--label_ids', '1', '10') + '--one_point_in_roi', '--label_ids', '1', '10']) assert ret.success diff --git a/scripts/tests/test_tractogram_detect_loops.py b/scripts/tests/test_tractogram_detect_loops.py index 73bc88209..1ab6e583a 100644 --- a/scripts/tests/test_tractogram_detect_loops.py +++ b/scripts/tests/test_tractogram_detect_loops.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_detect_loops.py', '--help') + ret = script_runner.run(['scil_tractogram_detect_loops.py', '--help']) assert ret.success @@ -21,10 +21,10 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4_filtered.trk') - ret = script_runner.run('scil_tractogram_detect_loops.py', + ret = script_runner.run(['scil_tractogram_detect_loops.py', in_bundle, 'bundle_4_filtered_no_loops.trk', '--looping_tractogram', 'bundle_4_filtered_loops.trk', '--angle', '270', '--qb', '4', - '--processes', '1', '--display_counts') + '--processes', '1', '--display_counts']) assert ret.success diff --git a/scripts/tests/test_tractogram_dpp_math.py b/scripts/tests/test_tractogram_dpp_math.py index 0471961ed..bc2ed2ccb 100644 --- a/scripts/tests/test_tractogram_dpp_math.py +++ b/scripts/tests/test_tractogram_dpp_math.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_dpp_math.py', '--help') + ret = script_runner.run(['scil_tractogram_dpp_math.py', '--help']) assert ret.success @@ -26,24 +26,24 @@ def test_execution_tractogram_point_math_mean_3D_defaults(script_runner, t1_on_bundle = 't1_on_streamlines.trk' # Create some dpp. Could have test data with dpp instead. - script_runner.run('scil_tractogram_project_map_to_streamlines.py', + script_runner.run(['scil_tractogram_project_map_to_streamlines.py', in_bundle, t1_on_bundle, '--in_maps', in_t1, - '--out_dpp_name', 't1') + '--out_dpp_name', 't1']) # Test dps mode - ret = script_runner.run('scil_tractogram_dpp_math.py', + ret = script_runner.run(['scil_tractogram_dpp_math.py', 'mean', t1_on_bundle, 't1_mean_on_streamlines.trk', '--mode', 'dps', '--in_dpp_name', 't1', - '--out_keys', 't1_mean') + '--out_keys', 't1_mean']) assert ret.success # Test dpp mode - ret = script_runner.run('scil_tractogram_dpp_math.py', + ret = script_runner.run(['scil_tractogram_dpp_math.py', 'mean', t1_on_bundle, 't1_mean_on_streamlines2.trk', '--mode', 'dpp', '--in_dpp_name', 't1', - '--out_keys', 't1_mean') + '--out_keys', 't1_mean']) assert ret.success @@ -55,16 +55,16 @@ def test_execution_tractogram_point_math_mean_4D_correlation(script_runner, in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') fodf_on_bundle = 'fodf_on_streamlines.trk' - script_runner.run('scil_tractogram_project_map_to_streamlines.py', + script_runner.run(['scil_tractogram_project_map_to_streamlines.py', in_bundle, fodf_on_bundle, '--in_maps', in_fodf, in_fodf, - '--out_dpp_name', 'fodf', 'fodf2') + '--out_dpp_name', 'fodf', 'fodf2']) - ret = script_runner.run('scil_tractogram_dpp_math.py', + ret = script_runner.run(['scil_tractogram_dpp_math.py', 'correlation', fodf_on_bundle, 'fodf_correlation_on_streamlines.trk', '--mode', 'dps', '--endpoints_only', '--in_dpp_name', 'fodf', - '--out_keys', 'fodf_correlation') + '--out_keys', 'fodf_correlation']) assert ret.success diff --git a/scripts/tests/test_tractogram_dps_math.py b/scripts/tests/test_tractogram_dps_math.py index 8a133633e..6834325cd 100644 --- a/scripts/tests/test_tractogram_dps_math.py +++ b/scripts/tests/test_tractogram_dps_math.py @@ -16,8 +16,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_dps_math.py', - '--help') + ret = script_runner.run(['scil_tractogram_dps_math.py', + '--help']) assert ret.success @@ -29,11 +29,11 @@ def test_execution_dps_math_import(script_runner, monkeypatch): filename = 'vals.npy' outname = 'out.trk' np.save(filename, np.arange(len(sft))) - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math.py', in_bundle, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname, - '-f') + '-f']) assert ret.success @@ -43,11 +43,11 @@ def test_execution_dps_math_import_single_value(script_runner, in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') outname = 'out.trk' - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math.py', in_bundle, 'import', 'key', '--in_dps_single_value', '42', '--out_tractogram', outname, - '-f') + '-f']) assert ret.success @@ -57,11 +57,11 @@ def test_execution_dps_math_import_single_value_array(script_runner, in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') outname = 'out.trk' - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math.py', in_bundle, 'import', 'key', '--in_dps_single_value', '1', '1.1', '1.2', '--out_tractogram', outname, - '-f') + '-f']) assert ret.success @@ -74,11 +74,11 @@ def test_execution_dps_math_import_with_missing_vals(script_runner, filename = 'vals.npy' outname = 'out.trk' np.save(filename, np.arange(len(sft) - 10)) - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math.py', in_bundle, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname, - '-f') + '-f']) assert ret.stderr @@ -92,16 +92,16 @@ def test_execution_dps_math_import_with_existing_key(script_runner, outname = 'out.trk' outname2 = 'out_2.trk' np.save(filename, np.arange(len(sft))) - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math.py', in_bundle, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname, - '-f') + '-f']) assert ret.success - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math.py', outname, 'import', 'key', '--in_dps_file', filename, - '--out_tractogram', outname2,) + '--out_tractogram', outname2,]) assert not ret.success @@ -113,11 +113,11 @@ def test_execution_dps_math_tck_output(script_runner, monkeypatch): filename = 'vals.npy' outname = 'out.tck' np.save(filename, np.arange(len(sft))) - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math.py', in_bundle, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname, - '-f') + '-f']) assert not ret.success @@ -132,10 +132,10 @@ def test_execution_dps_math_delete(script_runner, monkeypatch): } save_tractogram(sft, in_bundle) outname = 'out.trk' - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math.py', in_bundle, 'delete', 'key', '--out_tractogram', outname, - '-f') + '-f']) assert ret.success @@ -144,10 +144,10 @@ def test_execution_dps_math_delete_no_key(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') outname = 'out.trk' - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math.py', in_bundle, 'delete', 'key', '--out_tractogram', outname, - '-f') + '-f']) assert not ret.success @@ -162,10 +162,10 @@ def test_execution_dps_math_export(script_runner, monkeypatch): } save_tractogram(sft, in_bundle) filename = 'out.txt' - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math.py', in_bundle, 'export', 'key', '--out_dps_file', filename, - '-f') + '-f']) assert ret.success @@ -174,8 +174,8 @@ def test_execution_dps_math_export_no_key(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') filename = 'out.txt' - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math.py', in_bundle, 'export', 'key', '--out_dps_file', filename, - '-f') + '-f']) assert not ret.success diff --git a/scripts/tests/test_tractogram_extract_ushape.py b/scripts/tests/test_tractogram_extract_ushape.py index bbcfed761..85890cf98 100644 --- a/scripts/tests/test_tractogram_extract_ushape.py +++ b/scripts/tests/test_tractogram_extract_ushape.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_extract_ushape.py', - '--help') + ret = script_runner.run(['scil_tractogram_extract_ushape.py', + '--help']) assert ret.success @@ -23,10 +23,10 @@ def test_execution_processing(script_runner, monkeypatch): in_trk = os.path.join(SCILPY_HOME, 'tracking', 'union.trk') out_trk = 'ushape.trk' remaining_trk = 'remaining.trk' - ret = script_runner.run('scil_tractogram_extract_ushape.py', + ret = script_runner.run(['scil_tractogram_extract_ushape.py', in_trk, out_trk, '--minU', '0.5', '--maxU', '1', '--remaining_tractogram', remaining_trk, - '--display_counts') + '--display_counts']) assert ret.success diff --git a/scripts/tests/test_tractogram_filter_by_anatomy.py b/scripts/tests/test_tractogram_filter_by_anatomy.py index 2b8e04d8c..be6c60c44 100644 --- a/scripts/tests/test_tractogram_filter_by_anatomy.py +++ b/scripts/tests/test_tractogram_filter_by_anatomy.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_filter_by_anatomy.py', - '--help') + ret = script_runner.run(['scil_tractogram_filter_by_anatomy.py', + '--help']) assert ret.success @@ -24,9 +24,9 @@ def test_execution_filtering_all_options(script_runner, monkeypatch): 'tractogram_filter_ana.trk') in_wmparc = os.path.join(SCILPY_HOME, 'anatomical_filtering', 'wmparc_filter_ana.nii.gz') - ret = script_runner.run('scil_tractogram_filter_by_anatomy.py', + ret = script_runner.run(['scil_tractogram_filter_by_anatomy.py', in_tractogram, in_wmparc, - os.path.expanduser(tmp_dir.name), + os.path.expanduser(tmp_dir.name]), '--minL', '40', '--maxL', '200', '--angle', '300', '--processes', '1', '--save_volumes', '--dilate_ctx', '2', @@ -43,9 +43,9 @@ def test_execution_filtering_rejected(script_runner, monkeypatch): 'tractogram_filter_ana.trk') in_wmparc = os.path.join(SCILPY_HOME, 'anatomical_filtering', 'wmparc_filter_ana.nii.gz') - ret = script_runner.run('scil_tractogram_filter_by_anatomy.py', + ret = script_runner.run(['scil_tractogram_filter_by_anatomy.py', in_tractogram, in_wmparc, - os.path.expanduser(tmp_dir.name), + os.path.expanduser(tmp_dir.name]), '--minL', '40', '--maxL', '200', '--angle', '300', '--processes', '1', '--save_volumes', '--dilate_ctx', '2', @@ -61,9 +61,9 @@ def test_execution_filtering_save_intermediate(script_runner, monkeypatch): 'tractogram_filter_ana.trk') in_wmparc = os.path.join(SCILPY_HOME, 'anatomical_filtering', 'wmparc_filter_ana.nii.gz') - ret = script_runner.run('scil_tractogram_filter_by_anatomy.py', + ret = script_runner.run(['scil_tractogram_filter_by_anatomy.py', in_tractogram, in_wmparc, - os.path.expanduser(tmp_dir.name), + os.path.expanduser(tmp_dir.name]), '--minL', '40', '--maxL', '200', '--angle', '300', '--processes', '1', '--save_volumes', '--dilate_ctx', '2', diff --git a/scripts/tests/test_tractogram_filter_by_length.py b/scripts/tests/test_tractogram_filter_by_length.py index d5f4eda7d..f3659ccd5 100644 --- a/scripts/tests/test_tractogram_filter_by_length.py +++ b/scripts/tests/test_tractogram_filter_by_length.py @@ -14,8 +14,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_filter_by_length.py', - '--help') + ret = script_runner.run(['scil_tractogram_filter_by_length.py', + '--help']) assert ret.success @@ -26,9 +26,9 @@ def test_execution_filtering(script_runner, monkeypatch): # script execution. in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') - ret = script_runner.run('scil_tractogram_filter_by_length.py', + ret = script_runner.run(['scil_tractogram_filter_by_length.py', in_bundle, 'bundle_4_filtered.trk', - '--minL', '125', '--maxL', '130') + '--minL', '125', '--maxL', '130']) sft = load_tractogram('bundle_4_filtered.trk', 'same') assert len(sft) == 52 @@ -40,10 +40,10 @@ def test_rejected_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') - ret = script_runner.run('scil_tractogram_filter_by_length.py', + ret = script_runner.run(['scil_tractogram_filter_by_length.py', in_bundle, 'bundle_all_1mm_filtered.trk', '--minL', '125', '--maxL', '130', - '--out_rejected', 'bundle_all_1mm_rejected.trk') + '--out_rejected', 'bundle_all_1mm_rejected.trk']) assert ret.success assert os.path.exists('bundle_all_1mm_rejected.trk') assert os.path.exists('bundle_all_1mm_rejected.trk') @@ -59,10 +59,10 @@ def test_rejected_filtering_no_rejection(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') - ret = script_runner.run('scil_tractogram_filter_by_length.py', + ret = script_runner.run(['scil_tractogram_filter_by_length.py', in_bundle, 'bundle_4_filtered_no_rejection.trk', '--minL', '125', '--maxL', '130', - '--out_rejected', 'bundle_4_rejected.trk') + '--out_rejected', 'bundle_4_rejected.trk']) assert ret.success # File should be created even though there are no rejected streamlines diff --git a/scripts/tests/test_tractogram_filter_by_orientation.py b/scripts/tests/test_tractogram_filter_by_orientation.py index 727cf22c9..95ed81247 100644 --- a/scripts/tests/test_tractogram_filter_by_orientation.py +++ b/scripts/tests/test_tractogram_filter_by_orientation.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_filter_by_orientation.py', - '--help') + ret = script_runner.run(['scil_tractogram_filter_by_orientation.py', + '--help']) assert ret.success @@ -22,8 +22,8 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') - ret = script_runner.run('scil_tractogram_filter_by_orientation.py', + ret = script_runner.run(['scil_tractogram_filter_by_orientation.py', in_bundle, 'bundle_4_filtered.trk', '--min_x', '20', '--max_y', '230', '--min_z', '30', - '--use_abs') + '--use_abs']) assert ret.success diff --git a/scripts/tests/test_tractogram_filter_by_roi.py b/scripts/tests/test_tractogram_filter_by_roi.py index 52470a943..742abd341 100644 --- a/scripts/tests/test_tractogram_filter_by_roi.py +++ b/scripts/tests/test_tractogram_filter_by_roi.py @@ -19,31 +19,31 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_filter_by_roi.py', '--help') + ret = script_runner.run(['scil_tractogram_filter_by_roi.py', '--help']) assert ret.success def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_filter_by_roi.py', in_tractogram, + ret = script_runner.run(['scil_tractogram_filter_by_roi.py', in_tractogram, 'bundle_1.trk', '--display_counts', '--drawn_roi', in_roi, 'any', 'include', '--bdo', in_bdo, 'any', 'include', '--x_plane', '0', 'either_end', 'exclude', '--y_plane', '0', 'all', 'exclude', '0', '--z_plane', '0', 'either_end', 'exclude', '1', - '--save_rejected', 'bundle_1_rejected.trk') + '--save_rejected', 'bundle_1_rejected.trk']) assert ret.success def test_execution_filtering_overwrite_distance(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_filter_by_roi.py', in_tractogram, + ret = script_runner.run(['scil_tractogram_filter_by_roi.py', in_tractogram, 'bundle_2.trk', '--display_counts', '--drawn_roi', in_roi, 'any', 'include', '2', - '--overwrite_distance', 'any', 'include', '4') + '--overwrite_distance', 'any', 'include', '4']) assert ret.success @@ -57,7 +57,7 @@ def test_execution_filtering_list(script_runner, monkeypatch): f.write('bdo {} "any" "include"\n'.format(in_bdo)) f.write("bdo {} 'any' include".format(in_bdo)) - ret = script_runner.run('scil_tractogram_filter_by_roi.py', in_tractogram, + ret = script_runner.run(['scil_tractogram_filter_by_roi.py', in_tractogram, 'bundle_3.trk', '--display_counts', - '--filtering_list', filelist) + '--filtering_list', filelist]) assert ret.success diff --git a/scripts/tests/test_tractogram_filter_collisions.py b/scripts/tests/test_tractogram_filter_collisions.py index 037f585e4..a5004f3b9 100644 --- a/scripts/tests/test_tractogram_filter_collisions.py +++ b/scripts/tests/test_tractogram_filter_collisions.py @@ -33,7 +33,7 @@ def init_data(): def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_filter_collisions.py', '--help') + ret = script_runner.run(['scil_tractogram_filter_collisions.py', '--help']) assert ret.success @@ -44,9 +44,9 @@ def test_execution_filtering(script_runner, monkeypatch): diameters = [5, 1] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions.py', 'tractogram.trk', 'diameters.txt', 'clean.trk', - '-f') + '-f']) assert ret.success @@ -57,9 +57,9 @@ def test_execution_filtering_out_colliding_prefix(script_runner, monkeypatch): diameters = [5, 1] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions.py', 'tractogram.trk', 'diameters.txt', 'clean.trk', - '--out_colliding_prefix', 'tractogram', '-f') + '--out_colliding_prefix', 'tractogram', '-f']) assert ret.success @@ -70,9 +70,9 @@ def test_execution_filtering_single_diameter(script_runner, monkeypatch): diameters = [5] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions.py', 'tractogram.trk', 'diameters.txt', 'clean.trk', - '-f') + '-f']) assert ret.success @@ -83,9 +83,9 @@ def test_execution_filtering_no_shuffle(script_runner, monkeypatch): diameters = [5, 1] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions.py', 'tractogram.trk', 'diameters.txt', 'clean.trk', - '--disable_shuffling', '-f') + '--disable_shuffling', '-f']) assert ret.success @@ -96,9 +96,9 @@ def test_execution_filtering_min_distance(script_runner, monkeypatch): diameters = [0.001, 0.001] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions.py', 'tractogram.trk', 'diameters.txt', 'clean.trk', - '--min_distance', '5', '-f') + '--min_distance', '5', '-f']) assert ret.success @@ -110,9 +110,9 @@ def test_execution_filtering_metrics(script_runner, monkeypatch): diameters = [0.001, 0.001] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions.py', 'tractogram.trk', 'diameters.txt', 'clean.trk', - '--out_metrics', 'metrics.json', '-f') + '--out_metrics', 'metrics.json', '-f']) assert ret.success @@ -124,7 +124,7 @@ def test_execution_rotation_matrix(script_runner, monkeypatch): diameters = [0.001, 0.001] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions.py', 'tractogram.trk', 'diameters.txt', 'clean.trk', - '--out_rotation_matrix', 'rotation.mat', '-f') + '--out_rotation_matrix', 'rotation.mat', '-f']) assert ret.success diff --git a/scripts/tests/test_tractogram_flip.py b/scripts/tests/test_tractogram_flip.py index eb0d55ee6..f994a5df5 100644 --- a/scripts/tests/test_tractogram_flip.py +++ b/scripts/tests/test_tractogram_flip.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_flip.py', '--help') + ret = script_runner.run(['scil_tractogram_flip.py', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): 'gyri_fanning.fib') in_fa = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') - ret = script_runner.run('scil_tractogram_flip.py', in_fib, - 'gyri_fanning.tck', 'x', '--reference', in_fa) + ret = script_runner.run(['scil_tractogram_flip.py', in_fib, + 'gyri_fanning.tck', 'x', '--reference', in_fa]) assert ret.success diff --git a/scripts/tests/test_tractogram_math.py b/scripts/tests/test_tractogram_math.py index e4b3a85f8..3f41771c8 100644 --- a/scripts/tests/test_tractogram_math.py +++ b/scripts/tests/test_tractogram_math.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_math.py', '--help') + ret = script_runner.run(['scil_tractogram_math.py', '--help']) assert ret.success @@ -22,9 +22,9 @@ def test_execution_lazy_concatenate_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'lazy_concatenate', + ret = script_runner.run(['scil_tractogram_math.py', 'lazy_concatenate', in_tracto_1, in_tracto_2, - 'lazy_concatenate.trk') + 'lazy_concatenate.trk']) assert ret.success @@ -32,9 +32,9 @@ def test_execution_lazy_concatenate_mix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'lazy_concatenate', + ret = script_runner.run(['scil_tractogram_math.py', 'lazy_concatenate', in_tracto_1, in_tracto_2, - 'lazy_concatenate_mix.trk') + 'lazy_concatenate_mix.trk']) assert ret.success @@ -42,8 +42,8 @@ def test_execution_union_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'union', - in_tracto_1, in_tracto_2, 'union.trk') + ret = script_runner.run(['scil_tractogram_math.py', 'union', + in_tracto_1, in_tracto_2, 'union.trk']) assert ret.success @@ -51,8 +51,8 @@ def test_execution_intersection_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'intersection', - in_tracto_1, in_tracto_2, 'intersection.trk') + ret = script_runner.run(['scil_tractogram_math.py', 'intersection', + in_tracto_1, in_tracto_2, 'intersection.trk']) assert ret.success @@ -60,8 +60,8 @@ def test_execution_difference_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'difference', - in_tracto_1, in_tracto_2, 'difference.trk') + ret = script_runner.run(['scil_tractogram_math.py', 'difference', + in_tracto_1, in_tracto_2, 'difference.trk']) assert ret.success @@ -69,8 +69,8 @@ def test_execution_concatenate_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'concatenate', - in_tracto_1, in_tracto_2, 'concatenate.trk') + ret = script_runner.run(['scil_tractogram_math.py', 'concatenate', + in_tracto_1, in_tracto_2, 'concatenate.trk']) assert ret.success @@ -78,9 +78,9 @@ def test_execution_union_no_color_robust(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'union', + ret = script_runner.run(['scil_tractogram_math.py', 'union', in_tracto_1, in_tracto_2, 'union_r.trk', - '--robust') + '--robust']) assert ret.success @@ -88,9 +88,9 @@ def test_execution_intersection_no_color_robust(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'intersection', + ret = script_runner.run(['scil_tractogram_math.py', 'intersection', in_tracto_1, in_tracto_2, 'intersection_r.trk', - '--robust') + '--robust']) assert ret.success @@ -98,9 +98,9 @@ def test_execution_difference_no_color_robust(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'difference', + ret = script_runner.run(['scil_tractogram_math.py', 'difference', in_tracto_1, in_tracto_2, 'difference_r.trk', - '--robust') + '--robust']) assert ret.success @@ -108,8 +108,8 @@ def test_execution_union_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run('scil_tractogram_math.py', 'union', - in_tracto_1, in_tracto_2, 'union_color.trk') + ret = script_runner.run(['scil_tractogram_math.py', 'union', + in_tracto_1, in_tracto_2, 'union_color.trk']) assert ret.success @@ -117,8 +117,8 @@ def test_execution_intersection_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run('scil_tractogram_math.py', 'intersection', - in_tracto_1, in_tracto_2, 'intersection_color.trk') + ret = script_runner.run(['scil_tractogram_math.py', 'intersection', + in_tracto_1, in_tracto_2, 'intersection_color.trk']) assert ret.success @@ -126,8 +126,8 @@ def test_execution_difference_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run('scil_tractogram_math.py', 'difference', - in_tracto_1, in_tracto_2, 'difference_color.trk') + ret = script_runner.run(['scil_tractogram_math.py', 'difference', + in_tracto_1, in_tracto_2, 'difference_color.trk']) assert ret.success @@ -135,8 +135,8 @@ def test_execution_concatenate_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run('scil_tractogram_math.py', 'concatenate', - in_tracto_1, in_tracto_2, 'concatenate_color.trk') + ret = script_runner.run(['scil_tractogram_math.py', 'concatenate', + in_tracto_1, in_tracto_2, 'concatenate_color.trk']) assert ret.success @@ -145,8 +145,8 @@ def test_execution_union_mix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'union', - in_tracto_1, in_tracto_2, 'union_mix.trk') + ret = script_runner.run(['scil_tractogram_math.py', 'union', + in_tracto_1, in_tracto_2, 'union_mix.trk']) assert not ret.success @@ -154,9 +154,9 @@ def test_execution_intersection_mix_fake(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'intersection', + ret = script_runner.run(['scil_tractogram_math.py', 'intersection', in_tracto_1, in_tracto_2, 'intersection_mix.trk', - '--fake_metadata') + '--fake_metadata']) assert ret.success @@ -164,9 +164,9 @@ def test_execution_difference_empty_result(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundle_0.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run('scil_tractogram_math.py', 'difference', + ret = script_runner.run(['scil_tractogram_math.py', 'difference', in_tracto_1, in_tracto_2, - 'difference_empty_results.trk', '--no_metadata') + 'difference_empty_results.trk', '--no_metadata']) assert ret.success @@ -174,9 +174,9 @@ def test_execution_difference_empty_input_1(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'empty.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run('scil_tractogram_math.py', 'difference', + ret = script_runner.run(['scil_tractogram_math.py', 'difference', in_tracto_1, in_tracto_2, 'difference_empty_1.trk', - '--no_metadata') + '--no_metadata']) assert ret.success @@ -184,7 +184,7 @@ def test_execution_difference_empty_input_2(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') in_tracto_2 = os.path.join(trk_path, 'empty.trk') - ret = script_runner.run('scil_tractogram_math.py', 'difference', + ret = script_runner.run(['scil_tractogram_math.py', 'difference', in_tracto_1, in_tracto_2, 'difference_empty_2.trk', - '--no_metadata') + '--no_metadata']) assert ret.success diff --git a/scripts/tests/test_tractogram_pairwise_comparison.py b/scripts/tests/test_tractogram_pairwise_comparison.py index 5393ce273..7367be292 100644 --- a/scripts/tests/test_tractogram_pairwise_comparison.py +++ b/scripts/tests/test_tractogram_pairwise_comparison.py @@ -16,24 +16,24 @@ def test_help_option(script_runner): - ret = script_runner.run( - 'scil_tractogram_pairwise_comparison.py', '--help') + ret = script_runner.run([ + 'scil_tractogram_pairwise_comparison.py', '--help']) assert ret.success def test_execution_bundles_skip(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_pairwise_comparison.py', + ret = script_runner.run(['scil_tractogram_pairwise_comparison.py', in_1, in_2, '--out_dir', tmp_dir.name, '--reference', in_ref, - '--skip_streamlines_distance') + '--skip_streamlines_distance']) assert ret.success def test_execution_bundles(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_pairwise_comparison.py', + ret = script_runner.run(['scil_tractogram_pairwise_comparison.py', in_1, in_2, '--out_dir', tmp_dir.name, '--reference', in_ref, '-f', - '--skip_streamlines_distance') + '--skip_streamlines_distance']) assert ret.success diff --git a/scripts/tests/test_tractogram_print_info.py b/scripts/tests/test_tractogram_print_info.py index 2691b29e8..02d7a0c59 100644 --- a/scripts/tests/test_tractogram_print_info.py +++ b/scripts/tests/test_tractogram_print_info.py @@ -13,12 +13,12 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_print_info.py', '--help') + ret = script_runner.run(['scil_tractogram_print_info.py', '--help']) assert ret.success def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') - ret = script_runner.run('scil_tractogram_print_info.py', in_bundle) + ret = script_runner.run(['scil_tractogram_print_info.py', in_bundle]) assert ret.success diff --git a/scripts/tests/test_tractogram_project_map_to_streamlines.py b/scripts/tests/test_tractogram_project_map_to_streamlines.py index 2567601e1..dcc67cac5 100644 --- a/scripts/tests/test_tractogram_project_map_to_streamlines.py +++ b/scripts/tests/test_tractogram_project_map_to_streamlines.py @@ -17,62 +17,62 @@ def test_help_option(script_runner): - ret = script_runner.run( - 'scil_tractogram_project_map_to_streamlines.py', '--help') + ret = script_runner.run([ + 'scil_tractogram_project_map_to_streamlines.py', '--help']) assert ret.success def test_execution_3D_map(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run(['scil_tractogram_project_map_to_streamlines.py', in_tracto_1, 't1_on_streamlines.trk', '--in_maps', in_3d_map, - '--out_dpp_name', 't1') + '--out_dpp_name', 't1']) assert ret.success def test_execution_4D_map(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run(['scil_tractogram_project_map_to_streamlines.py', in_tracto_1, 'rgb_on_streamlines.trk', '--in_maps', in_4d_map, - '--out_dpp_name', 'rgb') + '--out_dpp_name', 'rgb']) assert ret.success def test_execution_3D_map_endpoints_only(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run(['scil_tractogram_project_map_to_streamlines.py', in_tracto_1, 't1_on_streamlines_endpoints.trk', '--in_maps', in_3d_map, '--out_dpp_name', 't1', - '--endpoints_only') + '--endpoints_only']) assert ret.success def test_execution_4D_map_endpoints_only(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run(['scil_tractogram_project_map_to_streamlines.py', in_tracto_1, 'rgb_on_streamlines_endpoints.trk', '--in_maps', in_4d_map, '--out_dpp_name', 'rgb', - '--endpoints_only') + '--endpoints_only']) assert ret.success def test_execution_3D_map_trilinear(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run(['scil_tractogram_project_map_to_streamlines.py', in_tracto_1, 't1_on_streamlines_trilinear.trk', '--in_maps', in_3d_map, '--out_dpp_name', 't1', - '--trilinear') + '--trilinear']) assert ret.success diff --git a/scripts/tests/test_tractogram_project_streamlines_to_map.py b/scripts/tests/test_tractogram_project_streamlines_to_map.py index bd2aded71..8c1b484f5 100644 --- a/scripts/tests/test_tractogram_project_streamlines_to_map.py +++ b/scripts/tests/test_tractogram_project_streamlines_to_map.py @@ -16,8 +16,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_project_streamlines_to_map.py', - '--help') + ret = script_runner.run(['scil_tractogram_project_streamlines_to_map.py', + '--help']) assert ret.success @@ -29,27 +29,27 @@ def test_execution_dpp(script_runner, monkeypatch): # Create our test data with dpp: add metrics as dpp. # Or get a tractogram that already as some dpp in the test data. - script_runner.run('scil_tractogram_project_map_to_streamlines.py', + script_runner.run(['scil_tractogram_project_map_to_streamlines.py', in_bundle, in_bundle_with_dpp, '-f', - '--in_maps', in_mni, '--out_dpp_name', 'some_metric') + '--in_maps', in_mni, '--out_dpp_name', 'some_metric']) # Tests with dpp. - ret = script_runner.run('scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run(['scil_tractogram_project_streamlines_to_map.py', in_bundle_with_dpp, 'project_dpp_', '--use_dpp', 'some_metric', '--point_by_point', - '--to_endpoints') + '--to_endpoints']) assert ret.success - ret = script_runner.run('scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run(['scil_tractogram_project_streamlines_to_map.py', in_bundle_with_dpp, 'project_mean_to_endpoints_', '--use_dpp', 'some_metric', '--mean_streamline', - '--to_endpoints') + '--to_endpoints']) assert ret.success - ret = script_runner.run('scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run(['scil_tractogram_project_streamlines_to_map.py', in_bundle_with_dpp, 'project_end_to_wm', '--use_dpp', 'some_metric', '--mean_endpoints', - '--to_wm') + '--to_wm']) assert ret.success @@ -62,17 +62,17 @@ def test_execution_dps(script_runner, monkeypatch): # Create our test data with dps: add metrics as dps. # Or get a tractogram that already as some dps in the test data. - script_runner.run('scil_tractogram_project_map_to_streamlines.py', + script_runner.run(['scil_tractogram_project_map_to_streamlines.py', in_bundle, in_bundle_with_dpp, '-f', - '--in_maps', in_mni, '--out_dpp_name', 'some_metric') - script_runner.run('scil_tractogram_dpp_math.py', 'min', in_bundle_with_dpp, + '--in_maps', in_mni, '--out_dpp_name', 'some_metric']) + script_runner.run(['scil_tractogram_dpp_math.py', 'min', in_bundle_with_dpp, in_bundle_with_dps, '--in_dpp_name', 'some_metric', '--out_keys', 'some_metric_dps', '--mode', 'dps', - '--keep_all') + '--keep_all']) # Tests with dps. - ret = script_runner.run('scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run(['scil_tractogram_project_streamlines_to_map.py', in_bundle_with_dps, 'project_dps_', '--use_dps', 'some_metric_dps', '--point_by_point', - '--to_wm') + '--to_wm']) assert ret.success diff --git a/scripts/tests/test_tractogram_qbx.py b/scripts/tests/test_tractogram_qbx.py index 1357fe728..733bdebb2 100644 --- a/scripts/tests/test_tractogram_qbx.py +++ b/scripts/tests/test_tractogram_qbx.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_qbx.py', '--help') + ret = script_runner.run(['scil_tractogram_qbx.py', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') - ret = script_runner.run('scil_tractogram_qbx.py', in_bundle, '12', - 'clusters/', '--out_centroids', 'centroids.trk') + ret = script_runner.run(['scil_tractogram_qbx.py', in_bundle, '12', + 'clusters/', '--out_centroids', 'centroids.trk']) assert ret.success diff --git a/scripts/tests/test_tractogram_register.py b/scripts/tests/test_tractogram_register.py index 8d5084060..66fd86928 100644 --- a/scripts/tests/test_tractogram_register.py +++ b/scripts/tests/test_tractogram_register.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_register.py', '--help') + ret = script_runner.run(['scil_tractogram_register.py', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_bundles(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') - ret = script_runner.run('scil_tractogram_register.py', in_moving, + ret = script_runner.run(['scil_tractogram_register.py', in_moving, in_static, '--only_rigid', - '--moving_tractogram_ref', in_ref) + '--moving_tractogram_ref', in_ref]) assert ret.success diff --git a/scripts/tests/test_tractogram_remove_invalid.py b/scripts/tests/test_tractogram_remove_invalid.py index e06f0da95..c6ba32c38 100644 --- a/scripts/tests/test_tractogram_remove_invalid.py +++ b/scripts/tests/test_tractogram_remove_invalid.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_remove_invalid.py', '--help') + ret = script_runner.run(['scil_tractogram_remove_invalid.py', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_bundles(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tractogram = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.trk') - ret = script_runner.run('scil_tractogram_remove_invalid.py', + ret = script_runner.run(['scil_tractogram_remove_invalid.py', in_tractogram, 'bundle_all_1mm.trk', '--cut', - '--remove_overlapping', '--remove_single', '-f') + '--remove_overlapping', '--remove_single', '-f']) assert ret.success diff --git a/scripts/tests/test_tractogram_resample.py b/scripts/tests/test_tractogram_resample.py index abe856a94..55b8c338f 100644 --- a/scripts/tests/test_tractogram_resample.py +++ b/scripts/tests/test_tractogram_resample.py @@ -16,20 +16,20 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_resample.py', '--help') + ret = script_runner.run(['scil_tractogram_resample.py', '--help']) assert ret.success def test_execution_downsample(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_resample.py', in_tracto, - '500', 'union_shuffle_sub_downsampled.trk') + ret = script_runner.run(['scil_tractogram_resample.py', in_tracto, + '500', 'union_shuffle_sub_downsampled.trk']) assert ret.success - ret = script_runner.run('scil_tractogram_resample.py', in_tracto, + ret = script_runner.run(['scil_tractogram_resample.py', in_tracto, '200', 'union_shuffle_sub_downsampled.trk', - '-f', '--downsample_per_cluster') + '-f', '--downsample_per_cluster']) assert ret.success @@ -37,9 +37,9 @@ def test_execution_upsample_noise(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # point-wise only - ret = script_runner.run('scil_tractogram_resample.py', in_tracto, + ret = script_runner.run(['scil_tractogram_resample.py', in_tracto, '2000', 'union_shuffle_sub_upsampled.trk', '-f', - '--point_wise_std', '0.5') + '--point_wise_std', '0.5']) assert ret.success @@ -47,13 +47,13 @@ def test_execution_upsample_ptt(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # ptt only - ret = script_runner.run('scil_tractogram_resample.py', in_tracto, + ret = script_runner.run(['scil_tractogram_resample.py', in_tracto, '500', 'union_shuffle_sub_upsampled.trk', '-f', - '--tube_radius', '5') + '--tube_radius', '5']) assert ret.success # both upsampling methods - ret = script_runner.run('scil_tractogram_resample.py', in_tracto, + ret = script_runner.run(['scil_tractogram_resample.py', in_tracto, '500', 'union_shuffle_sub_upsampled.trk', '-f', - '--point_wise_std', '10', '--tube_radius', '5') + '--point_wise_std', '10', '--tube_radius', '5']) assert ret.success diff --git a/scripts/tests/test_tractogram_resample_nb_points.py b/scripts/tests/test_tractogram_resample_nb_points.py index ffdd3915c..6d92c4907 100644 --- a/scripts/tests/test_tractogram_resample_nb_points.py +++ b/scripts/tests/test_tractogram_resample_nb_points.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_resample_nb_points.py', '--help') + ret = script_runner.run(['scil_tractogram_resample_nb_points.py', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni_c.trk') - ret = script_runner.run('scil_tractogram_resample_nb_points.py', + ret = script_runner.run(['scil_tractogram_resample_nb_points.py', in_bundle, 'IFGWM_uni_c_10.trk', - '--nb_pts_per_streamline', '10') + '--nb_pts_per_streamline', '10']) assert ret.success diff --git a/scripts/tests/test_tractogram_seed_density_map.py b/scripts/tests/test_tractogram_seed_density_map.py index ec9e2626c..f6aa993e2 100644 --- a/scripts/tests/test_tractogram_seed_density_map.py +++ b/scripts/tests/test_tractogram_seed_density_map.py @@ -13,13 +13,13 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_seed_density_map.py', '--help') + ret = script_runner.run(['scil_tractogram_seed_density_map.py', '--help']) assert ret.success def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracking = os.path.join(SCILPY_HOME, 'processing', 'tracking.trk') - ret = script_runner.run('scil_tractogram_seed_density_map.py', in_tracking, - 'seeds_density.nii.gz') + ret = script_runner.run(['scil_tractogram_seed_density_map.py', in_tracking, + 'seeds_density.nii.gz']) assert ret.success diff --git a/scripts/tests/test_tractogram_segment_connections_from_labels.py b/scripts/tests/test_tractogram_segment_connections_from_labels.py index e0ae13ae2..da8dbca75 100644 --- a/scripts/tests/test_tractogram_segment_connections_from_labels.py +++ b/scripts/tests/test_tractogram_segment_connections_from_labels.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run( - 'scil_tractogram_segment_connections_from_labels.py', '--help') + ret = script_runner.run([ + 'scil_tractogram_segment_connections_from_labels.py', '--help']) assert ret.success @@ -23,10 +23,10 @@ def test_execution_connectivity(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'connectivity', 'bundle_all_1mm.trk') in_atlas = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run( + ret = script_runner.run([ 'scil_tractogram_segment_connections_from_labels.py', in_bundle, in_atlas, 'decompose.h5', '--min_length', '20', '--max_length', '200', '--outlier_threshold', '0.5', '--loop_max_angle', '330', '--curv_qb_distance', '10', '--processes', '1', '-v', 'DEBUG', - '--save_final', '--out_dir', os.path.join(tmp_dir.name, 'out_bundles')) + '--save_final', '--out_dir', os.path.join(tmp_dir.name, 'out_bundles'])) assert ret.success diff --git a/scripts/tests/test_tractogram_segment_with_ROI_and_score.py b/scripts/tests/test_tractogram_segment_with_ROI_and_score.py index c7b0769fd..ad5136487 100644 --- a/scripts/tests/test_tractogram_segment_with_ROI_and_score.py +++ b/scripts/tests/test_tractogram_segment_with_ROI_and_score.py @@ -11,8 +11,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_segment_with_ROI_and_score.py', - '--help') + ret = script_runner.run(['scil_tractogram_segment_with_ROI_and_score.py', + '--help']) assert ret.success @@ -35,8 +35,8 @@ def test_score_bundles(script_runner, monkeypatch): with open(os.path.join("config_file.json"), "w") as f: json.dump(json_contents, f) - ret = script_runner.run('scil_tractogram_segment_with_ROI_and_score.py', + ret = script_runner.run(['scil_tractogram_segment_with_ROI_and_score.py', in_tractogram, "config_file.json", 'scoring_tractogram/', '--no_empty', - '--use_gt_masks_as_all_masks') + '--use_gt_masks_as_all_masks']) assert ret.success diff --git a/scripts/tests/test_tractogram_segment_with_bundleseg.py b/scripts/tests/test_tractogram_segment_with_bundleseg.py index 1de079e0e..ade3c1edd 100644 --- a/scripts/tests/test_tractogram_segment_with_bundleseg.py +++ b/scripts/tests/test_tractogram_segment_with_bundleseg.py @@ -14,8 +14,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_segment_with_bundleseg.py', - '--help') + ret = script_runner.run(['scil_tractogram_segment_with_bundleseg.py', + '--help']) assert ret.success @@ -34,9 +34,9 @@ def test_execution_bundles(script_runner, monkeypatch): with open('config.json', 'w') as outfile: json.dump(tmp_config, outfile) - ret = script_runner.run('scil_tractogram_segment_with_bundleseg.py', + ret = script_runner.run(['scil_tractogram_segment_with_bundleseg.py', in_tractogram, 'config.json', in_models, in_aff, '--inverse', - '--processes', '1', '-v', 'WARNING') + '--processes', '1', '-v', 'WARNING']) assert ret.success diff --git a/scripts/tests/test_tractogram_segment_with_recobundles.py b/scripts/tests/test_tractogram_segment_with_recobundles.py index 786ceb456..7e1469ca9 100644 --- a/scripts/tests/test_tractogram_segment_with_recobundles.py +++ b/scripts/tests/test_tractogram_segment_with_recobundles.py @@ -13,8 +13,8 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_segment_with_recobundles.py', - '--help') + ret = script_runner.run(['scil_tractogram_segment_with_recobundles.py', + '--help']) assert ret.success @@ -24,10 +24,10 @@ def test_execution_bundles(script_runner, monkeypatch): in_model = os.path.join(SCILPY_HOME, 'bundles', 'fibercup_atlas', 'subj_1', 'bundle_0.trk') in_aff = os.path.join(SCILPY_HOME, 'bundles', 'affine.txt') - ret = script_runner.run('scil_tractogram_segment_with_recobundles.py', + ret = script_runner.run(['scil_tractogram_segment_with_recobundles.py', in_tractogram, in_model, in_aff, 'bundle_0_reco.tck', '--inverse', '--tractogram_clustering_thr', '12', '--slr_threads', '1', '--out_pickle', - 'clusters.pkl') + 'clusters.pkl']) assert ret.success diff --git a/scripts/tests/test_tractogram_shuffle.py b/scripts/tests/test_tractogram_shuffle.py index c2fbacf00..5c3bfe6f8 100644 --- a/scripts/tests/test_tractogram_shuffle.py +++ b/scripts/tests/test_tractogram_shuffle.py @@ -13,13 +13,13 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_shuffle.py', '--help') + ret = script_runner.run(['scil_tractogram_shuffle.py', '--help']) assert ret.success def test_execution_tracking(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'tracking', 'union.trk') - ret = script_runner.run('scil_tractogram_shuffle.py', in_tracto, - 'union_shuffle.trk') + ret = script_runner.run(['scil_tractogram_shuffle.py', in_tracto, + 'union_shuffle.trk']) assert ret.success diff --git a/scripts/tests/test_tractogram_smooth.py b/scripts/tests/test_tractogram_smooth.py index 67bf99f2b..b6af3e944 100644 --- a/scripts/tests/test_tractogram_smooth.py +++ b/scripts/tests/test_tractogram_smooth.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_smooth.py', '--help') + ret = script_runner.run(['scil_tractogram_smooth.py', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_tracking(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'tracking', 'union_shuffle_sub.trk') - ret = script_runner.run('scil_tractogram_smooth.py', in_tracto, + ret = script_runner.run(['scil_tractogram_smooth.py', in_tracto, 'union_shuffle_sub_smooth.trk', '--gaussian', '10', - '--compress', '0.05') + '--compress', '0.05']) assert ret.success diff --git a/scripts/tests/test_tractogram_split.py b/scripts/tests/test_tractogram_split.py index cbcaa3d21..83953161c 100644 --- a/scripts/tests/test_tractogram_split.py +++ b/scripts/tests/test_tractogram_split.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_split.py', '--help') + ret = script_runner.run(['scil_tractogram_split.py', '--help']) assert ret.success @@ -21,16 +21,16 @@ def test_execution_tracking(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'tracking', 'local.trk') - ret = script_runner.run('scil_tractogram_split.py', in_tracto, - 'local_split', '--nb_chunks', '3', '-f') + ret = script_runner.run(['scil_tractogram_split.py', in_tracto, + 'local_split', '--nb_chunks', '3', '-f']) assert ret.success - ret = script_runner.run('scil_tractogram_split.py', in_tracto, + ret = script_runner.run(['scil_tractogram_split.py', in_tracto, 'local_split', '--nb_chunks', '3', '-f', - '--split_per_cluster') + '--split_per_cluster']) assert ret.success - ret = script_runner.run('scil_tractogram_split.py', in_tracto, + ret = script_runner.run(['scil_tractogram_split.py', in_tracto, 'local_split', '--nb_chunks', '3', '-f', - '--do_not_randomize') + '--do_not_randomize']) assert ret.success diff --git a/scripts/tests/test_viz_bingham_fit.py b/scripts/tests/test_viz_bingham_fit.py index 8b14b4cae..cb54ea830 100644 --- a/scripts/tests/test_viz_bingham_fit.py +++ b/scripts/tests/test_viz_bingham_fit.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_bingham_fit.py', '--help') + ret = script_runner.run(['scil_viz_bingham_fit.py', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_silent_without_output(script_runner, monkeypatch): # dummy dataset (the script should raise an error before using it) in_dummy = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run('scil_viz_bingham_fit.py', in_dummy, - '--silent') + ret = script_runner.run(['scil_viz_bingham_fit.py', in_dummy, + '--silent']) assert (not ret.success) diff --git a/scripts/tests/test_viz_bundle.py b/scripts/tests/test_viz_bundle.py index 87631065b..eb6e789e6 100644 --- a/scripts/tests/test_viz_bundle.py +++ b/scripts/tests/test_viz_bundle.py @@ -8,7 +8,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_bundle.py', '--help') + ret = script_runner.run(['scil_viz_bundle.py', '--help']) assert ret.success # Tests including VTK do not work on a server without a display @@ -20,6 +20,6 @@ def test_help_option(script_runner): # in_bundle = os.path.join( # SCILPY_HOME, 'bundles', 'fibercup_atlas', 'subj_1', 'bundle_0.trk') -# ret = script_runner.run('scil_viz_bundle.py', -# in_vol, in_bundle, 'out.png') +# ret = script_runner.run(['scil_viz_bundle.py', +# in_vol, in_bundle, 'out.png']) # assert ret.success diff --git a/scripts/tests/test_viz_bundle_screenshot_mni.py b/scripts/tests/test_viz_bundle_screenshot_mni.py index 397d593ed..0ffdca08b 100644 --- a/scripts/tests/test_viz_bundle_screenshot_mni.py +++ b/scripts/tests/test_viz_bundle_screenshot_mni.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_bundle_screenshot_mni.py', '--help') + ret = script_runner.run(['scil_viz_bundle_screenshot_mni.py', '--help']) assert ret.success diff --git a/scripts/tests/test_viz_bundle_screenshot_mosaic.py b/scripts/tests/test_viz_bundle_screenshot_mosaic.py index 26509532a..f2c1eb39c 100644 --- a/scripts/tests/test_viz_bundle_screenshot_mosaic.py +++ b/scripts/tests/test_viz_bundle_screenshot_mosaic.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_bundle_screenshot_mosaic.py', '--help') + ret = script_runner.run(['scil_viz_bundle_screenshot_mosaic.py', '--help']) assert ret.success diff --git a/scripts/tests/test_viz_connectivity.py b/scripts/tests/test_viz_connectivity.py index ea091be5d..36a8fc85d 100644 --- a/scripts/tests/test_viz_connectivity.py +++ b/scripts/tests/test_viz_connectivity.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_connectivity.py', '--help') + ret = script_runner.run(['scil_viz_connectivity.py', '--help']) assert ret.success @@ -23,9 +23,9 @@ def test_execution_connectivity(script_runner, monkeypatch): 'sc_norm.npy') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run('scil_viz_connectivity.py', in_sc, + ret = script_runner.run(['scil_viz_connectivity.py', in_sc, 'sc_norm.png', '--log', '--display_legend', '--labels_list', in_labels_list, '--histogram', 'hist.png', '--nb_bins', '50', - '--exclude_zeros', '--chord_chart', 'sc_chord.png') + '--exclude_zeros', '--chord_chart', 'sc_chord.png']) assert ret.success diff --git a/scripts/tests/test_viz_dti_screenshot.py b/scripts/tests/test_viz_dti_screenshot.py index 56c47a53c..105ed8436 100644 --- a/scripts/tests/test_viz_dti_screenshot.py +++ b/scripts/tests/test_viz_dti_screenshot.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_dti_screenshot.py', '--help') + ret = script_runner.run(['scil_viz_dti_screenshot.py', '--help']) assert ret.success diff --git a/scripts/tests/test_viz_fodf.py b/scripts/tests/test_viz_fodf.py index c033143f3..a546daedd 100644 --- a/scripts/tests/test_viz_fodf.py +++ b/scripts/tests/test_viz_fodf.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_fodf.py', '--help') + ret = script_runner.run(['scil_viz_fodf.py', '--help']) assert ret.success @@ -20,7 +20,7 @@ def test_silent_without_output(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run('scil_viz_fodf.py', in_fodf, '--silent') + ret = script_runner.run(['scil_viz_fodf.py', in_fodf, '--silent']) # Should say that requires an output with --silent mode assert (not ret.success) @@ -31,8 +31,8 @@ def test_run(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') out_name = os.path.join(tmp_dir.name, 'out.png') - ret = script_runner.run('scil_viz_fodf.py', in_fodf, '--silent', + ret = script_runner.run(['scil_viz_fodf.py', in_fodf, '--silent', '--in_transparency_mask', in_mask, - '--output', out_name) + '--output', out_name]) assert ret.success diff --git a/scripts/tests/test_viz_gradients_screenshot.py b/scripts/tests/test_viz_gradients_screenshot.py index 3d4886c47..23bd93e11 100644 --- a/scripts/tests/test_viz_gradients_screenshot.py +++ b/scripts/tests/test_viz_gradients_screenshot.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_gradients_screenshot.py', '--help') + ret = script_runner.run(['scil_viz_gradients_screenshot.py', '--help']) assert ret.success diff --git a/scripts/tests/test_viz_tractogram_collisions.py b/scripts/tests/test_viz_tractogram_collisions.py index 2d8819039..2200335ad 100644 --- a/scripts/tests/test_viz_tractogram_collisions.py +++ b/scripts/tests/test_viz_tractogram_collisions.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_tractogram_collisions.py', '--help') + ret = script_runner.run(['scil_viz_tractogram_collisions.py', '--help']) assert ret.success diff --git a/scripts/tests/test_viz_tractogram_seeds.py b/scripts/tests/test_viz_tractogram_seeds.py index 46baeb10e..33453e46e 100644 --- a/scripts/tests/test_viz_tractogram_seeds.py +++ b/scripts/tests/test_viz_tractogram_seeds.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_tractogram_seeds.py', '--help') + ret = script_runner.run(['scil_viz_tractogram_seeds.py', '--help']) assert ret.success diff --git a/scripts/tests/test_viz_tractogram_seeds_3d.py b/scripts/tests/test_viz_tractogram_seeds_3d.py index 688743270..d93a5a14b 100644 --- a/scripts/tests/test_viz_tractogram_seeds_3d.py +++ b/scripts/tests/test_viz_tractogram_seeds_3d.py @@ -2,5 +2,5 @@ # -*- coding: utf-8 -*- def test_help_option(script_runner): - ret = script_runner.run('scil_viz_tractogram_seeds_3d.py', '--help') + ret = script_runner.run(['scil_viz_tractogram_seeds_3d.py', '--help']) assert ret.success diff --git a/scripts/tests/test_viz_volume_histogram.py b/scripts/tests/test_viz_volume_histogram.py index 41cc09b29..18f166c0e 100644 --- a/scripts/tests/test_viz_volume_histogram.py +++ b/scripts/tests/test_viz_volume_histogram.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_volume_histogram.py', '--help') + ret = script_runner.run(['scil_viz_volume_histogram.py', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_processing(script_runner, monkeypatch): 'fa.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') - ret = script_runner.run('scil_viz_volume_histogram.py', in_fa, in_mask, - '20', 'histogram.png') + ret = script_runner.run(['scil_viz_volume_histogram.py', in_fa, in_mask, + '20', 'histogram.png']) assert ret.success diff --git a/scripts/tests/test_viz_volume_scatterplot.py b/scripts/tests/test_viz_volume_scatterplot.py index 207b09698..ba698ab24 100644 --- a/scripts/tests/test_viz_volume_scatterplot.py +++ b/scripts/tests/test_viz_volume_scatterplot.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_volume_scatterplot.py', '--help') + ret = script_runner.run(['scil_viz_volume_scatterplot.py', '--help']) assert ret.success @@ -23,8 +23,8 @@ def test_execution_processing(script_runner, monkeypatch): 'fa.nii.gz') in_y = os.path.join(SCILPY_HOME, 'plot', 'ad.nii.gz') - ret = script_runner.run('scil_viz_volume_scatterplot.py', in_x, in_y, - 'scatter_plot.png') + ret = script_runner.run(['scil_viz_volume_scatterplot.py', in_x, in_y, + 'scatter_plot.png']) assert ret.success @@ -36,8 +36,8 @@ def test_execution_processing_bin_mask(script_runner, monkeypatch): 'ad.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'plot', 'mask_wm.nii.gz') - ret = script_runner.run('scil_viz_volume_scatterplot.py', in_x, in_y, - 'scatter_plot_m.png', '--in_bin_mask', in_mask) + ret = script_runner.run(['scil_viz_volume_scatterplot.py', in_x, in_y, + 'scatter_plot_m.png', '--in_bin_mask', in_mask]) assert ret.success @@ -51,9 +51,9 @@ def test_execution_processing_prob_map(script_runner, monkeypatch): 'map_wm.nii.gz') in_prob_2 = os.path.join(SCILPY_HOME, 'plot', 'map_gm.nii.gz') - ret = script_runner.run('scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run(['scil_viz_volume_scatterplot.py', in_x, in_y, 'scatter_plot_prob.png', - '--in_prob_maps', in_prob_1, in_prob_2) + '--in_prob_maps', in_prob_1, in_prob_2]) assert ret.success @@ -67,9 +67,9 @@ def test_execution_processing_atlas(script_runner, monkeypatch): 'atlas_brainnetome.nii.gz') atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') - ret = script_runner.run('scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run(['scil_viz_volume_scatterplot.py', in_x, in_y, 'scatter_plot', '--in_atlas', in_atlas, - '--atlas_lut', atlas_lut) + '--atlas_lut', atlas_lut]) assert ret.success @@ -83,10 +83,10 @@ def test_execution_processing_atlas_folder(script_runner, monkeypatch): 'atlas_brainnetome.nii.gz') atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') - ret = script_runner.run('scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run(['scil_viz_volume_scatterplot.py', in_x, in_y, 'scatter_plot', '--in_atlas', in_atlas, '--atlas_lut', atlas_lut, - '--in_folder') + '--in_folder']) assert ret.success @@ -101,9 +101,9 @@ def test_execution_processing_atlas_folder_specific_label(script_runner, 'atlas_brainnetome.nii.gz') atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') - ret = script_runner.run('scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run(['scil_viz_volume_scatterplot.py', in_x, in_y, 'scatter_plot', '--in_atlas', in_atlas, '--atlas_lut', atlas_lut, '--specific_label', '2', '5', '7', - '--in_folder') + '--in_folder']) assert ret.success diff --git a/scripts/tests/test_viz_volume_screenshot.py b/scripts/tests/test_viz_volume_screenshot.py index 2c9509e39..2dca31ac8 100644 --- a/scripts/tests/test_viz_volume_screenshot.py +++ b/scripts/tests/test_viz_volume_screenshot.py @@ -16,11 +16,11 @@ def test_screenshot(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fa = os.path.join(SCILPY_HOME, 'bst', 'fa.nii.gz') - ret = script_runner.run("scil_viz_volume_screenshot.py", in_fa, 'fa.png', - '--display_slice_number', '--display_lr') + ret = script_runner.run(["scil_viz_volume_screenshot.py", in_fa, 'fa.png', + '--display_slice_number', '--display_lr']) assert ret.success def test_help_option(script_runner): - ret = script_runner.run("scil_viz_volume_screenshot.py", "--help") + ret = script_runner.run(["scil_viz_volume_screenshot.py", "--help"]) assert ret.success diff --git a/scripts/tests/test_viz_volume_screenshot_mosaic.py b/scripts/tests/test_viz_volume_screenshot_mosaic.py index bd42089af..1c94df323 100644 --- a/scripts/tests/test_viz_volume_screenshot_mosaic.py +++ b/scripts/tests/test_viz_volume_screenshot_mosaic.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run("scil_viz_volume_screenshot_mosaic.py", "--help") + ret = script_runner.run(["scil_viz_volume_screenshot_mosaic.py", "--help"]) assert ret.success diff --git a/scripts/tests/test_volume_apply_transform.py b/scripts/tests/test_volume_apply_transform.py index 1b9ba4407..ba3a65897 100644 --- a/scripts/tests/test_volume_apply_transform.py +++ b/scripts/tests/test_volume_apply_transform.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_apply_transform.py', '--help') + ret = script_runner.run(['scil_volume_apply_transform.py', '--help']) assert ret.success @@ -25,10 +25,10 @@ def test_execution_bst(script_runner, monkeypatch): 'fa.nii.gz') in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') - ret = script_runner.run('scil_volume_apply_transform.py', + ret = script_runner.run(['scil_volume_apply_transform.py', in_model, in_fa, in_aff, 'template_lin.nii.gz', '--inverse', - '-f') + '-f']) assert ret.success @@ -40,10 +40,10 @@ def test_execution_interp_nearest(script_runner, monkeypatch): 'fa.nii.gz') in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') - ret = script_runner.run('scil_volume_apply_transform.py', + ret = script_runner.run(['scil_volume_apply_transform.py', in_model, in_fa, in_aff, 'template_lin.nii.gz', '--inverse', - '--interp', 'nearest', '-f') + '--interp', 'nearest', '-f']) assert ret.success @@ -55,8 +55,8 @@ def test_execution_interp_lin(script_runner, monkeypatch): 'fa.nii.gz') in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') - ret = script_runner.run('scil_volume_apply_transform.py', + ret = script_runner.run(['scil_volume_apply_transform.py', in_model, in_fa, in_aff, 'template_lin.nii.gz', '--inverse', - '--interp', 'linear', '-f') + '--interp', 'linear', '-f']) assert ret.success diff --git a/scripts/tests/test_volume_b0_synthesis.py b/scripts/tests/test_volume_b0_synthesis.py index a9c811dc7..40d912439 100644 --- a/scripts/tests/test_volume_b0_synthesis.py +++ b/scripts/tests/test_volume_b0_synthesis.py @@ -24,7 +24,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_b0_synthesis.py', '--help') + ret = script_runner.run(['scil_volume_b0_synthesis.py', '--help']) assert ret.success @@ -45,8 +45,8 @@ def test_synthesis(script_runner, monkeypatch): nib.save(nib.Nifti1Image(b0_data.astype(np.uint8), b0_img.affine), 'b0_mask.nii.gz') - ret = script_runner.run('scil_volume_b0_synthesis.py', + ret = script_runner.run(['scil_volume_b0_synthesis.py', in_t1, 't1_mask.nii.gz', in_b0, 'b0_mask.nii.gz', - 'b0_synthesized.nii.gz', '-v') + 'b0_synthesized.nii.gz', '-v']) assert ret.success diff --git a/scripts/tests/test_volume_count_non_zero_voxels.py b/scripts/tests/test_volume_count_non_zero_voxels.py index cec9c23bc..e77f7b62d 100644 --- a/scripts/tests/test_volume_count_non_zero_voxels.py +++ b/scripts/tests/test_volume_count_non_zero_voxels.py @@ -13,25 +13,25 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_count_non_zero_voxels.py', '--help') + ret = script_runner.run(['scil_volume_count_non_zero_voxels.py', '--help']) assert ret.success def test_execution_simple_print(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'rgb.nii.gz') - ret = script_runner.run('scil_volume_count_non_zero_voxels.py', in_img) + ret = script_runner.run(['scil_volume_count_non_zero_voxels.py', in_img]) assert ret.success def test_execution_save_in_file(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'rgb.nii.gz') - ret = script_runner.run('scil_volume_count_non_zero_voxels.py', in_img, - '--out', 'printed.txt') + ret = script_runner.run(['scil_volume_count_non_zero_voxels.py', in_img, + '--out', 'printed.txt']) assert ret.success # Then re-use the same out file with --stats - ret = script_runner.run('scil_volume_count_non_zero_voxels.py', in_img, - '--out', 'printed.txt', '--stats') + ret = script_runner.run(['scil_volume_count_non_zero_voxels.py', in_img, + '--out', 'printed.txt', '--stats']) assert ret.success diff --git a/scripts/tests/test_volume_crop.py b/scripts/tests/test_volume_crop.py index 9d3066726..1637e4e85 100644 --- a/scripts/tests/test_volume_crop.py +++ b/scripts/tests/test_volume_crop.py @@ -13,18 +13,18 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_crop.py', '--help') + ret = script_runner.run(['scil_volume_crop.py', '--help']) assert ret.success def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi.nii.gz') - ret = script_runner.run('scil_volume_crop.py', in_dwi, 'dwi_crop.nii.gz', - '--output_bbox', 'bbox.json') + ret = script_runner.run(['scil_volume_crop.py', in_dwi, 'dwi_crop.nii.gz', + '--output_bbox', 'bbox.json']) assert ret.success # Then try to load back the same box - ret = script_runner.run('scil_volume_crop.py', in_dwi, 'dwi_crop2.nii.gz', - '--input_bbox', 'bbox.json') + ret = script_runner.run(['scil_volume_crop.py', in_dwi, 'dwi_crop2.nii.gz', + '--input_bbox', 'bbox.json']) assert ret.success diff --git a/scripts/tests/test_volume_distance_map.py b/scripts/tests/test_volume_distance_map.py index ed5802019..338005aca 100644 --- a/scripts/tests/test_volume_distance_map.py +++ b/scripts/tests/test_volume_distance_map.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_distance_map.py', '--help') + ret = script_runner.run(['scil_volume_distance_map.py', '--help']) assert ret.success @@ -27,9 +27,9 @@ def test_execution(script_runner, monkeypatch): in_mask_2 = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') - ret = script_runner.run('scil_volume_distance_map.py', + ret = script_runner.run(['scil_volume_distance_map.py', in_mask_1, in_mask_2, - 'distance_map.nii.gz') + 'distance_map.nii.gz']) img = nib.load('distance_map.nii.gz') data = img.get_fdata() diff --git a/scripts/tests/test_volume_flip.py b/scripts/tests/test_volume_flip.py index 2f6a57e53..1adf5662b 100644 --- a/scripts/tests/test_volume_flip.py +++ b/scripts/tests/test_volume_flip.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_flip.py', '--help') + ret = script_runner.run(['scil_volume_flip.py', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fa = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') - ret = script_runner.run('scil_volume_flip.py', in_fa, 'fa_flip.nii.gz', - 'x') + ret = script_runner.run(['scil_volume_flip.py', in_fa, 'fa_flip.nii.gz', + 'x']) assert ret.success diff --git a/scripts/tests/test_volume_math.py b/scripts/tests/test_volume_math.py index 6631a749f..41b72636d 100644 --- a/scripts/tests/test_volume_math.py +++ b/scripts/tests/test_volume_math.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_math.py', '--help') + ret = script_runner.run(['scil_volume_math.py', '--help']) assert ret.success @@ -25,24 +25,24 @@ def test_execution_add(script_runner, monkeypatch): 'brainstem_174.nii.gz') in_img_3 = os.path.join(SCILPY_HOME, 'atlas', 'brainstem_175.nii.gz') - ret = script_runner.run('scil_volume_math.py', 'addition', - in_img_1, in_img_2, in_img_3, 'brainstem.nii.gz') + ret = script_runner.run(['scil_volume_math.py', 'addition', + in_img_1, in_img_2, in_img_3, 'brainstem.nii.gz']) assert ret.success def test_execution_low_thresh(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'atlas', 'brainstem.nii.gz') - ret = script_runner.run('scil_volume_math.py', 'lower_threshold', - in_img, '1', 'brainstem_bin.nii.gz') + ret = script_runner.run(['scil_volume_math.py', 'lower_threshold', + in_img, '1', 'brainstem_bin.nii.gz']) assert ret.success def test_execution_low_mult(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'atlas', 'brainstem_bin.nii.gz') - ret = script_runner.run('scil_volume_math.py', 'multiplication', - in_img, '16', 'brainstem_unified.nii.gz') + ret = script_runner.run(['scil_volume_math.py', 'multiplication', + in_img, '16', 'brainstem_unified.nii.gz']) assert ret.success @@ -54,9 +54,9 @@ def test_execution_concatenate(script_runner, monkeypatch): in_img_4 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '13.nii.gz') in_img_5 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '17.nii.gz') in_img_6 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '18.nii.gz') - ret = script_runner.run('scil_volume_math.py', 'concatenate', + ret = script_runner.run(['scil_volume_math.py', 'concatenate', in_img_1, in_img_2, in_img_3, in_img_4, in_img_5, - in_img_6, 'concat_ids.nii.gz') + in_img_6, 'concat_ids.nii.gz']) assert ret.success @@ -66,7 +66,7 @@ def test_execution_concatenate_4D(script_runner, monkeypatch): in_img_2 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '8_10.nii.gz') in_img_3 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '12.nii.gz') in_img_4 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '8_10.nii.gz') - ret = script_runner.run('scil_volume_math.py', 'concatenate', + ret = script_runner.run(['scil_volume_math.py', 'concatenate', in_img_1, in_img_2, in_img_3, in_img_4, - 'concat_ids_4d.nii.gz') + 'concat_ids_4d.nii.gz']) assert ret.success diff --git a/scripts/tests/test_volume_pairwise_comparison.py b/scripts/tests/test_volume_pairwise_comparison.py index bb61d3ea2..d3babfd6d 100644 --- a/scripts/tests/test_volume_pairwise_comparison.py +++ b/scripts/tests/test_volume_pairwise_comparison.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_pairwise_comparison.py', '--help') + ret = script_runner.run(['scil_volume_pairwise_comparison.py', '--help']) assert ret.success @@ -26,8 +26,8 @@ def test_label_comparison(script_runner, monkeypatch): in_atlas_dilated = os.path.join( SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_single_brainstem_dil.nii.gz') - ret = script_runner.run('scil_volume_pairwise_comparison.py', - in_atlas, in_atlas_dilated, 'atlas.json') + ret = script_runner.run(['scil_volume_pairwise_comparison.py', + in_atlas, in_atlas_dilated, 'atlas.json']) assert ret.success @@ -40,8 +40,8 @@ def test_binary_comparison(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_volume_pairwise_comparison.py', - in_bin_1, in_bin_2, 'binary.json') + ret = script_runner.run(['scil_volume_pairwise_comparison.py', + in_bin_1, in_bin_2, 'binary.json']) assert ret.success @@ -58,8 +58,8 @@ def test_multiple_compare(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') - ret = script_runner.run('scil_volume_pairwise_comparison.py', - in_bin_1, in_bin_2, in_bin_3, 'multiple.json') + ret = script_runner.run(['scil_volume_pairwise_comparison.py', + in_bin_1, in_bin_2, in_bin_3, 'multiple.json']) assert ret.success @@ -76,9 +76,9 @@ def test_single_compare(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') - ret = script_runner.run('scil_volume_pairwise_comparison.py', + ret = script_runner.run(['scil_volume_pairwise_comparison.py', in_bin_1, in_bin_2, 'single.json', - '--single_compare', in_bin_3) + '--single_compare', in_bin_3]) assert ret.success @@ -95,10 +95,10 @@ def test_ratio_compare(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') - ret = script_runner.run('scil_volume_pairwise_comparison.py', + ret = script_runner.run(['scil_volume_pairwise_comparison.py', in_bin_1, in_bin_2, 'ratio.json', '--single_compare', in_bin_3, - '--ratio') + '--ratio']) assert ret.success @@ -109,8 +109,8 @@ def test_labels_to_mask_compare(script_runner, monkeypatch): in_mask = os.path.join( SCILPY_HOME, 'atlas', 'brainstem_bin.nii.gz') - ret = script_runner.run('scil_volume_pairwise_comparison.py', + ret = script_runner.run(['scil_volume_pairwise_comparison.py', in_atlas, 'labels_to_maskjson', '--single_compare', in_mask, - '--labels_to_mask') + '--labels_to_mask']) assert ret.success diff --git a/scripts/tests/test_volume_remove_outliers_ransac.py b/scripts/tests/test_volume_remove_outliers_ransac.py index 834442f86..44526a324 100644 --- a/scripts/tests/test_volume_remove_outliers_ransac.py +++ b/scripts/tests/test_volume_remove_outliers_ransac.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_remove_outliers_ransac.py', '--help') + ret = script_runner.run(['scil_volume_remove_outliers_ransac.py', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_ad = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') - ret = script_runner.run('scil_volume_remove_outliers_ransac.py', in_ad, - 'ad_ransanc.nii.gz') + ret = script_runner.run(['scil_volume_remove_outliers_ransac.py', in_ad, + 'ad_ransanc.nii.gz']) assert ret.success diff --git a/scripts/tests/test_volume_resample.py b/scripts/tests/test_volume_resample.py index 9133e5dbe..948ef5239 100644 --- a/scripts/tests/test_volume_resample.py +++ b/scripts/tests/test_volume_resample.py @@ -14,37 +14,37 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_resample.py', '--help') + ret = script_runner.run(['scil_volume_resample.py', '--help']) assert ret.success def test_execution_given_size(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_volume_resample.py', in_img, - 'fa_resample_2.nii.gz', '--voxel_size', '2') + ret = script_runner.run(['scil_volume_resample.py', in_img, + 'fa_resample_2.nii.gz', '--voxel_size', '2']) assert ret.success def test_execution_force_voxel(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_volume_resample.py', in_img, + ret = script_runner.run(['scil_volume_resample.py', in_img, 'fa_resample_4.nii.gz', '--voxel_size', '4', - '--enforce_voxel_size') + '--enforce_voxel_size']) assert ret.success def test_execution_ref(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ref = os.path.join(SCILPY_HOME, 'others', 'fa_resample.nii.gz') - ret = script_runner.run('scil_volume_resample.py', in_img, - 'fa_resample2.nii.gz', '--ref', ref) + ret = script_runner.run(['scil_volume_resample.py', in_img, + 'fa_resample2.nii.gz', '--ref', ref]) assert ret.success def test_execution_ref_force(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ref = os.path.join(SCILPY_HOME, 'others', 'fa_resample.nii.gz') - ret = script_runner.run('scil_volume_resample.py', in_img, + ret = script_runner.run(['scil_volume_resample.py', in_img, 'fa_resample_ref.nii.gz', '--ref', ref, - '--enforce_dimensions') + '--enforce_dimensions']) assert ret.success diff --git a/scripts/tests/test_volume_reshape.py b/scripts/tests/test_volume_reshape.py index 0fab76ee8..bbe0f4dec 100644 --- a/scripts/tests/test_volume_reshape.py +++ b/scripts/tests/test_volume_reshape.py @@ -15,46 +15,46 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_reshape.py', '--help') + ret = script_runner.run(['scil_volume_reshape.py', '--help']) assert ret.success def test_execution_crop(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_volume_reshape.py', in_img, + ret = script_runner.run(['scil_volume_reshape.py', in_img, 'fa_reshape.nii.gz', '--volume_size', '90', - '-f') + '-f']) assert ret.success def test_execution_pad(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_volume_reshape.py', in_img, + ret = script_runner.run(['scil_volume_reshape.py', in_img, 'fa_reshape.nii.gz', '--volume_size', '150', - '-f') + '-f']) assert ret.success def test_execution_full_size(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_volume_reshape.py', in_img, + ret = script_runner.run(['scil_volume_reshape.py', in_img, 'fa_reshape.nii.gz', '--volume_size', - '164', '164', '164', '-f') + '164', '164', '164', '-f']) assert ret.success def test_execution_dtype(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_volume_reshape.py', in_img, + ret = script_runner.run(['scil_volume_reshape.py', in_img, 'fa_reshape.nii.gz', '--volume_size', '111', '133', '109', '--data_type', - 'uint8', '-f') + 'uint8', '-f']) assert ret.success def test_execution_ref(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ref = os.path.join(SCILPY_HOME, 'others', 'fa_resample.nii.gz') - ret = script_runner.run('scil_volume_reshape.py', in_img, - 'fa_reshape.nii.gz', '--ref', ref, '-f') + ret = script_runner.run(['scil_volume_reshape.py', in_img, + 'fa_reshape.nii.gz', '--ref', ref, '-f']) assert ret.success diff --git a/scripts/tests/test_volume_reslice_to_reference.py b/scripts/tests/test_volume_reslice_to_reference.py index 9c62c48f0..39564f46c 100644 --- a/scripts/tests/test_volume_reslice_to_reference.py +++ b/scripts/tests/test_volume_reslice_to_reference.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_reslice_to_reference.py', '--help') + ret = script_runner.run(['scil_volume_reslice_to_reference.py', '--help']) assert ret.success @@ -21,9 +21,9 @@ def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 't1_crop.nii.gz') in_ref = os.path.join(SCILPY_HOME, 'others', 't1.nii.gz') - ret = script_runner.run('scil_volume_reslice_to_reference.py', in_img, + ret = script_runner.run(['scil_volume_reslice_to_reference.py', in_img, in_ref, 't1_reslice.nii.gz', - '--interpolation', 'nearest') + '--interpolation', 'nearest']) assert ret.success @@ -31,7 +31,7 @@ def test_execution_4D(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.nii.gz') in_ref = os.path.join(SCILPY_HOME, 'others', 't1.nii.gz') - ret = script_runner.run('scil_volume_reslice_to_reference.py', in_img, + ret = script_runner.run(['scil_volume_reslice_to_reference.py', in_img, in_ref, 'dwi_reslice.nii.gz', - '--interpolation', 'nearest') + '--interpolation', 'nearest']) assert ret.success diff --git a/scripts/tests/test_volume_stats_in_ROI.py b/scripts/tests/test_volume_stats_in_ROI.py index c03593858..beb6c7c6f 100644 --- a/scripts/tests/test_volume_stats_in_ROI.py +++ b/scripts/tests/test_volume_stats_in_ROI.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_stats_in_ROI.py', '--help') + ret = script_runner.run(['scil_volume_stats_in_ROI.py', '--help']) assert ret.success @@ -25,28 +25,28 @@ def test_execution_tractometry(script_runner, monkeypatch): 'mni_masked.nii.gz') # Test with a single ROI input - ret = script_runner.run('scil_volume_stats_in_ROI.py', - in_roi, '--metrics', in_ref) + ret = script_runner.run(['scil_volume_stats_in_ROI.py', + in_roi, '--metrics', in_ref]) assert ret.success # Test with multiple ROIs input - ret = script_runner.run('scil_volume_stats_in_ROI.py', - in_roi, in_roi, in_roi, '--metrics', in_ref) + ret = script_runner.run(['scil_volume_stats_in_ROI.py', + in_roi, in_roi, in_roi, '--metrics', in_ref]) assert ret.success # Test with multiple metric input - ret = script_runner.run('scil_volume_stats_in_ROI.py', - in_roi, '--metrics', in_ref, in_ref, in_ref) + ret = script_runner.run(['scil_volume_stats_in_ROI.py', + in_roi, '--metrics', in_ref, in_ref, in_ref]) assert ret.success # Test with multiple metric and ROIs input - ret = script_runner.run('scil_volume_stats_in_ROI.py', - in_roi, in_roi, '--metrics', in_ref, in_ref) + ret = script_runner.run(['scil_volume_stats_in_ROI.py', + in_roi, in_roi, '--metrics', in_ref, in_ref]) assert ret.success # Test with a metric folder metrics_dir = os.path.join(SCILPY_HOME, 'plot') in_roi = os.path.join(SCILPY_HOME, 'plot', 'mask_wm.nii.gz') - ret = script_runner.run('scil_volume_stats_in_ROI.py', - in_roi, '--metrics_dir', metrics_dir) + ret = script_runner.run(['scil_volume_stats_in_ROI.py', + in_roi, '--metrics_dir', metrics_dir]) assert ret.success diff --git a/scripts/tests/test_volume_stats_in_labels.py b/scripts/tests/test_volume_stats_in_labels.py index 4a4471384..a05c39913 100644 --- a/scripts/tests/test_volume_stats_in_labels.py +++ b/scripts/tests/test_volume_stats_in_labels.py @@ -11,7 +11,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_stats_in_labels.py', '--help') + ret = script_runner.run(['scil_volume_stats_in_labels.py', '--help']) assert ret.success @@ -22,19 +22,19 @@ def test_execution(script_runner, monkeypatch): atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') # Test with a single metric - ret = script_runner.run('scil_volume_stats_in_labels.py', - in_atlas, atlas_lut, "--metrics", in_metric) + ret = script_runner.run(['scil_volume_stats_in_labels.py', + in_atlas, atlas_lut, "--metrics", in_metric]) assert ret.success # Test with multiple metrics - ret = script_runner.run('scil_volume_stats_in_labels.py', + ret = script_runner.run(['scil_volume_stats_in_labels.py', in_atlas, atlas_lut, "--metrics", - in_metric, in_metric, in_metric) + in_metric, in_metric, in_metric]) assert ret.success # Test with a metric folder metrics_dir = os.path.join(SCILPY_HOME, 'plot') - ret = script_runner.run('scil_volume_stats_in_labels.py', + ret = script_runner.run(['scil_volume_stats_in_labels.py', in_atlas, atlas_lut, "--metrics_dir", - metrics_dir) + metrics_dir]) assert ret.success From 7d998bc86b024b481c52f20a14d82c473ba43d5f Mon Sep 17 00:00:00 2001 From: frheault Date: Fri, 11 Jul 2025 10:52:57 -0400 Subject: [PATCH 13/90] Fix errors due to regex --- pytest.ini | 5 +- scripts/tests/test_bids_validate.py | 42 +++++++------- .../tests/test_connectivity_reorder_rois.py | 10 ++-- scripts/tests/test_sh_to_aodf.py | 56 +++++++++---------- .../test_tractogram_filter_by_anatomy.py | 36 ++++++------ ...ctogram_segment_connections_from_labels.py | 2 +- 6 files changed, 77 insertions(+), 74 deletions(-) diff --git a/pytest.ini b/pytest.ini index a9acefdde..fee1f652a 100644 --- a/pytest.ini +++ b/pytest.ini @@ -36,4 +36,7 @@ addopts = --junit-xml=.test_reports/junit.xml --cov --cov-report html - --cov-report xml \ No newline at end of file + --cov-report xml + +markers = + ml: For tests related to machine learning (NLTK, Pytorch, etc.) \ No newline at end of file diff --git a/scripts/tests/test_bids_validate.py b/scripts/tests/test_bids_validate.py index b3422caba..bffbc172d 100644 --- a/scripts/tests/test_bids_validate.py +++ b/scripts/tests/test_bids_validate.py @@ -23,7 +23,7 @@ def generate_fake_metadata_json( - intended_for=None, phase_dir=None, readout=None, **kwargs): + intended_for=None, phase_dir=None, readout=None, **kwargs): base_dict = {} if intended_for: @@ -40,11 +40,11 @@ def generate_fake_metadata_json( def generate_image_packet( - data,directory, prefix, - intended_for=None, - phase_dir=None, - readout=None, - **kwargs): + data, directory, prefix, + intended_for=None, + phase_dir=None, + readout=None, + **kwargs): nib.save(nib.Nifti1Image(data, np.eye(4)), os.path.join(directory, "{}.nii.gz".format(prefix))) @@ -302,7 +302,7 @@ def generate_fake_bids_structure( return structure_dir -def compare_jsons(json_output, test_dir): +def compare_jsons(json_output, test_dir): # Open test json file with open(os.path.join(test_dir, json_output), 'r') as f: test_json = json.load(f)[0] @@ -310,10 +310,11 @@ def compare_jsons(json_output, test_dir): # Clean test_json for key, value in test_json.items(): if isinstance(value, str): - test_json[key] = value.replace(test_dir + os.path.sep,'') + test_json[key] = value.replace(test_dir + os.path.sep, '') # Open correct json file - result_json = os.path.join(SCILPY_HOME, 'bids_json', json_output.replace('test', 'result')) + result_json = os.path.join( + SCILPY_HOME, 'bids_json', json_output.replace('test', 'result')) with open(result_json, 'r') as f: result = json.load(f)[0] @@ -331,7 +332,6 @@ def test_help_option(script_runner): assert ret.success - @pytest.mark.parametrize( "dwi_is_complex,json_output", [(False, 'test_real_dwi_epi.json'), @@ -348,8 +348,8 @@ def test_bids_epi(tmpdir, script_runner, dwi_is_complex, json_output): ret = script_runner.run([ 'scil_bids_validate.py', test_dir, - os.path.join(test_dir, json_output]), - '-f', '-v') + os.path.join(test_dir, json_output), + '-f', '-v']) if ret.success: assert compare_jsons(json_output, test_dir) @@ -363,7 +363,7 @@ def test_bids_epi(tmpdir, script_runner, dwi_is_complex, json_output): (True, True, 'test_complex_dwi_complex_sbref.json')] ) def test_bids_sbref( - tmpdir, script_runner, dwi_is_complex, sbref_is_complex, json_output): + tmpdir, script_runner, dwi_is_complex, sbref_is_complex, json_output): test_dir = generate_fake_bids_structure( tmpdir, 1, 1, gen_anat_t1=True, @@ -375,8 +375,8 @@ def test_bids_sbref( ret = script_runner.run([ 'scil_bids_validate.py', test_dir, - os.path.join(test_dir, json_output]), - '-f', '-v') + os.path.join(test_dir, json_output), + '-f', '-v']) if ret.success: assert compare_jsons(json_output, test_dir) @@ -390,7 +390,7 @@ def test_bids_sbref( (True, True, 'test_complex_dwi_complex_rev_dwi.json')] ) def test_bids_rev_dwi( - tmpdir, script_runner, dwi_is_complex, rev_is_complex, json_output): + tmpdir, script_runner, dwi_is_complex, rev_is_complex, json_output): test_dir = generate_fake_bids_structure( tmpdir, 1, 1, gen_anat_t1=True, @@ -401,8 +401,8 @@ def test_bids_rev_dwi( ret = script_runner.run([ 'scil_bids_validate.py', test_dir, - os.path.join(test_dir, json_output]), - '-f', '-v') + os.path.join(test_dir, json_output), + '-f', '-v']) if ret.success: assert compare_jsons(json_output, test_dir) @@ -416,7 +416,7 @@ def test_bids_rev_dwi( (True, True, 'test_complex_dwi_complex_rev_dwi_sbref.json')] ) def test_bids_rev_dwi_sbref( - tmpdir, script_runner, dwi_is_complex, rev_is_complex, json_output): + tmpdir, script_runner, dwi_is_complex, rev_is_complex, json_output): test_dir = generate_fake_bids_structure( tmpdir, 1, 1, gen_anat_t1=True, @@ -429,8 +429,8 @@ def test_bids_rev_dwi_sbref( ret = script_runner.run([ 'scil_bids_validate.py', test_dir, - os.path.join(test_dir, json_output]), - '-f', '-v') + os.path.join(test_dir, json_output), + '-f', '-v']) if ret.success: assert compare_jsons(json_output, test_dir) diff --git a/scripts/tests/test_connectivity_reorder_rois.py b/scripts/tests/test_connectivity_reorder_rois.py index bf9ed8699..531dab258 100644 --- a/scripts/tests/test_connectivity_reorder_rois.py +++ b/scripts/tests/test_connectivity_reorder_rois.py @@ -28,8 +28,8 @@ def test_execution_compute_OLO(script_runner, monkeypatch): 'labels_list.txt') ret = script_runner.run(['scil_connectivity_reorder_rois.py', in_sc, '--optimal_leaf_ordering', 'OLO.txt', - '--out_dir', os.path.expanduser(tmp_dir.name]), - '--labels_list', in_labels_list, '-f') + '--out_dir', os.path.expanduser(tmp_dir.name), + '--labels_list', in_labels_list, '-f']) assert ret.success @@ -41,7 +41,7 @@ def test_execution_apply_ordering(script_runner, monkeypatch): 'labels_list.txt') ret = script_runner.run(['scil_connectivity_reorder_rois.py', in_sc, '--in_ordering', in_txt, - '--out_suffix', '_sc_reo', - '--out_dir', os.path.expanduser(tmp_dir.name]), - '--labels_list', in_labels_list, '-f') + '--out_suffix', '_sc_reo', + '--out_dir', os.path.expanduser(tmp_dir.name), + '--labels_list', in_labels_list, '-f']) assert ret.success diff --git a/scripts/tests/test_sh_to_aodf.py b/scripts/tests/test_sh_to_aodf.py index 18368b76f..188229961 100644 --- a/scripts/tests/test_sh_to_aodf.py +++ b/scripts/tests/test_sh_to_aodf.py @@ -31,15 +31,15 @@ def test_asym_basis_output_gpu(script_runner, in_fodf, expected_fodf, monkeypatc ret = script_runner.run(['scil_sh_to_aodf.py', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', - '--sigma_align', '0.8', - '--sigma_spatial', '1.0', - '--sigma_range', '0.2', - '--sigma_angle', '0.06', - '--use_opencl', - '--device', 'gpu', - '--sh_basis', 'descoteaux07_legacy', '-f', - '--include_center', - print_result=True, shell=True]) + '--sigma_align', '0.8', + '--sigma_spatial', '1.0', + '--sigma_range', '0.2', + '--sigma_angle', '0.06', + '--use_opencl', + '--device', 'gpu', + '--sh_basis', 'descoteaux07_legacy', '-f', + '--include_center'], + print_result=True, shell=True) if have_opencl: # if we have opencl the script should not raise an error @@ -67,14 +67,14 @@ def test_asym_basis_output(script_runner, in_fodf, expected_fodf, monkeypatch): ret = script_runner.run(['scil_sh_to_aodf.py', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', - '--sigma_align', '0.8', - '--sigma_spatial', '1.0', - '--sigma_range', '0.2', - '--sigma_angle', '0.06', - '--device', 'cpu', - '--sh_basis', 'descoteaux07_legacy', '-f', - '--include_center', - print_result=True, shell=True]) + '--sigma_align', '0.8', + '--sigma_spatial', '1.0', + '--sigma_range', '0.2', + '--sigma_angle', '0.06', + '--device', 'cpu', + '--sh_basis', 'descoteaux07_legacy', '-f', + '--include_center'], + print_result=True, shell=True) assert ret.success @@ -94,14 +94,14 @@ def test_asym_input(script_runner, in_fodf, expected_fodf, monkeypatch): ret = script_runner.run(['scil_sh_to_aodf.py', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', - '--sigma_align', '0.8', - '--sigma_spatial', '1.0', - '--sigma_range', '0.2', - '--sigma_angle', '0.06', - '--device', 'cpu', - '--sh_basis', 'descoteaux07_legacy', '-f', - '--include_center', - print_result=True, shell=True]) + '--sigma_align', '0.8', + '--sigma_spatial', '1.0', + '--sigma_range', '0.2', + '--sigma_angle', '0.06', + '--device', 'cpu', + '--sh_basis', 'descoteaux07_legacy', '-f', + '--include_center'], + print_result=True, shell=True) assert ret.success @@ -120,9 +120,9 @@ def test_cosine_method(script_runner, in_fodf, out_fodf, monkeypatch): ret = script_runner.run(['scil_sh_to_aodf.py', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', - '--method', 'cosine', '-f', - '--sh_basis', 'descoteaux07_legacy', - print_result=True, shell=True]) + '--method', 'cosine', '-f', + '--sh_basis', 'descoteaux07_legacy'], + print_result=True, shell=True) assert ret.success diff --git a/scripts/tests/test_tractogram_filter_by_anatomy.py b/scripts/tests/test_tractogram_filter_by_anatomy.py index be6c60c44..c3253df0a 100644 --- a/scripts/tests/test_tractogram_filter_by_anatomy.py +++ b/scripts/tests/test_tractogram_filter_by_anatomy.py @@ -26,14 +26,14 @@ def test_execution_filtering_all_options(script_runner, monkeypatch): 'wmparc_filter_ana.nii.gz') ret = script_runner.run(['scil_tractogram_filter_by_anatomy.py', in_tractogram, in_wmparc, - os.path.expanduser(tmp_dir.name]), + os.path.expanduser(tmp_dir.name), '--minL', '40', '--maxL', '200', '--angle', '300', - '--processes', '1', '--save_volumes', - '--dilate_ctx', '2', - '--save_intermediate_tractograms', - '--save_counts', - '--save_rejected', - '-f') + '--processes', '1', '--save_volumes', + '--dilate_ctx', '2', + '--save_intermediate_tractograms', + '--save_counts', + '--save_rejected', + '-f']) assert ret.success @@ -45,13 +45,13 @@ def test_execution_filtering_rejected(script_runner, monkeypatch): 'wmparc_filter_ana.nii.gz') ret = script_runner.run(['scil_tractogram_filter_by_anatomy.py', in_tractogram, in_wmparc, - os.path.expanduser(tmp_dir.name]), + os.path.expanduser(tmp_dir.name), '--minL', '40', '--maxL', '200', '--angle', '300', - '--processes', '1', '--save_volumes', - '--dilate_ctx', '2', - '--save_counts', - '--save_rejected', - '-f') + '--processes', '1', '--save_volumes', + '--dilate_ctx', '2', + '--save_counts', + '--save_rejected', + '-f']) assert ret.success @@ -63,10 +63,10 @@ def test_execution_filtering_save_intermediate(script_runner, monkeypatch): 'wmparc_filter_ana.nii.gz') ret = script_runner.run(['scil_tractogram_filter_by_anatomy.py', in_tractogram, in_wmparc, - os.path.expanduser(tmp_dir.name]), + os.path.expanduser(tmp_dir.name), '--minL', '40', '--maxL', '200', '--angle', '300', - '--processes', '1', '--save_volumes', - '--dilate_ctx', '2', - '--save_intermediate_tractograms', - '-f') + '--processes', '1', '--save_volumes', + '--dilate_ctx', '2', + '--save_intermediate_tractograms', + '-f']) assert ret.success diff --git a/scripts/tests/test_tractogram_segment_connections_from_labels.py b/scripts/tests/test_tractogram_segment_connections_from_labels.py index da8dbca75..e618204e9 100644 --- a/scripts/tests/test_tractogram_segment_connections_from_labels.py +++ b/scripts/tests/test_tractogram_segment_connections_from_labels.py @@ -28,5 +28,5 @@ def test_execution_connectivity(script_runner, monkeypatch): in_atlas, 'decompose.h5', '--min_length', '20', '--max_length', '200', '--outlier_threshold', '0.5', '--loop_max_angle', '330', '--curv_qb_distance', '10', '--processes', '1', '-v', 'DEBUG', - '--save_final', '--out_dir', os.path.join(tmp_dir.name, 'out_bundles'])) + '--save_final', '--out_dir', os.path.join(tmp_dir.name, 'out_bundles')]) assert ret.success From b41973665427ec4bbfb8fe01716a95793f56692d Mon Sep 17 00:00:00 2001 From: frheault Date: Fri, 11 Jul 2025 11:39:13 -0400 Subject: [PATCH 14/90] Fix fibertube array error --- scilpy/tractograms/streamline_operations.py | 2 +- scripts/tests/test_fibertube_compute_density.py | 2 +- scripts/tests/test_fibertube_score_tractogram.py | 6 +++--- scripts/tests/test_fibertube_tracking.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scilpy/tractograms/streamline_operations.py b/scilpy/tractograms/streamline_operations.py index 61106d0ad..e3215bd39 100644 --- a/scilpy/tractograms/streamline_operations.py +++ b/scilpy/tractograms/streamline_operations.py @@ -1103,4 +1103,4 @@ def find_seed_indexes_on_streamlines(seeds, streamlines, atol=1.e-8): raise ValueError('A seed coordinate was not found on streamline.') seed_indexes.append(seed_index) - return seed_indexes + return np.array(seed_indexes, dtype=np.uint32) diff --git a/scripts/tests/test_fibertube_compute_density.py b/scripts/tests/test_fibertube_compute_density.py index d2466d049..68f724bb8 100644 --- a/scripts/tests/test_fibertube_compute_density.py +++ b/scripts/tests/test_fibertube_compute_density.py @@ -31,7 +31,7 @@ def init_data(): sft_fibertubes = StatefulTractogram(streamlines, mask_img, Space.VOX, Origin.NIFTI) sft_fibertubes.data_per_streamline = { - "diameters": [0.2, 0.01] + "diameters": np.array([0.2, 0.01]) } save_tractogram(sft_fibertubes, 'fibertubes.trk', True) diff --git a/scripts/tests/test_fibertube_score_tractogram.py b/scripts/tests/test_fibertube_score_tractogram.py index 0e103e349..3145ea48c 100644 --- a/scripts/tests/test_fibertube_score_tractogram.py +++ b/scripts/tests/test_fibertube_score_tractogram.py @@ -39,14 +39,14 @@ def init_data(): space=Space.VOX, origin=Origin.NIFTI) sft_fibertubes.data_per_streamline = { - "diameters": [0.002, 0.001] + "diameters": np.array([0.002, 0.001]) } sft_tracking = StatefulTractogram(streamlines, mask_img, space=Space.VOX, origin=Origin.NIFTI) sft_tracking.data_per_streamline = { - "seeds": [streamlines[0][0], streamlines[1][-1]], - "seed_ids": [0., 1.] + "seeds": np.array([streamlines[0][0], streamlines[1][-1]]), + "seed_ids": np.array([0, 1], dtype=np.uint32), } save_tractogram(sft_fibertubes, 'fibertubes.trk', True) diff --git a/scripts/tests/test_fibertube_tracking.py b/scripts/tests/test_fibertube_tracking.py index bed9dfe6b..389b892b6 100644 --- a/scripts/tests/test_fibertube_tracking.py +++ b/scripts/tests/test_fibertube_tracking.py @@ -31,7 +31,7 @@ def init_data(): space=Space.VOX, origin=Origin.NIFTI) sft.data_per_streamline = { - "diameters": [0.002, 0.001] + "diameters": np.array([0.002, 0.001]) } save_tractogram(sft, 'tractogram.trk', True) From eac664257e164737a5ed8c73dbe4e5ae08c8c865 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 11 Jul 2025 15:32:02 -0400 Subject: [PATCH 15/90] add filtering overlap point + nb points --- scripts/scil_bundle_label_map.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/scil_bundle_label_map.py b/scripts/scil_bundle_label_map.py index ce5aefd28..e497a2c5b 100755 --- a/scripts/scil_bundle_label_map.py +++ b/scripts/scil_bundle_label_map.py @@ -81,7 +81,8 @@ add_verbose_arg, assert_inputs_exist, assert_output_dirs_exist_and_empty, - load_matrix_in_any_format) + load_matrix_in_any_format, + ranged_type) from scilpy.tractanalysis.bundle_operations import uniformize_bundle_sft from scilpy.tractanalysis.streamlines_metrics import compute_tract_counts_map from scilpy.tractanalysis.distance_to_centroid import (subdivide_bundles, @@ -89,7 +90,7 @@ from scilpy.tractograms.streamline_and_mask_operations import \ cut_streamlines_with_mask, CuttingStyle from scilpy.tractograms.streamline_operations import \ - filter_streamlines_by_nb_points + filter_streamlines_by_nb_points, remove_overlapping_points_streamlines from scilpy.viz.color import get_lookup_table from scilpy.version import version_string @@ -117,6 +118,10 @@ def _build_arg_parser(): p.add_argument('--nb_pts', type=int, help='Number of divisions for the bundles.\n' 'Default is the number of points of the centroid.') + p.add_argument('--threshold', type=ranged_type(float, 0, None), + default=0.001, + help='Maximum distance between two points to be considered ' + 'overlapping [%(default)s mm].') p.add_argument('--colormap', default='jet', help='Select the colormap for colored trk (data_per_point) ' '[%(default)s].') @@ -325,6 +330,10 @@ def main(): cut_sft = cut_streamlines_with_mask( new_sft, binary_mask, cutting_style=CuttingStyle.KEEP_LONGEST) + + cut_sft = remove_overlapping_points_streamlines(cut_sft, args.threshold) + cut_sft = filter_streamlines_by_nb_points(cut_sft, min_nb_points=2) + logging.debug( f'Cut streamlines in {round(time.time() - timer, 3)} seconds') cut_sft.data_per_point['color'] = ArraySequence(cut_sft.streamlines) From dbda416aa93b65924ecdd4ce9f235087780fc4ee Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 11 Jul 2025 15:53:06 -0400 Subject: [PATCH 16/90] fix pep8 --- scripts/scil_bundle_label_map.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/scil_bundle_label_map.py b/scripts/scil_bundle_label_map.py index e497a2c5b..68dc36905 100755 --- a/scripts/scil_bundle_label_map.py +++ b/scripts/scil_bundle_label_map.py @@ -121,7 +121,7 @@ def _build_arg_parser(): p.add_argument('--threshold', type=ranged_type(float, 0, None), default=0.001, help='Maximum distance between two points to be considered ' - 'overlapping [%(default)s mm].') + 'overlapping [%(default)s mm].') p.add_argument('--colormap', default='jet', help='Select the colormap for colored trk (data_per_point) ' '[%(default)s].') @@ -330,8 +330,9 @@ def main(): cut_sft = cut_streamlines_with_mask( new_sft, binary_mask, cutting_style=CuttingStyle.KEEP_LONGEST) - - cut_sft = remove_overlapping_points_streamlines(cut_sft, args.threshold) + + cut_sft = remove_overlapping_points_streamlines(cut_sft, + args.threshold) cut_sft = filter_streamlines_by_nb_points(cut_sft, min_nb_points=2) logging.debug( From 58090a377278715325349a1bf161adb165d70691 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 11 Jul 2025 15:53:45 -0400 Subject: [PATCH 17/90] update version --- scilpy/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scilpy/version.py b/scilpy/version.py index 538d1e903..298977536 100644 --- a/scilpy/version.py +++ b/scilpy/version.py @@ -7,7 +7,7 @@ # Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z" _version_major = 2 _version_minor = 1 -_version_micro = 0 +_version_micro = 1 _version_extra = '' # Construct full version string from these. From 97defa2012f5d1a301ef6b2578a11919380bfd9b Mon Sep 17 00:00:00 2001 From: frheault Date: Fri, 18 Jul 2025 10:57:38 -0400 Subject: [PATCH 18/90] Handle empty labels --- .../tractanalysis/reproducibility_measures.py | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/scilpy/tractanalysis/reproducibility_measures.py b/scilpy/tractanalysis/reproducibility_measures.py index 054d3d16f..9e9e58498 100755 --- a/scilpy/tractanalysis/reproducibility_measures.py +++ b/scilpy/tractanalysis/reproducibility_measures.py @@ -744,6 +744,12 @@ def compare_volume_wrapper(data_1, data_2, voxel_size=1, ratio=False, union_values = np.union1d(unique_values_1, unique_values_2) + measures_name = ['adjacency_voxels', + 'dice_voxels', + 'hausdorff', + 'volume_overlap', + 'volume_overreach'] + dict_measures = {} for val in union_values: binary_1 = np.zeros(data_1.shape, dtype=np.uint8) @@ -755,6 +761,15 @@ def compare_volume_wrapper(data_1, data_2, voxel_size=1, ratio=False, else: binary_2[data_2 == val] = 1 + if np.count_nonzero(binary_1) == 0 or np.count_nonzero(binary_2) == 0: + tmp_dict = dict.fromkeys(measures_name, np.nan) + for measure_name in measures_name: + if measure_name not in dict_measures: + dict_measures[measure_name] = {} + dict_measures[measure_name].update( + {int(val): tmp_dict[measure_name]}) + continue + # These measures are in mm^3 volume_overlap = np.count_nonzero(binary_1 * binary_2) volume_overreach = np.abs(np.count_nonzero( @@ -776,12 +791,6 @@ def compare_volume_wrapper(data_1, data_2, voxel_size=1, ratio=False, hausdorff_vox = compute_hausdorff_voxel(binary_1, binary_2) - measures_name = ['adjacency_voxels', - 'dice_voxels', - 'hausdorff', - 'volume_overlap', - 'volume_overreach'] - # If computing ratio, voxel size does not make sense if ratio: voxel_size = 1. From 10eb3ad7cb7c4cf4379a152798ab950715461813 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Mon, 21 Jul 2025 16:50:10 -0400 Subject: [PATCH 19/90] change repo organization - first trial --- MANIFEST.in | 2 +- codecov.yml | 4 +- pyproject.toml | 280 +++++++++++++++++- .../scil_add_tracking_mask_to_pft_maps.py | 21 -- scripts/legacy/scil_analyse_lesions_load.py | 21 -- .../legacy/scil_apply_bias_field_on_dwi.py | 20 -- .../legacy/scil_apply_transform_to_bvecs.py | 20 -- .../legacy/scil_apply_transform_to_hdf5.py | 20 -- .../legacy/scil_apply_transform_to_image.py | 22 -- .../legacy/scil_apply_transform_to_surface.py | 22 -- .../scil_apply_transform_to_tractogram.py | 22 -- .../scil_assign_custom_color_to_tractogram.py | 22 -- ...cil_assign_uniform_color_to_tractograms.py | 22 -- scripts/legacy/scil_clean_qbx_clusters.py | 20 -- scripts/legacy/scil_combine_labels.py | 22 -- scripts/legacy/scil_compare_connectivity.py | 22 -- scripts/legacy/scil_compress_streamlines.py | 20 -- scripts/legacy/scil_compute_MT_maps.py | 20 -- scripts/legacy/scil_compute_NODDI.py | 20 -- scripts/legacy/scil_compute_NODDI_priors.py | 20 -- .../legacy/scil_compute_asym_odf_metrics.py | 20 -- .../legacy/scil_compute_bundle_mean_std.py | 20 -- .../scil_compute_bundle_mean_std_per_point.py | 22 -- scripts/legacy/scil_compute_bundle_volume.py | 21 -- .../scil_compute_bundle_volume_per_label.py | 21 -- .../scil_compute_bundle_voxel_label_map.py | 21 -- scripts/legacy/scil_compute_centroid.py | 20 -- scripts/legacy/scil_compute_connectivity.py | 22 -- scripts/legacy/scil_compute_divide.py | 20 -- scripts/legacy/scil_compute_dti_metrics.py | 20 -- scripts/legacy/scil_compute_endpoints_map.py | 20 -- .../scil_compute_fodf_max_in_ventricles.py | 21 -- scripts/legacy/scil_compute_fodf_metrics.py | 20 -- scripts/legacy/scil_compute_freewater.py | 20 -- .../scil_compute_hdf5_average_density_map.py | 21 -- scripts/legacy/scil_compute_ihMT_maps.py | 20 -- .../legacy/scil_compute_kurtosis_metrics.py | 20 -- ...scil_compute_lobe_specific_fodf_metrics.py | 21 -- scripts/legacy/scil_compute_local_tracking.py | 20 -- .../legacy/scil_compute_local_tracking_dev.py | 21 -- ...mpute_maps_for_particle_filter_tracking.py | 21 -- ...cil_compute_mean_fixel_afd_from_bundles.py | 21 -- .../scil_compute_mean_fixel_afd_from_hdf5.py | 21 -- ...ute_mean_fixel_lobe_metric_from_bundles.py | 21 -- scripts/legacy/scil_compute_mean_frf.py | 20 -- scripts/legacy/scil_compute_memsmt_fodf.py | 20 -- scripts/legacy/scil_compute_memsmt_frf.py | 20 -- .../scil_compute_metrics_stats_in_ROI.py | 21 -- scripts/legacy/scil_compute_msmt_fodf.py | 20 -- scripts/legacy/scil_compute_msmt_frf.py | 20 -- scripts/legacy/scil_compute_pca.py | 20 -- scripts/legacy/scil_compute_pft.py | 20 -- scripts/legacy/scil_compute_powder_average.py | 20 -- scripts/legacy/scil_compute_qball_metrics.py | 20 -- scripts/legacy/scil_compute_qbx.py | 21 -- scripts/legacy/scil_compute_rish_from_sh.py | 20 -- scripts/legacy/scil_compute_seed_by_labels.py | 20 -- .../legacy/scil_compute_seed_density_map.py | 20 -- scripts/legacy/scil_compute_sf_from_sh.py | 20 -- scripts/legacy/scil_compute_sh_from_signal.py | 20 -- scripts/legacy/scil_compute_ssst_fodf.py | 20 -- scripts/legacy/scil_compute_ssst_frf.py | 20 -- .../scil_compute_streamlines_density_map.py | 21 -- .../scil_compute_streamlines_length_stats.py | 21 -- scripts/legacy/scil_compute_todi.py | 21 -- scripts/legacy/scil_concatenate_dwi.py | 20 -- scripts/legacy/scil_convert_fdf.py | 20 -- .../scil_convert_gradients_fsl_to_mrtrix.py | 22 -- .../scil_convert_gradients_mrtrix_to_fsl.py | 22 -- scripts/legacy/scil_convert_json_to_xlsx.py | 21 -- scripts/legacy/scil_convert_rgb.py | 23 -- scripts/legacy/scil_convert_sh_basis.py | 20 -- scripts/legacy/scil_convert_surface.py | 21 -- scripts/legacy/scil_convert_tensors.py | 20 -- scripts/legacy/scil_convert_tractogram.py | 22 -- scripts/legacy/scil_count_non_zero_voxels.py | 22 -- scripts/legacy/scil_count_streamlines.py | 20 -- scripts/legacy/scil_crop_volume.py | 22 -- scripts/legacy/scil_cut_streamlines.py | 20 -- scripts/legacy/scil_decompose_connectivity.py | 21 -- .../legacy/scil_detect_dwi_volume_outliers.py | 21 -- .../legacy/scil_detect_streamlines_loops.py | 21 -- scripts/legacy/scil_dilate_labels.py | 22 -- .../legacy/scil_estimate_bundles_diameter.py | 21 -- ..._bundles_binary_classification_measures.py | 23 -- ...il_evaluate_bundles_individual_measures.py | 21 -- ...ate_bundles_pairwise_agreement_measures.py | 21 -- ...il_evaluate_connectivity_graph_measures.py | 23 -- ...onnectivity_pairwise_agreement_measures.py | 23 -- ...execute_angle_aware_bilateral_filtering.py | 21 -- .../scil_execute_asymmetric_filtering.py | 21 -- scripts/legacy/scil_extract_b0.py | 20 -- scripts/legacy/scil_extract_dwi_shell.py | 20 -- scripts/legacy/scil_extract_ushape.py | 20 -- scripts/legacy/scil_filter_connectivity.py | 22 -- .../scil_filter_streamlines_by_length.py | 21 -- .../scil_filter_streamlines_by_orientation.py | 21 -- scripts/legacy/scil_filter_tractogram.py | 20 -- .../scil_filter_tractogram_anatomically.py | 21 -- scripts/legacy/scil_fit_bingham_to_fodf.py | 20 -- scripts/legacy/scil_flip_gradients.py | 21 -- scripts/legacy/scil_flip_streamlines.py | 20 -- scripts/legacy/scil_flip_surface.py | 21 -- scripts/legacy/scil_flip_volume.py | 20 -- .../legacy/scil_generate_gradient_sampling.py | 21 -- .../scil_generate_priors_from_bundle.py | 23 -- scripts/legacy/scil_group_comparison.py | 21 -- scripts/legacy/scil_harmonize_json.py | 21 -- scripts/legacy/scil_image_math.py | 20 -- scripts/legacy/scil_merge_json.py | 21 -- scripts/legacy/scil_merge_sh.py | 20 -- scripts/legacy/scil_normalize_connectivity.py | 22 -- scripts/legacy/scil_outlier_rejection.py | 20 -- scripts/legacy/scil_perform_majority_vote.py | 21 -- .../legacy/scil_plot_mean_std_per_point.py | 21 -- scripts/legacy/scil_prepare_eddy_command.py | 20 -- scripts/legacy/scil_prepare_topup_command.py | 20 -- .../scil_print_connectivity_filenames.py | 23 -- scripts/legacy/scil_print_header.py | 20 -- .../legacy/scil_project_streamlines_to_map.py | 21 -- .../legacy/scil_recognize_multi_bundles.py | 20 -- .../legacy/scil_recognize_single_bundle.py | 20 -- scripts/legacy/scil_register_tractogram.py | 21 -- .../legacy/scil_remove_invalid_streamlines.py | 22 -- scripts/legacy/scil_remove_labels.py | 22 -- scripts/legacy/scil_remove_outliers_ransac.py | 20 -- scripts/legacy/scil_reorder_connectivity.py | 22 -- scripts/legacy/scil_reorder_dwi_philips.py | 20 -- scripts/legacy/scil_resample_bvals.py | 21 -- scripts/legacy/scil_resample_streamlines.py | 21 -- scripts/legacy/scil_resample_tractogram.py | 21 -- scripts/legacy/scil_resample_volume.py | 22 -- scripts/legacy/scil_reshape_to_reference.py | 21 -- scripts/legacy/scil_run_commit.py | 20 -- scripts/legacy/scil_run_nlmeans.py | 20 -- .../legacy/scil_save_connections_from_hdf5.py | 21 -- scripts/legacy/scil_score_bundles.py | 21 -- scripts/legacy/scil_score_tractogram.py | 20 -- scripts/legacy/scil_screenshot_bundle.py | 20 -- scripts/legacy/scil_screenshot_dti.py | 20 -- scripts/legacy/scil_screenshot_volume.py | 20 -- .../scil_screenshot_volume_mosaic_overlap.py | 21 -- scripts/legacy/scil_set_response_function.py | 20 -- scripts/legacy/scil_shuffle_streamlines.py | 20 -- scripts/legacy/scil_smooth_streamlines.py | 20 -- scripts/legacy/scil_smooth_surface.py | 21 -- scripts/legacy/scil_snr_in_roi.py | 20 -- scripts/legacy/scil_split_image.py | 20 -- scripts/legacy/scil_split_tractogram.py | 20 -- scripts/legacy/scil_split_volume_by_ids.py | 22 -- scripts/legacy/scil_split_volume_by_labels.py | 22 -- scripts/legacy/scil_streamlines_math.py | 20 -- scripts/legacy/scil_swap_gradient_axis.py | 21 -- .../scil_uniformize_streamlines_endpoints.py | 21 -- .../legacy/scil_validate_and_correct_bvecs.py | 21 -- ...cil_validate_and_correct_eddy_gradients.py | 21 -- scripts/legacy/scil_validate_bids.py | 21 -- ...l_verify_space_attributes_compatibility.py | 21 -- scripts/legacy/scil_visualize_bingham_fit.py | 20 -- scripts/legacy/scil_visualize_bundles.py | 20 -- .../legacy/scil_visualize_bundles_mosaic.py | 20 -- scripts/legacy/scil_visualize_connectivity.py | 20 -- scripts/legacy/scil_visualize_fodf.py | 20 -- scripts/legacy/scil_visualize_gradients.py | 20 -- scripts/legacy/scil_visualize_histogram.py | 20 -- scripts/legacy/scil_visualize_scatterplot.py | 20 -- scripts/legacy/scil_visualize_seeds.py | 20 -- scripts/legacy/scil_visualize_seeds_3d.py | 20 -- .../scil_volume_reshape_to_reference.py | 21 -- scripts/legacy/tests/test_legacy_scripts.py | 183 ------------ .../tests/test_bundle_explore_bundleseg.py | 7 - .../tests/test_dwi_prepare_eddy_command.py | 7 - .../tests/test_viz_bundle_screenshot_mni.py | 7 - .../test_viz_bundle_screenshot_mosaic.py | 7 - .../tests/test_viz_gradients_screenshot.py | 7 - .../tests/test_viz_tractogram_collisions.py | 7 - scripts/tests/test_viz_tractogram_seeds_3d.py | 6 - .../test_viz_volume_screenshot_mosaic.py | 7 - setup.py | 103 ------- {scilpy => src/scilpy}/__init__.py | 2 +- .../scilpy/cli}/__init__.py | 0 .../scilpy/cli}/scil_NODDI_maps.py | 0 .../scilpy/cli}/scil_NODDI_priors.py | 0 .../scilpy/cli}/scil_aodf_metrics.py | 0 .../scilpy/cli}/scil_bids_validate.py | 0 .../scilpy/cli}/scil_bingham_metrics.py | 0 .../scilpy/cli}/scil_btensor_metrics.py | 0 .../cli}/scil_bundle_alter_to_target_dice.py | 0 .../cli}/scil_bundle_clean_qbx_clusters.py | 0 .../cli}/scil_bundle_compute_centroid.py | 0 .../cli}/scil_bundle_compute_endpoints_map.py | 0 .../scilpy/cli}/scil_bundle_diameter.py | 0 .../cli}/scil_bundle_explore_bundleseg.py | 0 .../cli}/scil_bundle_filter_by_occurence.py | 0 .../scilpy/cli}/scil_bundle_fixel_analysis.py | 0 .../cli}/scil_bundle_generate_priors.py | 0 .../scilpy/cli}/scil_bundle_label_map.py | 0 .../scilpy/cli}/scil_bundle_mean_fixel_afd.py | 0 .../scil_bundle_mean_fixel_afd_from_hdf5.py | 0 .../scil_bundle_mean_fixel_bingham_metric.py | 0 .../scil_bundle_mean_fixel_mrds_metric.py | 0 .../scilpy/cli}/scil_bundle_mean_std.py | 0 .../cli}/scil_bundle_pairwise_comparison.py | 0 .../cli}/scil_bundle_reject_outliers.py | 0 ...undle_score_many_bundles_one_tractogram.py | 0 ...le_score_same_bundle_many_segmentations.py | 0 .../scilpy/cli}/scil_bundle_shape_measures.py | 0 .../cli}/scil_bundle_uniformize_endpoints.py | 0 .../cli}/scil_bundle_volume_per_label.py | 0 .../scil_connectivity_compare_populations.py | 0 .../scil_connectivity_compute_matrices.py | 0 .../cli}/scil_connectivity_compute_pca.py | 0 ...scil_connectivity_compute_simple_matrix.py | 0 .../scilpy/cli}/scil_connectivity_filter.py | 0 .../cli}/scil_connectivity_graph_measures.py | 0 ...l_connectivity_hdf5_average_density_map.py | 0 .../scilpy/cli}/scil_connectivity_math.py | 0 .../cli}/scil_connectivity_normalize.py | 0 .../scil_connectivity_pairwise_agreement.py | 0 .../cli}/scil_connectivity_print_filenames.py | 0 .../cli}/scil_connectivity_reorder_rois.py | 0 .../scilpy/cli}/scil_denoising_nlmeans.py | 0 .../scilpy/cli}/scil_dki_metrics.py | 0 .../scilpy/cli}/scil_dti_convert_tensors.py | 0 .../scilpy/cli}/scil_dti_metrics.py | 0 .../scilpy/cli}/scil_dwi_apply_bias_field.py | 0 .../scilpy/cli}/scil_dwi_compute_snr.py | 0 .../scilpy/cli}/scil_dwi_concatenate.py | 0 .../scilpy/cli}/scil_dwi_convert_FDF.py | 0 .../cli}/scil_dwi_detect_volume_outliers.py | 0 .../scilpy/cli}/scil_dwi_extract_b0.py | 0 .../scilpy/cli}/scil_dwi_extract_shell.py | 0 .../scilpy/cli}/scil_dwi_powder_average.py | 0 .../cli}/scil_dwi_prepare_eddy_command.py | 0 .../cli}/scil_dwi_prepare_topup_command.py | 0 .../scilpy/cli}/scil_dwi_reorder_philips.py | 0 .../scilpy/cli}/scil_dwi_split_by_indices.py | 0 {scripts => src/scilpy/cli}/scil_dwi_to_sh.py | 0 .../cli}/scil_fibertube_compute_density.py | 0 .../cli}/scil_fibertube_score_tractogram.py | 0 .../scilpy/cli}/scil_fibertube_tracking.py | 0 .../scilpy/cli}/scil_fodf_bundleparc.py | 0 .../cli}/scil_fodf_max_in_ventricles.py | 0 .../scilpy/cli}/scil_fodf_memsmt.py | 0 .../scilpy/cli}/scil_fodf_metrics.py | 0 {scripts => src/scilpy/cli}/scil_fodf_msmt.py | 0 {scripts => src/scilpy/cli}/scil_fodf_ssst.py | 0 .../scilpy/cli}/scil_fodf_to_bingham.py | 0 .../scilpy/cli}/scil_freewater_maps.py | 0 .../scilpy/cli}/scil_freewater_priors.py | 2 +- {scripts => src/scilpy/cli}/scil_frf_mean.py | 0 .../scilpy/cli}/scil_frf_memsmt.py | 0 {scripts => src/scilpy/cli}/scil_frf_msmt.py | 0 .../scilpy/cli}/scil_frf_set_diffusivities.py | 0 {scripts => src/scilpy/cli}/scil_frf_ssst.py | 0 .../scilpy/cli}/scil_get_version.py | 0 .../cli}/scil_gradients_apply_transform.py | 0 .../scilpy/cli}/scil_gradients_convert.py | 0 .../cli}/scil_gradients_generate_sampling.py | 0 .../scilpy/cli}/scil_gradients_modify_axes.py | 0 .../cli}/scil_gradients_normalize_bvecs.py | 0 .../scilpy/cli}/scil_gradients_round_bvals.py | 0 .../cli}/scil_gradients_validate_correct.py | 0 .../scil_gradients_validate_correct_eddy.py | 0 .../cli}/scil_gradients_validate_sampling.py | 0 .../scilpy/cli}/scil_header_print_info.py | 0 .../scil_header_validate_compatibility.py | 0 .../cli}/scil_json_convert_entries_to_xlsx.py | 0 .../cli}/scil_json_harmonize_entries.py | 0 .../scilpy/cli}/scil_json_merge_entries.py | 0 .../scilpy/cli}/scil_labels_combine.py | 0 .../scilpy/cli}/scil_labels_dilate.py | 0 .../scilpy/cli}/scil_labels_from_mask.py | 0 .../scilpy/cli}/scil_labels_remove.py | 0 .../cli}/scil_labels_split_volume_by_ids.py | 0 .../cli}/scil_labels_split_volume_from_lut.py | 6 +- .../scilpy/cli}/scil_lesions_generate_nawm.py | 0 .../scilpy/cli}/scil_lesions_info.py | 0 .../scilpy/cli}/scil_mrds_metrics.py | 0 .../scil_mrds_select_number_of_tensors.py | 0 .../scilpy/cli}/scil_mti_adjust_B1_header.py | 0 .../scilpy/cli}/scil_mti_maps_MT.py | 0 .../scilpy/cli}/scil_mti_maps_ihMT.py | 0 .../scilpy/cli}/scil_plot_stats_per_point.py | 0 .../scilpy/cli}/scil_qball_metrics.py | 0 .../scilpy/cli}/scil_rgb_convert.py | 0 .../scilpy/cli}/scil_search_keywords.py | 5 +- .../scilpy/cli}/scil_sh_convert.py | 0 {scripts => src/scilpy/cli}/scil_sh_fusion.py | 0 .../scilpy/cli}/scil_sh_to_aodf.py | 0 .../scilpy/cli}/scil_sh_to_rish.py | 0 {scripts => src/scilpy/cli}/scil_sh_to_sf.py | 0 .../cli}/scil_stats_group_comparison.py | 0 .../cli}/scil_surface_apply_transform.py | 0 .../scilpy/cli}/scil_surface_convert.py | 0 .../scilpy/cli}/scil_surface_create.py | 0 .../scilpy/cli}/scil_surface_flip.py | 0 .../scilpy/cli}/scil_surface_smooth.py | 0 .../scilpy/cli}/scil_tracking_local.py | 0 .../scilpy/cli}/scil_tracking_local_dev.py | 0 .../scilpy/cli}/scil_tracking_pft.py | 0 .../scilpy/cli}/scil_tracking_pft_maps.py | 0 .../cli}/scil_tracking_pft_maps_edit.py | 0 .../cli}/scil_tractogram_apply_transform.py | 0 ...scil_tractogram_apply_transform_to_hdf5.py | 0 .../scil_tractogram_assign_custom_color.py | 0 .../scil_tractogram_assign_uniform_color.py | 0 .../scilpy/cli}/scil_tractogram_commit.py | 0 .../scilpy/cli}/scil_tractogram_compress.py | 0 .../cli}/scil_tractogram_compute_TODI.py | 0 .../scil_tractogram_compute_density_map.py | 0 .../scilpy/cli}/scil_tractogram_convert.py | 0 .../scil_tractogram_convert_hdf5_to_trk.py | 0 .../scil_tractogram_convert_trk_to_hdf5.py | 0 .../cli}/scil_tractogram_count_streamlines.py | 0 .../cli}/scil_tractogram_cut_streamlines.py | 0 .../cli}/scil_tractogram_detect_loops.py | 0 .../scilpy/cli}/scil_tractogram_dpp_math.py | 0 .../scilpy/cli}/scil_tractogram_dps_math.py | 0 .../cli}/scil_tractogram_extract_ushape.py | 0 .../cli}/scil_tractogram_filter_by_anatomy.py | 0 .../cli}/scil_tractogram_filter_by_length.py | 0 .../scil_tractogram_filter_by_orientation.py | 0 .../cli}/scil_tractogram_filter_by_roi.py | 0 .../cli}/scil_tractogram_filter_collisions.py | 0 .../scilpy/cli}/scil_tractogram_flip.py | 0 .../scilpy/cli}/scil_tractogram_math.py | 0 .../scil_tractogram_pairwise_comparison.py | 0 .../scilpy/cli}/scil_tractogram_print_info.py | 0 ...l_tractogram_project_map_to_streamlines.py | 0 ...l_tractogram_project_streamlines_to_map.py | 0 .../scilpy/cli}/scil_tractogram_qbx.py | 0 .../scilpy/cli}/scil_tractogram_register.py | 0 .../cli}/scil_tractogram_remove_invalid.py | 0 .../scilpy/cli}/scil_tractogram_resample.py | 0 .../scil_tractogram_resample_nb_points.py | 0 .../cli}/scil_tractogram_seed_density_map.py | 0 ...ctogram_segment_connections_from_labels.py | 0 ...l_tractogram_segment_with_ROI_and_score.py | 0 .../scil_tractogram_segment_with_bundleseg.py | 0 ...cil_tractogram_segment_with_recobundles.py | 0 .../scilpy/cli}/scil_tractogram_shuffle.py | 0 .../scilpy/cli}/scil_tractogram_smooth.py | 0 .../scilpy/cli}/scil_tractogram_split.py | 0 .../scilpy/cli}/scil_viz_bingham_fit.py | 0 .../scilpy/cli}/scil_viz_bundle.py | 0 .../cli}/scil_viz_bundle_screenshot_mni.py | 0 .../cli}/scil_viz_bundle_screenshot_mosaic.py | 0 .../scilpy/cli}/scil_viz_connectivity.py | 0 .../scilpy/cli}/scil_viz_dti_screenshot.py | 0 {scripts => src/scilpy/cli}/scil_viz_fodf.py | 0 .../cli}/scil_viz_gradients_screenshot.py | 0 .../cli}/scil_viz_tractogram_collisions.py | 0 .../scilpy/cli}/scil_viz_tractogram_seeds.py | 0 .../cli}/scil_viz_tractogram_seeds_3d.py | 0 .../scilpy/cli}/scil_viz_volume_histogram.py | 0 .../cli}/scil_viz_volume_scatterplot.py | 0 .../scilpy/cli}/scil_viz_volume_screenshot.py | 0 .../cli}/scil_viz_volume_screenshot_mosaic.py | 0 .../cli}/scil_volume_apply_transform.py | 0 .../scilpy/cli}/scil_volume_b0_synthesis.py | 0 .../cli}/scil_volume_count_non_zero_voxels.py | 0 .../scilpy/cli}/scil_volume_crop.py | 0 .../scilpy/cli}/scil_volume_distance_map.py | 0 .../scilpy/cli}/scil_volume_flip.py | 0 .../scilpy/cli}/scil_volume_math.py | 0 .../cli}/scil_volume_pairwise_comparison.py | 0 .../scil_volume_remove_outliers_ransac.py | 0 .../scilpy/cli}/scil_volume_resample.py | 0 .../scilpy/cli}/scil_volume_reshape.py | 0 .../cli}/scil_volume_reslice_to_reference.py | 0 .../scilpy/cli}/scil_volume_stats_in_ROI.py | 0 .../cli}/scil_volume_stats_in_labels.py | 0 .../scilpy/cli/tests}/__init__.py | 0 .../scilpy/cli}/tests/test_NODDI_maps.py | 6 +- .../scilpy/cli}/tests/test_NODDI_priors.py | 4 +- .../scilpy/cli}/tests/test_aodf_metrics.py | 12 +- .../scilpy/cli}/tests/test_bids_validate.py | 10 +- .../scilpy/cli}/tests/test_bingham_metrics.py | 8 +- .../scilpy/cli}/tests/test_btensor_metrics.py | 14 +- .../tests/test_bundle_alter_to_target_dice.py | 12 +- .../tests/test_bundle_clean_qbx_clusters.py | 3 +- .../tests/test_bundle_compute_centroid.py | 4 +- .../test_bundle_compute_endpoints_map.py | 6 +- .../scilpy/cli}/tests/test_bundle_diameter.py | 4 +- .../tests/test_bundle_explore_bundleseg.py | 7 + .../tests/test_bundle_filter_by_occurence.py | 4 +- .../cli}/tests/test_bundle_fixel_analysis.py | 8 +- .../cli}/tests/test_bundle_generate_priors.py | 4 +- .../cli}/tests/test_bundle_label_map.py | 6 +- .../cli}/tests/test_bundle_mean_fixel_afd.py | 4 +- .../test_bundle_mean_fixel_afd_from_hdf5.py | 4 +- .../test_bundle_mean_fixel_bingham_metric.py | 4 +- .../test_bundle_mean_fixel_mrds_metric.py | 2 +- .../scilpy/cli}/tests/test_bundle_mean_std.py | 6 +- .../tests/test_bundle_pairwise_comparison.py | 12 +- .../cli}/tests/test_bundle_reject_outliers.py | 4 +- ...undle_score_many_bundles_one_tractogram.py | 4 +- ...le_score_same_bundle_many_segmentations.py | 4 +- .../cli}/tests/test_bundle_shape_measures.py | 4 +- .../tests/test_bundle_uniformize_endpoints.py | 6 +- .../tests/test_bundle_volume_per_label.py | 4 +- .../test_connectivity_compare_populations.py | 4 +- .../test_connectivity_compute_matrices.py | 4 +- .../tests/test_connectivity_compute_pca.py | 4 +- ...test_connectivity_compute_simple_matrix.py | 4 +- .../cli}/tests/test_connectivity_filter.py | 4 +- .../tests/test_connectivity_graph_measures.py | 4 +- ...t_connectivity_hdf5_average_density_map.py | 6 +- .../cli}/tests/test_connectivity_math.py | 8 +- .../cli}/tests/test_connectivity_normalize.py | 4 +- .../test_connectivity_pairwise_agreement.py | 4 +- .../test_connectivity_print_filenames.py | 4 +- .../tests/test_connectivity_reorder_rois.py | 6 +- .../cli}/tests/test_denoising_nlmeans.py | 10 +- .../scilpy/cli}/tests/test_dki_metrics.py | 4 +- .../cli}/tests/test_dti_convert_tensors.py | 6 +- .../scilpy/cli}/tests/test_dti_metrics.py | 14 +- .../cli}/tests/test_dwi_apply_bias_field.py | 4 +- .../scilpy/cli}/tests/test_dwi_compute_snr.py | 4 +- .../scilpy/cli}/tests/test_dwi_concatenate.py | 4 +- .../scilpy/cli/tests/test_dwi_convert_FDF.py | 2 +- .../tests/test_dwi_detect_volume_outliers.py | 6 +- .../scilpy/cli}/tests/test_dwi_extract_b0.py | 6 +- .../cli}/tests/test_dwi_extract_shell.py | 8 +- .../cli}/tests/test_dwi_powder_average.py | 4 +- .../tests/test_dwi_prepare_eddy_command.py | 7 + .../tests/test_dwi_prepare_topup_command.py | 7 + .../cli}/tests/test_dwi_reorder_philips.py | 8 +- .../cli}/tests/test_dwi_split_by_indices.py | 8 +- .../scilpy/cli}/tests/test_dwi_to_sh.py | 6 +- .../tests/test_fibertube_compute_density.py | 6 +- .../tests/test_fibertube_score_tractogram.py | 4 +- .../cli}/tests/test_fibertube_tracking.py | 22 +- .../scilpy/cli}/tests/test_fodf_bundleparc.py | 10 +- .../cli}/tests/test_fodf_max_in_ventricles.py | 4 +- .../scilpy/cli}/tests/test_fodf_memsmt.py | 8 +- .../scilpy/cli}/tests/test_fodf_metrics.py | 4 +- .../scilpy/cli}/tests/test_fodf_msmt.py | 4 +- .../scilpy/cli}/tests/test_fodf_ssst.py | 6 +- .../scilpy/cli}/tests/test_fodf_to_bingham.py | 6 +- .../scilpy/cli}/tests/test_freewater_maps.py | 4 +- .../cli}/tests/test_freewater_priors.py | 2 +- .../scilpy/cli}/tests/test_frf_mean.py | 10 +- .../scilpy/cli}/tests/test_frf_memsmt.py | 18 +- .../scilpy/cli}/tests/test_frf_msmt.py | 18 +- .../cli}/tests/test_frf_set_diffusivities.py | 10 +- .../scilpy/cli}/tests/test_frf_ssst.py | 18 +- .../tests/test_gradients_apply_transform.py | 4 +- .../cli}/tests/test_gradients_convert.py | 12 +- .../tests/test_gradients_generate_sampling.py | 4 +- .../cli}/tests/test_gradients_modify_axes.py | 6 +- .../tests/test_gradients_normalize_bvecs.py | 4 +- .../cli}/tests/test_gradients_round_bvals.py | 4 +- .../tests/test_gradients_validate_correct.py | 8 +- .../test_gradients_validate_correct_eddy.py | 6 +- .../tests/test_gradients_validate_sampling.py | 6 +- .../cli}/tests/test_header_print_info.py | 6 +- .../test_header_validate_compatibility.py | 4 +- .../test_json_convert_entries_to_xlsx.py | 4 +- .../cli/tests/test_json_harmonize_entries.py | 6 + .../cli}/tests/test_json_merge_entries.py | 4 +- .../scilpy/cli}/tests/test_labels_combine.py | 6 +- .../scilpy/cli}/tests/test_labels_dilate.py | 4 +- .../cli}/tests/test_labels_from_mask.py | 14 +- .../scilpy/cli}/tests/test_labels_remove.py | 4 +- .../tests/test_labels_split_volume_by_ids.py | 4 +- .../test_labels_split_volume_from_lut.py | 4 +- .../cli}/tests/test_lesions_generate_nawm.py | 4 +- .../scilpy/cli}/tests/test_lesions_info.py | 2 +- .../scilpy/cli}/tests/test_mrds_metrics.py | 6 +- .../test_mrds_select_number_of_tensors.py | 6 +- .../cli}/tests/test_mti_adjust_B1_header.py | 4 +- .../scilpy/cli}/tests/test_mti_maps_MT.py | 28 +- .../scilpy/cli}/tests/test_mti_maps_ihMT.py | 28 +- .../cli}/tests/test_plot_stats_per_point.py | 4 +- .../scilpy/cli}/tests/test_qball_metrics.py | 8 +- .../scilpy/cli}/tests/test_rgb_convert.py | 4 +- .../scilpy/cli}/tests/test_search_keywords.py | 8 +- .../scilpy/cli}/tests/test_sh_convert.py | 4 +- .../scilpy/cli}/tests/test_sh_fusion.py | 4 +- .../scilpy/cli}/tests/test_sh_to_aodf.py | 10 +- .../scilpy/cli}/tests/test_sh_to_rish.py | 4 +- .../scilpy/cli}/tests/test_sh_to_sf.py | 10 +- .../cli}/tests/test_stats_group_comparison.py | 4 +- .../tests/test_surface_apply_transform.py | 4 +- .../scilpy/cli}/tests/test_surface_convert.py | 6 +- .../scilpy/cli}/tests/test_surface_create.py | 12 +- .../scilpy/cli}/tests/test_surface_flip.py | 4 +- .../scilpy/cli}/tests/test_surface_smooth.py | 4 +- .../scilpy/cli}/tests/test_tracking_local.py | 30 +- .../cli}/tests/test_tracking_local_dev.py | 8 +- .../scilpy/cli}/tests/test_tracking_pft.py | 4 +- .../cli}/tests/test_tracking_pft_maps.py | 4 +- .../cli}/tests/test_tracking_pft_maps_edit.py | 4 +- .../tests/test_tractogram_apply_transform.py | 4 +- ...test_tractogram_apply_transform_to_hdf5.py | 4 +- .../test_tractogram_assign_custom_color.py | 8 +- .../test_tractogram_assign_uniform_color.py | 8 +- .../cli}/tests/test_tractogram_commit.py | 6 +- .../cli}/tests/test_tractogram_compress.py | 4 +- .../tests/test_tractogram_compute_TODI.py | 6 +- .../test_tractogram_compute_density_map.py | 6 +- .../cli}/tests/test_tractogram_convert.py | 4 +- .../test_tractogram_convert_hdf5_to_trk.py | 10 +- .../test_tractogram_convert_trk_to_hdf5.py | 6 +- .../test_tractogram_count_streamlines.py | 4 +- .../tests/test_tractogram_cut_streamlines.py | 18 +- .../tests/test_tractogram_detect_loops.py | 4 +- .../cli}/tests/test_tractogram_dpp_math.py | 12 +- .../cli}/tests/test_tractogram_dps_math.py | 24 +- .../tests/test_tractogram_extract_ushape.py | 4 +- .../test_tractogram_filter_by_anatomy.py | 8 +- .../tests/test_tractogram_filter_by_length.py | 8 +- .../test_tractogram_filter_by_orientation.py | 4 +- .../tests/test_tractogram_filter_by_roi.py | 8 +- .../test_tractogram_filter_collisions.py | 16 +- .../scilpy/cli}/tests/test_tractogram_flip.py | 4 +- .../scilpy/cli}/tests/test_tractogram_math.py | 38 +-- .../test_tractogram_pairwise_comparison.py | 6 +- .../cli}/tests/test_tractogram_print_info.py | 4 +- ...t_tractogram_project_map_to_streamlines.py | 12 +- ...t_tractogram_project_streamlines_to_map.py | 16 +- .../scilpy/cli}/tests/test_tractogram_qbx.py | 4 +- .../cli}/tests/test_tractogram_register.py | 4 +- .../tests/test_tractogram_remove_invalid.py | 4 +- .../cli}/tests/test_tractogram_resample.py | 12 +- .../test_tractogram_resample_nb_points.py | 4 +- .../tests/test_tractogram_seed_density_map.py | 4 +- ...ctogram_segment_connections_from_labels.py | 4 +- ...t_tractogram_segment_with_ROI_and_score.py | 4 +- .../test_tractogram_segment_with_bundleseg.py | 4 +- ...est_tractogram_segment_with_recobundles.py | 4 +- .../cli}/tests/test_tractogram_shuffle.py | 4 +- .../cli}/tests/test_tractogram_smooth.py | 4 +- .../cli}/tests/test_tractogram_split.py | 8 +- .../scilpy/cli}/tests/test_viz_bingham_fit.py | 4 +- .../scilpy/cli}/tests/test_viz_bundle.py | 4 +- .../tests/test_viz_bundle_screenshot_mni.py | 7 + .../test_viz_bundle_screenshot_mosaic.py | 2 +- .../cli}/tests/test_viz_connectivity.py | 4 +- .../cli/tests/test_viz_dti_screenshot.py | 2 +- .../scilpy/cli}/tests/test_viz_fodf.py | 6 +- .../tests/test_viz_gradients_screenshot.py | 7 + .../tests/test_viz_tractogram_collisions.py | 7 + .../cli/tests/test_viz_tractogram_seeds.py | 7 + .../cli/tests/test_viz_tractogram_seeds_3d.py | 3 +- .../cli}/tests/test_viz_volume_histogram.py | 4 +- .../cli}/tests/test_viz_volume_scatterplot.py | 14 +- .../cli}/tests/test_viz_volume_screenshot.py | 4 +- .../test_viz_volume_screenshot_mosaic.py | 2 +- .../cli}/tests/test_volume_apply_transform.py | 8 +- .../cli}/tests/test_volume_b0_synthesis.py | 4 +- .../test_volume_count_non_zero_voxels.py | 8 +- .../scilpy/cli}/tests/test_volume_crop.py | 6 +- .../cli}/tests/test_volume_distance_map.py | 4 +- .../scilpy/cli}/tests/test_volume_flip.py | 4 +- .../scilpy/cli}/tests/test_volume_math.py | 12 +- .../tests/test_volume_pairwise_comparison.py | 14 +- .../test_volume_remove_outliers_ransac.py | 4 +- .../scilpy/cli}/tests/test_volume_resample.py | 10 +- .../scilpy/cli}/tests/test_volume_reshape.py | 12 +- .../tests/test_volume_reslice_to_reference.py | 6 +- .../cli}/tests/test_volume_stats_in_ROI.py | 12 +- .../cli}/tests/test_volume_stats_in_labels.py | 8 +- .../scilpy/connectivity}/__init__.py | 0 .../scilpy}/connectivity/connectivity.py | 0 .../scilpy}/connectivity/matrix_tools.py | 0 .../tests/test_connectivity_tools.py | 0 .../data}/LUT/dk_aggregate_structures.json | 0 .../LUT/freesurfer_desikan_killiany.json | 0 .../data}/LUT/freesurfer_subcortical.json | 0 .../dwi/tests => src/scilpy/data}/__init__.py | 0 ...152_t1_tal_nlin_asym_09c_masked_2_5.nii.gz | Bin {data => src/scilpy/data}/vocabulary.json | 0 .../scilpy/denoise}/__init__.py | 0 {scilpy => src/scilpy}/denoise/aodf_filter.cl | 0 .../scilpy}/denoise/asym_filtering.py | 0 .../denoise/tests/test_asym_filtering.py | 0 .../gradients => src/scilpy/dwi}/__init__.py | 0 {scilpy => src/scilpy}/dwi/operations.py | 0 .../scilpy/dwi/tests}/__init__.py | 0 .../scilpy}/dwi/tests/test_operations.py | 0 .../scilpy}/dwi/tests/test_utils.py | 0 {scilpy => src/scilpy}/dwi/utils.py | 0 .../scilpy/gpuparallel}/__init__.py | 0 .../scilpy}/gpuparallel/opencl_utils.py | 0 .../io => src/scilpy/gradients}/__init__.py | 0 .../scilpy}/gradients/bvec_bval_tools.py | 0 .../gradients/gen_gradient_sampling.py | 0 .../gradients/optimize_gradient_sampling.py | 0 .../gradients/tests/test_bvec_bval_tools.py | 0 .../tests/test_gen_gradient_sampling.py | 0 .../gradients/tests/test_gradients_utils.py | 0 .../tests/test_optimize_gradient_sampling.py | 0 {scilpy => src/scilpy}/gradients/utils.py | 0 {scilpy/ml => src/scilpy/image}/__init__.py | 0 {scilpy => src/scilpy}/image/labels.py | 26 +- {scilpy => src/scilpy}/image/reslice.py | 0 .../scilpy/image/tests}/__init__.py | 0 .../scilpy}/image/tests/test_labels.py | 10 +- .../scilpy}/image/tests/test_volume_math.py | 0 .../image/tests/test_volume_metrics.py | 0 .../image/tests/test_volume_operations.py | 0 {scilpy => src/scilpy}/image/utils.py | 0 .../scilpy}/image/volume_b0_synthesis.py | 0 {scilpy => src/scilpy}/image/volume_math.py | 0 .../scilpy}/image/volume_metrics.py | 0 .../scilpy}/image/volume_operations.py | 0 .../scilpy}/image/volume_space_management.py | 0 .../scilpy/io}/__init__.py | 0 {scilpy => src/scilpy}/io/btensor.py | 0 {scilpy => src/scilpy}/io/deprecator.py | 0 {scilpy => src/scilpy}/io/dvc.py | 0 {scilpy => src/scilpy}/io/fetcher.py | 0 {scilpy => src/scilpy}/io/gradients.py | 0 {scilpy => src/scilpy}/io/hdf5.py | 0 {scilpy => src/scilpy}/io/image.py | 0 {scilpy => src/scilpy}/io/mti.py | 0 {scilpy => src/scilpy}/io/streamlines.py | 0 {scilpy => src/scilpy}/io/tensor.py | 0 {scilpy => src/scilpy}/io/utils.py | 0 {scilpy => src/scilpy}/io/varian_fdf.py | 0 {scilpy/reconst => src/scilpy/ml}/__init__.py | 0 .../scilpy/ml/bundleparc}/__init__.py | 0 .../scilpy}/ml/bundleparc/attention.py | 0 .../scilpy}/ml/bundleparc/bundleparcnet.py | 0 .../scilpy}/ml/bundleparc/encodings.py | 0 .../scilpy}/ml/bundleparc/predict.py | 0 .../bundleparc/tests/test_bundleparc_utils.py | 0 {scilpy => src/scilpy}/ml/bundleparc/utils.py | 0 {scilpy => src/scilpy}/ml/utils.py | 0 .../scilpy/preprocessing}/__init__.py | 0 .../preprocessing/distortion_correction.py | 0 .../scilpy/reconst}/__init__.py | 0 {scilpy => src/scilpy}/reconst/aodf.py | 0 {scilpy => src/scilpy}/reconst/bingham.py | 0 {scilpy => src/scilpy}/reconst/divide.py | 0 .../scilpy}/reconst/fiber_coherence.py | 0 {scilpy => src/scilpy}/reconst/fodf.py | 0 {scilpy => src/scilpy}/reconst/frf.py | 0 {scilpy => src/scilpy}/reconst/mti.py | 0 {scilpy => src/scilpy}/reconst/sh.py | 0 .../scilpy}/reconst/tests/test_aodf.py | 0 .../scilpy}/reconst/tests/test_bingham.py | 0 .../scilpy}/reconst/tests/test_divide.py | 0 .../reconst/tests/test_fiber_coherence.py | 0 .../scilpy}/reconst/tests/test_fodf.py | 0 .../scilpy}/reconst/tests/test_frf.py | 0 .../scilpy}/reconst/tests/test_mti.py | 0 .../scilpy}/reconst/tests/test_sh.py | 0 .../scilpy}/reconst/tests/test_utils.py | 0 {scilpy => src/scilpy}/reconst/utils.py | 0 .../scilpy/segment}/__init__.py | 0 {scilpy => src/scilpy}/segment/bundleseg.py | 0 {scilpy => src/scilpy}/segment/models.py | 0 {scilpy => src/scilpy}/segment/streamlines.py | 0 .../segment/tests/test_tractogram_from_roi.py | 0 .../scilpy}/segment/tractogram_from_roi.py | 0 .../scilpy}/segment/voting_scheme.py | 0 .../scilpy/stats}/__init__.py | 0 {scilpy => src/scilpy}/stats/matrix_stats.py | 0 {scilpy => src/scilpy}/stats/stats.py | 0 .../scilpy}/stats/tests/test_matrix_stats.py | 0 {scilpy => src/scilpy}/stats/utils.py | 0 .../scilpy/surfaces}/__init__.py | 0 .../scilpy}/surfaces/surface_operations.py | 0 .../surfaces/tests/test_surface_operations.py | 0 .../surfaces/tests/test_surfaces_utils.py | 0 {scilpy => src/scilpy}/surfaces/utils.py | 0 {scilpy => src/scilpy}/tests/arrays.py | 0 {scilpy => src/scilpy}/tests/dict.py | 0 {scilpy => src/scilpy}/tests/streamlines.py | 0 {scilpy => src/scilpy}/tests/utils.py | 0 .../tests => src/scilpy/tracking}/__init__.py | 0 .../scilpy}/tracking/fibertube_utils.py | 0 .../scilpy}/tracking/local_tracking.cl | 0 {scilpy => src/scilpy}/tracking/propagator.py | 0 {scilpy => src/scilpy}/tracking/rap.py | 0 {scilpy => src/scilpy}/tracking/seed.py | 0 .../scilpy}/tracking/tests/test_propagator.py | 0 .../scilpy}/tracking/tests/test_seed.py | 0 .../scilpy}/tracking/tests/test_tracker.py | 0 {scilpy => src/scilpy}/tracking/tracker.py | 0 {scilpy => src/scilpy}/tracking/utils.py | 0 .../scilpy/tractanalysis}/__init__.py | 0 .../tractanalysis/afd_along_streamlines.py | 0 .../bingham_metric_along_streamlines.py | 0 .../tractanalysis/bundle_operations.py | 0 .../connectivity_segmentation.py | 0 .../tractanalysis/distance_to_centroid.py | 0 .../tractanalysis/fibertube_scoring.py | 0 .../scilpy}/tractanalysis/fixel_density.py | 0 .../scilpy}/tractanalysis/json_utils.py | 0 .../tractanalysis/mrds_along_streamlines.py | 0 .../tractanalysis/reproducibility_measures.py | 0 .../scilpy}/tractanalysis/scoring.py | 0 .../tractanalysis/streamlines_metrics.pyx | 0 .../tractanalysis/tests/test_fixel_density.py | 0 .../tractanalysis/tests/test_json_utils.py | 0 .../tests/test_reproducibility_measures.py | 0 {scilpy => src/scilpy}/tractanalysis/todi.py | 0 .../scilpy}/tractanalysis/todi_util.py | 0 .../voxel_boundary_intersection.pyx | 0 .../scilpy/tractograms}/__init__.py | 0 .../tractograms/dps_and_dpp_management.py | 0 .../tractograms/intersection_finder.py | 0 .../tractograms/lazy_tractogram_operations.py | 0 .../streamline_and_mask_operations.py | 0 .../tractograms/streamline_operations.py | 0 .../scilpy/tractograms/tests}/__init__.py | 0 .../tests/test_dps_and_dpp_management.py | 0 .../tests/test_lazy_tractogram_operations.py | 0 .../test_streamline_and_mask_operations.py | 0 .../tests/test_streamline_operations.py | 0 .../tests/test_tractogram_operations.py | 0 .../tractograms/tractogram_operations.py | 0 .../scilpy}/tractograms/uncompress.pyx | 0 {scilpy => src/scilpy}/utils/__init__.py | 0 {scilpy => src/scilpy}/utils/filenames.py | 0 {scilpy => src/scilpy}/utils/metrics_tools.py | 0 {scilpy => src/scilpy}/utils/scilpy_bot.py | 20 +- {scilpy => src/scilpy}/utils/spatial.py | 0 .../scilpy}/utils/tests/test_scilpy_bot.py | 0 {scilpy => src/scilpy}/version.py | 0 .../legacy => src/scilpy/viz}/__init__.py | 0 .../scilpy/viz/backends}/__init__.py | 0 {scilpy => src/scilpy}/viz/backends/fury.py | 0 {scilpy => src/scilpy}/viz/backends/pil.py | 0 {scilpy => src/scilpy}/viz/backends/vtk.py | 0 {scilpy => src/scilpy}/viz/color.py | 0 {scilpy => src/scilpy}/viz/gradients.py | 0 {scilpy => src/scilpy}/viz/legacy/__init__.py | 0 .../scilpy}/viz/legacy/chord_chart.py | 0 {scilpy => src/scilpy}/viz/plot.py | 0 {scilpy => src/scilpy}/viz/screenshot.py | 0 {scilpy => src/scilpy}/viz/slice.py | 0 {scilpy => src/scilpy}/viz/utils.py | 0 738 files changed, 993 insertions(+), 4474 deletions(-) delete mode 100755 scripts/legacy/scil_add_tracking_mask_to_pft_maps.py delete mode 100755 scripts/legacy/scil_analyse_lesions_load.py delete mode 100755 scripts/legacy/scil_apply_bias_field_on_dwi.py delete mode 100755 scripts/legacy/scil_apply_transform_to_bvecs.py delete mode 100755 scripts/legacy/scil_apply_transform_to_hdf5.py delete mode 100755 scripts/legacy/scil_apply_transform_to_image.py delete mode 100755 scripts/legacy/scil_apply_transform_to_surface.py delete mode 100755 scripts/legacy/scil_apply_transform_to_tractogram.py delete mode 100755 scripts/legacy/scil_assign_custom_color_to_tractogram.py delete mode 100755 scripts/legacy/scil_assign_uniform_color_to_tractograms.py delete mode 100755 scripts/legacy/scil_clean_qbx_clusters.py delete mode 100755 scripts/legacy/scil_combine_labels.py delete mode 100755 scripts/legacy/scil_compare_connectivity.py delete mode 100755 scripts/legacy/scil_compress_streamlines.py delete mode 100755 scripts/legacy/scil_compute_MT_maps.py delete mode 100755 scripts/legacy/scil_compute_NODDI.py delete mode 100755 scripts/legacy/scil_compute_NODDI_priors.py delete mode 100755 scripts/legacy/scil_compute_asym_odf_metrics.py delete mode 100755 scripts/legacy/scil_compute_bundle_mean_std.py delete mode 100755 scripts/legacy/scil_compute_bundle_mean_std_per_point.py delete mode 100755 scripts/legacy/scil_compute_bundle_volume.py delete mode 100755 scripts/legacy/scil_compute_bundle_volume_per_label.py delete mode 100755 scripts/legacy/scil_compute_bundle_voxel_label_map.py delete mode 100755 scripts/legacy/scil_compute_centroid.py delete mode 100755 scripts/legacy/scil_compute_connectivity.py delete mode 100755 scripts/legacy/scil_compute_divide.py delete mode 100755 scripts/legacy/scil_compute_dti_metrics.py delete mode 100755 scripts/legacy/scil_compute_endpoints_map.py delete mode 100755 scripts/legacy/scil_compute_fodf_max_in_ventricles.py delete mode 100755 scripts/legacy/scil_compute_fodf_metrics.py delete mode 100755 scripts/legacy/scil_compute_freewater.py delete mode 100755 scripts/legacy/scil_compute_hdf5_average_density_map.py delete mode 100755 scripts/legacy/scil_compute_ihMT_maps.py delete mode 100755 scripts/legacy/scil_compute_kurtosis_metrics.py delete mode 100755 scripts/legacy/scil_compute_lobe_specific_fodf_metrics.py delete mode 100755 scripts/legacy/scil_compute_local_tracking.py delete mode 100755 scripts/legacy/scil_compute_local_tracking_dev.py delete mode 100755 scripts/legacy/scil_compute_maps_for_particle_filter_tracking.py delete mode 100755 scripts/legacy/scil_compute_mean_fixel_afd_from_bundles.py delete mode 100755 scripts/legacy/scil_compute_mean_fixel_afd_from_hdf5.py delete mode 100755 scripts/legacy/scil_compute_mean_fixel_lobe_metric_from_bundles.py delete mode 100755 scripts/legacy/scil_compute_mean_frf.py delete mode 100755 scripts/legacy/scil_compute_memsmt_fodf.py delete mode 100755 scripts/legacy/scil_compute_memsmt_frf.py delete mode 100755 scripts/legacy/scil_compute_metrics_stats_in_ROI.py delete mode 100755 scripts/legacy/scil_compute_msmt_fodf.py delete mode 100755 scripts/legacy/scil_compute_msmt_frf.py delete mode 100755 scripts/legacy/scil_compute_pca.py delete mode 100755 scripts/legacy/scil_compute_pft.py delete mode 100755 scripts/legacy/scil_compute_powder_average.py delete mode 100755 scripts/legacy/scil_compute_qball_metrics.py delete mode 100755 scripts/legacy/scil_compute_qbx.py delete mode 100755 scripts/legacy/scil_compute_rish_from_sh.py delete mode 100755 scripts/legacy/scil_compute_seed_by_labels.py delete mode 100755 scripts/legacy/scil_compute_seed_density_map.py delete mode 100755 scripts/legacy/scil_compute_sf_from_sh.py delete mode 100755 scripts/legacy/scil_compute_sh_from_signal.py delete mode 100755 scripts/legacy/scil_compute_ssst_fodf.py delete mode 100755 scripts/legacy/scil_compute_ssst_frf.py delete mode 100755 scripts/legacy/scil_compute_streamlines_density_map.py delete mode 100755 scripts/legacy/scil_compute_streamlines_length_stats.py delete mode 100755 scripts/legacy/scil_compute_todi.py delete mode 100755 scripts/legacy/scil_concatenate_dwi.py delete mode 100755 scripts/legacy/scil_convert_fdf.py delete mode 100755 scripts/legacy/scil_convert_gradients_fsl_to_mrtrix.py delete mode 100755 scripts/legacy/scil_convert_gradients_mrtrix_to_fsl.py delete mode 100755 scripts/legacy/scil_convert_json_to_xlsx.py delete mode 100755 scripts/legacy/scil_convert_rgb.py delete mode 100755 scripts/legacy/scil_convert_sh_basis.py delete mode 100755 scripts/legacy/scil_convert_surface.py delete mode 100755 scripts/legacy/scil_convert_tensors.py delete mode 100755 scripts/legacy/scil_convert_tractogram.py delete mode 100755 scripts/legacy/scil_count_non_zero_voxels.py delete mode 100755 scripts/legacy/scil_count_streamlines.py delete mode 100755 scripts/legacy/scil_crop_volume.py delete mode 100755 scripts/legacy/scil_cut_streamlines.py delete mode 100755 scripts/legacy/scil_decompose_connectivity.py delete mode 100755 scripts/legacy/scil_detect_dwi_volume_outliers.py delete mode 100755 scripts/legacy/scil_detect_streamlines_loops.py delete mode 100755 scripts/legacy/scil_dilate_labels.py delete mode 100755 scripts/legacy/scil_estimate_bundles_diameter.py delete mode 100755 scripts/legacy/scil_evaluate_bundles_binary_classification_measures.py delete mode 100755 scripts/legacy/scil_evaluate_bundles_individual_measures.py delete mode 100755 scripts/legacy/scil_evaluate_bundles_pairwise_agreement_measures.py delete mode 100755 scripts/legacy/scil_evaluate_connectivity_graph_measures.py delete mode 100755 scripts/legacy/scil_evaluate_connectivity_pairwise_agreement_measures.py delete mode 100755 scripts/legacy/scil_execute_angle_aware_bilateral_filtering.py delete mode 100755 scripts/legacy/scil_execute_asymmetric_filtering.py delete mode 100755 scripts/legacy/scil_extract_b0.py delete mode 100755 scripts/legacy/scil_extract_dwi_shell.py delete mode 100755 scripts/legacy/scil_extract_ushape.py delete mode 100755 scripts/legacy/scil_filter_connectivity.py delete mode 100755 scripts/legacy/scil_filter_streamlines_by_length.py delete mode 100755 scripts/legacy/scil_filter_streamlines_by_orientation.py delete mode 100755 scripts/legacy/scil_filter_tractogram.py delete mode 100755 scripts/legacy/scil_filter_tractogram_anatomically.py delete mode 100755 scripts/legacy/scil_fit_bingham_to_fodf.py delete mode 100755 scripts/legacy/scil_flip_gradients.py delete mode 100755 scripts/legacy/scil_flip_streamlines.py delete mode 100755 scripts/legacy/scil_flip_surface.py delete mode 100755 scripts/legacy/scil_flip_volume.py delete mode 100755 scripts/legacy/scil_generate_gradient_sampling.py delete mode 100755 scripts/legacy/scil_generate_priors_from_bundle.py delete mode 100755 scripts/legacy/scil_group_comparison.py delete mode 100755 scripts/legacy/scil_harmonize_json.py delete mode 100755 scripts/legacy/scil_image_math.py delete mode 100755 scripts/legacy/scil_merge_json.py delete mode 100755 scripts/legacy/scil_merge_sh.py delete mode 100755 scripts/legacy/scil_normalize_connectivity.py delete mode 100755 scripts/legacy/scil_outlier_rejection.py delete mode 100755 scripts/legacy/scil_perform_majority_vote.py delete mode 100755 scripts/legacy/scil_plot_mean_std_per_point.py delete mode 100755 scripts/legacy/scil_prepare_eddy_command.py delete mode 100755 scripts/legacy/scil_prepare_topup_command.py delete mode 100755 scripts/legacy/scil_print_connectivity_filenames.py delete mode 100755 scripts/legacy/scil_print_header.py delete mode 100755 scripts/legacy/scil_project_streamlines_to_map.py delete mode 100755 scripts/legacy/scil_recognize_multi_bundles.py delete mode 100755 scripts/legacy/scil_recognize_single_bundle.py delete mode 100755 scripts/legacy/scil_register_tractogram.py delete mode 100755 scripts/legacy/scil_remove_invalid_streamlines.py delete mode 100755 scripts/legacy/scil_remove_labels.py delete mode 100755 scripts/legacy/scil_remove_outliers_ransac.py delete mode 100755 scripts/legacy/scil_reorder_connectivity.py delete mode 100755 scripts/legacy/scil_reorder_dwi_philips.py delete mode 100755 scripts/legacy/scil_resample_bvals.py delete mode 100755 scripts/legacy/scil_resample_streamlines.py delete mode 100755 scripts/legacy/scil_resample_tractogram.py delete mode 100755 scripts/legacy/scil_resample_volume.py delete mode 100755 scripts/legacy/scil_reshape_to_reference.py delete mode 100755 scripts/legacy/scil_run_commit.py delete mode 100755 scripts/legacy/scil_run_nlmeans.py delete mode 100755 scripts/legacy/scil_save_connections_from_hdf5.py delete mode 100755 scripts/legacy/scil_score_bundles.py delete mode 100755 scripts/legacy/scil_score_tractogram.py delete mode 100755 scripts/legacy/scil_screenshot_bundle.py delete mode 100755 scripts/legacy/scil_screenshot_dti.py delete mode 100755 scripts/legacy/scil_screenshot_volume.py delete mode 100755 scripts/legacy/scil_screenshot_volume_mosaic_overlap.py delete mode 100755 scripts/legacy/scil_set_response_function.py delete mode 100755 scripts/legacy/scil_shuffle_streamlines.py delete mode 100755 scripts/legacy/scil_smooth_streamlines.py delete mode 100755 scripts/legacy/scil_smooth_surface.py delete mode 100755 scripts/legacy/scil_snr_in_roi.py delete mode 100755 scripts/legacy/scil_split_image.py delete mode 100755 scripts/legacy/scil_split_tractogram.py delete mode 100755 scripts/legacy/scil_split_volume_by_ids.py delete mode 100755 scripts/legacy/scil_split_volume_by_labels.py delete mode 100755 scripts/legacy/scil_streamlines_math.py delete mode 100755 scripts/legacy/scil_swap_gradient_axis.py delete mode 100755 scripts/legacy/scil_uniformize_streamlines_endpoints.py delete mode 100755 scripts/legacy/scil_validate_and_correct_bvecs.py delete mode 100755 scripts/legacy/scil_validate_and_correct_eddy_gradients.py delete mode 100755 scripts/legacy/scil_validate_bids.py delete mode 100755 scripts/legacy/scil_verify_space_attributes_compatibility.py delete mode 100755 scripts/legacy/scil_visualize_bingham_fit.py delete mode 100755 scripts/legacy/scil_visualize_bundles.py delete mode 100755 scripts/legacy/scil_visualize_bundles_mosaic.py delete mode 100755 scripts/legacy/scil_visualize_connectivity.py delete mode 100755 scripts/legacy/scil_visualize_fodf.py delete mode 100755 scripts/legacy/scil_visualize_gradients.py delete mode 100755 scripts/legacy/scil_visualize_histogram.py delete mode 100755 scripts/legacy/scil_visualize_scatterplot.py delete mode 100755 scripts/legacy/scil_visualize_seeds.py delete mode 100755 scripts/legacy/scil_visualize_seeds_3d.py delete mode 100755 scripts/legacy/scil_volume_reshape_to_reference.py delete mode 100644 scripts/legacy/tests/test_legacy_scripts.py delete mode 100644 scripts/tests/test_bundle_explore_bundleseg.py delete mode 100644 scripts/tests/test_dwi_prepare_eddy_command.py delete mode 100644 scripts/tests/test_viz_bundle_screenshot_mni.py delete mode 100644 scripts/tests/test_viz_bundle_screenshot_mosaic.py delete mode 100644 scripts/tests/test_viz_gradients_screenshot.py delete mode 100644 scripts/tests/test_viz_tractogram_collisions.py delete mode 100644 scripts/tests/test_viz_tractogram_seeds_3d.py delete mode 100644 scripts/tests/test_viz_volume_screenshot_mosaic.py delete mode 100644 setup.py rename {scilpy => src/scilpy}/__init__.py (95%) rename {scilpy/connectivity => src/scilpy/cli}/__init__.py (100%) rename {scripts => src/scilpy/cli}/scil_NODDI_maps.py (100%) rename {scripts => src/scilpy/cli}/scil_NODDI_priors.py (100%) rename {scripts => src/scilpy/cli}/scil_aodf_metrics.py (100%) rename {scripts => src/scilpy/cli}/scil_bids_validate.py (100%) rename {scripts => src/scilpy/cli}/scil_bingham_metrics.py (100%) rename {scripts => src/scilpy/cli}/scil_btensor_metrics.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_alter_to_target_dice.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_clean_qbx_clusters.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_compute_centroid.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_compute_endpoints_map.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_diameter.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_explore_bundleseg.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_filter_by_occurence.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_fixel_analysis.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_generate_priors.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_label_map.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_mean_fixel_afd.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_mean_fixel_afd_from_hdf5.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_mean_fixel_bingham_metric.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_mean_fixel_mrds_metric.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_mean_std.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_pairwise_comparison.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_reject_outliers.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_score_many_bundles_one_tractogram.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_score_same_bundle_many_segmentations.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_shape_measures.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_uniformize_endpoints.py (100%) rename {scripts => src/scilpy/cli}/scil_bundle_volume_per_label.py (100%) rename {scripts => src/scilpy/cli}/scil_connectivity_compare_populations.py (100%) rename {scripts => src/scilpy/cli}/scil_connectivity_compute_matrices.py (100%) rename {scripts => src/scilpy/cli}/scil_connectivity_compute_pca.py (100%) rename {scripts => src/scilpy/cli}/scil_connectivity_compute_simple_matrix.py (100%) rename {scripts => src/scilpy/cli}/scil_connectivity_filter.py (100%) rename {scripts => src/scilpy/cli}/scil_connectivity_graph_measures.py (100%) rename {scripts => src/scilpy/cli}/scil_connectivity_hdf5_average_density_map.py (100%) rename {scripts => src/scilpy/cli}/scil_connectivity_math.py (100%) rename {scripts => src/scilpy/cli}/scil_connectivity_normalize.py (100%) rename {scripts => src/scilpy/cli}/scil_connectivity_pairwise_agreement.py (100%) rename {scripts => src/scilpy/cli}/scil_connectivity_print_filenames.py (100%) rename {scripts => src/scilpy/cli}/scil_connectivity_reorder_rois.py (100%) rename {scripts => src/scilpy/cli}/scil_denoising_nlmeans.py (100%) rename {scripts => src/scilpy/cli}/scil_dki_metrics.py (100%) rename {scripts => src/scilpy/cli}/scil_dti_convert_tensors.py (100%) rename {scripts => src/scilpy/cli}/scil_dti_metrics.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_apply_bias_field.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_compute_snr.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_concatenate.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_convert_FDF.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_detect_volume_outliers.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_extract_b0.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_extract_shell.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_powder_average.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_prepare_eddy_command.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_prepare_topup_command.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_reorder_philips.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_split_by_indices.py (100%) rename {scripts => src/scilpy/cli}/scil_dwi_to_sh.py (100%) rename {scripts => src/scilpy/cli}/scil_fibertube_compute_density.py (100%) rename {scripts => src/scilpy/cli}/scil_fibertube_score_tractogram.py (100%) rename {scripts => src/scilpy/cli}/scil_fibertube_tracking.py (100%) rename {scripts => src/scilpy/cli}/scil_fodf_bundleparc.py (100%) rename {scripts => src/scilpy/cli}/scil_fodf_max_in_ventricles.py (100%) rename {scripts => src/scilpy/cli}/scil_fodf_memsmt.py (100%) rename {scripts => src/scilpy/cli}/scil_fodf_metrics.py (100%) rename {scripts => src/scilpy/cli}/scil_fodf_msmt.py (100%) rename {scripts => src/scilpy/cli}/scil_fodf_ssst.py (100%) rename {scripts => src/scilpy/cli}/scil_fodf_to_bingham.py (100%) rename {scripts => src/scilpy/cli}/scil_freewater_maps.py (100%) rename {scripts => src/scilpy/cli}/scil_freewater_priors.py (71%) rename {scripts => src/scilpy/cli}/scil_frf_mean.py (100%) rename {scripts => src/scilpy/cli}/scil_frf_memsmt.py (100%) rename {scripts => src/scilpy/cli}/scil_frf_msmt.py (100%) rename {scripts => src/scilpy/cli}/scil_frf_set_diffusivities.py (100%) rename {scripts => src/scilpy/cli}/scil_frf_ssst.py (100%) rename {scripts => src/scilpy/cli}/scil_get_version.py (100%) rename {scripts => src/scilpy/cli}/scil_gradients_apply_transform.py (100%) rename {scripts => src/scilpy/cli}/scil_gradients_convert.py (100%) rename {scripts => src/scilpy/cli}/scil_gradients_generate_sampling.py (100%) rename {scripts => src/scilpy/cli}/scil_gradients_modify_axes.py (100%) rename {scripts => src/scilpy/cli}/scil_gradients_normalize_bvecs.py (100%) rename {scripts => src/scilpy/cli}/scil_gradients_round_bvals.py (100%) rename {scripts => src/scilpy/cli}/scil_gradients_validate_correct.py (100%) rename {scripts => src/scilpy/cli}/scil_gradients_validate_correct_eddy.py (100%) rename {scripts => src/scilpy/cli}/scil_gradients_validate_sampling.py (100%) rename {scripts => src/scilpy/cli}/scil_header_print_info.py (100%) rename {scripts => src/scilpy/cli}/scil_header_validate_compatibility.py (100%) rename {scripts => src/scilpy/cli}/scil_json_convert_entries_to_xlsx.py (100%) rename {scripts => src/scilpy/cli}/scil_json_harmonize_entries.py (100%) rename {scripts => src/scilpy/cli}/scil_json_merge_entries.py (100%) rename {scripts => src/scilpy/cli}/scil_labels_combine.py (100%) rename {scripts => src/scilpy/cli}/scil_labels_dilate.py (100%) rename {scripts => src/scilpy/cli}/scil_labels_from_mask.py (100%) rename {scripts => src/scilpy/cli}/scil_labels_remove.py (100%) rename {scripts => src/scilpy/cli}/scil_labels_split_volume_by_ids.py (100%) rename {scripts => src/scilpy/cli}/scil_labels_split_volume_from_lut.py (93%) rename {scripts => src/scilpy/cli}/scil_lesions_generate_nawm.py (100%) rename {scripts => src/scilpy/cli}/scil_lesions_info.py (100%) rename {scripts => src/scilpy/cli}/scil_mrds_metrics.py (100%) rename {scripts => src/scilpy/cli}/scil_mrds_select_number_of_tensors.py (100%) rename {scripts => src/scilpy/cli}/scil_mti_adjust_B1_header.py (100%) rename {scripts => src/scilpy/cli}/scil_mti_maps_MT.py (100%) rename {scripts => src/scilpy/cli}/scil_mti_maps_ihMT.py (100%) rename {scripts => src/scilpy/cli}/scil_plot_stats_per_point.py (100%) rename {scripts => src/scilpy/cli}/scil_qball_metrics.py (100%) rename {scripts => src/scilpy/cli}/scil_rgb_convert.py (100%) rename {scripts => src/scilpy/cli}/scil_search_keywords.py (98%) rename {scripts => src/scilpy/cli}/scil_sh_convert.py (100%) rename {scripts => src/scilpy/cli}/scil_sh_fusion.py (100%) rename {scripts => src/scilpy/cli}/scil_sh_to_aodf.py (100%) rename {scripts => src/scilpy/cli}/scil_sh_to_rish.py (100%) rename {scripts => src/scilpy/cli}/scil_sh_to_sf.py (100%) rename {scripts => src/scilpy/cli}/scil_stats_group_comparison.py (100%) rename {scripts => src/scilpy/cli}/scil_surface_apply_transform.py (100%) rename {scripts => src/scilpy/cli}/scil_surface_convert.py (100%) rename {scripts => src/scilpy/cli}/scil_surface_create.py (100%) rename {scripts => src/scilpy/cli}/scil_surface_flip.py (100%) rename {scripts => src/scilpy/cli}/scil_surface_smooth.py (100%) rename {scripts => src/scilpy/cli}/scil_tracking_local.py (100%) rename {scripts => src/scilpy/cli}/scil_tracking_local_dev.py (100%) rename {scripts => src/scilpy/cli}/scil_tracking_pft.py (100%) rename {scripts => src/scilpy/cli}/scil_tracking_pft_maps.py (100%) rename {scripts => src/scilpy/cli}/scil_tracking_pft_maps_edit.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_apply_transform.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_apply_transform_to_hdf5.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_assign_custom_color.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_assign_uniform_color.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_commit.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_compress.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_compute_TODI.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_compute_density_map.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_convert.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_convert_hdf5_to_trk.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_convert_trk_to_hdf5.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_count_streamlines.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_cut_streamlines.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_detect_loops.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_dpp_math.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_dps_math.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_extract_ushape.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_filter_by_anatomy.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_filter_by_length.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_filter_by_orientation.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_filter_by_roi.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_filter_collisions.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_flip.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_math.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_pairwise_comparison.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_print_info.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_project_map_to_streamlines.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_project_streamlines_to_map.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_qbx.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_register.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_remove_invalid.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_resample.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_resample_nb_points.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_seed_density_map.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_segment_connections_from_labels.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_segment_with_ROI_and_score.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_segment_with_bundleseg.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_segment_with_recobundles.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_shuffle.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_smooth.py (100%) rename {scripts => src/scilpy/cli}/scil_tractogram_split.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_bingham_fit.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_bundle.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_bundle_screenshot_mni.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_bundle_screenshot_mosaic.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_connectivity.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_dti_screenshot.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_fodf.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_gradients_screenshot.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_tractogram_collisions.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_tractogram_seeds.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_tractogram_seeds_3d.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_volume_histogram.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_volume_scatterplot.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_volume_screenshot.py (100%) rename {scripts => src/scilpy/cli}/scil_viz_volume_screenshot_mosaic.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_apply_transform.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_b0_synthesis.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_count_non_zero_voxels.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_crop.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_distance_map.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_flip.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_math.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_pairwise_comparison.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_remove_outliers_ransac.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_resample.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_reshape.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_reslice_to_reference.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_stats_in_ROI.py (100%) rename {scripts => src/scilpy/cli}/scil_volume_stats_in_labels.py (100%) rename {scilpy/denoise => src/scilpy/cli/tests}/__init__.py (100%) rename {scripts => src/scilpy/cli}/tests/test_NODDI_maps.py (92%) rename {scripts => src/scilpy/cli}/tests/test_NODDI_priors.py (89%) rename {scripts => src/scilpy/cli}/tests/test_aodf_metrics.py (86%) rename {scripts => src/scilpy/cli}/tests/test_bids_validate.py (98%) rename {scripts => src/scilpy/cli}/tests/test_bingham_metrics.py (88%) rename {scripts => src/scilpy/cli}/tests/test_btensor_metrics.py (92%) rename {scripts => src/scilpy/cli}/tests/test_bundle_alter_to_target_dice.py (86%) rename scripts/tests/test_json_harmonize_entries.py => src/scilpy/cli/tests/test_bundle_clean_qbx_clusters.py (64%) rename {scripts => src/scilpy/cli}/tests/test_bundle_compute_centroid.py (83%) rename {scripts => src/scilpy/cli}/tests/test_bundle_compute_endpoints_map.py (81%) rename {scripts => src/scilpy/cli}/tests/test_bundle_diameter.py (84%) create mode 100644 src/scilpy/cli/tests/test_bundle_explore_bundleseg.py rename {scripts => src/scilpy/cli}/tests/test_bundle_filter_by_occurence.py (85%) rename {scripts => src/scilpy/cli}/tests/test_bundle_fixel_analysis.py (92%) rename {scripts => src/scilpy/cli}/tests/test_bundle_generate_priors.py (87%) rename {scripts => src/scilpy/cli}/tests/test_bundle_label_map.py (89%) rename {scripts => src/scilpy/cli}/tests/test_bundle_mean_fixel_afd.py (85%) rename {scripts => src/scilpy/cli}/tests/test_bundle_mean_fixel_afd_from_hdf5.py (98%) rename {scripts => src/scilpy/cli}/tests/test_bundle_mean_fixel_bingham_metric.py (88%) rename {scripts => src/scilpy/cli}/tests/test_bundle_mean_fixel_mrds_metric.py (70%) rename {scripts => src/scilpy/cli}/tests/test_bundle_mean_std.py (85%) rename {scripts => src/scilpy/cli}/tests/test_bundle_pairwise_comparison.py (91%) rename {scripts => src/scilpy/cli}/tests/test_bundle_reject_outliers.py (85%) rename {scripts => src/scilpy/cli}/tests/test_bundle_score_many_bundles_one_tractogram.py (98%) rename {scripts => src/scilpy/cli}/tests/test_bundle_score_same_bundle_many_segmentations.py (89%) rename {scripts => src/scilpy/cli}/tests/test_bundle_shape_measures.py (87%) rename {scripts => src/scilpy/cli}/tests/test_bundle_uniformize_endpoints.py (84%) rename {scripts => src/scilpy/cli}/tests/test_bundle_volume_per_label.py (85%) rename {scripts => src/scilpy/cli}/tests/test_connectivity_compare_populations.py (98%) rename {scripts => src/scilpy/cli}/tests/test_connectivity_compute_matrices.py (89%) rename {scripts => src/scilpy/cli}/tests/test_connectivity_compute_pca.py (85%) rename {scripts => src/scilpy/cli}/tests/test_connectivity_compute_simple_matrix.py (86%) rename {scripts => src/scilpy/cli}/tests/test_connectivity_filter.py (86%) rename {scripts => src/scilpy/cli}/tests/test_connectivity_graph_measures.py (84%) rename {scripts => src/scilpy/cli}/tests/test_connectivity_hdf5_average_density_map.py (97%) rename {scripts => src/scilpy/cli}/tests/test_connectivity_math.py (83%) rename {scripts => src/scilpy/cli}/tests/test_connectivity_normalize.py (88%) rename {scripts => src/scilpy/cli}/tests/test_connectivity_pairwise_agreement.py (97%) rename {scripts => src/scilpy/cli}/tests/test_connectivity_print_filenames.py (84%) rename {scripts => src/scilpy/cli}/tests/test_connectivity_reorder_rois.py (88%) rename {scripts => src/scilpy/cli}/tests/test_denoising_nlmeans.py (86%) rename {scripts => src/scilpy/cli}/tests/test_dki_metrics.py (90%) rename {scripts => src/scilpy/cli}/tests/test_dti_convert_tensors.py (84%) rename {scripts => src/scilpy/cli}/tests/test_dti_metrics.py (87%) rename {scripts => src/scilpy/cli}/tests/test_dwi_apply_bias_field.py (85%) rename {scripts => src/scilpy/cli}/tests/test_dwi_compute_snr.py (89%) rename {scripts => src/scilpy/cli}/tests/test_dwi_concatenate.py (88%) rename scripts/tests/test_viz_dti_screenshot.py => src/scilpy/cli/tests/test_dwi_convert_FDF.py (61%) rename {scripts => src/scilpy/cli}/tests/test_dwi_detect_volume_outliers.py (81%) rename {scripts => src/scilpy/cli}/tests/test_dwi_extract_b0.py (82%) rename {scripts => src/scilpy/cli}/tests/test_dwi_extract_shell.py (89%) rename {scripts => src/scilpy/cli}/tests/test_dwi_powder_average.py (85%) create mode 100644 src/scilpy/cli/tests/test_dwi_prepare_eddy_command.py create mode 100644 src/scilpy/cli/tests/test_dwi_prepare_topup_command.py rename {scripts => src/scilpy/cli}/tests/test_dwi_reorder_philips.py (91%) rename {scripts => src/scilpy/cli}/tests/test_dwi_split_by_indices.py (83%) rename {scripts => src/scilpy/cli}/tests/test_dwi_to_sh.py (84%) rename {scripts => src/scilpy/cli}/tests/test_fibertube_compute_density.py (90%) rename {scripts => src/scilpy/cli}/tests/test_fibertube_score_tractogram.py (93%) rename {scripts => src/scilpy/cli}/tests/test_fibertube_tracking.py (88%) rename {scripts => src/scilpy/cli}/tests/test_fodf_bundleparc.py (80%) rename {scripts => src/scilpy/cli}/tests/test_fodf_max_in_ventricles.py (86%) rename {scripts => src/scilpy/cli}/tests/test_fodf_memsmt.py (94%) rename {scripts => src/scilpy/cli}/tests/test_fodf_metrics.py (87%) rename {scripts => src/scilpy/cli}/tests/test_fodf_msmt.py (92%) rename {scripts => src/scilpy/cli}/tests/test_fodf_ssst.py (87%) rename {scripts => src/scilpy/cli}/tests/test_fodf_to_bingham.py (91%) rename {scripts => src/scilpy/cli}/tests/test_freewater_maps.py (91%) rename {scripts => src/scilpy/cli}/tests/test_freewater_priors.py (62%) rename {scripts => src/scilpy/cli}/tests/test_frf_mean.py (82%) rename {scripts => src/scilpy/cli}/tests/test_frf_memsmt.py (94%) rename {scripts => src/scilpy/cli}/tests/test_frf_msmt.py (89%) rename {scripts => src/scilpy/cli}/tests/test_frf_set_diffusivities.py (84%) rename {scripts => src/scilpy/cli}/tests/test_frf_ssst.py (82%) rename {scripts => src/scilpy/cli}/tests/test_gradients_apply_transform.py (86%) rename {scripts => src/scilpy/cli}/tests/test_gradients_convert.py (91%) rename {scripts => src/scilpy/cli}/tests/test_gradients_generate_sampling.py (82%) rename {scripts => src/scilpy/cli}/tests/test_gradients_modify_axes.py (79%) rename {scripts => src/scilpy/cli}/tests/test_gradients_normalize_bvecs.py (84%) rename {scripts => src/scilpy/cli}/tests/test_gradients_round_bvals.py (86%) rename {scripts => src/scilpy/cli}/tests/test_gradients_validate_correct.py (84%) rename {scripts => src/scilpy/cli}/tests/test_gradients_validate_correct_eddy.py (98%) rename {scripts => src/scilpy/cli}/tests/test_gradients_validate_sampling.py (81%) rename {scripts => src/scilpy/cli}/tests/test_header_print_info.py (80%) rename {scripts => src/scilpy/cli}/tests/test_header_validate_compatibility.py (83%) rename {scripts => src/scilpy/cli}/tests/test_json_convert_entries_to_xlsx.py (81%) create mode 100644 src/scilpy/cli/tests/test_json_harmonize_entries.py rename {scripts => src/scilpy/cli}/tests/test_json_merge_entries.py (85%) rename {scripts => src/scilpy/cli}/tests/test_labels_combine.py (90%) rename {scripts => src/scilpy/cli}/tests/test_labels_dilate.py (86%) rename {scripts => src/scilpy/cli}/tests/test_labels_from_mask.py (88%) rename {scripts => src/scilpy/cli}/tests/test_labels_remove.py (85%) rename {scripts => src/scilpy/cli}/tests/test_labels_split_volume_by_ids.py (82%) rename {scripts => src/scilpy/cli}/tests/test_labels_split_volume_from_lut.py (84%) rename {scripts => src/scilpy/cli}/tests/test_lesions_generate_nawm.py (84%) rename {scripts => src/scilpy/cli}/tests/test_lesions_info.py (63%) rename {scripts => src/scilpy/cli}/tests/test_mrds_metrics.py (90%) rename {scripts => src/scilpy/cli}/tests/test_mrds_select_number_of_tensors.py (85%) rename {scripts => src/scilpy/cli}/tests/test_mti_adjust_B1_header.py (85%) rename {scripts => src/scilpy/cli}/tests/test_mti_maps_MT.py (91%) rename {scripts => src/scilpy/cli}/tests/test_mti_maps_ihMT.py (93%) rename {scripts => src/scilpy/cli}/tests/test_plot_stats_per_point.py (83%) rename {scripts => src/scilpy/cli}/tests/test_qball_metrics.py (86%) rename {scripts => src/scilpy/cli}/tests/test_rgb_convert.py (85%) rename {scripts => src/scilpy/cli}/tests/test_search_keywords.py (58%) rename {scripts => src/scilpy/cli}/tests/test_sh_convert.py (86%) rename {scripts => src/scilpy/cli}/tests/test_sh_fusion.py (84%) rename {scripts => src/scilpy/cli}/tests/test_sh_to_aodf.py (95%) rename {scripts => src/scilpy/cli}/tests/test_sh_to_rish.py (82%) rename {scripts => src/scilpy/cli}/tests/test_sh_to_sf.py (90%) rename {scripts => src/scilpy/cli}/tests/test_stats_group_comparison.py (90%) rename {scripts => src/scilpy/cli}/tests/test_surface_apply_transform.py (84%) rename {scripts => src/scilpy/cli}/tests/test_surface_convert.py (85%) rename {scripts => src/scilpy/cli}/tests/test_surface_create.py (90%) rename {scripts => src/scilpy/cli}/tests/test_surface_flip.py (85%) rename {scripts => src/scilpy/cli}/tests/test_surface_smooth.py (85%) rename {scripts => src/scilpy/cli}/tests/test_tracking_local.py (89%) rename {scripts => src/scilpy/cli}/tests/test_tracking_local_dev.py (92%) rename {scripts => src/scilpy/cli}/tests/test_tracking_pft.py (91%) rename {scripts => src/scilpy/cli}/tests/test_tracking_pft_maps.py (88%) rename {scripts => src/scilpy/cli}/tests/test_tracking_pft_maps_edit.py (88%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_apply_transform.py (87%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_apply_transform_to_hdf5.py (98%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_assign_custom_color.py (98%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_assign_uniform_color.py (98%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_commit.py (89%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_compress.py (84%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_compute_TODI.py (86%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_compute_density_map.py (98%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_convert.py (85%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_convert_hdf5_to_trk.py (98%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_convert_trk_to_hdf5.py (98%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_count_streamlines.py (80%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_cut_streamlines.py (91%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_detect_loops.py (87%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_dpp_math.py (90%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_dps_math.py (90%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_extract_ushape.py (88%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_filter_by_anatomy.py (91%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_filter_by_length.py (90%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_filter_by_orientation.py (98%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_filter_by_roi.py (87%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_filter_collisions.py (86%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_flip.py (86%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_math.py (84%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_pairwise_comparison.py (95%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_print_info.py (81%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_project_map_to_streamlines.py (95%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_project_streamlines_to_map.py (95%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_qbx.py (84%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_register.py (87%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_remove_invalid.py (85%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_resample.py (80%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_resample_nb_points.py (83%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_seed_density_map.py (80%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_segment_connections_from_labels.py (88%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_segment_with_ROI_and_score.py (98%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_segment_with_bundleseg.py (98%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_segment_with_recobundles.py (98%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_shuffle.py (82%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_smooth.py (85%) rename {scripts => src/scilpy/cli}/tests/test_tractogram_split.py (78%) rename {scripts => src/scilpy/cli}/tests/test_viz_bingham_fit.py (83%) rename {scripts => src/scilpy/cli}/tests/test_viz_bundle.py (86%) create mode 100644 src/scilpy/cli/tests/test_viz_bundle_screenshot_mni.py rename scripts/tests/test_dwi_prepare_topup_command.py => src/scilpy/cli/tests/test_viz_bundle_screenshot_mosaic.py (65%) rename {scripts => src/scilpy/cli}/tests/test_viz_connectivity.py (88%) rename scripts/tests/test_dwi_convert_FDF.py => src/scilpy/cli/tests/test_viz_dti_screenshot.py (63%) rename {scripts => src/scilpy/cli}/tests/test_viz_fodf.py (84%) create mode 100644 src/scilpy/cli/tests/test_viz_gradients_screenshot.py create mode 100644 src/scilpy/cli/tests/test_viz_tractogram_collisions.py create mode 100644 src/scilpy/cli/tests/test_viz_tractogram_seeds.py rename scripts/tests/test_viz_tractogram_seeds.py => src/scilpy/cli/tests/test_viz_tractogram_seeds_3d.py (63%) rename {scripts => src/scilpy/cli}/tests/test_viz_volume_histogram.py (84%) rename {scripts => src/scilpy/cli}/tests/test_viz_volume_scatterplot.py (88%) rename {scripts => src/scilpy/cli}/tests/test_viz_volume_screenshot.py (81%) rename scripts/tests/test_bundle_clean_qbx_clusters.py => src/scilpy/cli/tests/test_viz_volume_screenshot_mosaic.py (59%) rename {scripts => src/scilpy/cli}/tests/test_volume_apply_transform.py (89%) rename {scripts => src/scilpy/cli}/tests/test_volume_b0_synthesis.py (92%) rename {scripts => src/scilpy/cli}/tests/test_volume_count_non_zero_voxels.py (76%) rename {scripts => src/scilpy/cli}/tests/test_volume_crop.py (78%) rename {scripts => src/scilpy/cli}/tests/test_volume_distance_map.py (89%) rename {scripts => src/scilpy/cli}/tests/test_volume_flip.py (83%) rename {scripts => src/scilpy/cli}/tests/test_volume_math.py (87%) rename {scripts => src/scilpy/cli}/tests/test_volume_pairwise_comparison.py (90%) rename {scripts => src/scilpy/cli}/tests/test_volume_remove_outliers_ransac.py (81%) rename {scripts => src/scilpy/cli}/tests/test_volume_resample.py (82%) rename {scripts => src/scilpy/cli}/tests/test_volume_reshape.py (82%) rename {scripts => src/scilpy/cli}/tests/test_volume_reslice_to_reference.py (83%) rename {scripts => src/scilpy/cli}/tests/test_volume_stats_in_ROI.py (80%) rename {scripts => src/scilpy/cli}/tests/test_volume_stats_in_labels.py (81%) rename {scilpy/dwi => src/scilpy/connectivity}/__init__.py (100%) rename {scilpy => src/scilpy}/connectivity/connectivity.py (100%) rename {scilpy => src/scilpy}/connectivity/matrix_tools.py (100%) rename {scilpy => src/scilpy}/connectivity/tests/test_connectivity_tools.py (100%) rename {data => src/scilpy/data}/LUT/dk_aggregate_structures.json (100%) rename {data => src/scilpy/data}/LUT/freesurfer_desikan_killiany.json (100%) rename {data => src/scilpy/data}/LUT/freesurfer_subcortical.json (100%) rename {scilpy/dwi/tests => src/scilpy/data}/__init__.py (100%) rename {data => src/scilpy/data}/mni_icbm152_t1_tal_nlin_asym_09c_masked_2_5.nii.gz (100%) rename {data => src/scilpy/data}/vocabulary.json (100%) rename {scilpy/gpuparallel => src/scilpy/denoise}/__init__.py (100%) rename {scilpy => src/scilpy}/denoise/aodf_filter.cl (100%) rename {scilpy => src/scilpy}/denoise/asym_filtering.py (100%) rename {scilpy => src/scilpy}/denoise/tests/test_asym_filtering.py (100%) rename {scilpy/gradients => src/scilpy/dwi}/__init__.py (100%) rename {scilpy => src/scilpy}/dwi/operations.py (100%) rename {scilpy/image => src/scilpy/dwi/tests}/__init__.py (100%) rename {scilpy => src/scilpy}/dwi/tests/test_operations.py (100%) rename {scilpy => src/scilpy}/dwi/tests/test_utils.py (100%) rename {scilpy => src/scilpy}/dwi/utils.py (100%) rename {scilpy/image/tests => src/scilpy/gpuparallel}/__init__.py (100%) rename {scilpy => src/scilpy}/gpuparallel/opencl_utils.py (100%) rename {scilpy/io => src/scilpy/gradients}/__init__.py (100%) rename {scilpy => src/scilpy}/gradients/bvec_bval_tools.py (100%) rename {scilpy => src/scilpy}/gradients/gen_gradient_sampling.py (100%) rename {scilpy => src/scilpy}/gradients/optimize_gradient_sampling.py (100%) rename {scilpy => src/scilpy}/gradients/tests/test_bvec_bval_tools.py (100%) rename {scilpy => src/scilpy}/gradients/tests/test_gen_gradient_sampling.py (100%) rename {scilpy => src/scilpy}/gradients/tests/test_gradients_utils.py (100%) rename {scilpy => src/scilpy}/gradients/tests/test_optimize_gradient_sampling.py (100%) rename {scilpy => src/scilpy}/gradients/utils.py (100%) rename {scilpy/ml => src/scilpy/image}/__init__.py (100%) rename {scilpy => src/scilpy}/image/labels.py (96%) rename {scilpy => src/scilpy}/image/reslice.py (100%) rename {scilpy/ml/bundleparc => src/scilpy/image/tests}/__init__.py (100%) rename {scilpy => src/scilpy}/image/tests/test_labels.py (96%) rename {scilpy => src/scilpy}/image/tests/test_volume_math.py (100%) rename {scilpy => src/scilpy}/image/tests/test_volume_metrics.py (100%) rename {scilpy => src/scilpy}/image/tests/test_volume_operations.py (100%) rename {scilpy => src/scilpy}/image/utils.py (100%) rename {scilpy => src/scilpy}/image/volume_b0_synthesis.py (100%) rename {scilpy => src/scilpy}/image/volume_math.py (100%) rename {scilpy => src/scilpy}/image/volume_metrics.py (100%) rename {scilpy => src/scilpy}/image/volume_operations.py (100%) rename {scilpy => src/scilpy}/image/volume_space_management.py (100%) rename {scilpy/preprocessing => src/scilpy/io}/__init__.py (100%) rename {scilpy => src/scilpy}/io/btensor.py (100%) rename {scilpy => src/scilpy}/io/deprecator.py (100%) rename {scilpy => src/scilpy}/io/dvc.py (100%) rename {scilpy => src/scilpy}/io/fetcher.py (100%) rename {scilpy => src/scilpy}/io/gradients.py (100%) rename {scilpy => src/scilpy}/io/hdf5.py (100%) rename {scilpy => src/scilpy}/io/image.py (100%) rename {scilpy => src/scilpy}/io/mti.py (100%) rename {scilpy => src/scilpy}/io/streamlines.py (100%) rename {scilpy => src/scilpy}/io/tensor.py (100%) rename {scilpy => src/scilpy}/io/utils.py (100%) rename {scilpy => src/scilpy}/io/varian_fdf.py (100%) rename {scilpy/reconst => src/scilpy/ml}/__init__.py (100%) rename {scilpy/segment => src/scilpy/ml/bundleparc}/__init__.py (100%) rename {scilpy => src/scilpy}/ml/bundleparc/attention.py (100%) rename {scilpy => src/scilpy}/ml/bundleparc/bundleparcnet.py (100%) rename {scilpy => src/scilpy}/ml/bundleparc/encodings.py (100%) rename {scilpy => src/scilpy}/ml/bundleparc/predict.py (100%) rename {scilpy => src/scilpy}/ml/bundleparc/tests/test_bundleparc_utils.py (100%) rename {scilpy => src/scilpy}/ml/bundleparc/utils.py (100%) rename {scilpy => src/scilpy}/ml/utils.py (100%) rename {scilpy/stats => src/scilpy/preprocessing}/__init__.py (100%) rename {scilpy => src/scilpy}/preprocessing/distortion_correction.py (100%) rename {scilpy/surfaces => src/scilpy/reconst}/__init__.py (100%) rename {scilpy => src/scilpy}/reconst/aodf.py (100%) rename {scilpy => src/scilpy}/reconst/bingham.py (100%) rename {scilpy => src/scilpy}/reconst/divide.py (100%) rename {scilpy => src/scilpy}/reconst/fiber_coherence.py (100%) rename {scilpy => src/scilpy}/reconst/fodf.py (100%) rename {scilpy => src/scilpy}/reconst/frf.py (100%) rename {scilpy => src/scilpy}/reconst/mti.py (100%) rename {scilpy => src/scilpy}/reconst/sh.py (100%) rename {scilpy => src/scilpy}/reconst/tests/test_aodf.py (100%) rename {scilpy => src/scilpy}/reconst/tests/test_bingham.py (100%) rename {scilpy => src/scilpy}/reconst/tests/test_divide.py (100%) rename {scilpy => src/scilpy}/reconst/tests/test_fiber_coherence.py (100%) rename {scilpy => src/scilpy}/reconst/tests/test_fodf.py (100%) rename {scilpy => src/scilpy}/reconst/tests/test_frf.py (100%) rename {scilpy => src/scilpy}/reconst/tests/test_mti.py (100%) rename {scilpy => src/scilpy}/reconst/tests/test_sh.py (100%) rename {scilpy => src/scilpy}/reconst/tests/test_utils.py (100%) rename {scilpy => src/scilpy}/reconst/utils.py (100%) rename {scilpy/tracking => src/scilpy/segment}/__init__.py (100%) rename {scilpy => src/scilpy}/segment/bundleseg.py (100%) rename {scilpy => src/scilpy}/segment/models.py (100%) rename {scilpy => src/scilpy}/segment/streamlines.py (100%) rename {scilpy => src/scilpy}/segment/tests/test_tractogram_from_roi.py (100%) rename {scilpy => src/scilpy}/segment/tractogram_from_roi.py (100%) rename {scilpy => src/scilpy}/segment/voting_scheme.py (100%) rename {scilpy/tractanalysis => src/scilpy/stats}/__init__.py (100%) rename {scilpy => src/scilpy}/stats/matrix_stats.py (100%) rename {scilpy => src/scilpy}/stats/stats.py (100%) rename {scilpy => src/scilpy}/stats/tests/test_matrix_stats.py (100%) rename {scilpy => src/scilpy}/stats/utils.py (100%) rename {scilpy/tractograms => src/scilpy/surfaces}/__init__.py (100%) rename {scilpy => src/scilpy}/surfaces/surface_operations.py (100%) rename {scilpy => src/scilpy}/surfaces/tests/test_surface_operations.py (100%) rename {scilpy => src/scilpy}/surfaces/tests/test_surfaces_utils.py (100%) rename {scilpy => src/scilpy}/surfaces/utils.py (100%) rename {scilpy => src/scilpy}/tests/arrays.py (100%) rename {scilpy => src/scilpy}/tests/dict.py (100%) rename {scilpy => src/scilpy}/tests/streamlines.py (100%) rename {scilpy => src/scilpy}/tests/utils.py (100%) rename {scilpy/tractograms/tests => src/scilpy/tracking}/__init__.py (100%) rename {scilpy => src/scilpy}/tracking/fibertube_utils.py (100%) rename {scilpy => src/scilpy}/tracking/local_tracking.cl (100%) rename {scilpy => src/scilpy}/tracking/propagator.py (100%) rename {scilpy => src/scilpy}/tracking/rap.py (100%) rename {scilpy => src/scilpy}/tracking/seed.py (100%) rename {scilpy => src/scilpy}/tracking/tests/test_propagator.py (100%) rename {scilpy => src/scilpy}/tracking/tests/test_seed.py (100%) rename {scilpy => src/scilpy}/tracking/tests/test_tracker.py (100%) rename {scilpy => src/scilpy}/tracking/tracker.py (100%) rename {scilpy => src/scilpy}/tracking/utils.py (100%) rename {scilpy/viz => src/scilpy/tractanalysis}/__init__.py (100%) rename {scilpy => src/scilpy}/tractanalysis/afd_along_streamlines.py (100%) rename {scilpy => src/scilpy}/tractanalysis/bingham_metric_along_streamlines.py (100%) rename {scilpy => src/scilpy}/tractanalysis/bundle_operations.py (100%) rename {scilpy => src/scilpy}/tractanalysis/connectivity_segmentation.py (100%) rename {scilpy => src/scilpy}/tractanalysis/distance_to_centroid.py (100%) rename {scilpy => src/scilpy}/tractanalysis/fibertube_scoring.py (100%) rename {scilpy => src/scilpy}/tractanalysis/fixel_density.py (100%) rename {scilpy => src/scilpy}/tractanalysis/json_utils.py (100%) rename {scilpy => src/scilpy}/tractanalysis/mrds_along_streamlines.py (100%) rename {scilpy => src/scilpy}/tractanalysis/reproducibility_measures.py (100%) rename {scilpy => src/scilpy}/tractanalysis/scoring.py (100%) rename {scilpy => src/scilpy}/tractanalysis/streamlines_metrics.pyx (100%) rename {scilpy => src/scilpy}/tractanalysis/tests/test_fixel_density.py (100%) rename {scilpy => src/scilpy}/tractanalysis/tests/test_json_utils.py (100%) rename {scilpy => src/scilpy}/tractanalysis/tests/test_reproducibility_measures.py (100%) rename {scilpy => src/scilpy}/tractanalysis/todi.py (100%) rename {scilpy => src/scilpy}/tractanalysis/todi_util.py (100%) rename {scilpy => src/scilpy}/tractanalysis/voxel_boundary_intersection.pyx (100%) rename {scilpy/viz/backends => src/scilpy/tractograms}/__init__.py (100%) rename {scilpy => src/scilpy}/tractograms/dps_and_dpp_management.py (100%) rename {scilpy => src/scilpy}/tractograms/intersection_finder.py (100%) rename {scilpy => src/scilpy}/tractograms/lazy_tractogram_operations.py (100%) rename {scilpy => src/scilpy}/tractograms/streamline_and_mask_operations.py (100%) rename {scilpy => src/scilpy}/tractograms/streamline_operations.py (100%) rename {scripts => src/scilpy/tractograms/tests}/__init__.py (100%) rename {scilpy => src/scilpy}/tractograms/tests/test_dps_and_dpp_management.py (100%) rename {scilpy => src/scilpy}/tractograms/tests/test_lazy_tractogram_operations.py (100%) rename {scilpy => src/scilpy}/tractograms/tests/test_streamline_and_mask_operations.py (100%) rename {scilpy => src/scilpy}/tractograms/tests/test_streamline_operations.py (100%) rename {scilpy => src/scilpy}/tractograms/tests/test_tractogram_operations.py (100%) rename {scilpy => src/scilpy}/tractograms/tractogram_operations.py (100%) rename {scilpy => src/scilpy}/tractograms/uncompress.pyx (100%) rename {scilpy => src/scilpy}/utils/__init__.py (100%) rename {scilpy => src/scilpy}/utils/filenames.py (100%) rename {scilpy => src/scilpy}/utils/metrics_tools.py (100%) rename {scilpy => src/scilpy}/utils/scilpy_bot.py (96%) rename {scilpy => src/scilpy}/utils/spatial.py (100%) rename {scilpy => src/scilpy}/utils/tests/test_scilpy_bot.py (100%) rename {scilpy => src/scilpy}/version.py (100%) rename {scripts/legacy => src/scilpy/viz}/__init__.py (100%) rename {scripts/tests => src/scilpy/viz/backends}/__init__.py (100%) rename {scilpy => src/scilpy}/viz/backends/fury.py (100%) rename {scilpy => src/scilpy}/viz/backends/pil.py (100%) rename {scilpy => src/scilpy}/viz/backends/vtk.py (100%) rename {scilpy => src/scilpy}/viz/color.py (100%) rename {scilpy => src/scilpy}/viz/gradients.py (100%) rename {scilpy => src/scilpy}/viz/legacy/__init__.py (100%) rename {scilpy => src/scilpy}/viz/legacy/chord_chart.py (100%) rename {scilpy => src/scilpy}/viz/plot.py (100%) rename {scilpy => src/scilpy}/viz/screenshot.py (100%) rename {scilpy => src/scilpy}/viz/slice.py (100%) rename {scilpy => src/scilpy}/viz/utils.py (100%) diff --git a/MANIFEST.in b/MANIFEST.in index e16edd8b0..7a77a5739 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,7 +3,7 @@ include LICENSE include requirements.txt include .python-version -recursive-include data/LUT * +recursive-include src/scilpy/data * recursive-include scilpy *.c recursive-include scilpy *.cpp recursive-include scilpy *.pyx diff --git a/codecov.yml b/codecov.yml index 9f9d97b6f..7416bd623 100644 --- a/codecov.yml +++ b/codecov.yml @@ -24,11 +24,11 @@ component_management: - component_id: scilpy_scripts name: Scripts paths: - - scripts/ + - src/scilpy/cli/ - component_id: scilpy_library name: Library paths: - - scilpy/ + - src/scilpy/ comment: layout: "condensed_header, diff, components" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 791959734..8ff54b319 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,283 @@ -# Minimal build configuration at detailed here: -# https://github.com/pypa/pip/issues/11457 - [build-system] requires = [ "setuptools >= 64", + "setuptools_scm[toml]", "Cython==3.0.*", "numpy==1.25.*" ] +build-backend = "setuptools.build_meta" + +[project] +name = "scilpy" +version = "2.2.0" +description = "Scilpy: diffusion MRI tools and utilities" +authors = [{ name = "SCIL Team" }] +readme = "README.md" +requires-python = ">=3.9, <3.12" +license = { file = "LICENSE" } +classifiers = [ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Topic :: Scientific/Engineering" +] +dependencies = [ + "bids-validator==1.11.*", + "bctpy==0.5.*", + "bz2file==0.98.*", + "coloredlogs==15.0.*", + "cvxpy==1.4.*", + "cycler==0.11.*", + "Cython==3.0.*", + "dipy==1.10.*", + "deepdiff==6.3.0", + "dmri-amico==2.1.*", + "dmri-commit==2.3.*", + "docopt==0.6.*", + "dvc==3.48.*", + "dvc-http==2.32.*", + "formulaic==0.3.*", + "fury==0.11.*", + "future==0.18.*", + "GitPython==3.1.*", + "h5py==3.10.*", + "joblib==1.2.*", + "kiwisolver==1.4.*", + "matplotlib==3.6.*", + "PyMCubes==0.1.*", + "nibabel==5.2.*", + "nilearn==0.9.*", + "numba==0.59.1", + "numba-kdtree==0.4.0", + "nltk==3.8.*", + "numpy==1.25.*", + "openpyxl==3.0.*", + "packaging == 23.2.*", + "Pillow==10.2.*", + "pybids==0.16.*", + "pyparsing==3.0.*", + "PySocks==1.7.*", + "pytest==7.2.*", + "pytest-console-scripts==1.3.*", + "pytest-cov==4.1.0", + "pytest-html==4.1.1", + "pytest-mock==3.10.*", + "python-dateutil==2.8.*", + "pytz==2022.6.*", + "requests==2.28.*", + "scikit-learn==1.2.*", + "scikit-image==0.22.*", + "scipy==1.11.*", + "six==1.16.*", + "spams==2.6.*", + "statsmodels==0.13.*", + "trimeshpy==0.0.4", + "vtk==9.2.*" +] + +[project.optional-dependencies] +dev = ["pytest", "ipython"] + +[tool.setuptools] +package-dir = { "" = "src" } +include-package-data = true + +[tool.setuptools.package-data] +"scilpy.data" = ["src/scilpy/data"] + +[project.scripts] +scil_aodf_metrics = "scilpy.cli.scil_aodf_metrics:main" +scil_bids_validate = "scilpy.cli.scil_bids_validate:main" +scil_bingham_metrics = "scilpy.cli.scil_bingham_metrics:main" +scil_btensor_metrics = "scilpy.cli.scil_btensor_metrics:main" +scil_bundle_alter_to_target_dice = "scilpy.cli.scil_bundle_alter_to_target_dice:main" +scil_bundle_clean_qbx_clusters = "scilpy.cli.scil_bundle_clean_qbx_clusters:main" +scil_bundle_compute_centroid = "scilpy.cli.scil_bundle_compute_centroid:main" +scil_bundle_compute_endpoints_map = "scilpy.cli.scil_bundle_compute_endpoints_map:main" +scil_bundle_diameter = "scilpy.cli.scil_bundle_diameter:main" +scil_bundle_explore_bundleseg = "scilpy.cli.scil_bundle_explore_bundleseg:main" +scil_bundle_filter_by_occurence = "scilpy.cli.scil_bundle_filter_by_occurence:main" +scil_bundle_fixel_analysis = "scilpy.cli.scil_bundle_fixel_analysis:main" +scil_bundle_generate_priors = "scilpy.cli.scil_bundle_generate_priors:main" +scil_bundle_label_map = "scilpy.cli.scil_bundle_label_map:main" +scil_bundle_mean_fixel_afd_from_hdf5 = "scilpy.cli.scil_bundle_mean_fixel_afd_from_hdf5:main" +scil_bundle_mean_fixel_afd = "scilpy.cli.scil_bundle_mean_fixel_afd:main" +scil_bundle_mean_fixel_bingham_metric = "scilpy.cli.scil_bundle_mean_fixel_bingham_metric:main" +scil_bundle_mean_fixel_mrds_metric = "scilpy.cli.scil_bundle_mean_fixel_mrds_metric:main" +scil_bundle_mean_std = "scilpy.cli.scil_bundle_mean_std:main" +scil_bundle_pairwise_comparison = "scilpy.cli.scil_bundle_pairwise_comparison:main" +scil_bundle_reject_outliers = "scilpy.cli.scil_bundle_reject_outliers:main" +scil_bundle_score_many_bundles_one_tractogram = "scilpy.cli.scil_bundle_score_many_bundles_one_tractogram:main" +scil_bundle_score_same_bundle_many_segmentations = "scilpy.cli.scil_bundle_score_same_bundle_many_segmentations:main" +scil_bundle_shape_measures = "scilpy.cli.scil_bundle_shape_measures:main" +scil_bundle_uniformize_endpoints = "scilpy.cli.scil_bundle_uniformize_endpoints:main" +scil_bundle_volume_per_label = "scilpy.cli.scil_bundle_volume_per_label:main" +scil_connectivity_compare_populations = "scilpy.cli.scil_connectivity_compare_populations:main" +scil_connectivity_compute_matrices = "scilpy.cli.scil_connectivity_compute_matrices:main" +scil_connectivity_compute_pca = "scilpy.cli.scil_connectivity_compute_pca:main" +scil_connectivity_compute_simple_matrix = "scilpy.cli.scil_connectivity_compute_simple_matrix:main" +scil_connectivity_filter = "scilpy.cli.scil_connectivity_filter:main" +scil_connectivity_graph_measures = "scilpy.cli.scil_connectivity_graph_measures:main" +scil_connectivity_hdf5_average_density_map = "scilpy.cli.scil_connectivity_hdf5_average_density_map:main" +scil_connectivity_math = "scilpy.cli.scil_connectivity_math:main" +scil_connectivity_normalize = "scilpy.cli.scil_connectivity_normalize:main" +scil_connectivity_pairwise_agreement = "scilpy.cli.scil_connectivity_pairwise_agreement:main" +scil_connectivity_print_filenames = "scilpy.cli.scil_connectivity_print_filenames:main" +scil_connectivity_reorder_rois = "scilpy.cli.scil_connectivity_reorder_rois:main" +scil_denoising_nlmeans = "scilpy.cli.scil_denoising_nlmeans:main" +scil_dki_metrics = "scilpy.cli.scil_dki_metrics:main" +scil_dti_convert_tensors = "scilpy.cli.scil_dti_convert_tensors:main" +scil_dti_metrics = "scilpy.cli.scil_dti_metrics:main" +scil_dwi_apply_bias_field = "scilpy.cli.scil_dwi_apply_bias_field:main" +scil_dwi_compute_snr = "scilpy.cli.scil_dwi_compute_snr:main" +scil_dwi_concatenate = "scilpy.cli.scil_dwi_concatenate:main" +scil_dwi_convert_FDF = "scilpy.cli.scil_dwi_convert_FDF:main" +scil_dwi_detect_volume_outliers = "scilpy.cli.scil_dwi_detect_volume_outliers:main" +scil_dwi_extract_b0 = "scilpy.cli.scil_dwi_extract_b0:main" +scil_dwi_extract_shell = "scilpy.cli.scil_dwi_extract_shell:main" +scil_dwi_powder_average = "scilpy.cli.scil_dwi_powder_average:main" +scil_dwi_prepare_eddy_command = "scilpy.cli.scil_dwi_prepare_eddy_command:main" +scil_dwi_prepare_topup_command = "scilpy.cli.scil_dwi_prepare_topup_command:main" +scil_dwi_reorder_philips = "scilpy.cli.scil_dwi_reorder_philips:main" +scil_dwi_split_by_indices = "scilpy.cli.scil_dwi_split_by_indices:main" +scil_dwi_to_sh = "scilpy.cli.scil_dwi_to_sh:main" +scil_fibertube_compute_density = "scilpy.cli.scil_fibertube_compute_density:main" +scil_fibertube_score_tractogram = "scilpy.cli.scil_fibertube_score_tractogram:main" +scil_fibertube_tracking = "scilpy.cli.scil_fibertube_tracking:main" +scil_fodf_bundleparc = "scilpy.cli.scil_fodf_bundleparc:main" +scil_fodf_max_in_ventricles = "scilpy.cli.scil_fodf_max_in_ventricles:main" +scil_fodf_memsmt = "scilpy.cli.scil_fodf_memsmt:main" +scil_fodf_metrics = "scilpy.cli.scil_fodf_metrics:main" +scil_fodf_msmt = "scilpy.cli.scil_fodf_msmt:main" +scil_fodf_ssst = "scilpy.cli.scil_fodf_ssst:main" +scil_fodf_to_bingham = "scilpy.cli.scil_fodf_to_bingham:main" +scil_freewater_maps = "scilpy.cli.scil_freewater_maps:main" +scil_freewater_priors = "scilpy.cli.scil_freewater_priors:main" +scil_frf_mean = "scilpy.cli.scil_frf_mean:main" +scil_frf_memsmt = "scilpy.cli.scil_frf_memsmt:main" +scil_frf_msmt = "scilpy.cli.scil_frf_msmt:main" +scil_frf_set_diffusivities = "scilpy.cli.scil_frf_set_diffusivities:main" +scil_frf_ssst = "scilpy.cli.scil_frf_ssst:main" +scil_get_version = "scilpy.cli.scil_get_version:main" +scil_gradients_apply_transform = "scilpy.cli.scil_gradients_apply_transform:main" +scil_gradients_convert = "scilpy.cli.scil_gradients_convert:main" +scil_gradients_generate_sampling = "scilpy.cli.scil_gradients_generate_sampling:main" +scil_gradients_modify_axes = "scilpy.cli.scil_gradients_modify_axes:main" +scil_gradients_normalize_bvecs = "scilpy.cli.scil_gradients_normalize_bvecs:main" +scil_gradients_round_bvals = "scilpy.cli.scil_gradients_round_bvals:main" +scil_gradients_validate_correct_eddy = "scilpy.cli.scil_gradients_validate_correct_eddy:main" +scil_gradients_validate_correct = "scilpy.cli.scil_gradients_validate_correct:main" +scil_gradients_validate_sampling = "scilpy.cli.scil_gradients_validate_sampling:main" +scil_header_print_info = "scilpy.cli.scil_header_print_info:main" +scil_header_validate_compatibility = "scilpy.cli.scil_header_validate_compatibility:main" +scil_json_convert_entries_to_xlsx = "scilpy.cli.scil_json_convert_entries_to_xlsx:main" +scil_json_harmonize_entries = "scilpy.cli.scil_json_harmonize_entries:main" +scil_json_merge_entries = "scilpy.cli.scil_json_merge_entries:main" +scil_labels_combine = "scilpy.cli.scil_labels_combine:main" +scil_labels_dilate = "scilpy.cli.scil_labels_dilate:main" +scil_labels_from_mask = "scilpy.cli.scil_labels_from_mask:main" +scil_labels_remove = "scilpy.cli.scil_labels_remove:main" +scil_labels_split_volume_by_ids = "scilpy.cli.scil_labels_split_volume_by_ids:main" +scil_labels_split_volume_from_lut = "scilpy.cli.scil_labels_split_volume_from_lut:main" +scil_lesions_generate_nawm = "scilpy.cli.scil_lesions_generate_nawm:main" +scil_lesions_info = "scilpy.cli.scil_lesions_info:main" +scil_mrds_metrics = "scilpy.cli.scil_mrds_metrics:main" +scil_mrds_select_number_of_tensors = "scilpy.cli.scil_mrds_select_number_of_tensors:main" +scil_mti_adjust_B1_header = "scilpy.cli.scil_mti_adjust_B1_header:main" +scil_mti_maps_ihMT = "scilpy.cli.scil_mti_maps_ihMT:main" +scil_mti_maps_MT = "scilpy.cli.scil_mti_maps_MT:main" +scil_NODDI_maps = "scilpy.cli.scil_NODDI_maps:main" +scil_NODDI_priors = "scilpy.cli.scil_NODDI_priors:main" +scil_plot_stats_per_point = "scilpy.cli.scil_plot_stats_per_point:main" +scil_qball_metrics = "scilpy.cli.scil_qball_metrics:main" +scil_rgb_convert = "scilpy.cli.scil_rgb_convert:main" +scil_search_keywords = "scilpy.cli.scil_search_keywords:main" +scil_sh_convert = "scilpy.cli.scil_sh_convert:main" +scil_sh_fusion = "scilpy.cli.scil_sh_fusion:main" +scil_sh_to_aodf = "scilpy.cli.scil_sh_to_aodf:main" +scil_sh_to_rish = "scilpy.cli.scil_sh_to_rish:main" +scil_sh_to_sf = "scilpy.cli.scil_sh_to_sf:main" +scil_stats_group_comparison = "scilpy.cli.scil_stats_group_comparison:main" +scil_surface_apply_transform = "scilpy.cli.scil_surface_apply_transform:main" +scil_surface_convert = "scilpy.cli.scil_surface_convert:main" +scil_surface_create = "scilpy.cli.scil_surface_create:main" +scil_surface_flip = "scilpy.cli.scil_surface_flip:main" +scil_surface_smooth = "scilpy.cli.scil_surface_smooth:main" +scil_tracking_local_dev = "scilpy.cli.scil_tracking_local_dev:main" +scil_tracking_local = "scilpy.cli.scil_tracking_local:main" +scil_tracking_pft_maps_edit = "scilpy.cli.scil_tracking_pft_maps_edit:main" +scil_tracking_pft_maps = "scilpy.cli.scil_tracking_pft_maps:main" +scil_tracking_pft = "scilpy.cli.scil_tracking_pft:main" +scil_tractogram_apply_transform = "scilpy.cli.scil_tractogram_apply_transform:main" +scil_tractogram_apply_transform_to_hdf5 = "scilpy.cli.scil_tractogram_apply_transform_to_hdf5:main" +scil_tractogram_assign_custom_color = "scilpy.cli.scil_tractogram_assign_custom_color:main" +scil_tractogram_assign_uniform_color = "scilpy.cli.scil_tractogram_assign_uniform_color:main" +scil_tractogram_commit = "scilpy.cli.scil_tractogram_commit:main" +scil_tractogram_compress = "scilpy.cli.scil_tractogram_compress:main" +scil_tractogram_compute_density_map = "scilpy.cli.scil_tractogram_compute_density_map:main" +scil_tractogram_compute_TODI = "scilpy.cli.scil_tractogram_compute_TODI:main" +scil_tractogram_convert_hdf5_to_trk = "scilpy.cli.scil_tractogram_convert_hdf5_to_trk:main" +scil_tractogram_convert = "scilpy.cli.scil_tractogram_convert:main" +scil_tractogram_convert_trk_to_hdf5 = "scilpy.cli.scil_tractogram_convert_trk_to_hdf5:main" +scil_tractogram_count_streamlines = "scilpy.cli.scil_tractogram_count_streamlines:main" +scil_tractogram_cut_streamlines = "scilpy.cli.scil_tractogram_cut_streamlines:main" +scil_tractogram_detect_loops = "scilpy.cli.scil_tractogram_detect_loops:main" +scil_tractogram_dpp_math = "scilpy.cli.scil_tractogram_dpp_math:main" +scil_tractogram_dps_math = "scilpy.cli.scil_tractogram_dps_math:main" +scil_tractogram_extract_ushape = "scilpy.cli.scil_tractogram_extract_ushape:main" +scil_tractogram_filter_by_anatomy = "scilpy.cli.scil_tractogram_filter_by_anatomy:main" +scil_tractogram_filter_by_length = "scilpy.cli.scil_tractogram_filter_by_length:main" +scil_tractogram_filter_by_orientation = "scilpy.cli.scil_tractogram_filter_by_orientation:main" +scil_tractogram_filter_by_roi = "scilpy.cli.scil_tractogram_filter_by_roi:main" +scil_tractogram_filter_collisions = "scilpy.cli.scil_tractogram_filter_collisions:main" +scil_tractogram_flip = "scilpy.cli.scil_tractogram_flip:main" +scil_tractogram_math = "scilpy.cli.scil_tractogram_math:main" +scil_tractogram_pairwise_comparison = "scilpy.cli.scil_tractogram_pairwise_comparison:main" +scil_tractogram_print_info = "scilpy.cli.scil_tractogram_print_info:main" +scil_tractogram_project_map_to_streamlines = "scilpy.cli.scil_tractogram_project_map_to_streamlines:main" +scil_tractogram_project_streamlines_to_map = "scilpy.cli.scil_tractogram_project_streamlines_to_map:main" +scil_tractogram_qbx = "scilpy.cli.scil_tractogram_qbx:main" +scil_tractogram_register = "scilpy.cli.scil_tractogram_register:main" +scil_tractogram_remove_invalid = "scilpy.cli.scil_tractogram_remove_invalid:main" +scil_tractogram_resample_nb_points = "scilpy.cli.scil_tractogram_resample_nb_points:main" +scil_tractogram_resample = "scilpy.cli.scil_tractogram_resample:main" +scil_tractogram_seed_density_map = "scilpy.cli.scil_tractogram_seed_density_map:main" +scil_tractogram_segment_connections_from_labels = "scilpy.cli.scil_tractogram_segment_connections_from_labels:main" +scil_tractogram_segment_with_bundleseg = "scilpy.cli.scil_tractogram_segment_with_bundleseg:main" +scil_tractogram_segment_with_recobundles = "scilpy.cli.scil_tractogram_segment_with_recobundles:main" +scil_tractogram_segment_with_ROI_and_score = "scilpy.cli.scil_tractogram_segment_with_ROI_and_score:main" +scil_tractogram_shuffle = "scilpy.cli.scil_tractogram_shuffle:main" +scil_tractogram_smooth = "scilpy.cli.scil_tractogram_smooth:main" +scil_tractogram_split = "scilpy.cli.scil_tractogram_split:main" +scil_viz_bingham_fit = "scilpy.cli.scil_viz_bingham_fit:main" +scil_viz_bundle = "scilpy.cli.scil_viz_bundle:main" +scil_viz_bundle_screenshot_mni = "scilpy.cli.scil_viz_bundle_screenshot_mni:main" +scil_viz_bundle_screenshot_mosaic = "scilpy.cli.scil_viz_bundle_screenshot_mosaic:main" +scil_viz_connectivity = "scilpy.cli.scil_viz_connectivity:main" +scil_viz_dti_screenshot = "scilpy.cli.scil_viz_dti_screenshot:main" +scil_viz_fodf = "scilpy.cli.scil_viz_fodf:main" +scil_viz_gradients_screenshot = "scilpy.cli.scil_viz_gradients_screenshot:main" +scil_viz_tractogram_collisions = "scilpy.cli.scil_viz_tractogram_collisions:main" +scil_viz_tractogram_seeds_3d = "scilpy.cli.scil_viz_tractogram_seeds_3d:main" +scil_viz_tractogram_seeds = "scilpy.cli.scil_viz_tractogram_seeds:main" +scil_viz_volume_histogram = "scilpy.cli.scil_viz_volume_histogram:main" +scil_viz_volume_scatterplot = "scilpy.cli.scil_viz_volume_scatterplot:main" +scil_viz_volume_screenshot_mosaic = "scilpy.cli.scil_viz_volume_screenshot_mosaic:main" +scil_viz_volume_screenshot = "scilpy.cli.scil_viz_volume_screenshot:main" +scil_volume_apply_transform = "scilpy.cli.scil_volume_apply_transform:main" +scil_volume_b0_synthesis = "scilpy.cli.scil_volume_b0_synthesis:main" +scil_volume_count_non_zero_voxels = "scilpy.cli.scil_volume_count_non_zero_voxels:main" +scil_volume_crop = "scilpy.cli.scil_volume_crop:main" +scil_volume_distance_map = "scilpy.cli.scil_volume_distance_map:main" +scil_volume_flip = "scilpy.cli.scil_volume_flip:main" +scil_volume_math = "scilpy.cli.scil_volume_math:main" +scil_volume_pairwise_comparison = "scilpy.cli.scil_volume_pairwise_comparison:main" +scil_volume_remove_outliers_ransac = "scilpy.cli.scil_volume_remove_outliers_ransac:main" +scil_volume_resample = "scilpy.cli.scil_volume_resample:main" +scil_volume_reshape = "scilpy.cli.scil_volume_reshape:main" +scil_volume_reslice_to_reference = "scilpy.cli.scil_volume_reslice_to_reference:main" +scil_volume_stats_in_labels = "scilpy.cli.scil_volume_stats_in_labels:main" +scil_volume_stats_in_ROI = "scilpy.cli.scil_volume_stats_in_ROI:main" diff --git a/scripts/legacy/scil_add_tracking_mask_to_pft_maps.py b/scripts/legacy/scil_add_tracking_mask_to_pft_maps.py deleted file mode 100755 index 908eed73a..000000000 --- a/scripts/legacy/scil_add_tracking_mask_to_pft_maps.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tracking_pft_maps_edit import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tracking_pft_maps_edit.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_add_tracking_mask_to_pft_maps.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_analyse_lesions_load.py b/scripts/legacy/scil_analyse_lesions_load.py deleted file mode 100755 index 6352dd877..000000000 --- a/scripts/legacy/scil_analyse_lesions_load.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_lesions_info import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_lesions_info.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_analyse_lesions_load.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_apply_bias_field_on_dwi.py b/scripts/legacy/scil_apply_bias_field_on_dwi.py deleted file mode 100755 index 7b058d497..000000000 --- a/scripts/legacy/scil_apply_bias_field_on_dwi.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_apply_bias_field import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_apply_bias_field.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_apply_bias_field_on_dwi.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_apply_transform_to_bvecs.py b/scripts/legacy/scil_apply_transform_to_bvecs.py deleted file mode 100755 index fbd5fd326..000000000 --- a/scripts/legacy/scil_apply_transform_to_bvecs.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_gradients_apply_transform import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_gradients_apply_transform.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_apply_transform_to_bvecs.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_apply_transform_to_hdf5.py b/scripts/legacy/scil_apply_transform_to_hdf5.py deleted file mode 100755 index 00fe42d01..000000000 --- a/scripts/legacy/scil_apply_transform_to_hdf5.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_apply_transform_to_hdf5 import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_apply_transform_to_hdf5. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_apply_transform_to_hdf5.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_apply_transform_to_image.py b/scripts/legacy/scil_apply_transform_to_image.py deleted file mode 100755 index a04cfffed..000000000 --- a/scripts/legacy/scil_apply_transform_to_image.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_volume_apply_transform import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_volume_apply_transform.py. Please change -your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_apply_transform_to_image.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_apply_transform_to_surface.py b/scripts/legacy/scil_apply_transform_to_surface.py deleted file mode 100755 index 99babdb4b..000000000 --- a/scripts/legacy/scil_apply_transform_to_surface.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_surface_apply_transform import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_surface_apply_transform.py. Please change -your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_apply_transform_to_surface.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_apply_transform_to_tractogram.py b/scripts/legacy/scil_apply_transform_to_tractogram.py deleted file mode 100755 index ab71cdb08..000000000 --- a/scripts/legacy/scil_apply_transform_to_tractogram.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_apply_transform import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_apply_transform.py. Please change -your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_apply_transform_to_tractogram.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_assign_custom_color_to_tractogram.py b/scripts/legacy/scil_assign_custom_color_to_tractogram.py deleted file mode 100755 index 6a53ee955..000000000 --- a/scripts/legacy/scil_assign_custom_color_to_tractogram.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_assign_custom_color import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_assign_custom_color.py. -Please change your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_assign_custom_color_to_tractogram.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_assign_uniform_color_to_tractograms.py b/scripts/legacy/scil_assign_uniform_color_to_tractograms.py deleted file mode 100755 index f6f83de51..000000000 --- a/scripts/legacy/scil_assign_uniform_color_to_tractograms.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_assign_uniform_color import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_assign_uniform_color.py. -Please change your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_assign_uniform_color_to_tractogram.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_clean_qbx_clusters.py b/scripts/legacy/scil_clean_qbx_clusters.py deleted file mode 100755 index 0d32d87ec..000000000 --- a/scripts/legacy/scil_clean_qbx_clusters.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_clean_qbx_clusters import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_clean_qbx_clusters.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_clean_qbx_clusters.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_combine_labels.py b/scripts/legacy/scil_combine_labels.py deleted file mode 100755 index 16a638e64..000000000 --- a/scripts/legacy/scil_combine_labels.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_labels_combine import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_labels_combine.py. -Now, all our scripts using labels start with scil_labels_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_combine_labels.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compare_connectivity.py b/scripts/legacy/scil_compare_connectivity.py deleted file mode 100755 index e431a600d..000000000 --- a/scripts/legacy/scil_compare_connectivity.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_connectivity_compare_populations import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_connectivity_compare_populations.py. -All our scripts regarding connectivity now start with scil_connectivity_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compare_connectivity.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compress_streamlines.py b/scripts/legacy/scil_compress_streamlines.py deleted file mode 100755 index 9088f8586..000000000 --- a/scripts/legacy/scil_compress_streamlines.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_compress import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_compress.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compress_streamlines.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_MT_maps.py b/scripts/legacy/scil_compute_MT_maps.py deleted file mode 100755 index 40d5a941d..000000000 --- a/scripts/legacy/scil_compute_MT_maps.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_mti_maps_MT import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_mti_maps_MT.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_MT_maps.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_NODDI.py b/scripts/legacy/scil_compute_NODDI.py deleted file mode 100755 index 2cbcdd060..000000000 --- a/scripts/legacy/scil_compute_NODDI.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_NODDI_maps import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_NODDI_maps.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_NODDI.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_NODDI_priors.py b/scripts/legacy/scil_compute_NODDI_priors.py deleted file mode 100755 index 998609e7d..000000000 --- a/scripts/legacy/scil_compute_NODDI_priors.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_NODDI_priors import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_NODDI_priors.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_NODDI_priors.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_asym_odf_metrics.py b/scripts/legacy/scil_compute_asym_odf_metrics.py deleted file mode 100755 index df570652c..000000000 --- a/scripts/legacy/scil_compute_asym_odf_metrics.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_aodf_metrics import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_aodf_metrics.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_asym_odf_metrics.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_bundle_mean_std.py b/scripts/legacy/scil_compute_bundle_mean_std.py deleted file mode 100755 index 59dd5a690..000000000 --- a/scripts/legacy/scil_compute_bundle_mean_std.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_mean_std import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_mean_std.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_bundle_mean_std.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_bundle_mean_std_per_point.py b/scripts/legacy/scil_compute_bundle_mean_std_per_point.py deleted file mode 100755 index 745659ed4..000000000 --- a/scripts/legacy/scil_compute_bundle_mean_std_per_point.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_mean_std import main as new_main - - -DEPRECATION_MSG = """ -This script has been merged with new script scil_bundle_mean_std.py. It is -now available through option '--per_point'. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_bundle_mean_std_per_point.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_bundle_volume.py b/scripts/legacy/scil_compute_bundle_volume.py deleted file mode 100755 index b51a27710..000000000 --- a/scripts/legacy/scil_compute_bundle_volume.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_shape_measures import main as new_main - - -DEPRECATION_MSG = """ -This script has been removed. You can now obtain this information using -scil_bundle_shape_measures.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_bundle_volume.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_bundle_volume_per_label.py b/scripts/legacy/scil_compute_bundle_volume_per_label.py deleted file mode 100755 index 2e4cbfd9c..000000000 --- a/scripts/legacy/scil_compute_bundle_volume_per_label.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_volume_per_label import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_volume_per_label.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_bundle_volume_per_label.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_bundle_voxel_label_map.py b/scripts/legacy/scil_compute_bundle_voxel_label_map.py deleted file mode 100755 index d573962f8..000000000 --- a/scripts/legacy/scil_compute_bundle_voxel_label_map.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_label_map import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_label_map.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_bundle_voxel_label_map.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_centroid.py b/scripts/legacy/scil_compute_centroid.py deleted file mode 100755 index 12d6616e5..000000000 --- a/scripts/legacy/scil_compute_centroid.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_compute_centroid import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_compute_centroid.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_centroid.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_connectivity.py b/scripts/legacy/scil_compute_connectivity.py deleted file mode 100755 index be5f8adec..000000000 --- a/scripts/legacy/scil_compute_connectivity.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_connectivity_compute_matrices import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_connectivity_compute_matrices.py. -All our scripts regarding connectivity now start with scil_connectivity_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_connectivity.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_divide.py b/scripts/legacy/scil_compute_divide.py deleted file mode 100755 index e2acee782..000000000 --- a/scripts/legacy/scil_compute_divide.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_btensor_metrics import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_btensor_metrics.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_divide.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_dti_metrics.py b/scripts/legacy/scil_compute_dti_metrics.py deleted file mode 100755 index 04aaa6ebd..000000000 --- a/scripts/legacy/scil_compute_dti_metrics.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dti_metrics import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dti_metrics.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_dti_metrics.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_endpoints_map.py b/scripts/legacy/scil_compute_endpoints_map.py deleted file mode 100755 index 1f1a1d22f..000000000 --- a/scripts/legacy/scil_compute_endpoints_map.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_compute_endpoints_map import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_compute_endpoints_map.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_endpoints_map.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_fodf_max_in_ventricles.py b/scripts/legacy/scil_compute_fodf_max_in_ventricles.py deleted file mode 100755 index 2e3273da6..000000000 --- a/scripts/legacy/scil_compute_fodf_max_in_ventricles.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_fodf_max_in_ventricles import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_fodf_max_in_ventricles.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_fodf_max_in_ventricles.py", DEPRECATION_MSG, - '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_fodf_metrics.py b/scripts/legacy/scil_compute_fodf_metrics.py deleted file mode 100755 index 1117e78cd..000000000 --- a/scripts/legacy/scil_compute_fodf_metrics.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_fodf_metrics import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_fodf_metrics.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_fodf_metrics.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_freewater.py b/scripts/legacy/scil_compute_freewater.py deleted file mode 100755 index 630987674..000000000 --- a/scripts/legacy/scil_compute_freewater.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_freewater_maps import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_freewater_maps.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_freewater.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_hdf5_average_density_map.py b/scripts/legacy/scil_compute_hdf5_average_density_map.py deleted file mode 100755 index a11326a7a..000000000 --- a/scripts/legacy/scil_compute_hdf5_average_density_map.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_connectivity_hdf5_average_density_map import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_connectivity_hdf5_average_density_map.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_hdf5_average_density_map.py", DEPRECATION_MSG, - '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_ihMT_maps.py b/scripts/legacy/scil_compute_ihMT_maps.py deleted file mode 100755 index fe5f0d22f..000000000 --- a/scripts/legacy/scil_compute_ihMT_maps.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_mti_maps_ihMT import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_mti_maps_ihMT.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_ihMT_maps.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_kurtosis_metrics.py b/scripts/legacy/scil_compute_kurtosis_metrics.py deleted file mode 100755 index 1c985be40..000000000 --- a/scripts/legacy/scil_compute_kurtosis_metrics.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dki_metrics import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dki_metrics.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_kurtosis_metrics.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_lobe_specific_fodf_metrics.py b/scripts/legacy/scil_compute_lobe_specific_fodf_metrics.py deleted file mode 100755 index 207f3d734..000000000 --- a/scripts/legacy/scil_compute_lobe_specific_fodf_metrics.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bingham_metrics import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bingham_metrics.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_lobe_specific_fodf_metrics.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_local_tracking.py b/scripts/legacy/scil_compute_local_tracking.py deleted file mode 100755 index 47fd060e0..000000000 --- a/scripts/legacy/scil_compute_local_tracking.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tracking_local import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tracking_local.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_local_tracking.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_local_tracking_dev.py b/scripts/legacy/scil_compute_local_tracking_dev.py deleted file mode 100755 index e6bee6304..000000000 --- a/scripts/legacy/scil_compute_local_tracking_dev.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tracking_local_dev import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tracking_local_dev.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_local_tracking_dev.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_maps_for_particle_filter_tracking.py b/scripts/legacy/scil_compute_maps_for_particle_filter_tracking.py deleted file mode 100755 index d01f1700d..000000000 --- a/scripts/legacy/scil_compute_maps_for_particle_filter_tracking.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tracking_pft_maps import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tracking_pft_maps.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_maps_for_particle_filter_tracking.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_mean_fixel_afd_from_bundles.py b/scripts/legacy/scil_compute_mean_fixel_afd_from_bundles.py deleted file mode 100755 index adc416206..000000000 --- a/scripts/legacy/scil_compute_mean_fixel_afd_from_bundles.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_mean_fixel_afd import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_mean_fixel_afd.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_fixel_afd_from_bundles.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_mean_fixel_afd_from_hdf5.py b/scripts/legacy/scil_compute_mean_fixel_afd_from_hdf5.py deleted file mode 100755 index d7d29d51b..000000000 --- a/scripts/legacy/scil_compute_mean_fixel_afd_from_hdf5.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_mean_fixel_afd_from_hdf5 import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_mean_fixel_afd.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_fixel_afd_from_hdf5.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_mean_fixel_lobe_metric_from_bundles.py b/scripts/legacy/scil_compute_mean_fixel_lobe_metric_from_bundles.py deleted file mode 100755 index fb7cc7d8c..000000000 --- a/scripts/legacy/scil_compute_mean_fixel_lobe_metric_from_bundles.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_mean_fixel_bingham_metric import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_mean_fixel_bingham_metric.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_mean_fixel_lobe_metric_from_bundles.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_mean_frf.py b/scripts/legacy/scil_compute_mean_frf.py deleted file mode 100755 index d55da50a5..000000000 --- a/scripts/legacy/scil_compute_mean_frf.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_frf_mean import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_frf_mean.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_mean_frf.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_memsmt_fodf.py b/scripts/legacy/scil_compute_memsmt_fodf.py deleted file mode 100755 index 8b6439441..000000000 --- a/scripts/legacy/scil_compute_memsmt_fodf.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_fodf_memsmt import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_fodf_memsmt.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_memsmt_fodf.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_memsmt_frf.py b/scripts/legacy/scil_compute_memsmt_frf.py deleted file mode 100755 index 45d608c98..000000000 --- a/scripts/legacy/scil_compute_memsmt_frf.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_frf_memsmt import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_frf_memsmt.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_memsmt_frf.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_metrics_stats_in_ROI.py b/scripts/legacy/scil_compute_metrics_stats_in_ROI.py deleted file mode 100755 index 26174f809..000000000 --- a/scripts/legacy/scil_compute_metrics_stats_in_ROI.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_volume_stats_in_ROI import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_volume_stats_in_ROI.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_metrics_stats_in_ROI.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_msmt_fodf.py b/scripts/legacy/scil_compute_msmt_fodf.py deleted file mode 100755 index 5fbf6c2f8..000000000 --- a/scripts/legacy/scil_compute_msmt_fodf.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_fodf_msmt import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_fodf_msmt.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_msmt_fodf.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_msmt_frf.py b/scripts/legacy/scil_compute_msmt_frf.py deleted file mode 100755 index 37bfdf39b..000000000 --- a/scripts/legacy/scil_compute_msmt_frf.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_frf_msmt import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_frf_msmt.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_msmt_frf.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_pca.py b/scripts/legacy/scil_compute_pca.py deleted file mode 100755 index daa10731c..000000000 --- a/scripts/legacy/scil_compute_pca.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_connectivity_compute_pca import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_connectivity_compute_pca.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_pca.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_pft.py b/scripts/legacy/scil_compute_pft.py deleted file mode 100755 index b09cd9582..000000000 --- a/scripts/legacy/scil_compute_pft.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tracking_pft import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tracking_pft.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_pft.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_powder_average.py b/scripts/legacy/scil_compute_powder_average.py deleted file mode 100755 index d9fc0c2e8..000000000 --- a/scripts/legacy/scil_compute_powder_average.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_powder_average import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_powder_average.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_powder_average.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_qball_metrics.py b/scripts/legacy/scil_compute_qball_metrics.py deleted file mode 100755 index 6e917bcea..000000000 --- a/scripts/legacy/scil_compute_qball_metrics.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_qball_metrics import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_qball_metrics.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_qball_metrics.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_qbx.py b/scripts/legacy/scil_compute_qbx.py deleted file mode 100755 index 091486c6b..000000000 --- a/scripts/legacy/scil_compute_qbx.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_qbx import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_qbx.py. Please change -your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_compute_qbx.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_rish_from_sh.py b/scripts/legacy/scil_compute_rish_from_sh.py deleted file mode 100755 index 1a29cf872..000000000 --- a/scripts/legacy/scil_compute_rish_from_sh.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_sh_to_rish import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_sh_to_rish.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_rish_from_sh.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_seed_by_labels.py b/scripts/legacy/scil_compute_seed_by_labels.py deleted file mode 100755 index 58cb1d663..000000000 --- a/scripts/legacy/scil_compute_seed_by_labels.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_volume_stats_in_labels import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_volume_stats_in_labels.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_seed_by_label.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_seed_density_map.py b/scripts/legacy/scil_compute_seed_density_map.py deleted file mode 100755 index 280a755c0..000000000 --- a/scripts/legacy/scil_compute_seed_density_map.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_seed_density_map import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_seed_density_map.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_seed_density_map.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_sf_from_sh.py b/scripts/legacy/scil_compute_sf_from_sh.py deleted file mode 100755 index 4fd792192..000000000 --- a/scripts/legacy/scil_compute_sf_from_sh.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_sh_to_sf import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_sh_to_sf.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_sf_from_sh.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_sh_from_signal.py b/scripts/legacy/scil_compute_sh_from_signal.py deleted file mode 100755 index 0d93ffeca..000000000 --- a/scripts/legacy/scil_compute_sh_from_signal.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_to_sh import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_to_sh.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_sh_from_signal.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_ssst_fodf.py b/scripts/legacy/scil_compute_ssst_fodf.py deleted file mode 100755 index 01f86b3ec..000000000 --- a/scripts/legacy/scil_compute_ssst_fodf.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_fodf_ssst import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_fodf_ssst.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_ssst_fodf.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_ssst_frf.py b/scripts/legacy/scil_compute_ssst_frf.py deleted file mode 100755 index a66032e80..000000000 --- a/scripts/legacy/scil_compute_ssst_frf.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_frf_ssst import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_frf_ssst.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_ssst_frf.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_streamlines_density_map.py b/scripts/legacy/scil_compute_streamlines_density_map.py deleted file mode 100755 index 683a711da..000000000 --- a/scripts/legacy/scil_compute_streamlines_density_map.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_compute_density_map import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_compute_density_map.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_streamlines_density_map.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_streamlines_length_stats.py b/scripts/legacy/scil_compute_streamlines_length_stats.py deleted file mode 100755 index a6182fa2c..000000000 --- a/scripts/legacy/scil_compute_streamlines_length_stats.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_print_info import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_print_info.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_compute_streamlines_length_stats.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_compute_todi.py b/scripts/legacy/scil_compute_todi.py deleted file mode 100755 index 395bd27d2..000000000 --- a/scripts/legacy/scil_compute_todi.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_compute_TODI import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_compute_TODI.py. Please change -your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_compute_todi", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_concatenate_dwi.py b/scripts/legacy/scil_concatenate_dwi.py deleted file mode 100755 index 11934999e..000000000 --- a/scripts/legacy/scil_concatenate_dwi.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_concatenate import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_concatenate.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_concatenate_dwi.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_convert_fdf.py b/scripts/legacy/scil_convert_fdf.py deleted file mode 100755 index ac094fd6a..000000000 --- a/scripts/legacy/scil_convert_fdf.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_convert_FDF import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_convert_FDF.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_convert_fdf.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_convert_gradients_fsl_to_mrtrix.py b/scripts/legacy/scil_convert_gradients_fsl_to_mrtrix.py deleted file mode 100755 index d7815887d..000000000 --- a/scripts/legacy/scil_convert_gradients_fsl_to_mrtrix.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_gradients_convert import main as new_main - - -DEPRECATION_MSG = """ -This script has been merged with scil_gradients_convert_mrtrix_to_fsl.py -and renamed scil_gradients_convert.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_convert_gradients_fsl_to_mrtrix.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_convert_gradients_mrtrix_to_fsl.py b/scripts/legacy/scil_convert_gradients_mrtrix_to_fsl.py deleted file mode 100755 index be7b158e2..000000000 --- a/scripts/legacy/scil_convert_gradients_mrtrix_to_fsl.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_gradients_convert import main as new_main - - -DEPRECATION_MSG = """ -This script has been merged with scil_gradients_convert_fsl_to_mrtrix.py -and renamed scil_gradients_convert.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_convert_gradients_mrtrix_to_fsl.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_convert_json_to_xlsx.py b/scripts/legacy/scil_convert_json_to_xlsx.py deleted file mode 100755 index 790b17102..000000000 --- a/scripts/legacy/scil_convert_json_to_xlsx.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_json_convert_entries_to_xlsx import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_json_convert_entries_to_xlsx.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_convert_json_to_xlsx.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_convert_rgb.py b/scripts/legacy/scil_convert_rgb.py deleted file mode 100755 index 31730bf4c..000000000 --- a/scripts/legacy/scil_convert_rgb.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_rgb_convert import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_rgb_convert.py. -Now, all our scripts using metrics or reconstructions start -with scil_reconst_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_convert_rgb.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_convert_sh_basis.py b/scripts/legacy/scil_convert_sh_basis.py deleted file mode 100755 index 1a808fafe..000000000 --- a/scripts/legacy/scil_convert_sh_basis.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_sh_convert import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_sh_convert.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_convert_sh_basis.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_convert_surface.py b/scripts/legacy/scil_convert_surface.py deleted file mode 100755 index ceb27e057..000000000 --- a/scripts/legacy/scil_convert_surface.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_surface_convert import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_surface_convert.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_convert_surface.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_convert_tensors.py b/scripts/legacy/scil_convert_tensors.py deleted file mode 100755 index 7de4cbaea..000000000 --- a/scripts/legacy/scil_convert_tensors.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dti_convert_tensors import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dti_convert_tensors.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_convert_tensors.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_convert_tractogram.py b/scripts/legacy/scil_convert_tractogram.py deleted file mode 100755 index d0a054a80..000000000 --- a/scripts/legacy/scil_convert_tractogram.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_convert import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_convert.py. -Now, all our scripts using tractogram start with scil_tractogram_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_convert_tractogram.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_count_non_zero_voxels.py b/scripts/legacy/scil_count_non_zero_voxels.py deleted file mode 100755 index 2c3c358b8..000000000 --- a/scripts/legacy/scil_count_non_zero_voxels.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_volume_count_non_zero_voxels import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_volume_count_non_zero_voxels.py. -Please change your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_count_non_zero_voxels.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_count_streamlines.py b/scripts/legacy/scil_count_streamlines.py deleted file mode 100755 index 55a11e927..000000000 --- a/scripts/legacy/scil_count_streamlines.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_count_streamlines import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_count_streamlines.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_count_streamlines.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_crop_volume.py b/scripts/legacy/scil_crop_volume.py deleted file mode 100755 index df95f4cae..000000000 --- a/scripts/legacy/scil_crop_volume.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_volume_crop import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_volume_crop.py. Please change -your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_crop_volume.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_cut_streamlines.py b/scripts/legacy/scil_cut_streamlines.py deleted file mode 100755 index a76a7a562..000000000 --- a/scripts/legacy/scil_cut_streamlines.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_cut_streamlines import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_cut_streamlines.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_cut_streamlines.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_decompose_connectivity.py b/scripts/legacy/scil_decompose_connectivity.py deleted file mode 100755 index f6b6bdc92..000000000 --- a/scripts/legacy/scil_decompose_connectivity.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_segment_connections_from_labels import main as m - - -DEPRECATION_MSG = """ -This script has been renamed -scil_tractogram_segment_connections_from_labels.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_decompose_connectivity.py", DEPRECATION_MSG, '2.0.0') -def main(): - m() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_detect_dwi_volume_outliers.py b/scripts/legacy/scil_detect_dwi_volume_outliers.py deleted file mode 100755 index a5b1cff26..000000000 --- a/scripts/legacy/scil_detect_dwi_volume_outliers.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_detect_volume_outliers import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_detect_volume_outliers.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_detect_dwi_volume_outliers.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_detect_streamlines_loops.py b/scripts/legacy/scil_detect_streamlines_loops.py deleted file mode 100755 index 973ec3ab9..000000000 --- a/scripts/legacy/scil_detect_streamlines_loops.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_detect_loops import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_detect_loops.py. Please change -your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_detect_streamlines_loops.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_dilate_labels.py b/scripts/legacy/scil_dilate_labels.py deleted file mode 100755 index ef18e37c5..000000000 --- a/scripts/legacy/scil_dilate_labels.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_labels_dilate import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_labels_dilate.py. -Now, all our scripts using labels start with scil_labels_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_labels_dilate.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_estimate_bundles_diameter.py b/scripts/legacy/scil_estimate_bundles_diameter.py deleted file mode 100755 index ff6a413a1..000000000 --- a/scripts/legacy/scil_estimate_bundles_diameter.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_diameter import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_diameter.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_estimate_bundles_diameter.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_evaluate_bundles_binary_classification_measures.py b/scripts/legacy/scil_evaluate_bundles_binary_classification_measures.py deleted file mode 100755 index 3978b2465..000000000 --- a/scripts/legacy/scil_evaluate_bundles_binary_classification_measures.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_score_same_bundle_many_segmentations import \ - main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed -scil_bundle_score_same_bundle_many_segmentations.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_evaluate_bundles_binary_classification_measures.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_evaluate_bundles_individual_measures.py b/scripts/legacy/scil_evaluate_bundles_individual_measures.py deleted file mode 100755 index 55a0d8016..000000000 --- a/scripts/legacy/scil_evaluate_bundles_individual_measures.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_shape_measures import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_shape_measures.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_evaluate_bundles_invidiual_measures.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_evaluate_bundles_pairwise_agreement_measures.py b/scripts/legacy/scil_evaluate_bundles_pairwise_agreement_measures.py deleted file mode 100755 index 4a33ff12e..000000000 --- a/scripts/legacy/scil_evaluate_bundles_pairwise_agreement_measures.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_pairwise_comparison import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_pairwise_comparison.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_evaluate_bundles_pairwise_agreement_measures.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_evaluate_connectivity_graph_measures.py b/scripts/legacy/scil_evaluate_connectivity_graph_measures.py deleted file mode 100755 index dc5b31bcf..000000000 --- a/scripts/legacy/scil_evaluate_connectivity_graph_measures.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_connectivity_graph_measures import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_connectivity_graph_measures.py. -All our scripts regarding connectivity now start with scil_connectivity_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_evaluate_connectivity_graph_measures.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_evaluate_connectivity_pairwise_agreement_measures.py b/scripts/legacy/scil_evaluate_connectivity_pairwise_agreement_measures.py deleted file mode 100755 index 12065b63d..000000000 --- a/scripts/legacy/scil_evaluate_connectivity_pairwise_agreement_measures.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_connectivity_pairwise_agreement import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_connectivity_pairwise_agreement.py. -All our scripts regarding connectivity now start with scil_connectivity_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_evaluate_connectivity_pairwaise_agreement_measures.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_execute_angle_aware_bilateral_filtering.py b/scripts/legacy/scil_execute_angle_aware_bilateral_filtering.py deleted file mode 100755 index eaa71f26d..000000000 --- a/scripts/legacy/scil_execute_angle_aware_bilateral_filtering.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_sh_to_aodf import main as new_main - - -DEPRECATION_MSG = """ -This script has been merged with scil_execute_asymmetric_filtering.py -into scil_sh_to_aodf.py Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_execute_angle_aware_bilateral_filtering.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_execute_asymmetric_filtering.py b/scripts/legacy/scil_execute_asymmetric_filtering.py deleted file mode 100755 index 8c1a10093..000000000 --- a/scripts/legacy/scil_execute_asymmetric_filtering.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_sh_to_aodf import main as new_main - - -DEPRECATION_MSG = """ -This script has been merged with scil_execute_angle_aware_bilateral_filtering.py -into scil_sh_to_aodf.py Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_execute_asymmetric_filtering.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_extract_b0.py b/scripts/legacy/scil_extract_b0.py deleted file mode 100755 index 9570c899e..000000000 --- a/scripts/legacy/scil_extract_b0.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_extract_b0 import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_extract_b0.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_extract_b0.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_extract_dwi_shell.py b/scripts/legacy/scil_extract_dwi_shell.py deleted file mode 100755 index b7d009a45..000000000 --- a/scripts/legacy/scil_extract_dwi_shell.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_extract_shell import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_extract_shell.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_extract_dwi_shell.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_extract_ushape.py b/scripts/legacy/scil_extract_ushape.py deleted file mode 100755 index e4fc8da29..000000000 --- a/scripts/legacy/scil_extract_ushape.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_extract_ushape import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_extract_ushape.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_extract_ushape.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_filter_connectivity.py b/scripts/legacy/scil_filter_connectivity.py deleted file mode 100755 index 76160be89..000000000 --- a/scripts/legacy/scil_filter_connectivity.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_connectivity_filter import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_connectivity_filter.py. -All our scripts regarding connectivity now start with scil_connectivity_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_filter_connectivity.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_filter_streamlines_by_length.py b/scripts/legacy/scil_filter_streamlines_by_length.py deleted file mode 100755 index ba4da5e88..000000000 --- a/scripts/legacy/scil_filter_streamlines_by_length.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_filter_by_length import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_filter_by_length.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_filter_streamlines_by_length.py", DEPRECATION_MSG, - '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_filter_streamlines_by_orientation.py b/scripts/legacy/scil_filter_streamlines_by_orientation.py deleted file mode 100755 index cc9fac412..000000000 --- a/scripts/legacy/scil_filter_streamlines_by_orientation.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_filter_by_orientation import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_filter_by_orientation.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_filter_streamlines_by_orientation.py", DEPRECATION_MSG, - '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_filter_tractogram.py b/scripts/legacy/scil_filter_tractogram.py deleted file mode 100755 index 53bfe88e4..000000000 --- a/scripts/legacy/scil_filter_tractogram.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_filter_by_roi import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_filter_by_roi.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_filter_tractogram.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_filter_tractogram_anatomically.py b/scripts/legacy/scil_filter_tractogram_anatomically.py deleted file mode 100755 index a15fe7c48..000000000 --- a/scripts/legacy/scil_filter_tractogram_anatomically.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_filter_by_anatomy import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_filter_by_anatomy.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_filter_streamlines_anatomically.py", DEPRECATION_MSG, - '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_fit_bingham_to_fodf.py b/scripts/legacy/scil_fit_bingham_to_fodf.py deleted file mode 100755 index 914936d95..000000000 --- a/scripts/legacy/scil_fit_bingham_to_fodf.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_fodf_to_bingham import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_fodf_to_bingham.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_fit_bingham_to_fodf.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_flip_gradients.py b/scripts/legacy/scil_flip_gradients.py deleted file mode 100755 index 6d0e9897e..000000000 --- a/scripts/legacy/scil_flip_gradients.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_gradients_modify_axes import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_gradients_modify_axes.py. -Please change your existing pipelines accordingly. Please note that options -have changed, too. -""" - - -@deprecate_script("scil_flip_gradients.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_flip_streamlines.py b/scripts/legacy/scil_flip_streamlines.py deleted file mode 100755 index a61e1be9b..000000000 --- a/scripts/legacy/scil_flip_streamlines.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_flip import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_flip.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_flip_streamlines.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_flip_surface.py b/scripts/legacy/scil_flip_surface.py deleted file mode 100755 index e3109e9d1..000000000 --- a/scripts/legacy/scil_flip_surface.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_surface_flip import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_surface_flip.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_flip_surface.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_flip_volume.py b/scripts/legacy/scil_flip_volume.py deleted file mode 100755 index c84adaa36..000000000 --- a/scripts/legacy/scil_flip_volume.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_volume_flip import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_volume_flip.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_flip_volume.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_generate_gradient_sampling.py b/scripts/legacy/scil_generate_gradient_sampling.py deleted file mode 100755 index f00aa4932..000000000 --- a/scripts/legacy/scil_generate_gradient_sampling.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_gradients_generate_sampling import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_gradients_generate_sampling.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_generate_gradient_sampling.py", DEPRECATION_MSG, - '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_generate_priors_from_bundle.py b/scripts/legacy/scil_generate_priors_from_bundle.py deleted file mode 100755 index c8fb9a34b..000000000 --- a/scripts/legacy/scil_generate_priors_from_bundle.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_generate_priors import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_generate_priors.py. -Now, all our scripts using labels start with scil_labels_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_generate_priors_from_bundle.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_group_comparison.py b/scripts/legacy/scil_group_comparison.py deleted file mode 100755 index cbca6f546..000000000 --- a/scripts/legacy/scil_group_comparison.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_stats_group_comparison import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_stats_group_comparison.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_group_comparison.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_harmonize_json.py b/scripts/legacy/scil_harmonize_json.py deleted file mode 100755 index eedf80956..000000000 --- a/scripts/legacy/scil_harmonize_json.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_json_harmonize_entries import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_json_harmonize_entries.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_merge_json.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_image_math.py b/scripts/legacy/scil_image_math.py deleted file mode 100755 index d0dc1373a..000000000 --- a/scripts/legacy/scil_image_math.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_volume_math import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_volume_math.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_image_math.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_merge_json.py b/scripts/legacy/scil_merge_json.py deleted file mode 100755 index 2bc51bb25..000000000 --- a/scripts/legacy/scil_merge_json.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_json_merge_entries import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_json_merge_entries.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_json_merge_entries.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_merge_sh.py b/scripts/legacy/scil_merge_sh.py deleted file mode 100755 index 74792d24f..000000000 --- a/scripts/legacy/scil_merge_sh.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_sh_fusion import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_sh_fusion.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_merge_sh.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_normalize_connectivity.py b/scripts/legacy/scil_normalize_connectivity.py deleted file mode 100755 index 72a7b0e80..000000000 --- a/scripts/legacy/scil_normalize_connectivity.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_connectivity_normalize import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_connectivity_normalize.py. -All our scripts regarding connectivity now start with scil_connectivity_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_normalize_connectivity.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_outlier_rejection.py b/scripts/legacy/scil_outlier_rejection.py deleted file mode 100755 index 9d35fa107..000000000 --- a/scripts/legacy/scil_outlier_rejection.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_reject_outliers import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_reject_outliers.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_outlier_rejection.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_perform_majority_vote.py b/scripts/legacy/scil_perform_majority_vote.py deleted file mode 100755 index 8029fdfe4..000000000 --- a/scripts/legacy/scil_perform_majority_vote.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_filter_by_occurence import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_filter_by_occurence.py. - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_perform_majority_vote.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_plot_mean_std_per_point.py b/scripts/legacy/scil_plot_mean_std_per_point.py deleted file mode 100755 index e288e119f..000000000 --- a/scripts/legacy/scil_plot_mean_std_per_point.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_plot_stats_per_point import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_plot_stats_per_point.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_plot_mean_std_per_point.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_prepare_eddy_command.py b/scripts/legacy/scil_prepare_eddy_command.py deleted file mode 100755 index d14a6b97e..000000000 --- a/scripts/legacy/scil_prepare_eddy_command.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_prepare_eddy_command import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_prepare_eddy_command.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_prepare_eddy_command.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_prepare_topup_command.py b/scripts/legacy/scil_prepare_topup_command.py deleted file mode 100755 index 2e2c7fb78..000000000 --- a/scripts/legacy/scil_prepare_topup_command.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_prepare_topup_command import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_prepare_topup_command.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_prepare_topup_command.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_print_connectivity_filenames.py b/scripts/legacy/scil_print_connectivity_filenames.py deleted file mode 100755 index 351588d1c..000000000 --- a/scripts/legacy/scil_print_connectivity_filenames.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_connectivity_print_filenames import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_connectivity_print_filenames.py. -All our scripts regarding connectivity now start with scil_connectivity_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_print_connectivity_filenames.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_print_header.py b/scripts/legacy/scil_print_header.py deleted file mode 100755 index 9c7e26a49..000000000 --- a/scripts/legacy/scil_print_header.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_header_print_info import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_header_print_info.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_print_header.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_project_streamlines_to_map.py b/scripts/legacy/scil_project_streamlines_to_map.py deleted file mode 100755 index 457db1eca..000000000 --- a/scripts/legacy/scil_project_streamlines_to_map.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_project_streamlines_to_map import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_project_streamlines_to_map.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_project_streamlines_to_map.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_recognize_multi_bundles.py b/scripts/legacy/scil_recognize_multi_bundles.py deleted file mode 100755 index 9f3707a0e..000000000 --- a/scripts/legacy/scil_recognize_multi_bundles.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_segment_with_bundleseg import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_segment_with_bundleseg.py. Please -change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_recognize_multi_bundles.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_recognize_single_bundle.py b/scripts/legacy/scil_recognize_single_bundle.py deleted file mode 100755 index 6be0a8138..000000000 --- a/scripts/legacy/scil_recognize_single_bundle.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_segment_with_recobundles import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_segment_with_recobundles.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_recognize_single_bundle.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_register_tractogram.py b/scripts/legacy/scil_register_tractogram.py deleted file mode 100755 index ebec29c8b..000000000 --- a/scripts/legacy/scil_register_tractogram.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_register import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_register.py. Please change -your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_register_tractogram.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_remove_invalid_streamlines.py b/scripts/legacy/scil_remove_invalid_streamlines.py deleted file mode 100755 index f372ee5fa..000000000 --- a/scripts/legacy/scil_remove_invalid_streamlines.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_remove_invalid import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_remove_invalid.py. Please change -your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_remove_invalid_streamlines.py", DEPRECATION_MSG, - '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_remove_labels.py b/scripts/legacy/scil_remove_labels.py deleted file mode 100755 index 8d4d6f4bc..000000000 --- a/scripts/legacy/scil_remove_labels.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_labels_remove import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_labels_remove.py. -Now, all our scripts using labels start with scil_labels_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_remove_labels.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_remove_outliers_ransac.py b/scripts/legacy/scil_remove_outliers_ransac.py deleted file mode 100755 index e35ae01cb..000000000 --- a/scripts/legacy/scil_remove_outliers_ransac.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_volume_remove_outliers_ransac import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_volume_remove_outliers_ransac.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_remove_outliers_ransac.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_reorder_connectivity.py b/scripts/legacy/scil_reorder_connectivity.py deleted file mode 100755 index 85911ac39..000000000 --- a/scripts/legacy/scil_reorder_connectivity.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_connectivity_reorder_rois import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_connectivity_reorder_rois.py. -All our scripts regarding connectivity now start with scil_connectivity_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_reorder_connectivity.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_reorder_dwi_philips.py b/scripts/legacy/scil_reorder_dwi_philips.py deleted file mode 100755 index 617543c8c..000000000 --- a/scripts/legacy/scil_reorder_dwi_philips.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_reorder_philips import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_reorder_philips.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_reorder_dwi_philips.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_resample_bvals.py b/scripts/legacy/scil_resample_bvals.py deleted file mode 100755 index 77c92bf75..000000000 --- a/scripts/legacy/scil_resample_bvals.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_gradients_round_bvals import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_gradients_round_bvals_to_shells.py. -Please change your existing pipelines accordingly. Please note that options -have changed, too. -""" - - -@deprecate_script("scil_resample_bvals.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_resample_streamlines.py b/scripts/legacy/scil_resample_streamlines.py deleted file mode 100755 index 3b7f24144..000000000 --- a/scripts/legacy/scil_resample_streamlines.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_resample_nb_points import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_resample_nb_points.py. Please -change your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_resample_streamlines.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_resample_tractogram.py b/scripts/legacy/scil_resample_tractogram.py deleted file mode 100755 index 641d4efd5..000000000 --- a/scripts/legacy/scil_resample_tractogram.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_resample import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_resample.py. Please change -your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_resample_tractogram.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_resample_volume.py b/scripts/legacy/scil_resample_volume.py deleted file mode 100755 index 4356e179f..000000000 --- a/scripts/legacy/scil_resample_volume.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_volume_resample import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_volume_resample.py. Please change -your existing pipelines accordingly. - -""" - - -@deprecate_script("scil_resample_volume.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_reshape_to_reference.py b/scripts/legacy/scil_reshape_to_reference.py deleted file mode 100755 index f460081c8..000000000 --- a/scripts/legacy/scil_reshape_to_reference.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_volume_reslice_to_reference import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_volume_reslice_to_reference.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_reshape_to_reference.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_run_commit.py b/scripts/legacy/scil_run_commit.py deleted file mode 100755 index 1692ebbf7..000000000 --- a/scripts/legacy/scil_run_commit.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_commit import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_commit.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_run_commit.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_run_nlmeans.py b/scripts/legacy/scil_run_nlmeans.py deleted file mode 100755 index 98ca7c2fb..000000000 --- a/scripts/legacy/scil_run_nlmeans.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_denoising_nlmeans import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_denoising_nlmeans.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_run_nlmeans.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_save_connections_from_hdf5.py b/scripts/legacy/scil_save_connections_from_hdf5.py deleted file mode 100755 index 0cbadfe45..000000000 --- a/scripts/legacy/scil_save_connections_from_hdf5.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_convert_hdf5_to_trk import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_convert_hdf5_to_trk.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_save_connections_from_hdf5.py", DEPRECATION_MSG, - '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_score_bundles.py b/scripts/legacy/scil_score_bundles.py deleted file mode 100755 index 75a1c2821..000000000 --- a/scripts/legacy/scil_score_bundles.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_score_many_bundles_one_tractogram import \ - main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_score_many_bundles_one_tractogram.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_score_bundles.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_score_tractogram.py b/scripts/legacy/scil_score_tractogram.py deleted file mode 100755 index 5b3d1ba2c..000000000 --- a/scripts/legacy/scil_score_tractogram.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_segment_with_ROI_and_score import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_segment_with_ROI_and_score.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_score_tractogram.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_screenshot_bundle.py b/scripts/legacy/scil_screenshot_bundle.py deleted file mode 100755 index f6189e3b0..000000000 --- a/scripts/legacy/scil_screenshot_bundle.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_bundle_screenshot_mni import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_bundle_screenshot_mni.py. Please change -your existing pipelines accordingly. -''' - - -@deprecate_script("scil_screenshot_bundle.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_screenshot_dti.py b/scripts/legacy/scil_screenshot_dti.py deleted file mode 100755 index 0f737a0b8..000000000 --- a/scripts/legacy/scil_screenshot_dti.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_dti_screenshot import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_dti_screenshot.py. Please change -your existing pipelines accordingly. -''' - - -@deprecate_script("scil_screenshot_dti.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_screenshot_volume.py b/scripts/legacy/scil_screenshot_volume.py deleted file mode 100755 index 8feb5e346..000000000 --- a/scripts/legacy/scil_screenshot_volume.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_volume_screenshot import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_volume_screenshot.py. Please change -your existing pipelines accordingly. -''' - - -@deprecate_script("scil_screenshot_volume.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_screenshot_volume_mosaic_overlap.py b/scripts/legacy/scil_screenshot_volume_mosaic_overlap.py deleted file mode 100755 index 94d0ca60f..000000000 --- a/scripts/legacy/scil_screenshot_volume_mosaic_overlap.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_volume_screenshot_mosaic import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_volume_screenshot_mosaic.py. Please -change your existing pipelines accordingly. -''' - - -@deprecate_script("scil_screenshot_volume_mosaic_overlap.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_set_response_function.py b/scripts/legacy/scil_set_response_function.py deleted file mode 100755 index e305ee7b0..000000000 --- a/scripts/legacy/scil_set_response_function.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_frf_set_diffusivities import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_frf_set_diffusivities.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_set_response_function.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_shuffle_streamlines.py b/scripts/legacy/scil_shuffle_streamlines.py deleted file mode 100755 index 980cfbf86..000000000 --- a/scripts/legacy/scil_shuffle_streamlines.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_shuffle import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_shuffle.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_shuffle_streamlines.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_smooth_streamlines.py b/scripts/legacy/scil_smooth_streamlines.py deleted file mode 100755 index dd8f7378d..000000000 --- a/scripts/legacy/scil_smooth_streamlines.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_smooth import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_smooth.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_smooth_streamlines.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_smooth_surface.py b/scripts/legacy/scil_smooth_surface.py deleted file mode 100755 index 0fb0fab5b..000000000 --- a/scripts/legacy/scil_smooth_surface.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_surface_smooth import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_surface_smooth.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_smooth_surface.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_snr_in_roi.py b/scripts/legacy/scil_snr_in_roi.py deleted file mode 100755 index a3bdcc7a5..000000000 --- a/scripts/legacy/scil_snr_in_roi.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_compute_snr import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_compute_snr.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_snr_in_roi.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_split_image.py b/scripts/legacy/scil_split_image.py deleted file mode 100755 index 20cb37d31..000000000 --- a/scripts/legacy/scil_split_image.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_dwi_split_by_indices import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_dwi_split_by_indices.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_split_image.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_split_tractogram.py b/scripts/legacy/scil_split_tractogram.py deleted file mode 100755 index 0fafcbd2d..000000000 --- a/scripts/legacy/scil_split_tractogram.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_split import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_split.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_split_tractogram.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_split_volume_by_ids.py b/scripts/legacy/scil_split_volume_by_ids.py deleted file mode 100755 index cf0a45879..000000000 --- a/scripts/legacy/scil_split_volume_by_ids.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_labels_split_volume_by_ids import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_labels_split_volume_by_ids.py. -Now, all our scripts using labels start with scil_labels_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_split_volume_by_ids.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_split_volume_by_labels.py b/scripts/legacy/scil_split_volume_by_labels.py deleted file mode 100755 index b25890433..000000000 --- a/scripts/legacy/scil_split_volume_by_labels.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_labels_split_volume_from_lut import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_labels_split_volume_from_lut. -Now, all our scripts using labels start with scil_labels_...! - -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_split_volume_by_labels.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_streamlines_math.py b/scripts/legacy/scil_streamlines_math.py deleted file mode 100755 index 86d92211c..000000000 --- a/scripts/legacy/scil_streamlines_math.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_tractogram_math import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_tractogram_math.py. Please change -your existing pipelines accordingly. -""" - - -@deprecate_script("scil_streamlines_math.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_swap_gradient_axis.py b/scripts/legacy/scil_swap_gradient_axis.py deleted file mode 100755 index 2b8686e79..000000000 --- a/scripts/legacy/scil_swap_gradient_axis.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_gradients_modify_axes import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_gradients_modify_axes.py. -Please change your existing pipelines accordingly. Please note that options -have changed, too. -""" - - -@deprecate_script("scil_swap_gradient_axis.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_uniformize_streamlines_endpoints.py b/scripts/legacy/scil_uniformize_streamlines_endpoints.py deleted file mode 100755 index 8943896be..000000000 --- a/scripts/legacy/scil_uniformize_streamlines_endpoints.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bundle_uniformize_endpoints import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bundle_uniformize_endpoints.py. Please -change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_uniformize_streamlines_endpoints.py", DEPRECATION_MSG, - '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_validate_and_correct_bvecs.py b/scripts/legacy/scil_validate_and_correct_bvecs.py deleted file mode 100755 index 72fc36061..000000000 --- a/scripts/legacy/scil_validate_and_correct_bvecs.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_gradients_validate_correct import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_gradients_validate_correct.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_validate_and_correct_bvecs.py", DEPRECATION_MSG, - '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_validate_and_correct_eddy_gradients.py b/scripts/legacy/scil_validate_and_correct_eddy_gradients.py deleted file mode 100755 index a8065504b..000000000 --- a/scripts/legacy/scil_validate_and_correct_eddy_gradients.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_gradients_validate_correct_eddy import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_gradients_validate_correct_eddy.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_validate_and_correct_eddy_gradients.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_validate_bids.py b/scripts/legacy/scil_validate_bids.py deleted file mode 100755 index f4b0392bf..000000000 --- a/scripts/legacy/scil_validate_bids.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_bids_validate import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_bids_validate.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_validate_bids.py", DEPRECATION_MSG, - '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_verify_space_attributes_compatibility.py b/scripts/legacy/scil_verify_space_attributes_compatibility.py deleted file mode 100755 index ba4ca3007..000000000 --- a/scripts/legacy/scil_verify_space_attributes_compatibility.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_header_validate_compatibility import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_header_validate_compatibility.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_verify_space_attributes_compatibility.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_visualize_bingham_fit.py b/scripts/legacy/scil_visualize_bingham_fit.py deleted file mode 100755 index b43921ad1..000000000 --- a/scripts/legacy/scil_visualize_bingham_fit.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_bingham_fit import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_bingham_fit.py. Please change -your existing pipelines accordingly. -''' - - -@deprecate_script("scil_visualize_bingham_fit.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_visualize_bundles.py b/scripts/legacy/scil_visualize_bundles.py deleted file mode 100755 index 5f3d3d746..000000000 --- a/scripts/legacy/scil_visualize_bundles.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_bundle import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_bundle.py. Please change -your existing pipelines accordingly. -''' - - -@deprecate_script("scil_visualize_bundles.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_visualize_bundles_mosaic.py b/scripts/legacy/scil_visualize_bundles_mosaic.py deleted file mode 100755 index 881ab34ea..000000000 --- a/scripts/legacy/scil_visualize_bundles_mosaic.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_bundle_screenshot_mosaic import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_bundle_screenshot_mosaic.py. Please -change your existing pipelines accordingly. -''' - - -@deprecate_script("scil_visualize_bundles_mosaic.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_visualize_connectivity.py b/scripts/legacy/scil_visualize_connectivity.py deleted file mode 100755 index c713f0322..000000000 --- a/scripts/legacy/scil_visualize_connectivity.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_connectivity import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_connectivity.py. Please change -your existing pipelines accordingly. -''' - - -@deprecate_script("scil_visualize_connectivity.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_visualize_fodf.py b/scripts/legacy/scil_visualize_fodf.py deleted file mode 100755 index 50d37668b..000000000 --- a/scripts/legacy/scil_visualize_fodf.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_fodf import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_fodf.py. Please change -your existing pipelines accordingly. -''' - - -@deprecate_script("scil_visualize_fodf.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_visualize_gradients.py b/scripts/legacy/scil_visualize_gradients.py deleted file mode 100755 index 705d726de..000000000 --- a/scripts/legacy/scil_visualize_gradients.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_gradients_screenshot import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_gradients_screenshot.py. Please change -your existing pipelines accordingly. -''' - - -@deprecate_script("scil_visualize_gradients.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_visualize_histogram.py b/scripts/legacy/scil_visualize_histogram.py deleted file mode 100755 index 7e248f705..000000000 --- a/scripts/legacy/scil_visualize_histogram.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_volume_histogram import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_volume_histogram.py. Please change -your existing pipelines accordingly. -''' - - -@deprecate_script("scil_visualize_histogram.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_visualize_scatterplot.py b/scripts/legacy/scil_visualize_scatterplot.py deleted file mode 100755 index f73d5b4c7..000000000 --- a/scripts/legacy/scil_visualize_scatterplot.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_volume_scatterplot import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_volume_scatterplot.py. Please change -your existing pipelines accordingly. -''' - - -@deprecate_script("scil_visualize_scatterplot.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_visualize_seeds.py b/scripts/legacy/scil_visualize_seeds.py deleted file mode 100755 index 63662be54..000000000 --- a/scripts/legacy/scil_visualize_seeds.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_tractogram_seeds import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_tractogram_seeds.py. Please change -your existing pipelines accordingly. -''' - - -@deprecate_script("scil_visualize_seeds.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_visualize_seeds_3d.py b/scripts/legacy/scil_visualize_seeds_3d.py deleted file mode 100755 index e67acd0fa..000000000 --- a/scripts/legacy/scil_visualize_seeds_3d.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_viz_tractogram_seeds_3d import main as new_main - - -DEPRECATION_MSG = ''' -This script has been renamed scil_viz_tractogram_seeds_3d.py. Please -change your existing pipelines accordingly. -''' - - -@deprecate_script("scil_visualize_seeds_3d.py", DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/scil_volume_reshape_to_reference.py b/scripts/legacy/scil_volume_reshape_to_reference.py deleted file mode 100755 index 1df623cf2..000000000 --- a/scripts/legacy/scil_volume_reshape_to_reference.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from scilpy.io.deprecator import deprecate_script -from scripts.scil_volume_reslice_to_reference import main as new_main - - -DEPRECATION_MSG = """ -This script has been renamed scil_volume_reslice_to_reference.py. -Please change your existing pipelines accordingly. -""" - - -@deprecate_script("scil_volume_reshape_to_reference.py", - DEPRECATION_MSG, '2.0.0') -def main(): - new_main() - - -if __name__ == "__main__": - main() diff --git a/scripts/legacy/tests/test_legacy_scripts.py b/scripts/legacy/tests/test_legacy_scripts.py deleted file mode 100644 index 467bcf63b..000000000 --- a/scripts/legacy/tests/test_legacy_scripts.py +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import pytest - -legacy_scripts_list_tag_1_6_0 = [ - "scil_add_tracking_mask_to_pft_maps.py", - "scil_analyse_lesions_load.py", - "scil_apply_bias_field_on_dwi.py", - "scil_apply_transform_to_bvecs.py", - "scil_apply_transform_to_hdf5.py", - "scil_apply_transform_to_image.py", - "scil_apply_transform_to_surface.py", - "scil_apply_transform_to_tractogram.py", - "scil_assign_custom_color_to_tractogram.py", - "scil_assign_uniform_color_to_tractograms.py", - "scil_clean_qbx_clusters.py", - "scil_combine_labels.py", - "scil_compare_connectivity.py", - "scil_compress_streamlines.py", - "scil_compute_asym_odf_metrics.py", - "scil_compute_bundle_mean_std_per_point.py", - "scil_compute_bundle_mean_std.py", - "scil_compute_bundle_volume_per_label.py", - "scil_compute_bundle_volume.py", - "scil_compute_bundle_voxel_label_map.py", - "scil_compute_centroid.py", - "scil_compute_connectivity.py", - "scil_compute_divide.py", - "scil_compute_dti_metrics.py", - "scil_compute_endpoints_map.py", - "scil_compute_fodf_max_in_ventricles.py", - "scil_compute_fodf_metrics.py", - "scil_compute_freewater.py", - "scil_compute_hdf5_average_density_map.py", - "scil_compute_ihMT_maps.py", - "scil_compute_kurtosis_metrics.py", - "scil_compute_lobe_specific_fodf_metrics.py", - "scil_compute_local_tracking_dev.py", - "scil_compute_local_tracking.py", - "scil_compute_maps_for_particle_filter_tracking.py", - "scil_compute_mean_fixel_afd_from_bundles.py", - "scil_compute_mean_fixel_afd_from_hdf5.py", - "scil_compute_mean_fixel_lobe_metric_from_bundles.py", - "scil_compute_mean_frf.py", - "scil_compute_memsmt_fodf.py", - "scil_compute_memsmt_frf.py", - "scil_compute_metrics_stats_in_ROI.py", - "scil_compute_msmt_fodf.py", - "scil_compute_msmt_frf.py", - "scil_compute_MT_maps.py", - "scil_compute_NODDI_priors.py", - "scil_compute_NODDI.py", - "scil_compute_pca.py", - "scil_compute_pft.py", - "scil_compute_powder_average.py", - "scil_compute_qball_metrics.py", - "scil_compute_qbx.py", - "scil_compute_rish_from_sh.py", - "scil_compute_seed_by_labels.py", - "scil_compute_seed_density_map.py", - "scil_compute_sf_from_sh.py", - "scil_compute_sh_from_signal.py", - "scil_compute_ssst_fodf.py", - "scil_compute_ssst_frf.py", - "scil_compute_streamlines_density_map.py", - "scil_compute_streamlines_length_stats.py", - "scil_compute_todi.py", - "scil_concatenate_dwi.py", - "scil_connectivity_math.py", - "scil_convert_gradients_fsl_to_mrtrix.py", - "scil_convert_gradients_mrtrix_to_fsl.py", - "scil_convert_fdf.py", - "scil_convert_json_to_xlsx.py", - "scil_convert_rgb.py", - "scil_convert_sh_basis.py", - "scil_convert_surface.py", - "scil_convert_tensors.py", - "scil_convert_tractogram.py", - "scil_count_non_zero_voxels.py", - "scil_count_streamlines.py", - "scil_crop_volume.py", - "scil_cut_streamlines.py", - "scil_decompose_connectivity.py", - "scil_detect_dwi_volume_outliers.py", - "scil_detect_streamlines_loops.py", - "scil_dilate_labels.py", - "scil_estimate_bundles_diameter.py", - "scil_evaluate_bundles_binary_classification_measures.py", - "scil_evaluate_bundles_individual_measures.py", - "scil_evaluate_bundles_pairwise_agreement_measures.py", - "scil_evaluate_connectivity_graph_measures.py", - "scil_evaluate_connectivity_pairwise_agreement_measures.py", - "scil_execute_angle_aware_bilateral_filtering.py", - "scil_execute_asymmetric_filtering.py", - "scil_extract_b0.py", - "scil_extract_dwi_shell.py", - "scil_extract_ushape.py", - "scil_filter_connectivity.py", - "scil_filter_streamlines_by_length.py", - "scil_filter_streamlines_by_orientation.py", - "scil_filter_tractogram_anatomically.py", - "scil_filter_tractogram.py", - "scil_fit_bingham_to_fodf.py", - "scil_flip_gradients.py", - "scil_flip_streamlines.py", - "scil_flip_surface.py", - "scil_flip_volume.py", - "scil_generate_gradient_sampling.py", - "scil_generate_priors_from_bundle.py", - "scil_get_version.py", - "scil_group_comparison.py", - "scil_harmonize_json.py", - "scil_image_math.py", - "scil_merge_json.py", - "scil_merge_sh.py", - "scil_normalize_connectivity.py", - "scil_outlier_rejection.py", - "scil_perform_majority_vote.py", - "scil_plot_mean_std_per_point.py", - "scil_prepare_eddy_command.py", - "scil_prepare_topup_command.py", - "scil_print_connectivity_filenames.py", - "scil_print_header.py", - "scil_tractogram_project_streamlines_to_map.py", - "scil_recognize_multi_bundles.py", - "scil_recognize_single_bundle.py", - "scil_register_tractogram.py", - "scil_remove_invalid_streamlines.py", - "scil_remove_labels.py", - "scil_remove_outliers_ransac.py", - "scil_reorder_connectivity.py", - "scil_reorder_dwi_philips.py", - "scil_resample_bvals.py", - "scil_resample_streamlines.py", - "scil_resample_tractogram.py", - "scil_resample_volume.py", - "scil_reshape_to_reference.py", - "scil_run_commit.py", - "scil_run_nlmeans.py", - "scil_save_connections_from_hdf5.py", - "scil_score_bundles.py", - "scil_score_tractogram.py", - "scil_screenshot_bundle.py", - "scil_screenshot_dti.py", - "scil_screenshot_volume_mosaic_overlap.py", - "scil_screenshot_volume.py", - "scil_search_keywords.py", - "scil_set_response_function.py", - "scil_shuffle_streamlines.py", - "scil_smooth_streamlines.py", - "scil_smooth_surface.py", - "scil_snr_in_roi.py", - "scil_split_image.py", - "scil_split_tractogram.py", - "scil_split_volume_by_ids.py", - "scil_split_volume_by_labels.py", - "scil_streamlines_math.py", - "scil_swap_gradient_axis.py", - "scil_tractogram_math.py", - "scil_uniformize_streamlines_endpoints.py", - "scil_validate_and_correct_bvecs.py", - "scil_validate_and_correct_eddy_gradients.py", - "scil_validate_bids.py", - "scil_verify_space_attributes_compatibility.py", - "scil_visualize_bingham_fit.py", - "scil_visualize_bundles_mosaic.py", - "scil_visualize_bundles.py", - "scil_visualize_connectivity.py", - "scil_visualize_fodf.py", - "scil_visualize_gradients.py", - "scil_visualize_histogram.py", - "scil_visualize_scatterplot.py", - "scil_visualize_seeds_3d.py", - "scil_visualize_seeds.py"] - - -# test that all scripts available in scilpy 1.6.0 can be called -@pytest.mark.filterwarnings("ignore") -def test_help_option(script_runner): - for script in legacy_scripts_list_tag_1_6_0: - ret = script_runner.run(script, '--help') - assert ret.success diff --git a/scripts/tests/test_bundle_explore_bundleseg.py b/scripts/tests/test_bundle_explore_bundleseg.py deleted file mode 100644 index 397d593ed..000000000 --- a/scripts/tests/test_bundle_explore_bundleseg.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - -def test_help_option(script_runner): - ret = script_runner.run('scil_viz_bundle_screenshot_mni.py', '--help') - assert ret.success diff --git a/scripts/tests/test_dwi_prepare_eddy_command.py b/scripts/tests/test_dwi_prepare_eddy_command.py deleted file mode 100644 index cb5334864..000000000 --- a/scripts/tests/test_dwi_prepare_eddy_command.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - -def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_prepare_eddy_command.py', '--help') - assert ret.success diff --git a/scripts/tests/test_viz_bundle_screenshot_mni.py b/scripts/tests/test_viz_bundle_screenshot_mni.py deleted file mode 100644 index 397d593ed..000000000 --- a/scripts/tests/test_viz_bundle_screenshot_mni.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - -def test_help_option(script_runner): - ret = script_runner.run('scil_viz_bundle_screenshot_mni.py', '--help') - assert ret.success diff --git a/scripts/tests/test_viz_bundle_screenshot_mosaic.py b/scripts/tests/test_viz_bundle_screenshot_mosaic.py deleted file mode 100644 index 26509532a..000000000 --- a/scripts/tests/test_viz_bundle_screenshot_mosaic.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - -def test_help_option(script_runner): - ret = script_runner.run('scil_viz_bundle_screenshot_mosaic.py', '--help') - assert ret.success diff --git a/scripts/tests/test_viz_gradients_screenshot.py b/scripts/tests/test_viz_gradients_screenshot.py deleted file mode 100644 index 3d4886c47..000000000 --- a/scripts/tests/test_viz_gradients_screenshot.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - -def test_help_option(script_runner): - ret = script_runner.run('scil_viz_gradients_screenshot.py', '--help') - assert ret.success diff --git a/scripts/tests/test_viz_tractogram_collisions.py b/scripts/tests/test_viz_tractogram_collisions.py deleted file mode 100644 index 2d8819039..000000000 --- a/scripts/tests/test_viz_tractogram_collisions.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - -def test_help_option(script_runner): - ret = script_runner.run('scil_viz_tractogram_collisions.py', '--help') - assert ret.success diff --git a/scripts/tests/test_viz_tractogram_seeds_3d.py b/scripts/tests/test_viz_tractogram_seeds_3d.py deleted file mode 100644 index 688743270..000000000 --- a/scripts/tests/test_viz_tractogram_seeds_3d.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -def test_help_option(script_runner): - ret = script_runner.run('scil_viz_tractogram_seeds_3d.py', '--help') - assert ret.success diff --git a/scripts/tests/test_viz_volume_screenshot_mosaic.py b/scripts/tests/test_viz_volume_screenshot_mosaic.py deleted file mode 100644 index bd42089af..000000000 --- a/scripts/tests/test_viz_volume_screenshot_mosaic.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - -def test_help_option(script_runner): - ret = script_runner.run("scil_viz_volume_screenshot_mosaic.py", "--help") - assert ret.success diff --git a/setup.py b/setup.py deleted file mode 100644 index bed21c838..000000000 --- a/setup.py +++ /dev/null @@ -1,103 +0,0 @@ -import os - -from setuptools import setup, find_packages, Extension -from setuptools.command.build_ext import build_ext - -with open('requirements.txt') as f: - required_dependencies = f.read().splitlines() - external_dependencies = [] - for dependency in required_dependencies: - if dependency[0:2] == '-e': - repo_name = dependency.split('=')[-1] - repo_url = dependency[3:] - external_dependencies.append('{} @ {}'.format(repo_name, repo_url)) - else: - external_dependencies.append(dependency) - - -def get_extensions(): - define_macros = [('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')] - uncompress = Extension('scilpy.tractograms.uncompress', - ['scilpy/tractograms/uncompress.pyx'], - define_macros=define_macros) - voxel_boundary_intersection =\ - Extension('scilpy.tractanalysis.voxel_boundary_intersection', - ['scilpy/tractanalysis/voxel_boundary_intersection.pyx'], - define_macros=define_macros) - streamlines_metrics =\ - Extension('scilpy.tractanalysis.streamlines_metrics', - ['scilpy/tractanalysis/streamlines_metrics.pyx'], - define_macros=define_macros) - return [uncompress, voxel_boundary_intersection, streamlines_metrics] - - -class CustomBuildExtCommand(build_ext): - """ build_ext command to use when numpy headers are needed. """ - - def run(self): - # Now that the requirements are installed, get everything from numpy - from Cython.Build import cythonize - from numpy import get_include - - # Add everything requires for build - self.swig_opts = None - self.include_dirs = [get_include()] - self.distribution.ext_modules[:] = cythonize( - self.distribution.ext_modules) - - # Call original build_ext command - build_ext.finalize_options(self) - build_ext.run(self) - - -# Get the requiered python version -PYTHON_VERSION = "" -with open('.python-version') as f: - f.readline() - PYTHON_VERSION = f.readline().strip("\n") - -# Get version and release info, which is all stored in scilpy/version.py -ver_file = os.path.join('scilpy', 'version.py') -with open(ver_file) as f: - exec(f.read()) - -entry_point_legacy = [] -if os.getenv('SCILPY_LEGACY') != 'False': - entry_point_legacy = ["{}=scripts.legacy.{}:main".format( - os.path.basename(s), - os.path.basename(s).split(".")[0]) for s in LEGACY_SCRIPTS] - -opts = dict(name=NAME, - maintainer=MAINTAINER, - maintainer_email=MAINTAINER_EMAIL, - description=DESCRIPTION, - long_description=LONG_DESCRIPTION, - url=URL, - download_url=DOWNLOAD_URL, - license=LICENSE, - classifiers=CLASSIFIERS, - author=AUTHOR, - author_email=AUTHOR_EMAIL, - platforms=PLATFORMS, - version=VERSION, - packages=find_packages(), - cmdclass={ - 'build_ext': CustomBuildExtCommand - }, - ext_modules=get_extensions(), - python_requires=PYTHON_VERSION, - setup_requires=[], # replaced by PEP518 (pyproject.toml) - install_requires=external_dependencies, - entry_points={ - 'console_scripts': ["{}=scripts.{}:main".format( - os.path.basename(s), - os.path.basename(s).split(".")[0]) for s in SCRIPTS] + - entry_point_legacy - }, - data_files=[('data/LUT', - ["data/LUT/freesurfer_desikan_killiany.json", - "data/LUT/freesurfer_subcortical.json", - "data/LUT/dk_aggregate_structures.json"])], - include_package_data=True) - -setup(**opts) diff --git a/scilpy/__init__.py b/src/scilpy/__init__.py similarity index 95% rename from scilpy/__init__.py rename to src/scilpy/__init__.py index fb666eb4d..de573386d 100644 --- a/scilpy/__init__.py +++ b/src/scilpy/__init__.py @@ -12,7 +12,7 @@ def get_home(): def get_root(): import os - return os.path.realpath(f"{os.path.dirname(os.path.abspath(__file__))}/..") + return os.path.realpath(f"{os.path.dirname(os.path.abspath(__file__))}/../..") SCILPY_HOME = get_home() diff --git a/scilpy/connectivity/__init__.py b/src/scilpy/cli/__init__.py similarity index 100% rename from scilpy/connectivity/__init__.py rename to src/scilpy/cli/__init__.py diff --git a/scripts/scil_NODDI_maps.py b/src/scilpy/cli/scil_NODDI_maps.py similarity index 100% rename from scripts/scil_NODDI_maps.py rename to src/scilpy/cli/scil_NODDI_maps.py diff --git a/scripts/scil_NODDI_priors.py b/src/scilpy/cli/scil_NODDI_priors.py similarity index 100% rename from scripts/scil_NODDI_priors.py rename to src/scilpy/cli/scil_NODDI_priors.py diff --git a/scripts/scil_aodf_metrics.py b/src/scilpy/cli/scil_aodf_metrics.py similarity index 100% rename from scripts/scil_aodf_metrics.py rename to src/scilpy/cli/scil_aodf_metrics.py diff --git a/scripts/scil_bids_validate.py b/src/scilpy/cli/scil_bids_validate.py similarity index 100% rename from scripts/scil_bids_validate.py rename to src/scilpy/cli/scil_bids_validate.py diff --git a/scripts/scil_bingham_metrics.py b/src/scilpy/cli/scil_bingham_metrics.py similarity index 100% rename from scripts/scil_bingham_metrics.py rename to src/scilpy/cli/scil_bingham_metrics.py diff --git a/scripts/scil_btensor_metrics.py b/src/scilpy/cli/scil_btensor_metrics.py similarity index 100% rename from scripts/scil_btensor_metrics.py rename to src/scilpy/cli/scil_btensor_metrics.py diff --git a/scripts/scil_bundle_alter_to_target_dice.py b/src/scilpy/cli/scil_bundle_alter_to_target_dice.py similarity index 100% rename from scripts/scil_bundle_alter_to_target_dice.py rename to src/scilpy/cli/scil_bundle_alter_to_target_dice.py diff --git a/scripts/scil_bundle_clean_qbx_clusters.py b/src/scilpy/cli/scil_bundle_clean_qbx_clusters.py similarity index 100% rename from scripts/scil_bundle_clean_qbx_clusters.py rename to src/scilpy/cli/scil_bundle_clean_qbx_clusters.py diff --git a/scripts/scil_bundle_compute_centroid.py b/src/scilpy/cli/scil_bundle_compute_centroid.py similarity index 100% rename from scripts/scil_bundle_compute_centroid.py rename to src/scilpy/cli/scil_bundle_compute_centroid.py diff --git a/scripts/scil_bundle_compute_endpoints_map.py b/src/scilpy/cli/scil_bundle_compute_endpoints_map.py similarity index 100% rename from scripts/scil_bundle_compute_endpoints_map.py rename to src/scilpy/cli/scil_bundle_compute_endpoints_map.py diff --git a/scripts/scil_bundle_diameter.py b/src/scilpy/cli/scil_bundle_diameter.py similarity index 100% rename from scripts/scil_bundle_diameter.py rename to src/scilpy/cli/scil_bundle_diameter.py diff --git a/scripts/scil_bundle_explore_bundleseg.py b/src/scilpy/cli/scil_bundle_explore_bundleseg.py similarity index 100% rename from scripts/scil_bundle_explore_bundleseg.py rename to src/scilpy/cli/scil_bundle_explore_bundleseg.py diff --git a/scripts/scil_bundle_filter_by_occurence.py b/src/scilpy/cli/scil_bundle_filter_by_occurence.py similarity index 100% rename from scripts/scil_bundle_filter_by_occurence.py rename to src/scilpy/cli/scil_bundle_filter_by_occurence.py diff --git a/scripts/scil_bundle_fixel_analysis.py b/src/scilpy/cli/scil_bundle_fixel_analysis.py similarity index 100% rename from scripts/scil_bundle_fixel_analysis.py rename to src/scilpy/cli/scil_bundle_fixel_analysis.py diff --git a/scripts/scil_bundle_generate_priors.py b/src/scilpy/cli/scil_bundle_generate_priors.py similarity index 100% rename from scripts/scil_bundle_generate_priors.py rename to src/scilpy/cli/scil_bundle_generate_priors.py diff --git a/scripts/scil_bundle_label_map.py b/src/scilpy/cli/scil_bundle_label_map.py similarity index 100% rename from scripts/scil_bundle_label_map.py rename to src/scilpy/cli/scil_bundle_label_map.py diff --git a/scripts/scil_bundle_mean_fixel_afd.py b/src/scilpy/cli/scil_bundle_mean_fixel_afd.py similarity index 100% rename from scripts/scil_bundle_mean_fixel_afd.py rename to src/scilpy/cli/scil_bundle_mean_fixel_afd.py diff --git a/scripts/scil_bundle_mean_fixel_afd_from_hdf5.py b/src/scilpy/cli/scil_bundle_mean_fixel_afd_from_hdf5.py similarity index 100% rename from scripts/scil_bundle_mean_fixel_afd_from_hdf5.py rename to src/scilpy/cli/scil_bundle_mean_fixel_afd_from_hdf5.py diff --git a/scripts/scil_bundle_mean_fixel_bingham_metric.py b/src/scilpy/cli/scil_bundle_mean_fixel_bingham_metric.py similarity index 100% rename from scripts/scil_bundle_mean_fixel_bingham_metric.py rename to src/scilpy/cli/scil_bundle_mean_fixel_bingham_metric.py diff --git a/scripts/scil_bundle_mean_fixel_mrds_metric.py b/src/scilpy/cli/scil_bundle_mean_fixel_mrds_metric.py similarity index 100% rename from scripts/scil_bundle_mean_fixel_mrds_metric.py rename to src/scilpy/cli/scil_bundle_mean_fixel_mrds_metric.py diff --git a/scripts/scil_bundle_mean_std.py b/src/scilpy/cli/scil_bundle_mean_std.py similarity index 100% rename from scripts/scil_bundle_mean_std.py rename to src/scilpy/cli/scil_bundle_mean_std.py diff --git a/scripts/scil_bundle_pairwise_comparison.py b/src/scilpy/cli/scil_bundle_pairwise_comparison.py similarity index 100% rename from scripts/scil_bundle_pairwise_comparison.py rename to src/scilpy/cli/scil_bundle_pairwise_comparison.py diff --git a/scripts/scil_bundle_reject_outliers.py b/src/scilpy/cli/scil_bundle_reject_outliers.py similarity index 100% rename from scripts/scil_bundle_reject_outliers.py rename to src/scilpy/cli/scil_bundle_reject_outliers.py diff --git a/scripts/scil_bundle_score_many_bundles_one_tractogram.py b/src/scilpy/cli/scil_bundle_score_many_bundles_one_tractogram.py similarity index 100% rename from scripts/scil_bundle_score_many_bundles_one_tractogram.py rename to src/scilpy/cli/scil_bundle_score_many_bundles_one_tractogram.py diff --git a/scripts/scil_bundle_score_same_bundle_many_segmentations.py b/src/scilpy/cli/scil_bundle_score_same_bundle_many_segmentations.py similarity index 100% rename from scripts/scil_bundle_score_same_bundle_many_segmentations.py rename to src/scilpy/cli/scil_bundle_score_same_bundle_many_segmentations.py diff --git a/scripts/scil_bundle_shape_measures.py b/src/scilpy/cli/scil_bundle_shape_measures.py similarity index 100% rename from scripts/scil_bundle_shape_measures.py rename to src/scilpy/cli/scil_bundle_shape_measures.py diff --git a/scripts/scil_bundle_uniformize_endpoints.py b/src/scilpy/cli/scil_bundle_uniformize_endpoints.py similarity index 100% rename from scripts/scil_bundle_uniformize_endpoints.py rename to src/scilpy/cli/scil_bundle_uniformize_endpoints.py diff --git a/scripts/scil_bundle_volume_per_label.py b/src/scilpy/cli/scil_bundle_volume_per_label.py similarity index 100% rename from scripts/scil_bundle_volume_per_label.py rename to src/scilpy/cli/scil_bundle_volume_per_label.py diff --git a/scripts/scil_connectivity_compare_populations.py b/src/scilpy/cli/scil_connectivity_compare_populations.py similarity index 100% rename from scripts/scil_connectivity_compare_populations.py rename to src/scilpy/cli/scil_connectivity_compare_populations.py diff --git a/scripts/scil_connectivity_compute_matrices.py b/src/scilpy/cli/scil_connectivity_compute_matrices.py similarity index 100% rename from scripts/scil_connectivity_compute_matrices.py rename to src/scilpy/cli/scil_connectivity_compute_matrices.py diff --git a/scripts/scil_connectivity_compute_pca.py b/src/scilpy/cli/scil_connectivity_compute_pca.py similarity index 100% rename from scripts/scil_connectivity_compute_pca.py rename to src/scilpy/cli/scil_connectivity_compute_pca.py diff --git a/scripts/scil_connectivity_compute_simple_matrix.py b/src/scilpy/cli/scil_connectivity_compute_simple_matrix.py similarity index 100% rename from scripts/scil_connectivity_compute_simple_matrix.py rename to src/scilpy/cli/scil_connectivity_compute_simple_matrix.py diff --git a/scripts/scil_connectivity_filter.py b/src/scilpy/cli/scil_connectivity_filter.py similarity index 100% rename from scripts/scil_connectivity_filter.py rename to src/scilpy/cli/scil_connectivity_filter.py diff --git a/scripts/scil_connectivity_graph_measures.py b/src/scilpy/cli/scil_connectivity_graph_measures.py similarity index 100% rename from scripts/scil_connectivity_graph_measures.py rename to src/scilpy/cli/scil_connectivity_graph_measures.py diff --git a/scripts/scil_connectivity_hdf5_average_density_map.py b/src/scilpy/cli/scil_connectivity_hdf5_average_density_map.py similarity index 100% rename from scripts/scil_connectivity_hdf5_average_density_map.py rename to src/scilpy/cli/scil_connectivity_hdf5_average_density_map.py diff --git a/scripts/scil_connectivity_math.py b/src/scilpy/cli/scil_connectivity_math.py similarity index 100% rename from scripts/scil_connectivity_math.py rename to src/scilpy/cli/scil_connectivity_math.py diff --git a/scripts/scil_connectivity_normalize.py b/src/scilpy/cli/scil_connectivity_normalize.py similarity index 100% rename from scripts/scil_connectivity_normalize.py rename to src/scilpy/cli/scil_connectivity_normalize.py diff --git a/scripts/scil_connectivity_pairwise_agreement.py b/src/scilpy/cli/scil_connectivity_pairwise_agreement.py similarity index 100% rename from scripts/scil_connectivity_pairwise_agreement.py rename to src/scilpy/cli/scil_connectivity_pairwise_agreement.py diff --git a/scripts/scil_connectivity_print_filenames.py b/src/scilpy/cli/scil_connectivity_print_filenames.py similarity index 100% rename from scripts/scil_connectivity_print_filenames.py rename to src/scilpy/cli/scil_connectivity_print_filenames.py diff --git a/scripts/scil_connectivity_reorder_rois.py b/src/scilpy/cli/scil_connectivity_reorder_rois.py similarity index 100% rename from scripts/scil_connectivity_reorder_rois.py rename to src/scilpy/cli/scil_connectivity_reorder_rois.py diff --git a/scripts/scil_denoising_nlmeans.py b/src/scilpy/cli/scil_denoising_nlmeans.py similarity index 100% rename from scripts/scil_denoising_nlmeans.py rename to src/scilpy/cli/scil_denoising_nlmeans.py diff --git a/scripts/scil_dki_metrics.py b/src/scilpy/cli/scil_dki_metrics.py similarity index 100% rename from scripts/scil_dki_metrics.py rename to src/scilpy/cli/scil_dki_metrics.py diff --git a/scripts/scil_dti_convert_tensors.py b/src/scilpy/cli/scil_dti_convert_tensors.py similarity index 100% rename from scripts/scil_dti_convert_tensors.py rename to src/scilpy/cli/scil_dti_convert_tensors.py diff --git a/scripts/scil_dti_metrics.py b/src/scilpy/cli/scil_dti_metrics.py similarity index 100% rename from scripts/scil_dti_metrics.py rename to src/scilpy/cli/scil_dti_metrics.py diff --git a/scripts/scil_dwi_apply_bias_field.py b/src/scilpy/cli/scil_dwi_apply_bias_field.py similarity index 100% rename from scripts/scil_dwi_apply_bias_field.py rename to src/scilpy/cli/scil_dwi_apply_bias_field.py diff --git a/scripts/scil_dwi_compute_snr.py b/src/scilpy/cli/scil_dwi_compute_snr.py similarity index 100% rename from scripts/scil_dwi_compute_snr.py rename to src/scilpy/cli/scil_dwi_compute_snr.py diff --git a/scripts/scil_dwi_concatenate.py b/src/scilpy/cli/scil_dwi_concatenate.py similarity index 100% rename from scripts/scil_dwi_concatenate.py rename to src/scilpy/cli/scil_dwi_concatenate.py diff --git a/scripts/scil_dwi_convert_FDF.py b/src/scilpy/cli/scil_dwi_convert_FDF.py similarity index 100% rename from scripts/scil_dwi_convert_FDF.py rename to src/scilpy/cli/scil_dwi_convert_FDF.py diff --git a/scripts/scil_dwi_detect_volume_outliers.py b/src/scilpy/cli/scil_dwi_detect_volume_outliers.py similarity index 100% rename from scripts/scil_dwi_detect_volume_outliers.py rename to src/scilpy/cli/scil_dwi_detect_volume_outliers.py diff --git a/scripts/scil_dwi_extract_b0.py b/src/scilpy/cli/scil_dwi_extract_b0.py similarity index 100% rename from scripts/scil_dwi_extract_b0.py rename to src/scilpy/cli/scil_dwi_extract_b0.py diff --git a/scripts/scil_dwi_extract_shell.py b/src/scilpy/cli/scil_dwi_extract_shell.py similarity index 100% rename from scripts/scil_dwi_extract_shell.py rename to src/scilpy/cli/scil_dwi_extract_shell.py diff --git a/scripts/scil_dwi_powder_average.py b/src/scilpy/cli/scil_dwi_powder_average.py similarity index 100% rename from scripts/scil_dwi_powder_average.py rename to src/scilpy/cli/scil_dwi_powder_average.py diff --git a/scripts/scil_dwi_prepare_eddy_command.py b/src/scilpy/cli/scil_dwi_prepare_eddy_command.py similarity index 100% rename from scripts/scil_dwi_prepare_eddy_command.py rename to src/scilpy/cli/scil_dwi_prepare_eddy_command.py diff --git a/scripts/scil_dwi_prepare_topup_command.py b/src/scilpy/cli/scil_dwi_prepare_topup_command.py similarity index 100% rename from scripts/scil_dwi_prepare_topup_command.py rename to src/scilpy/cli/scil_dwi_prepare_topup_command.py diff --git a/scripts/scil_dwi_reorder_philips.py b/src/scilpy/cli/scil_dwi_reorder_philips.py similarity index 100% rename from scripts/scil_dwi_reorder_philips.py rename to src/scilpy/cli/scil_dwi_reorder_philips.py diff --git a/scripts/scil_dwi_split_by_indices.py b/src/scilpy/cli/scil_dwi_split_by_indices.py similarity index 100% rename from scripts/scil_dwi_split_by_indices.py rename to src/scilpy/cli/scil_dwi_split_by_indices.py diff --git a/scripts/scil_dwi_to_sh.py b/src/scilpy/cli/scil_dwi_to_sh.py similarity index 100% rename from scripts/scil_dwi_to_sh.py rename to src/scilpy/cli/scil_dwi_to_sh.py diff --git a/scripts/scil_fibertube_compute_density.py b/src/scilpy/cli/scil_fibertube_compute_density.py similarity index 100% rename from scripts/scil_fibertube_compute_density.py rename to src/scilpy/cli/scil_fibertube_compute_density.py diff --git a/scripts/scil_fibertube_score_tractogram.py b/src/scilpy/cli/scil_fibertube_score_tractogram.py similarity index 100% rename from scripts/scil_fibertube_score_tractogram.py rename to src/scilpy/cli/scil_fibertube_score_tractogram.py diff --git a/scripts/scil_fibertube_tracking.py b/src/scilpy/cli/scil_fibertube_tracking.py similarity index 100% rename from scripts/scil_fibertube_tracking.py rename to src/scilpy/cli/scil_fibertube_tracking.py diff --git a/scripts/scil_fodf_bundleparc.py b/src/scilpy/cli/scil_fodf_bundleparc.py similarity index 100% rename from scripts/scil_fodf_bundleparc.py rename to src/scilpy/cli/scil_fodf_bundleparc.py diff --git a/scripts/scil_fodf_max_in_ventricles.py b/src/scilpy/cli/scil_fodf_max_in_ventricles.py similarity index 100% rename from scripts/scil_fodf_max_in_ventricles.py rename to src/scilpy/cli/scil_fodf_max_in_ventricles.py diff --git a/scripts/scil_fodf_memsmt.py b/src/scilpy/cli/scil_fodf_memsmt.py similarity index 100% rename from scripts/scil_fodf_memsmt.py rename to src/scilpy/cli/scil_fodf_memsmt.py diff --git a/scripts/scil_fodf_metrics.py b/src/scilpy/cli/scil_fodf_metrics.py similarity index 100% rename from scripts/scil_fodf_metrics.py rename to src/scilpy/cli/scil_fodf_metrics.py diff --git a/scripts/scil_fodf_msmt.py b/src/scilpy/cli/scil_fodf_msmt.py similarity index 100% rename from scripts/scil_fodf_msmt.py rename to src/scilpy/cli/scil_fodf_msmt.py diff --git a/scripts/scil_fodf_ssst.py b/src/scilpy/cli/scil_fodf_ssst.py similarity index 100% rename from scripts/scil_fodf_ssst.py rename to src/scilpy/cli/scil_fodf_ssst.py diff --git a/scripts/scil_fodf_to_bingham.py b/src/scilpy/cli/scil_fodf_to_bingham.py similarity index 100% rename from scripts/scil_fodf_to_bingham.py rename to src/scilpy/cli/scil_fodf_to_bingham.py diff --git a/scripts/scil_freewater_maps.py b/src/scilpy/cli/scil_freewater_maps.py similarity index 100% rename from scripts/scil_freewater_maps.py rename to src/scilpy/cli/scil_freewater_maps.py diff --git a/scripts/scil_freewater_priors.py b/src/scilpy/cli/scil_freewater_priors.py similarity index 71% rename from scripts/scil_freewater_priors.py rename to src/scilpy/cli/scil_freewater_priors.py index d0ae218ca..884795220 100755 --- a/scripts/scil_freewater_priors.py +++ b/src/scilpy/cli/scil_freewater_priors.py @@ -5,7 +5,7 @@ Synonym for scil_NODDI_priors.py """ -from scripts.scil_NODDI_priors import main as noddi_priors_main +from scilpy.cli.scil_NODDI_priors import main as noddi_priors_main def main(): diff --git a/scripts/scil_frf_mean.py b/src/scilpy/cli/scil_frf_mean.py similarity index 100% rename from scripts/scil_frf_mean.py rename to src/scilpy/cli/scil_frf_mean.py diff --git a/scripts/scil_frf_memsmt.py b/src/scilpy/cli/scil_frf_memsmt.py similarity index 100% rename from scripts/scil_frf_memsmt.py rename to src/scilpy/cli/scil_frf_memsmt.py diff --git a/scripts/scil_frf_msmt.py b/src/scilpy/cli/scil_frf_msmt.py similarity index 100% rename from scripts/scil_frf_msmt.py rename to src/scilpy/cli/scil_frf_msmt.py diff --git a/scripts/scil_frf_set_diffusivities.py b/src/scilpy/cli/scil_frf_set_diffusivities.py similarity index 100% rename from scripts/scil_frf_set_diffusivities.py rename to src/scilpy/cli/scil_frf_set_diffusivities.py diff --git a/scripts/scil_frf_ssst.py b/src/scilpy/cli/scil_frf_ssst.py similarity index 100% rename from scripts/scil_frf_ssst.py rename to src/scilpy/cli/scil_frf_ssst.py diff --git a/scripts/scil_get_version.py b/src/scilpy/cli/scil_get_version.py similarity index 100% rename from scripts/scil_get_version.py rename to src/scilpy/cli/scil_get_version.py diff --git a/scripts/scil_gradients_apply_transform.py b/src/scilpy/cli/scil_gradients_apply_transform.py similarity index 100% rename from scripts/scil_gradients_apply_transform.py rename to src/scilpy/cli/scil_gradients_apply_transform.py diff --git a/scripts/scil_gradients_convert.py b/src/scilpy/cli/scil_gradients_convert.py similarity index 100% rename from scripts/scil_gradients_convert.py rename to src/scilpy/cli/scil_gradients_convert.py diff --git a/scripts/scil_gradients_generate_sampling.py b/src/scilpy/cli/scil_gradients_generate_sampling.py similarity index 100% rename from scripts/scil_gradients_generate_sampling.py rename to src/scilpy/cli/scil_gradients_generate_sampling.py diff --git a/scripts/scil_gradients_modify_axes.py b/src/scilpy/cli/scil_gradients_modify_axes.py similarity index 100% rename from scripts/scil_gradients_modify_axes.py rename to src/scilpy/cli/scil_gradients_modify_axes.py diff --git a/scripts/scil_gradients_normalize_bvecs.py b/src/scilpy/cli/scil_gradients_normalize_bvecs.py similarity index 100% rename from scripts/scil_gradients_normalize_bvecs.py rename to src/scilpy/cli/scil_gradients_normalize_bvecs.py diff --git a/scripts/scil_gradients_round_bvals.py b/src/scilpy/cli/scil_gradients_round_bvals.py similarity index 100% rename from scripts/scil_gradients_round_bvals.py rename to src/scilpy/cli/scil_gradients_round_bvals.py diff --git a/scripts/scil_gradients_validate_correct.py b/src/scilpy/cli/scil_gradients_validate_correct.py similarity index 100% rename from scripts/scil_gradients_validate_correct.py rename to src/scilpy/cli/scil_gradients_validate_correct.py diff --git a/scripts/scil_gradients_validate_correct_eddy.py b/src/scilpy/cli/scil_gradients_validate_correct_eddy.py similarity index 100% rename from scripts/scil_gradients_validate_correct_eddy.py rename to src/scilpy/cli/scil_gradients_validate_correct_eddy.py diff --git a/scripts/scil_gradients_validate_sampling.py b/src/scilpy/cli/scil_gradients_validate_sampling.py similarity index 100% rename from scripts/scil_gradients_validate_sampling.py rename to src/scilpy/cli/scil_gradients_validate_sampling.py diff --git a/scripts/scil_header_print_info.py b/src/scilpy/cli/scil_header_print_info.py similarity index 100% rename from scripts/scil_header_print_info.py rename to src/scilpy/cli/scil_header_print_info.py diff --git a/scripts/scil_header_validate_compatibility.py b/src/scilpy/cli/scil_header_validate_compatibility.py similarity index 100% rename from scripts/scil_header_validate_compatibility.py rename to src/scilpy/cli/scil_header_validate_compatibility.py diff --git a/scripts/scil_json_convert_entries_to_xlsx.py b/src/scilpy/cli/scil_json_convert_entries_to_xlsx.py similarity index 100% rename from scripts/scil_json_convert_entries_to_xlsx.py rename to src/scilpy/cli/scil_json_convert_entries_to_xlsx.py diff --git a/scripts/scil_json_harmonize_entries.py b/src/scilpy/cli/scil_json_harmonize_entries.py similarity index 100% rename from scripts/scil_json_harmonize_entries.py rename to src/scilpy/cli/scil_json_harmonize_entries.py diff --git a/scripts/scil_json_merge_entries.py b/src/scilpy/cli/scil_json_merge_entries.py similarity index 100% rename from scripts/scil_json_merge_entries.py rename to src/scilpy/cli/scil_json_merge_entries.py diff --git a/scripts/scil_labels_combine.py b/src/scilpy/cli/scil_labels_combine.py similarity index 100% rename from scripts/scil_labels_combine.py rename to src/scilpy/cli/scil_labels_combine.py diff --git a/scripts/scil_labels_dilate.py b/src/scilpy/cli/scil_labels_dilate.py similarity index 100% rename from scripts/scil_labels_dilate.py rename to src/scilpy/cli/scil_labels_dilate.py diff --git a/scripts/scil_labels_from_mask.py b/src/scilpy/cli/scil_labels_from_mask.py similarity index 100% rename from scripts/scil_labels_from_mask.py rename to src/scilpy/cli/scil_labels_from_mask.py diff --git a/scripts/scil_labels_remove.py b/src/scilpy/cli/scil_labels_remove.py similarity index 100% rename from scripts/scil_labels_remove.py rename to src/scilpy/cli/scil_labels_remove.py diff --git a/scripts/scil_labels_split_volume_by_ids.py b/src/scilpy/cli/scil_labels_split_volume_by_ids.py similarity index 100% rename from scripts/scil_labels_split_volume_by_ids.py rename to src/scilpy/cli/scil_labels_split_volume_by_ids.py diff --git a/scripts/scil_labels_split_volume_from_lut.py b/src/scilpy/cli/scil_labels_split_volume_from_lut.py similarity index 93% rename from scripts/scil_labels_split_volume_from_lut.py rename to src/scilpy/cli/scil_labels_split_volume_from_lut.py index a031aa4fd..cb197e15a 100755 --- a/scripts/scil_labels_split_volume_from_lut.py +++ b/src/scilpy/cli/scil_labels_split_volume_from_lut.py @@ -19,7 +19,7 @@ import nibabel as nib -from scilpy.image.labels import get_data_as_labels, get_lut_dir, split_labels +from scilpy.image.labels import get_data_as_labels, split_labels, SCILPY_LUT_DIR from scilpy.io.utils import (add_overwrite_arg, add_verbose_arg, assert_inputs_exist, assert_outputs_exist, assert_output_dirs_exist_and_empty) @@ -27,7 +27,7 @@ def _build_arg_parser(): - luts = [os.path.splitext(f)[0] for f in os.listdir(get_lut_dir())] + luts = [os.path.splitext(f)[0] for f in os.listdir(SCILPY_LUT_DIR)] p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter, @@ -67,7 +67,7 @@ def main(): label_img_data = get_data_as_labels(label_img) if args.scilpy_lut: - with open(os.path.join(get_lut_dir(), args.scilpy_lut + '.json')) as f: + with open(os.path.join(SCILPY_LUT_DIR, args.scilpy_lut + '.json')) as f: label_dict = json.load(f) else: with open(args.custom_lut) as f: diff --git a/scripts/scil_lesions_generate_nawm.py b/src/scilpy/cli/scil_lesions_generate_nawm.py similarity index 100% rename from scripts/scil_lesions_generate_nawm.py rename to src/scilpy/cli/scil_lesions_generate_nawm.py diff --git a/scripts/scil_lesions_info.py b/src/scilpy/cli/scil_lesions_info.py similarity index 100% rename from scripts/scil_lesions_info.py rename to src/scilpy/cli/scil_lesions_info.py diff --git a/scripts/scil_mrds_metrics.py b/src/scilpy/cli/scil_mrds_metrics.py similarity index 100% rename from scripts/scil_mrds_metrics.py rename to src/scilpy/cli/scil_mrds_metrics.py diff --git a/scripts/scil_mrds_select_number_of_tensors.py b/src/scilpy/cli/scil_mrds_select_number_of_tensors.py similarity index 100% rename from scripts/scil_mrds_select_number_of_tensors.py rename to src/scilpy/cli/scil_mrds_select_number_of_tensors.py diff --git a/scripts/scil_mti_adjust_B1_header.py b/src/scilpy/cli/scil_mti_adjust_B1_header.py similarity index 100% rename from scripts/scil_mti_adjust_B1_header.py rename to src/scilpy/cli/scil_mti_adjust_B1_header.py diff --git a/scripts/scil_mti_maps_MT.py b/src/scilpy/cli/scil_mti_maps_MT.py similarity index 100% rename from scripts/scil_mti_maps_MT.py rename to src/scilpy/cli/scil_mti_maps_MT.py diff --git a/scripts/scil_mti_maps_ihMT.py b/src/scilpy/cli/scil_mti_maps_ihMT.py similarity index 100% rename from scripts/scil_mti_maps_ihMT.py rename to src/scilpy/cli/scil_mti_maps_ihMT.py diff --git a/scripts/scil_plot_stats_per_point.py b/src/scilpy/cli/scil_plot_stats_per_point.py similarity index 100% rename from scripts/scil_plot_stats_per_point.py rename to src/scilpy/cli/scil_plot_stats_per_point.py diff --git a/scripts/scil_qball_metrics.py b/src/scilpy/cli/scil_qball_metrics.py similarity index 100% rename from scripts/scil_qball_metrics.py rename to src/scilpy/cli/scil_qball_metrics.py diff --git a/scripts/scil_rgb_convert.py b/src/scilpy/cli/scil_rgb_convert.py similarity index 100% rename from scripts/scil_rgb_convert.py rename to src/scilpy/cli/scil_rgb_convert.py diff --git a/scripts/scil_search_keywords.py b/src/scilpy/cli/scil_search_keywords.py similarity index 98% rename from scripts/scil_search_keywords.py rename to src/scilpy/cli/scil_search_keywords.py index 533c107c5..a713c35b2 100755 --- a/scripts/scil_search_keywords.py +++ b/src/scilpy/cli/scil_search_keywords.py @@ -65,7 +65,7 @@ from scilpy.utils.scilpy_bot import SPACING_LEN, VOCAB_FILE_PATH from scilpy.io.utils import add_verbose_arg from scilpy.version import version_string - +from scilpy import SCILPY_HOME def _build_arg_parser(): p = argparse.ArgumentParser(description=__doc__, @@ -131,8 +131,7 @@ def main(): phrase_mapping = {stem: orig for orig, stem in zip(phrases, stemmed_phrases)} - script_dir = pathlib.Path(__file__).parent - hidden_dir = script_dir / '.hidden' + hidden_dir = pathlib.Path(SCILPY_HOME) / ".hidden" if args.regenerate_help_files: shutil.rmtree(hidden_dir) diff --git a/scripts/scil_sh_convert.py b/src/scilpy/cli/scil_sh_convert.py similarity index 100% rename from scripts/scil_sh_convert.py rename to src/scilpy/cli/scil_sh_convert.py diff --git a/scripts/scil_sh_fusion.py b/src/scilpy/cli/scil_sh_fusion.py similarity index 100% rename from scripts/scil_sh_fusion.py rename to src/scilpy/cli/scil_sh_fusion.py diff --git a/scripts/scil_sh_to_aodf.py b/src/scilpy/cli/scil_sh_to_aodf.py similarity index 100% rename from scripts/scil_sh_to_aodf.py rename to src/scilpy/cli/scil_sh_to_aodf.py diff --git a/scripts/scil_sh_to_rish.py b/src/scilpy/cli/scil_sh_to_rish.py similarity index 100% rename from scripts/scil_sh_to_rish.py rename to src/scilpy/cli/scil_sh_to_rish.py diff --git a/scripts/scil_sh_to_sf.py b/src/scilpy/cli/scil_sh_to_sf.py similarity index 100% rename from scripts/scil_sh_to_sf.py rename to src/scilpy/cli/scil_sh_to_sf.py diff --git a/scripts/scil_stats_group_comparison.py b/src/scilpy/cli/scil_stats_group_comparison.py similarity index 100% rename from scripts/scil_stats_group_comparison.py rename to src/scilpy/cli/scil_stats_group_comparison.py diff --git a/scripts/scil_surface_apply_transform.py b/src/scilpy/cli/scil_surface_apply_transform.py similarity index 100% rename from scripts/scil_surface_apply_transform.py rename to src/scilpy/cli/scil_surface_apply_transform.py diff --git a/scripts/scil_surface_convert.py b/src/scilpy/cli/scil_surface_convert.py similarity index 100% rename from scripts/scil_surface_convert.py rename to src/scilpy/cli/scil_surface_convert.py diff --git a/scripts/scil_surface_create.py b/src/scilpy/cli/scil_surface_create.py similarity index 100% rename from scripts/scil_surface_create.py rename to src/scilpy/cli/scil_surface_create.py diff --git a/scripts/scil_surface_flip.py b/src/scilpy/cli/scil_surface_flip.py similarity index 100% rename from scripts/scil_surface_flip.py rename to src/scilpy/cli/scil_surface_flip.py diff --git a/scripts/scil_surface_smooth.py b/src/scilpy/cli/scil_surface_smooth.py similarity index 100% rename from scripts/scil_surface_smooth.py rename to src/scilpy/cli/scil_surface_smooth.py diff --git a/scripts/scil_tracking_local.py b/src/scilpy/cli/scil_tracking_local.py similarity index 100% rename from scripts/scil_tracking_local.py rename to src/scilpy/cli/scil_tracking_local.py diff --git a/scripts/scil_tracking_local_dev.py b/src/scilpy/cli/scil_tracking_local_dev.py similarity index 100% rename from scripts/scil_tracking_local_dev.py rename to src/scilpy/cli/scil_tracking_local_dev.py diff --git a/scripts/scil_tracking_pft.py b/src/scilpy/cli/scil_tracking_pft.py similarity index 100% rename from scripts/scil_tracking_pft.py rename to src/scilpy/cli/scil_tracking_pft.py diff --git a/scripts/scil_tracking_pft_maps.py b/src/scilpy/cli/scil_tracking_pft_maps.py similarity index 100% rename from scripts/scil_tracking_pft_maps.py rename to src/scilpy/cli/scil_tracking_pft_maps.py diff --git a/scripts/scil_tracking_pft_maps_edit.py b/src/scilpy/cli/scil_tracking_pft_maps_edit.py similarity index 100% rename from scripts/scil_tracking_pft_maps_edit.py rename to src/scilpy/cli/scil_tracking_pft_maps_edit.py diff --git a/scripts/scil_tractogram_apply_transform.py b/src/scilpy/cli/scil_tractogram_apply_transform.py similarity index 100% rename from scripts/scil_tractogram_apply_transform.py rename to src/scilpy/cli/scil_tractogram_apply_transform.py diff --git a/scripts/scil_tractogram_apply_transform_to_hdf5.py b/src/scilpy/cli/scil_tractogram_apply_transform_to_hdf5.py similarity index 100% rename from scripts/scil_tractogram_apply_transform_to_hdf5.py rename to src/scilpy/cli/scil_tractogram_apply_transform_to_hdf5.py diff --git a/scripts/scil_tractogram_assign_custom_color.py b/src/scilpy/cli/scil_tractogram_assign_custom_color.py similarity index 100% rename from scripts/scil_tractogram_assign_custom_color.py rename to src/scilpy/cli/scil_tractogram_assign_custom_color.py diff --git a/scripts/scil_tractogram_assign_uniform_color.py b/src/scilpy/cli/scil_tractogram_assign_uniform_color.py similarity index 100% rename from scripts/scil_tractogram_assign_uniform_color.py rename to src/scilpy/cli/scil_tractogram_assign_uniform_color.py diff --git a/scripts/scil_tractogram_commit.py b/src/scilpy/cli/scil_tractogram_commit.py similarity index 100% rename from scripts/scil_tractogram_commit.py rename to src/scilpy/cli/scil_tractogram_commit.py diff --git a/scripts/scil_tractogram_compress.py b/src/scilpy/cli/scil_tractogram_compress.py similarity index 100% rename from scripts/scil_tractogram_compress.py rename to src/scilpy/cli/scil_tractogram_compress.py diff --git a/scripts/scil_tractogram_compute_TODI.py b/src/scilpy/cli/scil_tractogram_compute_TODI.py similarity index 100% rename from scripts/scil_tractogram_compute_TODI.py rename to src/scilpy/cli/scil_tractogram_compute_TODI.py diff --git a/scripts/scil_tractogram_compute_density_map.py b/src/scilpy/cli/scil_tractogram_compute_density_map.py similarity index 100% rename from scripts/scil_tractogram_compute_density_map.py rename to src/scilpy/cli/scil_tractogram_compute_density_map.py diff --git a/scripts/scil_tractogram_convert.py b/src/scilpy/cli/scil_tractogram_convert.py similarity index 100% rename from scripts/scil_tractogram_convert.py rename to src/scilpy/cli/scil_tractogram_convert.py diff --git a/scripts/scil_tractogram_convert_hdf5_to_trk.py b/src/scilpy/cli/scil_tractogram_convert_hdf5_to_trk.py similarity index 100% rename from scripts/scil_tractogram_convert_hdf5_to_trk.py rename to src/scilpy/cli/scil_tractogram_convert_hdf5_to_trk.py diff --git a/scripts/scil_tractogram_convert_trk_to_hdf5.py b/src/scilpy/cli/scil_tractogram_convert_trk_to_hdf5.py similarity index 100% rename from scripts/scil_tractogram_convert_trk_to_hdf5.py rename to src/scilpy/cli/scil_tractogram_convert_trk_to_hdf5.py diff --git a/scripts/scil_tractogram_count_streamlines.py b/src/scilpy/cli/scil_tractogram_count_streamlines.py similarity index 100% rename from scripts/scil_tractogram_count_streamlines.py rename to src/scilpy/cli/scil_tractogram_count_streamlines.py diff --git a/scripts/scil_tractogram_cut_streamlines.py b/src/scilpy/cli/scil_tractogram_cut_streamlines.py similarity index 100% rename from scripts/scil_tractogram_cut_streamlines.py rename to src/scilpy/cli/scil_tractogram_cut_streamlines.py diff --git a/scripts/scil_tractogram_detect_loops.py b/src/scilpy/cli/scil_tractogram_detect_loops.py similarity index 100% rename from scripts/scil_tractogram_detect_loops.py rename to src/scilpy/cli/scil_tractogram_detect_loops.py diff --git a/scripts/scil_tractogram_dpp_math.py b/src/scilpy/cli/scil_tractogram_dpp_math.py similarity index 100% rename from scripts/scil_tractogram_dpp_math.py rename to src/scilpy/cli/scil_tractogram_dpp_math.py diff --git a/scripts/scil_tractogram_dps_math.py b/src/scilpy/cli/scil_tractogram_dps_math.py similarity index 100% rename from scripts/scil_tractogram_dps_math.py rename to src/scilpy/cli/scil_tractogram_dps_math.py diff --git a/scripts/scil_tractogram_extract_ushape.py b/src/scilpy/cli/scil_tractogram_extract_ushape.py similarity index 100% rename from scripts/scil_tractogram_extract_ushape.py rename to src/scilpy/cli/scil_tractogram_extract_ushape.py diff --git a/scripts/scil_tractogram_filter_by_anatomy.py b/src/scilpy/cli/scil_tractogram_filter_by_anatomy.py similarity index 100% rename from scripts/scil_tractogram_filter_by_anatomy.py rename to src/scilpy/cli/scil_tractogram_filter_by_anatomy.py diff --git a/scripts/scil_tractogram_filter_by_length.py b/src/scilpy/cli/scil_tractogram_filter_by_length.py similarity index 100% rename from scripts/scil_tractogram_filter_by_length.py rename to src/scilpy/cli/scil_tractogram_filter_by_length.py diff --git a/scripts/scil_tractogram_filter_by_orientation.py b/src/scilpy/cli/scil_tractogram_filter_by_orientation.py similarity index 100% rename from scripts/scil_tractogram_filter_by_orientation.py rename to src/scilpy/cli/scil_tractogram_filter_by_orientation.py diff --git a/scripts/scil_tractogram_filter_by_roi.py b/src/scilpy/cli/scil_tractogram_filter_by_roi.py similarity index 100% rename from scripts/scil_tractogram_filter_by_roi.py rename to src/scilpy/cli/scil_tractogram_filter_by_roi.py diff --git a/scripts/scil_tractogram_filter_collisions.py b/src/scilpy/cli/scil_tractogram_filter_collisions.py similarity index 100% rename from scripts/scil_tractogram_filter_collisions.py rename to src/scilpy/cli/scil_tractogram_filter_collisions.py diff --git a/scripts/scil_tractogram_flip.py b/src/scilpy/cli/scil_tractogram_flip.py similarity index 100% rename from scripts/scil_tractogram_flip.py rename to src/scilpy/cli/scil_tractogram_flip.py diff --git a/scripts/scil_tractogram_math.py b/src/scilpy/cli/scil_tractogram_math.py similarity index 100% rename from scripts/scil_tractogram_math.py rename to src/scilpy/cli/scil_tractogram_math.py diff --git a/scripts/scil_tractogram_pairwise_comparison.py b/src/scilpy/cli/scil_tractogram_pairwise_comparison.py similarity index 100% rename from scripts/scil_tractogram_pairwise_comparison.py rename to src/scilpy/cli/scil_tractogram_pairwise_comparison.py diff --git a/scripts/scil_tractogram_print_info.py b/src/scilpy/cli/scil_tractogram_print_info.py similarity index 100% rename from scripts/scil_tractogram_print_info.py rename to src/scilpy/cli/scil_tractogram_print_info.py diff --git a/scripts/scil_tractogram_project_map_to_streamlines.py b/src/scilpy/cli/scil_tractogram_project_map_to_streamlines.py similarity index 100% rename from scripts/scil_tractogram_project_map_to_streamlines.py rename to src/scilpy/cli/scil_tractogram_project_map_to_streamlines.py diff --git a/scripts/scil_tractogram_project_streamlines_to_map.py b/src/scilpy/cli/scil_tractogram_project_streamlines_to_map.py similarity index 100% rename from scripts/scil_tractogram_project_streamlines_to_map.py rename to src/scilpy/cli/scil_tractogram_project_streamlines_to_map.py diff --git a/scripts/scil_tractogram_qbx.py b/src/scilpy/cli/scil_tractogram_qbx.py similarity index 100% rename from scripts/scil_tractogram_qbx.py rename to src/scilpy/cli/scil_tractogram_qbx.py diff --git a/scripts/scil_tractogram_register.py b/src/scilpy/cli/scil_tractogram_register.py similarity index 100% rename from scripts/scil_tractogram_register.py rename to src/scilpy/cli/scil_tractogram_register.py diff --git a/scripts/scil_tractogram_remove_invalid.py b/src/scilpy/cli/scil_tractogram_remove_invalid.py similarity index 100% rename from scripts/scil_tractogram_remove_invalid.py rename to src/scilpy/cli/scil_tractogram_remove_invalid.py diff --git a/scripts/scil_tractogram_resample.py b/src/scilpy/cli/scil_tractogram_resample.py similarity index 100% rename from scripts/scil_tractogram_resample.py rename to src/scilpy/cli/scil_tractogram_resample.py diff --git a/scripts/scil_tractogram_resample_nb_points.py b/src/scilpy/cli/scil_tractogram_resample_nb_points.py similarity index 100% rename from scripts/scil_tractogram_resample_nb_points.py rename to src/scilpy/cli/scil_tractogram_resample_nb_points.py diff --git a/scripts/scil_tractogram_seed_density_map.py b/src/scilpy/cli/scil_tractogram_seed_density_map.py similarity index 100% rename from scripts/scil_tractogram_seed_density_map.py rename to src/scilpy/cli/scil_tractogram_seed_density_map.py diff --git a/scripts/scil_tractogram_segment_connections_from_labels.py b/src/scilpy/cli/scil_tractogram_segment_connections_from_labels.py similarity index 100% rename from scripts/scil_tractogram_segment_connections_from_labels.py rename to src/scilpy/cli/scil_tractogram_segment_connections_from_labels.py diff --git a/scripts/scil_tractogram_segment_with_ROI_and_score.py b/src/scilpy/cli/scil_tractogram_segment_with_ROI_and_score.py similarity index 100% rename from scripts/scil_tractogram_segment_with_ROI_and_score.py rename to src/scilpy/cli/scil_tractogram_segment_with_ROI_and_score.py diff --git a/scripts/scil_tractogram_segment_with_bundleseg.py b/src/scilpy/cli/scil_tractogram_segment_with_bundleseg.py similarity index 100% rename from scripts/scil_tractogram_segment_with_bundleseg.py rename to src/scilpy/cli/scil_tractogram_segment_with_bundleseg.py diff --git a/scripts/scil_tractogram_segment_with_recobundles.py b/src/scilpy/cli/scil_tractogram_segment_with_recobundles.py similarity index 100% rename from scripts/scil_tractogram_segment_with_recobundles.py rename to src/scilpy/cli/scil_tractogram_segment_with_recobundles.py diff --git a/scripts/scil_tractogram_shuffle.py b/src/scilpy/cli/scil_tractogram_shuffle.py similarity index 100% rename from scripts/scil_tractogram_shuffle.py rename to src/scilpy/cli/scil_tractogram_shuffle.py diff --git a/scripts/scil_tractogram_smooth.py b/src/scilpy/cli/scil_tractogram_smooth.py similarity index 100% rename from scripts/scil_tractogram_smooth.py rename to src/scilpy/cli/scil_tractogram_smooth.py diff --git a/scripts/scil_tractogram_split.py b/src/scilpy/cli/scil_tractogram_split.py similarity index 100% rename from scripts/scil_tractogram_split.py rename to src/scilpy/cli/scil_tractogram_split.py diff --git a/scripts/scil_viz_bingham_fit.py b/src/scilpy/cli/scil_viz_bingham_fit.py similarity index 100% rename from scripts/scil_viz_bingham_fit.py rename to src/scilpy/cli/scil_viz_bingham_fit.py diff --git a/scripts/scil_viz_bundle.py b/src/scilpy/cli/scil_viz_bundle.py similarity index 100% rename from scripts/scil_viz_bundle.py rename to src/scilpy/cli/scil_viz_bundle.py diff --git a/scripts/scil_viz_bundle_screenshot_mni.py b/src/scilpy/cli/scil_viz_bundle_screenshot_mni.py similarity index 100% rename from scripts/scil_viz_bundle_screenshot_mni.py rename to src/scilpy/cli/scil_viz_bundle_screenshot_mni.py diff --git a/scripts/scil_viz_bundle_screenshot_mosaic.py b/src/scilpy/cli/scil_viz_bundle_screenshot_mosaic.py similarity index 100% rename from scripts/scil_viz_bundle_screenshot_mosaic.py rename to src/scilpy/cli/scil_viz_bundle_screenshot_mosaic.py diff --git a/scripts/scil_viz_connectivity.py b/src/scilpy/cli/scil_viz_connectivity.py similarity index 100% rename from scripts/scil_viz_connectivity.py rename to src/scilpy/cli/scil_viz_connectivity.py diff --git a/scripts/scil_viz_dti_screenshot.py b/src/scilpy/cli/scil_viz_dti_screenshot.py similarity index 100% rename from scripts/scil_viz_dti_screenshot.py rename to src/scilpy/cli/scil_viz_dti_screenshot.py diff --git a/scripts/scil_viz_fodf.py b/src/scilpy/cli/scil_viz_fodf.py similarity index 100% rename from scripts/scil_viz_fodf.py rename to src/scilpy/cli/scil_viz_fodf.py diff --git a/scripts/scil_viz_gradients_screenshot.py b/src/scilpy/cli/scil_viz_gradients_screenshot.py similarity index 100% rename from scripts/scil_viz_gradients_screenshot.py rename to src/scilpy/cli/scil_viz_gradients_screenshot.py diff --git a/scripts/scil_viz_tractogram_collisions.py b/src/scilpy/cli/scil_viz_tractogram_collisions.py similarity index 100% rename from scripts/scil_viz_tractogram_collisions.py rename to src/scilpy/cli/scil_viz_tractogram_collisions.py diff --git a/scripts/scil_viz_tractogram_seeds.py b/src/scilpy/cli/scil_viz_tractogram_seeds.py similarity index 100% rename from scripts/scil_viz_tractogram_seeds.py rename to src/scilpy/cli/scil_viz_tractogram_seeds.py diff --git a/scripts/scil_viz_tractogram_seeds_3d.py b/src/scilpy/cli/scil_viz_tractogram_seeds_3d.py similarity index 100% rename from scripts/scil_viz_tractogram_seeds_3d.py rename to src/scilpy/cli/scil_viz_tractogram_seeds_3d.py diff --git a/scripts/scil_viz_volume_histogram.py b/src/scilpy/cli/scil_viz_volume_histogram.py similarity index 100% rename from scripts/scil_viz_volume_histogram.py rename to src/scilpy/cli/scil_viz_volume_histogram.py diff --git a/scripts/scil_viz_volume_scatterplot.py b/src/scilpy/cli/scil_viz_volume_scatterplot.py similarity index 100% rename from scripts/scil_viz_volume_scatterplot.py rename to src/scilpy/cli/scil_viz_volume_scatterplot.py diff --git a/scripts/scil_viz_volume_screenshot.py b/src/scilpy/cli/scil_viz_volume_screenshot.py similarity index 100% rename from scripts/scil_viz_volume_screenshot.py rename to src/scilpy/cli/scil_viz_volume_screenshot.py diff --git a/scripts/scil_viz_volume_screenshot_mosaic.py b/src/scilpy/cli/scil_viz_volume_screenshot_mosaic.py similarity index 100% rename from scripts/scil_viz_volume_screenshot_mosaic.py rename to src/scilpy/cli/scil_viz_volume_screenshot_mosaic.py diff --git a/scripts/scil_volume_apply_transform.py b/src/scilpy/cli/scil_volume_apply_transform.py similarity index 100% rename from scripts/scil_volume_apply_transform.py rename to src/scilpy/cli/scil_volume_apply_transform.py diff --git a/scripts/scil_volume_b0_synthesis.py b/src/scilpy/cli/scil_volume_b0_synthesis.py similarity index 100% rename from scripts/scil_volume_b0_synthesis.py rename to src/scilpy/cli/scil_volume_b0_synthesis.py diff --git a/scripts/scil_volume_count_non_zero_voxels.py b/src/scilpy/cli/scil_volume_count_non_zero_voxels.py similarity index 100% rename from scripts/scil_volume_count_non_zero_voxels.py rename to src/scilpy/cli/scil_volume_count_non_zero_voxels.py diff --git a/scripts/scil_volume_crop.py b/src/scilpy/cli/scil_volume_crop.py similarity index 100% rename from scripts/scil_volume_crop.py rename to src/scilpy/cli/scil_volume_crop.py diff --git a/scripts/scil_volume_distance_map.py b/src/scilpy/cli/scil_volume_distance_map.py similarity index 100% rename from scripts/scil_volume_distance_map.py rename to src/scilpy/cli/scil_volume_distance_map.py diff --git a/scripts/scil_volume_flip.py b/src/scilpy/cli/scil_volume_flip.py similarity index 100% rename from scripts/scil_volume_flip.py rename to src/scilpy/cli/scil_volume_flip.py diff --git a/scripts/scil_volume_math.py b/src/scilpy/cli/scil_volume_math.py similarity index 100% rename from scripts/scil_volume_math.py rename to src/scilpy/cli/scil_volume_math.py diff --git a/scripts/scil_volume_pairwise_comparison.py b/src/scilpy/cli/scil_volume_pairwise_comparison.py similarity index 100% rename from scripts/scil_volume_pairwise_comparison.py rename to src/scilpy/cli/scil_volume_pairwise_comparison.py diff --git a/scripts/scil_volume_remove_outliers_ransac.py b/src/scilpy/cli/scil_volume_remove_outliers_ransac.py similarity index 100% rename from scripts/scil_volume_remove_outliers_ransac.py rename to src/scilpy/cli/scil_volume_remove_outliers_ransac.py diff --git a/scripts/scil_volume_resample.py b/src/scilpy/cli/scil_volume_resample.py similarity index 100% rename from scripts/scil_volume_resample.py rename to src/scilpy/cli/scil_volume_resample.py diff --git a/scripts/scil_volume_reshape.py b/src/scilpy/cli/scil_volume_reshape.py similarity index 100% rename from scripts/scil_volume_reshape.py rename to src/scilpy/cli/scil_volume_reshape.py diff --git a/scripts/scil_volume_reslice_to_reference.py b/src/scilpy/cli/scil_volume_reslice_to_reference.py similarity index 100% rename from scripts/scil_volume_reslice_to_reference.py rename to src/scilpy/cli/scil_volume_reslice_to_reference.py diff --git a/scripts/scil_volume_stats_in_ROI.py b/src/scilpy/cli/scil_volume_stats_in_ROI.py similarity index 100% rename from scripts/scil_volume_stats_in_ROI.py rename to src/scilpy/cli/scil_volume_stats_in_ROI.py diff --git a/scripts/scil_volume_stats_in_labels.py b/src/scilpy/cli/scil_volume_stats_in_labels.py similarity index 100% rename from scripts/scil_volume_stats_in_labels.py rename to src/scilpy/cli/scil_volume_stats_in_labels.py diff --git a/scilpy/denoise/__init__.py b/src/scilpy/cli/tests/__init__.py similarity index 100% rename from scilpy/denoise/__init__.py rename to src/scilpy/cli/tests/__init__.py diff --git a/scripts/tests/test_NODDI_maps.py b/src/scilpy/cli/tests/test_NODDI_maps.py similarity index 92% rename from scripts/tests/test_NODDI_maps.py rename to src/scilpy/cli/tests/test_NODDI_maps.py index ed7e66b9f..c03eda4e8 100644 --- a/scripts/tests/test_NODDI_maps.py +++ b/src/scilpy/cli/tests/test_NODDI_maps.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_NODDI_maps.py', '--help') + ret = script_runner.run('scil_NODDI_maps', '--help') assert ret.success @@ -28,7 +28,7 @@ def test_execution_commit_amico(script_runner, monkeypatch): 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_NODDI_maps.py', in_dwi, + ret = script_runner.run('scil_NODDI_maps', in_dwi, in_bval, in_bvec, '--mask', mask, '--out_dir', 'noddi', '--tol', '30', '--para_diff', '0.0017', '--iso_diff', '0.003', @@ -45,7 +45,7 @@ def test_single_shell_fail(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_NODDI_maps.py', in_dwi, + ret = script_runner.run('scil_NODDI_maps', in_dwi, in_bval, in_bvec, '--out_dir', 'noddi', '--tol', '30', '--para_diff', '0.0017', '--iso_diff', '0.003', diff --git a/scripts/tests/test_NODDI_priors.py b/src/scilpy/cli/tests/test_NODDI_priors.py similarity index 89% rename from scripts/tests/test_NODDI_priors.py rename to src/scilpy/cli/tests/test_NODDI_priors.py index 11bfd29d4..bb4b10a9f 100644 --- a/scripts/tests/test_NODDI_priors.py +++ b/src/scilpy/cli/tests/test_NODDI_priors.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_NODDI_priors.py', '--help') + ret = script_runner.run('scil_NODDI_priors', '--help') assert ret.success @@ -27,7 +27,7 @@ def test_execution_commit_amico(script_runner, monkeypatch): 'md.nii.gz') in_rd = os.path.join(SCILPY_HOME, 'processing', 'rd.nii.gz') - ret = script_runner.run('scil_NODDI_priors.py', in_fa, in_ad, in_rd, in_md, + ret = script_runner.run('scil_NODDI_priors', in_fa, in_ad, in_rd, in_md, '--out_txt_1fiber_para', '1fiber_para.txt', '--out_txt_1fiber_perp', '1fiber_perp.txt', '--out_mask_1fiber', '1fiber.nii.gz', diff --git a/scripts/tests/test_aodf_metrics.py b/src/scilpy/cli/tests/test_aodf_metrics.py similarity index 86% rename from scripts/tests/test_aodf_metrics.py rename to src/scilpy/cli/tests/test_aodf_metrics.py index a242e060b..05831c9c7 100644 --- a/scripts/tests/test_aodf_metrics.py +++ b/src/scilpy/cli/tests/test_aodf_metrics.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_aodf_metrics.py', '--help') + ret = script_runner.run('scil_aodf_metrics', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution(script_runner, monkeypatch): f"{test_data_root}/fodf_descoteaux07_sub_unified_asym.nii.gz") # Using a low resolution sphere for peak extraction reduces process time - ret = script_runner.run('scil_aodf_metrics.py', in_fodf, + ret = script_runner.run('scil_aodf_metrics', in_fodf, '--sphere', 'repulsion100', '--processes', '1') assert ret.success @@ -34,7 +34,7 @@ def test_assert_not_all(script_runner, monkeypatch): in_fodf = os.path.join( f"{test_data_root}/fodf_descoteaux07_sub_unified_asym.nii.gz") - ret = script_runner.run('scil_aodf_metrics.py', in_fodf, + ret = script_runner.run('scil_aodf_metrics', in_fodf, '--not_all', '--processes', '1') assert not ret.success @@ -44,7 +44,7 @@ def test_execution_not_all(script_runner, monkeypatch): in_fodf = os.path.join( f"{test_data_root}/fodf_descoteaux07_sub_unified_asym.nii.gz") - ret = script_runner.run('scil_aodf_metrics.py', in_fodf, + ret = script_runner.run('scil_aodf_metrics', in_fodf, '--not_all', '--asi_map', 'asi_map.nii.gz', '-f', '--processes', '1') @@ -57,7 +57,7 @@ def test_assert_symmetric_input(script_runner, monkeypatch): f"{test_data_root}/fodf_descoteaux07_sub.nii.gz") # Using a low resolution sphere for peak extraction reduces process time - ret = script_runner.run('scil_aodf_metrics.py', in_fodf, + ret = script_runner.run('scil_aodf_metrics', in_fodf, '--sphere', 'repulsion100', '--processes', '1') assert not ret.success @@ -70,7 +70,7 @@ def test_execution_symmetric_input(script_runner, monkeypatch): # Using a low resolution sphere for peak extraction reduces process time # Using multiprocessing to test this option. - ret = script_runner.run('scil_aodf_metrics.py', in_fodf, + ret = script_runner.run('scil_aodf_metrics', in_fodf, '--sphere', 'repulsion100', '--not_all', '--nufid', 'nufid.nii.gz', '--processes', '4') diff --git a/scripts/tests/test_bids_validate.py b/src/scilpy/cli/tests/test_bids_validate.py similarity index 98% rename from scripts/tests/test_bids_validate.py rename to src/scilpy/cli/tests/test_bids_validate.py index 09e9765c5..4d371f090 100644 --- a/scripts/tests/test_bids_validate.py +++ b/src/scilpy/cli/tests/test_bids_validate.py @@ -327,7 +327,7 @@ def compare_jsons(json_output, test_dir): def test_help_option(script_runner): - ret = script_runner.run('scil_bids_validate.py', '--help') + ret = script_runner.run('scil_bids_validate', '--help') assert ret.success @@ -346,7 +346,7 @@ def test_bids_epi(tmpdir, script_runner, dwi_is_complex, json_output): complex_dwi=dwi_is_complex) ret = script_runner.run( - 'scil_bids_validate.py', + 'scil_bids_validate', test_dir, os.path.join(test_dir, json_output), '-f', '-v') @@ -373,7 +373,7 @@ def test_bids_sbref( complex_sbref=sbref_is_complex) ret = script_runner.run( - 'scil_bids_validate.py', + 'scil_bids_validate', test_dir, os.path.join(test_dir, json_output), '-f', '-v') @@ -399,7 +399,7 @@ def test_bids_rev_dwi( complex_rev_dwi=rev_is_complex) ret = script_runner.run( - 'scil_bids_validate.py', + 'scil_bids_validate', test_dir, os.path.join(test_dir, json_output), '-f', '-v') @@ -427,7 +427,7 @@ def test_bids_rev_dwi_sbref( complex_rev_dwi=rev_is_complex) ret = script_runner.run( - 'scil_bids_validate.py', + 'scil_bids_validate', test_dir, os.path.join(test_dir, json_output), '-f', '-v') diff --git a/scripts/tests/test_bingham_metrics.py b/src/scilpy/cli/tests/test_bingham_metrics.py similarity index 88% rename from scripts/tests/test_bingham_metrics.py rename to src/scilpy/cli/tests/test_bingham_metrics.py index d46b533d9..44018f205 100644 --- a/scripts/tests/test_bingham_metrics.py +++ b/src/scilpy/cli/tests/test_bingham_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bingham_metrics.py', + ret = script_runner.run('scil_bingham_metrics', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_processing(script_runner, monkeypatch): in_bingham = os.path.join(SCILPY_HOME, 'processing', 'fodf_bingham.nii.gz') - ret = script_runner.run('scil_bingham_metrics.py', + ret = script_runner.run('scil_bingham_metrics', in_bingham, '--nbr_integration_steps', '10', '--processes', '1') @@ -37,7 +37,7 @@ def test_execution_processing_mask(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') - ret = script_runner.run('scil_bingham_metrics.py', + ret = script_runner.run('scil_bingham_metrics', in_bingham, '--nbr_integration_steps', '10', '--processes', '1', '--mask', in_mask, '-f') @@ -49,7 +49,7 @@ def test_execution_processing_not_all(script_runner, monkeypatch): in_bingham = os.path.join(SCILPY_HOME, 'processing', 'fodf_bingham.nii.gz') - ret = script_runner.run('scil_bingham_metrics.py', + ret = script_runner.run('scil_bingham_metrics', in_bingham, '--nbr_integration_steps', '10', '--processes', '1', '--not_all', '--out_fs', 'fs.nii.gz', '-f') diff --git a/scripts/tests/test_btensor_metrics.py b/src/scilpy/cli/tests/test_btensor_metrics.py similarity index 92% rename from scripts/tests/test_btensor_metrics.py rename to src/scilpy/cli/tests/test_btensor_metrics.py index e79e1ce0b..8d630e73e 100644 --- a/scripts/tests/test_btensor_metrics.py +++ b/src/scilpy/cli/tests/test_btensor_metrics.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_btensor_metrics.py', '--help') + ret = script_runner.run('scil_btensor_metrics', '--help') assert ret.success @@ -33,7 +33,7 @@ def test_nb_btensors_check(script_runner, monkeypatch): fa = os.path.join(SCILPY_HOME, 'btensor', 'fa.nii.gz') - ret = script_runner.run('scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run('scil_btensor_metrics', '--in_dwis', in_dwi_lin, '--in_bvals', in_bval_lin, '--in_bvecs', in_bvec_lin, '--in_bdeltas', '1', '--fa', fa, '--do_weight_bvals', @@ -41,7 +41,7 @@ def test_nb_btensors_check(script_runner, monkeypatch): '--processes', '1', '-f') assert (not ret.success) - ret = script_runner.run('scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run('scil_btensor_metrics', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', '1', @@ -68,7 +68,7 @@ def test_inputs_check(script_runner, monkeypatch): fa = os.path.join(SCILPY_HOME, 'btensor', 'fa.nii.gz') - ret = script_runner.run('scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run('scil_btensor_metrics', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, '--in_bvecs', in_bvec_lin, '--in_bdeltas', '1', '--fa', fa, '--do_weight_bvals', @@ -76,7 +76,7 @@ def test_inputs_check(script_runner, monkeypatch): '--processes', '1', '-f') assert (not ret.success) - ret = script_runner.run('scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run('scil_btensor_metrics', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', @@ -85,7 +85,7 @@ def test_inputs_check(script_runner, monkeypatch): '--processes', '1', '-f') assert (not ret.success) - ret = script_runner.run('scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run('scil_btensor_metrics', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', @@ -118,7 +118,7 @@ def test_execution_processing(script_runner, monkeypatch): fa = os.path.join(SCILPY_HOME, 'btensor_testdata', 'fa.nii.gz') - ret = script_runner.run('scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run('scil_btensor_metrics', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, '--in_bvecs', in_bvec_lin, diff --git a/scripts/tests/test_bundle_alter_to_target_dice.py b/src/scilpy/cli/tests/test_bundle_alter_to_target_dice.py similarity index 86% rename from scripts/tests/test_bundle_alter_to_target_dice.py rename to src/scilpy/cli/tests/test_bundle_alter_to_target_dice.py index c2e476787..ac543de1a 100644 --- a/scripts/tests/test_bundle_alter_to_target_dice.py +++ b/src/scilpy/cli/tests/test_bundle_alter_to_target_dice.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_alter_to_target_dice.py', '--help') + ret = script_runner.run('scil_bundle_alter_to_target_dice', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_subsample(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_alter_to_target_dice.py', + ret = script_runner.run('scil_bundle_alter_to_target_dice', in_bundle, 'out_tractogram_subsample.trk', '--min_dice', '0.75', '--epsilon', '0.01', '--subsample', '--shuffle', '-v') @@ -32,7 +32,7 @@ def test_execution_trim(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_alter_to_target_dice.py', + ret = script_runner.run('scil_bundle_alter_to_target_dice', in_bundle, 'out_tractogram_trim.trk', '--min_dice', '0.75', '--epsilon', '0.01', '--trim', '-v') @@ -43,7 +43,7 @@ def test_execution_cut(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_alter_to_target_dice.py', + ret = script_runner.run('scil_bundle_alter_to_target_dice', in_bundle, 'out_tractogram_cut.trk', '--min_dice', '0.75', '--epsilon', '0.01', '--cut', '-v', 'DEBUG') @@ -54,7 +54,7 @@ def test_execution_replace(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_alter_to_target_dice.py', + ret = script_runner.run('scil_bundle_alter_to_target_dice', in_bundle, 'out_tractogram_replace.trk', '--min_dice', '0.75', '--epsilon', '0.01', '--replace', '-v') @@ -65,7 +65,7 @@ def test_execution_transform(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_alter_to_target_dice.py', + ret = script_runner.run('scil_bundle_alter_to_target_dice', in_bundle, 'out_tractogram_transform.trk', '--min_dice', '0.75', '--epsilon', '0.01', '--transform', '--save_transform', diff --git a/scripts/tests/test_json_harmonize_entries.py b/src/scilpy/cli/tests/test_bundle_clean_qbx_clusters.py similarity index 64% rename from scripts/tests/test_json_harmonize_entries.py rename to src/scilpy/cli/tests/test_bundle_clean_qbx_clusters.py index 42be74118..be486b30e 100644 --- a/scripts/tests/test_json_harmonize_entries.py +++ b/src/scilpy/cli/tests/test_bundle_clean_qbx_clusters.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- + def test_help_option(script_runner): - ret = script_runner.run('scil_json_harmonize_entries.py', '--help') + ret = script_runner.run('scil_bundle_clean_qbx_clusters', '--help') assert ret.success diff --git a/scripts/tests/test_bundle_compute_centroid.py b/src/scilpy/cli/tests/test_bundle_compute_centroid.py similarity index 83% rename from scripts/tests/test_bundle_compute_centroid.py rename to src/scilpy/cli/tests/test_bundle_compute_centroid.py index 227354517..17e21328f 100644 --- a/scripts/tests/test_bundle_compute_centroid.py +++ b/src/scilpy/cli/tests/test_bundle_compute_centroid.py @@ -13,13 +13,13 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_compute_centroid.py', '--help') + ret = script_runner.run('scil_bundle_compute_centroid', '--help') assert ret.success def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_compute_centroid.py', + ret = script_runner.run('scil_bundle_compute_centroid', in_bundle, 'IFGWM_uni_c.trk') assert ret.success diff --git a/scripts/tests/test_bundle_compute_endpoints_map.py b/src/scilpy/cli/tests/test_bundle_compute_endpoints_map.py similarity index 81% rename from scripts/tests/test_bundle_compute_endpoints_map.py rename to src/scilpy/cli/tests/test_bundle_compute_endpoints_map.py index 041a9f436..4849dd753 100644 --- a/scripts/tests/test_bundle_compute_endpoints_map.py +++ b/src/scilpy/cli/tests/test_bundle_compute_endpoints_map.py @@ -13,14 +13,14 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_compute_endpoints_map.py', '--help') + ret = script_runner.run('scil_bundle_compute_endpoints_map', '--help') assert ret.success def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_compute_endpoints_map.py', in_bundle, + ret = script_runner.run('scil_bundle_compute_endpoints_map', in_bundle, 'head.nii.gz', 'tail.nii.gz', '--binary', '-f') assert ret.success @@ -29,7 +29,7 @@ def test_execution_tractometry(script_runner, monkeypatch): def test_execution_tractometry_mm_distance5(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run('scil_bundle_compute_endpoints_map.py', in_bundle, + ret = script_runner.run('scil_bundle_compute_endpoints_map', in_bundle, 'head.nii.gz', 'tail.nii.gz', '--binary', '--distance', '5', '--unit', 'mm', '-f') diff --git a/scripts/tests/test_bundle_diameter.py b/src/scilpy/cli/tests/test_bundle_diameter.py similarity index 84% rename from scripts/tests/test_bundle_diameter.py rename to src/scilpy/cli/tests/test_bundle_diameter.py index 172a09270..c099abcbb 100644 --- a/scripts/tests/test_bundle_diameter.py +++ b/src/scilpy/cli/tests/test_bundle_diameter.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_diameter.py', '--help') + ret = script_runner.run('scil_bundle_diameter', '--help') assert ret.success @@ -22,6 +22,6 @@ def test_execution_tractometry(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') in_labels = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run('scil_bundle_diameter.py', in_bundle, in_labels, + ret = script_runner.run('scil_bundle_diameter', in_bundle, in_labels, '--wireframe', '--fitting_func', 'lin_up') assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_explore_bundleseg.py b/src/scilpy/cli/tests/test_bundle_explore_bundleseg.py new file mode 100644 index 000000000..60277863b --- /dev/null +++ b/src/scilpy/cli/tests/test_bundle_explore_bundleseg.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + + +def test_help_option(script_runner): + ret = script_runner.run('scil_viz_bundle_screenshot_mni', '--help') + assert ret.success diff --git a/scripts/tests/test_bundle_filter_by_occurence.py b/src/scilpy/cli/tests/test_bundle_filter_by_occurence.py similarity index 85% rename from scripts/tests/test_bundle_filter_by_occurence.py rename to src/scilpy/cli/tests/test_bundle_filter_by_occurence.py index 89386a49c..51bc81f30 100644 --- a/scripts/tests/test_bundle_filter_by_occurence.py +++ b/src/scilpy/cli/tests/test_bundle_filter_by_occurence.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_filter_by_occurence.py', '--help') + ret = script_runner.run('scil_bundle_filter_by_occurence', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_execution(script_runner, monkeypatch): 'bundle_4_filtered_no_loops.trk') prefix = 'test_voting_' - ret = script_runner.run('scil_bundle_filter_by_occurence.py', in_1, in_2, + ret = script_runner.run('scil_bundle_filter_by_occurence', in_1, in_2, in_3, prefix, '--ratio_streamlines', '0.5', '--ratio_voxels', '0.5') assert ret.success diff --git a/scripts/tests/test_bundle_fixel_analysis.py b/src/scilpy/cli/tests/test_bundle_fixel_analysis.py similarity index 92% rename from scripts/tests/test_bundle_fixel_analysis.py rename to src/scilpy/cli/tests/test_bundle_fixel_analysis.py index 21101de10..12b944fc5 100644 --- a/scripts/tests/test_bundle_fixel_analysis.py +++ b/src/scilpy/cli/tests/test_bundle_fixel_analysis.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_fixel_analysis.py', '--help') + ret = script_runner.run('scil_bundle_fixel_analysis', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_default_parameters(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'commit_amico', 'tracking.trk') # Using multiprocessing in this test, single in following tests. - ret = script_runner.run('scil_bundle_fixel_analysis.py', in_peaks, + ret = script_runner.run('scil_bundle_fixel_analysis', in_peaks, '--in_bundles', in_bundle, '--processes', '4', '-f') assert ret.success @@ -33,7 +33,7 @@ def test_all_parameters(script_runner, monkeypatch): in_peaks = os.path.join(SCILPY_HOME, 'commit_amico', 'peaks.nii.gz') in_bundle = os.path.join(SCILPY_HOME, 'commit_amico', 'tracking.trk') - ret = script_runner.run('scil_bundle_fixel_analysis.py', in_peaks, + ret = script_runner.run('scil_bundle_fixel_analysis', in_peaks, '--in_bundles', in_bundle, '--in_bundles_names', 'test', '--abs_thr', '5', @@ -50,7 +50,7 @@ def test_multiple_norm(script_runner, monkeypatch): in_peaks = os.path.join(SCILPY_HOME, 'commit_amico', 'peaks.nii.gz') in_bundle = os.path.join(SCILPY_HOME, 'commit_amico', 'tracking.trk') - ret = script_runner.run('scil_bundle_fixel_analysis.py', in_peaks, + ret = script_runner.run('scil_bundle_fixel_analysis', in_peaks, '--in_bundles', in_bundle, '--in_bundles_names', 'test', '--abs_thr', '5', diff --git a/scripts/tests/test_bundle_generate_priors.py b/src/scilpy/cli/tests/test_bundle_generate_priors.py similarity index 87% rename from scripts/tests/test_bundle_generate_priors.py rename to src/scilpy/cli/tests/test_bundle_generate_priors.py index 426bef83d..8ea7606ac 100644 --- a/scripts/tests/test_bundle_generate_priors.py +++ b/src/scilpy/cli/tests/test_bundle_generate_priors.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_generate_priors.py', '--help') + ret = script_runner.run('scil_bundle_generate_priors', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution_bst(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'bst', 'rpt_m_lin.trk') in_fodf = os.path.join(SCILPY_HOME, 'bst', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') - ret = script_runner.run('scil_bundle_generate_priors.py', + ret = script_runner.run('scil_bundle_generate_priors', in_bundle, in_fodf, in_mask, '--todi_sigma', '1', '--out_prefix', 'rpt_m', '--sh_basis', 'descoteaux07') diff --git a/scripts/tests/test_bundle_label_map.py b/src/scilpy/cli/tests/test_bundle_label_map.py similarity index 89% rename from scripts/tests/test_bundle_label_map.py rename to src/scilpy/cli/tests/test_bundle_label_map.py index 797ec6f39..c51d01030 100644 --- a/scripts/tests/test_bundle_label_map.py +++ b/src/scilpy/cli/tests/test_bundle_label_map.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_label_map.py', '--help') + ret = script_runner.run('scil_bundle_label_map', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_tractometry_euclidian(script_runner, monkeypatch): 'IFGWM.trk') in_centroid = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni_c_10.trk') - ret = script_runner.run('scil_bundle_label_map.py', + ret = script_runner.run('scil_bundle_label_map', in_bundle, in_centroid, 'results_euc/', '--colormap', 'viridis') @@ -37,7 +37,7 @@ def test_execution_tractometry_hyperplane(script_runner, monkeypatch): 'IFGWM.trk') in_centroid = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni_c_10.trk') - ret = script_runner.run('scil_bundle_label_map.py', + ret = script_runner.run('scil_bundle_label_map', in_bundle, in_centroid, 'results_man/', '--colormap', 'viridis', diff --git a/scripts/tests/test_bundle_mean_fixel_afd.py b/src/scilpy/cli/tests/test_bundle_mean_fixel_afd.py similarity index 85% rename from scripts/tests/test_bundle_mean_fixel_afd.py rename to src/scilpy/cli/tests/test_bundle_mean_fixel_afd.py index b9877ff3e..aaec3d600 100644 --- a/scripts/tests/test_bundle_mean_fixel_afd.py +++ b/src/scilpy/cli/tests/test_bundle_mean_fixel_afd.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_mean_fixel_afd.py', '--help') + ret = script_runner.run('scil_bundle_mean_fixel_afd', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution_processing(script_runner, monkeypatch): in_tracking = os.path.join(SCILPY_HOME, 'processing', 'tracking.trk') in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf_descoteaux07.nii.gz') - ret = script_runner.run('scil_bundle_mean_fixel_afd.py', in_tracking, + ret = script_runner.run('scil_bundle_mean_fixel_afd', in_tracking, in_fodf, 'afd_test.nii.gz', '--sh_basis', 'descoteaux07', '--length_weighting') assert ret.success diff --git a/scripts/tests/test_bundle_mean_fixel_afd_from_hdf5.py b/src/scilpy/cli/tests/test_bundle_mean_fixel_afd_from_hdf5.py similarity index 98% rename from scripts/tests/test_bundle_mean_fixel_afd_from_hdf5.py rename to src/scilpy/cli/tests/test_bundle_mean_fixel_afd_from_hdf5.py index 000699955..80783964a 100644 --- a/scripts/tests/test_bundle_mean_fixel_afd_from_hdf5.py +++ b/src/scilpy/cli/tests/test_bundle_mean_fixel_afd_from_hdf5.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_mean_fixel_afd_from_hdf5.py', + ret = script_runner.run('scil_bundle_mean_fixel_afd_from_hdf5', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution_connectivity(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_h5 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose.h5') in_fodf = os.path.join(SCILPY_HOME, 'connectivity', 'fodf.nii.gz') - ret = script_runner.run('scil_bundle_mean_fixel_afd_from_hdf5.py', + ret = script_runner.run('scil_bundle_mean_fixel_afd_from_hdf5', in_h5, in_fodf, 'decompose_afd.nii.gz', '--length_weighting', '--sh_basis', 'descoteaux07', '--processes', '1') diff --git a/scripts/tests/test_bundle_mean_fixel_bingham_metric.py b/src/scilpy/cli/tests/test_bundle_mean_fixel_bingham_metric.py similarity index 88% rename from scripts/tests/test_bundle_mean_fixel_bingham_metric.py rename to src/scilpy/cli/tests/test_bundle_mean_fixel_bingham_metric.py index 929cef9c2..ba4f29d87 100644 --- a/scripts/tests/test_bundle_mean_fixel_bingham_metric.py +++ b/src/scilpy/cli/tests/test_bundle_mean_fixel_bingham_metric.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run( - 'scil_bundle_mean_fixel_bingham_metric.py', '--help') + 'scil_bundle_mean_fixel_bingham_metric', '--help') assert ret.success @@ -26,7 +26,7 @@ def test_execution_processing(script_runner, monkeypatch): in_bundles = os.path.join(SCILPY_HOME, 'processing', 'tracking.trk') ret = script_runner.run( - 'scil_bundle_mean_fixel_bingham_metric.py', + 'scil_bundle_mean_fixel_bingham_metric', in_bundles, in_bingham, in_metric, 'fixel_mean_fd.nii.gz', '--length_weighting') diff --git a/scripts/tests/test_bundle_mean_fixel_mrds_metric.py b/src/scilpy/cli/tests/test_bundle_mean_fixel_mrds_metric.py similarity index 70% rename from scripts/tests/test_bundle_mean_fixel_mrds_metric.py rename to src/scilpy/cli/tests/test_bundle_mean_fixel_mrds_metric.py index efe916c2e..efc91c70d 100644 --- a/scripts/tests/test_bundle_mean_fixel_mrds_metric.py +++ b/src/scilpy/cli/tests/test_bundle_mean_fixel_mrds_metric.py @@ -3,6 +3,6 @@ def test_help_option(script_runner): ret = script_runner.run( - 'scil_bundle_mean_fixel_mrds_metric.py', '--help') + 'scil_bundle_mean_fixel_mrds_metric', '--help') assert ret.success diff --git a/scripts/tests/test_bundle_mean_std.py b/src/scilpy/cli/tests/test_bundle_mean_std.py similarity index 85% rename from scripts/tests/test_bundle_mean_std.py rename to src/scilpy/cli/tests/test_bundle_mean_std.py index bbd484cd0..cbcef4f92 100644 --- a/scripts/tests/test_bundle_mean_std.py +++ b/src/scilpy/cli/tests/test_bundle_mean_std.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_mean_std.py', '--help') + ret = script_runner.run('scil_bundle_mean_std', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_tractometry_whole(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') in_ref = os.path.join(SCILPY_HOME, 'tractometry', 'mni_masked.nii.gz') - ret = script_runner.run('scil_bundle_mean_std.py', in_bundle, in_ref, + ret = script_runner.run('scil_bundle_mean_std', in_bundle, in_ref, '--density_weighting', '--include_dps') assert ret.success @@ -32,7 +32,7 @@ def test_execution_tractometry_per_point(script_runner, monkeypatch): in_label = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') in_ref = os.path.join(SCILPY_HOME, 'tractometry', 'mni_masked.nii.gz') - ret = script_runner.run('scil_bundle_mean_std.py', in_bundle, in_ref, + ret = script_runner.run('scil_bundle_mean_std', in_bundle, in_ref, '--per_point', in_label, '--density_weighting') assert ret.success diff --git a/scripts/tests/test_bundle_pairwise_comparison.py b/src/scilpy/cli/tests/test_bundle_pairwise_comparison.py similarity index 91% rename from scripts/tests/test_bundle_pairwise_comparison.py rename to src/scilpy/cli/tests/test_bundle_pairwise_comparison.py index 131980840..44606ca57 100644 --- a/scripts/tests/test_bundle_pairwise_comparison.py +++ b/src/scilpy/cli/tests/test_bundle_pairwise_comparison.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run( - 'scil_bundle_pairwise_comparison.py', '--help') + 'scil_bundle_pairwise_comparison', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_execution_bundles(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') ret = script_runner.run( - 'scil_bundle_pairwise_comparison.py', + 'scil_bundle_pairwise_comparison', in_1, in_2, 'AF_L_similarity.json', '--streamline_dice', '--reference', in_ref, '--processes', '1') @@ -39,7 +39,7 @@ def test_single(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') ret = script_runner.run( - 'scil_bundle_pairwise_comparison.py', + 'scil_bundle_pairwise_comparison', in_2, 'AF_L_similarity_single.json', '--streamline_dice', '--reference', in_ref, '--single_compare', in_1, @@ -54,7 +54,7 @@ def test_no_overlap(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') ret = script_runner.run( - 'scil_bundle_pairwise_comparison.py', in_1, + 'scil_bundle_pairwise_comparison', in_1, in_2, 'AF_L_similarity_no_overlap.json', '--streamline_dice', '--reference', in_ref, '--ignore_zeros_in_BA', @@ -69,7 +69,7 @@ def test_ratio(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') ret = script_runner.run( - 'scil_bundle_pairwise_comparison.py', + 'scil_bundle_pairwise_comparison', in_2, 'AF_L_similarity_ratio.json', '--streamline_dice', '--reference', in_ref, '--single_compare', in_1, @@ -88,7 +88,7 @@ def test_ratio_fail(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') ret = script_runner.run( - 'scil_bundle_pairwise_comparison.py', + 'scil_bundle_pairwise_comparison', in_1, in_2, 'AF_L_similarity_fail.json', '--streamline_dice', '--reference', in_ref, '--processes', '1', diff --git a/scripts/tests/test_bundle_reject_outliers.py b/src/scilpy/cli/tests/test_bundle_reject_outliers.py similarity index 85% rename from scripts/tests/test_bundle_reject_outliers.py rename to src/scilpy/cli/tests/test_bundle_reject_outliers.py index 47f3f4d51..b44970941 100644 --- a/scripts/tests/test_bundle_reject_outliers.py +++ b/src/scilpy/cli/tests/test_bundle_reject_outliers.py @@ -13,14 +13,14 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_reject_outliers.py', '--help') + ret = script_runner.run('scil_bundle_reject_outliers', '--help') assert ret.success def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') - ret = script_runner.run('scil_bundle_reject_outliers.py', in_bundle, + ret = script_runner.run('scil_bundle_reject_outliers', in_bundle, 'inliers.trk', '--alpha', '0.6', '--remaining_bundle', 'outliers.trk', '--display_counts', '--indent', '4', diff --git a/scripts/tests/test_bundle_score_many_bundles_one_tractogram.py b/src/scilpy/cli/tests/test_bundle_score_many_bundles_one_tractogram.py similarity index 98% rename from scripts/tests/test_bundle_score_many_bundles_one_tractogram.py rename to src/scilpy/cli/tests/test_bundle_score_many_bundles_one_tractogram.py index 82cd62c37..2175d7e75 100644 --- a/scripts/tests/test_bundle_score_many_bundles_one_tractogram.py +++ b/src/scilpy/cli/tests/test_bundle_score_many_bundles_one_tractogram.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_score_many_bundles_one_tractogram.py', + ret = script_runner.run('scil_bundle_score_many_bundles_one_tractogram', '--help') assert ret.success @@ -42,7 +42,7 @@ def test_score_bundles(script_runner, monkeypatch): with open(os.path.join("config_file.json"), "w") as f: json.dump(json_contents, f) - ret = script_runner.run('scil_bundle_score_many_bundles_one_tractogram.py', + ret = script_runner.run('scil_bundle_score_many_bundles_one_tractogram', "config_file.json", "./", '--no_bbox_check') assert ret.success diff --git a/scripts/tests/test_bundle_score_same_bundle_many_segmentations.py b/src/scilpy/cli/tests/test_bundle_score_same_bundle_many_segmentations.py similarity index 89% rename from scripts/tests/test_bundle_score_same_bundle_many_segmentations.py rename to src/scilpy/cli/tests/test_bundle_score_same_bundle_many_segmentations.py index 784a7c414..8e55aeabc 100644 --- a/scripts/tests/test_bundle_score_same_bundle_many_segmentations.py +++ b/src/scilpy/cli/tests/test_bundle_score_same_bundle_many_segmentations.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run( - 'scil_bundle_score_same_bundle_many_segmentations.py', '--help') + 'scil_bundle_score_same_bundle_many_segmentations', '--help') assert ret.success @@ -28,7 +28,7 @@ def test_execution_bundles(script_runner, monkeypatch): in_model = os.path.join(SCILPY_HOME, 'bundles', 'fibercup_atlas', 'subj_1', 'bundle_0.trk') ret = script_runner.run( - 'scil_bundle_score_same_bundle_many_segmentations.py', + 'scil_bundle_score_same_bundle_many_segmentations', in_1, in_2, 'AF_L_binary.json', '--streamlines_measures', in_model, in_tractogram, '--processes', '1', '--reference', in_ref) assert ret.success diff --git a/scripts/tests/test_bundle_shape_measures.py b/src/scilpy/cli/tests/test_bundle_shape_measures.py similarity index 87% rename from scripts/tests/test_bundle_shape_measures.py rename to src/scilpy/cli/tests/test_bundle_shape_measures.py index 10e29331d..27f9584c6 100644 --- a/scripts/tests/test_bundle_shape_measures.py +++ b/src/scilpy/cli/tests/test_bundle_shape_measures.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_shape_measures.py', '--help') + ret = script_runner.run('scil_bundle_shape_measures', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_bundles(script_runner, monkeypatch): in_2 = os.path.join(SCILPY_HOME, 'bundles', 'voting_results', 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') - ret = script_runner.run('scil_bundle_shape_measures.py', + ret = script_runner.run('scil_bundle_shape_measures', in_1, in_2, '--out_json', 'AF_L_measures.json', '--reference', in_ref, '--processes', '1') assert ret.success diff --git a/scripts/tests/test_bundle_uniformize_endpoints.py b/src/scilpy/cli/tests/test_bundle_uniformize_endpoints.py similarity index 84% rename from scripts/tests/test_bundle_uniformize_endpoints.py rename to src/scilpy/cli/tests/test_bundle_uniformize_endpoints.py index d022be7ce..f33ba0cf9 100644 --- a/scripts/tests/test_bundle_uniformize_endpoints.py +++ b/src/scilpy/cli/tests/test_bundle_uniformize_endpoints.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_uniformize_endpoints.py', + ret = script_runner.run('scil_bundle_uniformize_endpoints', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_help_option(script_runner): def test_execution_auto(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') - ret = script_runner.run('scil_bundle_uniformize_endpoints.py', + ret = script_runner.run('scil_bundle_uniformize_endpoints', in_bundle, 'IFGWM_uni.trk', '--auto') assert ret.success @@ -30,7 +30,7 @@ def test_execution_target_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') label = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run('scil_bundle_uniformize_endpoints.py', + ret = script_runner.run('scil_bundle_uniformize_endpoints', in_bundle, 'IFGWM_uni2.trk', '--target_roi', label, '3', '10') assert ret.success diff --git a/scripts/tests/test_bundle_volume_per_label.py b/src/scilpy/cli/tests/test_bundle_volume_per_label.py similarity index 85% rename from scripts/tests/test_bundle_volume_per_label.py rename to src/scilpy/cli/tests/test_bundle_volume_per_label.py index 13d836c0a..57e43bfc6 100644 --- a/scripts/tests/test_bundle_volume_per_label.py +++ b/src/scilpy/cli/tests/test_bundle_volume_per_label.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_volume_per_label.py', + ret = script_runner.run('scil_bundle_volume_per_label', '--help') assert ret.success @@ -22,6 +22,6 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_label_map = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run('scil_bundle_volume_per_label.py', + ret = script_runner.run('scil_bundle_volume_per_label', in_label_map, 'IFGWM') assert ret.success diff --git a/scripts/tests/test_connectivity_compare_populations.py b/src/scilpy/cli/tests/test_connectivity_compare_populations.py similarity index 98% rename from scripts/tests/test_connectivity_compare_populations.py rename to src/scilpy/cli/tests/test_connectivity_compare_populations.py index c66b812b0..14ace8d9f 100644 --- a/scripts/tests/test_connectivity_compare_populations.py +++ b/src/scilpy/cli/tests/test_connectivity_compare_populations.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_compare_populations.py', + ret = script_runner.run('scil_connectivity_compare_populations', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_connectivity(script_runner, monkeypatch): in_1 = os.path.join(SCILPY_HOME, 'connectivity', 'sc.npy') in_2 = os.path.join(SCILPY_HOME, 'connectivity', 'sc_norm.npy') in_mask = os.path.join(SCILPY_HOME, 'connectivity', 'mask.npy') - ret = script_runner.run('scil_connectivity_compare_populations.py', + ret = script_runner.run('scil_connectivity_compare_populations', 'pval.npy', '--in_g1', in_1, '--in_g2', in_2, '--filtering_mask', in_mask) assert ret.success diff --git a/scripts/tests/test_connectivity_compute_matrices.py b/src/scilpy/cli/tests/test_connectivity_compute_matrices.py similarity index 89% rename from scripts/tests/test_connectivity_compute_matrices.py rename to src/scilpy/cli/tests/test_connectivity_compute_matrices.py index becb1ed7d..d5a88e527 100644 --- a/scripts/tests/test_connectivity_compute_matrices.py +++ b/src/scilpy/cli/tests/test_connectivity_compute_matrices.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_compute_matrices.py', '--help') + ret = script_runner.run('scil_connectivity_compute_matrices', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_connectivity(script_runner, monkeypatch): 'endpoints_atlas.nii.gz') in_avg = os.path.join(SCILPY_HOME, 'connectivity', 'avg_density_maps/') in_afd = os.path.join(SCILPY_HOME, 'connectivity', 'afd_max.nii.gz') - ret = script_runner.run('scil_connectivity_compute_matrices.py', in_h5, + ret = script_runner.run('scil_connectivity_compute_matrices', in_h5, in_atlas, '--volume', 'vol.npy', '--streamline_count', 'sc.npy', '--length', 'len.npy', diff --git a/scripts/tests/test_connectivity_compute_pca.py b/src/scilpy/cli/tests/test_connectivity_compute_pca.py similarity index 85% rename from scripts/tests/test_connectivity_compute_pca.py rename to src/scilpy/cli/tests/test_connectivity_compute_pca.py index d0dbe381b..cf261aebf 100644 --- a/scripts/tests/test_connectivity_compute_pca.py +++ b/src/scilpy/cli/tests/test_connectivity_compute_pca.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_compute_pca.py', '--help') + ret = script_runner.run('scil_connectivity_compute_pca', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_pca(script_runner, monkeypatch): output_folder = os.path.join(SCILPY_HOME, 'stats/pca_out') ids = os.path.join(SCILPY_HOME, 'stats/pca', 'list_id.txt') ret = script_runner.run( - 'scil_connectivity_compute_pca.py', input_folder, output_folder, + 'scil_connectivity_compute_pca', input_folder, output_folder, '--metrics', 'ad', 'fa', 'md', 'rd', 'nufo', 'afd_total', 'afd_fixel', '--list_ids', ids, '-f') assert ret.success diff --git a/scripts/tests/test_connectivity_compute_simple_matrix.py b/src/scilpy/cli/tests/test_connectivity_compute_simple_matrix.py similarity index 86% rename from scripts/tests/test_connectivity_compute_simple_matrix.py rename to src/scilpy/cli/tests/test_connectivity_compute_simple_matrix.py index 33411c60e..1c7e08e2c 100644 --- a/scripts/tests/test_connectivity_compute_simple_matrix.py +++ b/src/scilpy/cli/tests/test_connectivity_compute_simple_matrix.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run( - 'scil_connectivity_compute_simple_matrix.py', '--help') + 'scil_connectivity_compute_simple_matrix', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_script(script_runner, monkeypatch): in_sft = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') ret = script_runner.run( - 'scil_connectivity_compute_simple_matrix.py', in_sft, in_labels, + 'scil_connectivity_compute_simple_matrix', in_sft, in_labels, 'out_matrix.npy', 'out_labels.txt', '--hide_labels', '10', '--percentage', '--hide_fig', '--out_fig', 'matrices.png') assert ret.success diff --git a/scripts/tests/test_connectivity_filter.py b/src/scilpy/cli/tests/test_connectivity_filter.py similarity index 86% rename from scripts/tests/test_connectivity_filter.py rename to src/scilpy/cli/tests/test_connectivity_filter.py index cb365d93b..d659ed6ed 100644 --- a/scripts/tests/test_connectivity_filter.py +++ b/src/scilpy/cli/tests/test_connectivity_filter.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_filter.py', '--help') + ret = script_runner.run('scil_connectivity_filter', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_connectivity(script_runner, monkeypatch): 'sc.npy') in_sim = os.path.join(SCILPY_HOME, 'connectivity', 'len.npy') - ret = script_runner.run('scil_connectivity_filter.py', 'mask.npy', + ret = script_runner.run('scil_connectivity_filter', 'mask.npy', '--greater_than', in_sc, '5', '1', '--greater_than', in_sim, '0', '1', '--keep_condition_count') diff --git a/scripts/tests/test_connectivity_graph_measures.py b/src/scilpy/cli/tests/test_connectivity_graph_measures.py similarity index 84% rename from scripts/tests/test_connectivity_graph_measures.py rename to src/scilpy/cli/tests/test_connectivity_graph_measures.py index faf836476..46193fac9 100644 --- a/scripts/tests/test_connectivity_graph_measures.py +++ b/src/scilpy/cli/tests/test_connectivity_graph_measures.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_graph_measures.py', '--help') + ret = script_runner.run('scil_connectivity_graph_measures', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_connectivity(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(SCILPY_HOME, 'connectivity', 'sc_norm.npy') in_len = os.path.join(SCILPY_HOME, 'connectivity', 'len.npy') - ret = script_runner.run('scil_connectivity_graph_measures.py', in_sc, + ret = script_runner.run('scil_connectivity_graph_measures', in_sc, in_len, 'gtm.json', '--avg_node_wise', '--small_world') assert ret.success diff --git a/scripts/tests/test_connectivity_hdf5_average_density_map.py b/src/scilpy/cli/tests/test_connectivity_hdf5_average_density_map.py similarity index 97% rename from scripts/tests/test_connectivity_hdf5_average_density_map.py rename to src/scilpy/cli/tests/test_connectivity_hdf5_average_density_map.py index f059f909f..f802ad434 100644 --- a/scripts/tests/test_connectivity_hdf5_average_density_map.py +++ b/src/scilpy/cli/tests/test_connectivity_hdf5_average_density_map.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_hdf5_average_density_map.py', + ret = script_runner.run('scil_connectivity_hdf5_average_density_map', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_help_option(script_runner): def test_execution_connectivity(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_h5 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose.h5') - ret = script_runner.run('scil_connectivity_hdf5_average_density_map.py', + ret = script_runner.run('scil_connectivity_hdf5_average_density_map', in_h5, 'avg_density_map/', '--binary', '--processes', '1') assert ret.success @@ -31,7 +31,7 @@ def test_execution_connectivity_(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_h5_1 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose.h5') in_h5_2 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose_afd_rd.h5') - ret = script_runner.run('scil_connectivity_hdf5_average_density_map.py', + ret = script_runner.run('scil_connectivity_hdf5_average_density_map', in_h5_1, in_h5_2, 'avg_density_maps/', '--processes', '1') assert ret.success diff --git a/scripts/tests/test_connectivity_math.py b/src/scilpy/cli/tests/test_connectivity_math.py similarity index 83% rename from scripts/tests/test_connectivity_math.py rename to src/scilpy/cli/tests/test_connectivity_math.py index bd640349c..a027a459c 100644 --- a/scripts/tests/test_connectivity_math.py +++ b/src/scilpy/cli/tests/test_connectivity_math.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_math.py', '--help') + ret = script_runner.run('scil_connectivity_math', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_connectivity_div(script_runner, monkeypatch): 'sc.npy') in_vol = os.path.join(SCILPY_HOME, 'connectivity', 'vol.npy') - ret = script_runner.run('scil_connectivity_math.py', 'division', + ret = script_runner.run('scil_connectivity_math', 'division', in_sc, in_vol, 'sc_norm_vol.npy') assert ret.success @@ -32,7 +32,7 @@ def test_execution_connectivity_add(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(SCILPY_HOME, 'connectivity', 'sc.npy') - ret = script_runner.run('scil_connectivity_math.py', 'addition', + ret = script_runner.run('scil_connectivity_math', 'addition', in_sc, '10', 'sc_add_10.npy') assert ret.success @@ -41,6 +41,6 @@ def test_execution_connectivity_lower_threshold(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(SCILPY_HOME, 'connectivity', 'sc.npy') - ret = script_runner.run('scil_connectivity_math.py', 'lower_threshold', + ret = script_runner.run('scil_connectivity_math', 'lower_threshold', in_sc, '5', 'sc_lower_threshold.npy') assert ret.success diff --git a/scripts/tests/test_connectivity_normalize.py b/src/scilpy/cli/tests/test_connectivity_normalize.py similarity index 88% rename from scripts/tests/test_connectivity_normalize.py rename to src/scilpy/cli/tests/test_connectivity_normalize.py index 0a32e26d6..fbdbb7707 100644 --- a/scripts/tests/test_connectivity_normalize.py +++ b/src/scilpy/cli/tests/test_connectivity_normalize.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_normalize.py', '--help') + ret = script_runner.run('scil_connectivity_normalize', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_execution_connectivity(script_runner, monkeypatch): 'endpoints_atlas.nii.gz') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run('scil_connectivity_normalize.py', in_sc, + ret = script_runner.run('scil_connectivity_normalize', in_sc, 'sc_norm.npy', '--length', in_len, '--parcel_volume', in_atlas, in_labels_list) assert ret.success diff --git a/scripts/tests/test_connectivity_pairwise_agreement.py b/src/scilpy/cli/tests/test_connectivity_pairwise_agreement.py similarity index 97% rename from scripts/tests/test_connectivity_pairwise_agreement.py rename to src/scilpy/cli/tests/test_connectivity_pairwise_agreement.py index 0a271c637..1437d186c 100644 --- a/scripts/tests/test_connectivity_pairwise_agreement.py +++ b/src/scilpy/cli/tests/test_connectivity_pairwise_agreement.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_pairwise_agreement.py', + ret = script_runner.run('scil_connectivity_pairwise_agreement', '--help') assert ret.success @@ -22,6 +22,6 @@ def test_execution_connectivity(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(SCILPY_HOME, 'connectivity', 'sc_norm.npy') in_len = os.path.join(SCILPY_HOME, 'connectivity', 'len.npy') - ret = script_runner.run('scil_connectivity_pairwise_agreement.py', in_sc, + ret = script_runner.run('scil_connectivity_pairwise_agreement', in_sc, in_len, 'diff.json', '--single_compare', in_sc) assert ret.success diff --git a/scripts/tests/test_connectivity_print_filenames.py b/src/scilpy/cli/tests/test_connectivity_print_filenames.py similarity index 84% rename from scripts/tests/test_connectivity_print_filenames.py rename to src/scilpy/cli/tests/test_connectivity_print_filenames.py index 24d01ea8d..d6b2d10f8 100644 --- a/scripts/tests/test_connectivity_print_filenames.py +++ b/src/scilpy/cli/tests/test_connectivity_print_filenames.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_print_filenames.py', '--help') + ret = script_runner.run('scil_connectivity_print_filenames', '--help') assert ret.success @@ -23,6 +23,6 @@ def test_execution_connectivity(script_runner, monkeypatch): 'sc_norm.npy') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run('scil_connectivity_print_filenames.py', in_sc, + ret = script_runner.run('scil_connectivity_print_filenames', in_sc, in_labels_list, 'success.txt') assert ret.success diff --git a/scripts/tests/test_connectivity_reorder_rois.py b/src/scilpy/cli/tests/test_connectivity_reorder_rois.py similarity index 88% rename from scripts/tests/test_connectivity_reorder_rois.py rename to src/scilpy/cli/tests/test_connectivity_reorder_rois.py index 0d2e37269..29bbe9a53 100644 --- a/scripts/tests/test_connectivity_reorder_rois.py +++ b/src/scilpy/cli/tests/test_connectivity_reorder_rois.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_connectivity_reorder_rois.py', '--help') + ret = script_runner.run('scil_connectivity_reorder_rois', '--help') assert ret.success @@ -26,7 +26,7 @@ def test_execution_compute_OLO(script_runner, monkeypatch): 'sc_norm.npy') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run('scil_connectivity_reorder_rois.py', in_sc, + ret = script_runner.run('scil_connectivity_reorder_rois', in_sc, '--optimal_leaf_ordering', 'OLO.txt', '--out_dir', os.path.expanduser(tmp_dir.name), '--labels_list', in_labels_list, '-f') @@ -39,7 +39,7 @@ def test_execution_apply_ordering(script_runner, monkeypatch): in_txt = os.path.join(SCILPY_HOME, 'connectivity', 'reorder.txt') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run('scil_connectivity_reorder_rois.py', in_sc, + ret = script_runner.run('scil_connectivity_reorder_rois', in_sc, '--in_ordering', in_txt, '--out_suffix', '_sc_reo', '--out_dir', os.path.expanduser(tmp_dir.name), diff --git a/scripts/tests/test_denoising_nlmeans.py b/src/scilpy/cli/tests/test_denoising_nlmeans.py similarity index 86% rename from scripts/tests/test_denoising_nlmeans.py rename to src/scilpy/cli/tests/test_denoising_nlmeans.py index 45e0ffacb..ed6f5577b 100644 --- a/scripts/tests/test_denoising_nlmeans.py +++ b/src/scilpy/cli/tests/test_denoising_nlmeans.py @@ -13,14 +13,14 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_denoising_nlmeans.py', '--help') + ret = script_runner.run('scil_denoising_nlmeans', '--help') assert ret.success def test_execution_user_sigma(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 't1_resample.nii.gz') - ret = script_runner.run('scil_denoising_nlmeans.py', in_img, + ret = script_runner.run('scil_denoising_nlmeans', in_img, 'denoised.nii.gz', '--processes', '1', '--sigma', '8', '--number_coils', 0, '--gaussian') @@ -30,7 +30,7 @@ def test_execution_user_sigma(script_runner, monkeypatch): def test_execution_basic_3d(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 't1_resample.nii.gz') - ret = script_runner.run('scil_denoising_nlmeans.py', in_img, + ret = script_runner.run('scil_denoising_nlmeans', in_img, 't1_denoised.nii.gz', '--processes', '1', '--basic_sigma', '--number_coils', 0, '--gaussian') @@ -41,7 +41,7 @@ def test_execution_basic_4d_mask(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop_1000.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'processing', 'fa_thr.nii.gz') - ret = script_runner.run('scil_denoising_nlmeans.py', in_img, + ret = script_runner.run('scil_denoising_nlmeans', in_img, 't1_denoised2.nii.gz', '--processes', '1', '--basic_sigma', '--number_coils', 0, '--gaussian', '--mask_sigma', in_mask) @@ -51,7 +51,7 @@ def test_execution_basic_4d_mask(script_runner, monkeypatch): def test_execution_piesno(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'processing', 'dwi.nii.gz') - ret = script_runner.run('scil_denoising_nlmeans.py', in_img, + ret = script_runner.run('scil_denoising_nlmeans', in_img, 'dwi_denoised.nii.gz', '--processes', '1', '--piesno', '--number_coils', '4') assert ret.success diff --git a/scripts/tests/test_dki_metrics.py b/src/scilpy/cli/tests/test_dki_metrics.py similarity index 90% rename from scripts/tests/test_dki_metrics.py rename to src/scilpy/cli/tests/test_dki_metrics.py index 617c1b7af..a69fc11ae 100644 --- a/scripts/tests/test_dki_metrics.py +++ b/src/scilpy/cli/tests/test_dki_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dki_metrics.py', '--help') + ret = script_runner.run('scil_dki_metrics', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_execution_processing(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dki_metrics.py', in_dwi, + ret = script_runner.run('scil_dki_metrics', in_dwi, in_bval, in_bvec, '--not_all', '--dki_fa', 'dki_fa.nii.gz', '--dki_md', 'dki_md.nii.gz', diff --git a/scripts/tests/test_dti_convert_tensors.py b/src/scilpy/cli/tests/test_dti_convert_tensors.py similarity index 84% rename from scripts/tests/test_dti_convert_tensors.py rename to src/scilpy/cli/tests/test_dti_convert_tensors.py index 9d66d8345..a5b342f8a 100644 --- a/scripts/tests/test_dti_convert_tensors.py +++ b/src/scilpy/cli/tests/test_dti_convert_tensors.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dti_convert_tensors.py', '--help') + ret = script_runner.run('scil_dti_convert_tensors', '--help') assert ret.success @@ -25,11 +25,11 @@ def test_execution_processing(script_runner, monkeypatch): in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop_1000.nii.gz') in_bval = os.path.join(SCILPY_HOME, 'processing', '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - script_runner.run('scil_dti_metrics.py', in_dwi, + script_runner.run('scil_dti_metrics', in_dwi, in_bval, in_bvec, '--not_all', '--tensor', 'tensors.nii.gz', '--tensor_format', 'fsl') - ret = script_runner.run('scil_dti_convert_tensors.py', 'tensors.nii.gz', + ret = script_runner.run('scil_dti_convert_tensors', 'tensors.nii.gz', 'converted_tensors.nii.gz', 'fsl', 'mrtrix') assert ret.success diff --git a/scripts/tests/test_dti_metrics.py b/src/scilpy/cli/tests/test_dti_metrics.py similarity index 87% rename from scripts/tests/test_dti_metrics.py rename to src/scilpy/cli/tests/test_dti_metrics.py index 96c002ea5..8c193751e 100644 --- a/scripts/tests/test_dti_metrics.py +++ b/src/scilpy/cli/tests/test_dti_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dti_metrics.py', '--help') + ret = script_runner.run('scil_dti_metrics', '--help') assert ret.success @@ -26,10 +26,10 @@ def test_execution_processing_diff_metrics(script_runner, monkeypatch): # No mask fitting with this data? Creating our own. mask = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') mask_uint8 = os.path.join('mask_uint8.nii.gz') - script_runner.run('scil_volume_math.py', 'convert', + script_runner.run('scil_volume_math', 'convert', mask, mask_uint8, '--data_type', 'uint8') - ret = script_runner.run('scil_dti_metrics.py', in_dwi, + ret = script_runner.run('scil_dti_metrics', in_dwi, in_bval, in_bvec, '--not_all', '--fa', 'fa.nii.gz', '--md', 'md.nii.gz', @@ -49,10 +49,10 @@ def test_execution_processing_b0_threshold(script_runner, monkeypatch): # No mask fitting with this data? Creating our own. mask = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') mask_uint8 = os.path.join('mask_uint8.nii.gz') - script_runner.run('scil_volume_math.py', 'convert', + script_runner.run('scil_volume_math', 'convert', mask, mask_uint8, '--data_type', 'uint8') - ret = script_runner.run('scil_dti_metrics.py', in_dwi, + ret = script_runner.run('scil_dti_metrics', in_dwi, in_bval, in_bvec, '--not_all', '--fa', 'fa.nii.gz', '--b0_threshold', '1', '-f') assert not ret.success @@ -67,10 +67,10 @@ def test_execution_processing_rgb(script_runner, monkeypatch): # No mask fitting with this data? Creating our own. mask = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') mask_uint8 = os.path.join('mask_uint8.nii.gz') - script_runner.run('scil_volume_math.py', 'convert', + script_runner.run('scil_volume_math', 'convert', mask, mask_uint8, '--data_type', 'uint8') - ret = script_runner.run('scil_dti_metrics.py', in_dwi, + ret = script_runner.run('scil_dti_metrics', in_dwi, in_bval, in_bvec, '--not_all', '--rgb', 'rgb.nii.gz', '-f') assert ret.success diff --git a/scripts/tests/test_dwi_apply_bias_field.py b/src/scilpy/cli/tests/test_dwi_apply_bias_field.py similarity index 85% rename from scripts/tests/test_dwi_apply_bias_field.py rename to src/scilpy/cli/tests/test_dwi_apply_bias_field.py index c3b91993d..1d565208f 100644 --- a/scripts/tests/test_dwi_apply_bias_field.py +++ b/src/scilpy/cli/tests/test_dwi_apply_bias_field.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_apply_bias_field.py', '--help') + ret = script_runner.run('scil_dwi_apply_bias_field', '--help') assert ret.success @@ -23,6 +23,6 @@ def test_execution_processing(script_runner, monkeypatch): 'dwi_crop.nii.gz') in_bias = os.path.join(SCILPY_HOME, 'processing', 'bias_field_b0.nii.gz') - ret = script_runner.run('scil_dwi_apply_bias_field.py', in_dwi, + ret = script_runner.run('scil_dwi_apply_bias_field', in_dwi, in_bias, 'dwi_crop_n4.nii.gz') assert ret.success diff --git a/scripts/tests/test_dwi_compute_snr.py b/src/scilpy/cli/tests/test_dwi_compute_snr.py similarity index 89% rename from scripts/tests/test_dwi_compute_snr.py rename to src/scilpy/cli/tests/test_dwi_compute_snr.py index 1bfad3352..2a47864d2 100644 --- a/scripts/tests/test_dwi_compute_snr.py +++ b/src/scilpy/cli/tests/test_dwi_compute_snr.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_compute_snr.py', '--help') + ret = script_runner.run('scil_dwi_compute_snr', '--help') assert ret.success @@ -29,7 +29,7 @@ def test_snr(script_runner, monkeypatch): noise_mask = os.path.join(SCILPY_HOME, 'processing', 'small_roi_gm_mask.nii.gz') - ret = script_runner.run('scil_dwi_compute_snr.py', in_dwi, + ret = script_runner.run('scil_dwi_compute_snr', in_dwi, in_bval, in_bvec, in_mask, '--noise_mask', noise_mask, '--b0_thr', '10') diff --git a/scripts/tests/test_dwi_concatenate.py b/src/scilpy/cli/tests/test_dwi_concatenate.py similarity index 88% rename from scripts/tests/test_dwi_concatenate.py rename to src/scilpy/cli/tests/test_dwi_concatenate.py index 743e8a014..3a1d31539 100644 --- a/scripts/tests/test_dwi_concatenate.py +++ b/src/scilpy/cli/tests/test_dwi_concatenate.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_concatenate.py', '--help') + ret = script_runner.run('scil_dwi_concatenate', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_execution_processing_concatenate(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_concatenate.py', 'dwi_concat.nii.gz', + ret = script_runner.run('scil_dwi_concatenate', 'dwi_concat.nii.gz', 'concat.bval', 'concat.bvec', '--in_dwi', in_dwi, in_dwi, '--in_bvals', in_bval, in_bval, diff --git a/scripts/tests/test_viz_dti_screenshot.py b/src/scilpy/cli/tests/test_dwi_convert_FDF.py similarity index 61% rename from scripts/tests/test_viz_dti_screenshot.py rename to src/scilpy/cli/tests/test_dwi_convert_FDF.py index 56c47a53c..7e54c3dfc 100644 --- a/scripts/tests/test_viz_dti_screenshot.py +++ b/src/scilpy/cli/tests/test_dwi_convert_FDF.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_dti_screenshot.py', '--help') + ret = script_runner.run('scil_dwi_convert_FDF', '--help') assert ret.success diff --git a/scripts/tests/test_dwi_detect_volume_outliers.py b/src/scilpy/cli/tests/test_dwi_detect_volume_outliers.py similarity index 81% rename from scripts/tests/test_dwi_detect_volume_outliers.py rename to src/scilpy/cli/tests/test_dwi_detect_volume_outliers.py index c32b21ede..189451915 100644 --- a/scripts/tests/test_dwi_detect_volume_outliers.py +++ b/src/scilpy/cli/tests/test_dwi_detect_volume_outliers.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_detect_volume_outliers.py', '--help') + ret = script_runner.run('scil_dwi_detect_volume_outliers', '--help') assert ret.success @@ -25,11 +25,11 @@ def test_execution(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_detect_volume_outliers.py', in_dwi, + ret = script_runner.run('scil_dwi_detect_volume_outliers', in_dwi, in_bval, in_bvec, '-v') assert ret.success # Test wrong b0. Current minimal b-value is 5. - ret = script_runner.run('scil_dwi_detect_volume_outliers.py', in_dwi, + ret = script_runner.run('scil_dwi_detect_volume_outliers', in_dwi, in_bval, in_bvec, '--b0_threshold', '1') assert not ret.success diff --git a/scripts/tests/test_dwi_extract_b0.py b/src/scilpy/cli/tests/test_dwi_extract_b0.py similarity index 82% rename from scripts/tests/test_dwi_extract_b0.py rename to src/scilpy/cli/tests/test_dwi_extract_b0.py index 34447870d..ef08749c1 100644 --- a/scripts/tests/test_dwi_extract_b0.py +++ b/src/scilpy/cli/tests/test_dwi_extract_b0.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_extract_b0.py', '--help') + ret = script_runner.run('scil_dwi_extract_b0', '--help') assert ret.success @@ -25,11 +25,11 @@ def test_execution_processing(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_extract_b0.py', in_dwi, in_bval, in_bvec, + ret = script_runner.run('scil_dwi_extract_b0', in_dwi, in_bval, in_bvec, 'b0_mean.nii.gz', '--mean', '--b0', '20') assert ret.success # Test wrong b0. Current minimal b-value is 5. - ret = script_runner.run('scil_dwi_extract_b0.py', in_dwi, in_bval, in_bvec, + ret = script_runner.run('scil_dwi_extract_b0', in_dwi, in_bval, in_bvec, 'b0_mean.nii.gz', '--mean', '--b0', '1', '-f') assert not ret.success diff --git a/scripts/tests/test_dwi_extract_shell.py b/src/scilpy/cli/tests/test_dwi_extract_shell.py similarity index 89% rename from scripts/tests/test_dwi_extract_shell.py rename to src/scilpy/cli/tests/test_dwi_extract_shell.py index b0a824e7c..1cdbb63ee 100644 --- a/scripts/tests/test_dwi_extract_shell.py +++ b/src/scilpy/cli/tests/test_dwi_extract_shell.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_extract_shell.py', '--help') + ret = script_runner.run('scil_dwi_extract_shell', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_execution_processing_1000(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_extract_shell.py', in_dwi, + ret = script_runner.run('scil_dwi_extract_shell', in_dwi, in_bval, in_bvec, '0', '1000', 'dwi_crop_1000.nii.gz', '1000.bval', '1000.bvec', '-t', '30') @@ -40,7 +40,7 @@ def test_execution_out_indices(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_extract_shell.py', in_dwi, + ret = script_runner.run('scil_dwi_extract_shell', in_dwi, in_bval, in_bvec, '0', '1000', 'dwi_crop_1000__1.nii.gz', '1000__1.bval', '1000__1.bvec', '-t', '30', '--out_indices', @@ -56,7 +56,7 @@ def test_execution_processing_3000(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_extract_shell.py', in_dwi, + ret = script_runner.run('scil_dwi_extract_shell', in_dwi, in_bval, in_bvec, '0', '3000', 'dwi_crop_3000.nii.gz', '3000.bval', '3000.bvec', '-t', '30') diff --git a/scripts/tests/test_dwi_powder_average.py b/src/scilpy/cli/tests/test_dwi_powder_average.py similarity index 85% rename from scripts/tests/test_dwi_powder_average.py rename to src/scilpy/cli/tests/test_dwi_powder_average.py index f388d9f79..c752009cb 100644 --- a/scripts/tests/test_dwi_powder_average.py +++ b/src/scilpy/cli/tests/test_dwi_powder_average.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_powder_average.py', '--help') + ret = script_runner.run('scil_dwi_powder_average', '--help') assert ret.success @@ -25,6 +25,6 @@ def test_execution_processing(script_runner, monkeypatch): in_bval = os.path.join(SCILPY_HOME, 'processing', '1000.bval') - ret = script_runner.run('scil_dwi_powder_average.py', in_dwi, + ret = script_runner.run('scil_dwi_powder_average', in_dwi, in_bval, 'out_pwd_avg.nii.gz', '--shells', '1000') assert ret.success diff --git a/src/scilpy/cli/tests/test_dwi_prepare_eddy_command.py b/src/scilpy/cli/tests/test_dwi_prepare_eddy_command.py new file mode 100644 index 000000000..32c4415d1 --- /dev/null +++ b/src/scilpy/cli/tests/test_dwi_prepare_eddy_command.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + + +def test_help_option(script_runner): + ret = script_runner.run('scil_dwi_prepare_eddy_command', '--help') + assert ret.success diff --git a/src/scilpy/cli/tests/test_dwi_prepare_topup_command.py b/src/scilpy/cli/tests/test_dwi_prepare_topup_command.py new file mode 100644 index 000000000..6e317f242 --- /dev/null +++ b/src/scilpy/cli/tests/test_dwi_prepare_topup_command.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + + +def test_help_option(script_runner): + ret = script_runner.run('scil_dwi_prepare_topup_command', '--help') + assert ret.success diff --git a/scripts/tests/test_dwi_reorder_philips.py b/src/scilpy/cli/tests/test_dwi_reorder_philips.py similarity index 91% rename from scripts/tests/test_dwi_reorder_philips.py rename to src/scilpy/cli/tests/test_dwi_reorder_philips.py index 0903d1ed0..d2b261e85 100644 --- a/scripts/tests/test_dwi_reorder_philips.py +++ b/src/scilpy/cli/tests/test_dwi_reorder_philips.py @@ -17,7 +17,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_reorder_philips.py', '--help') + ret = script_runner.run('scil_dwi_reorder_philips', '--help') assert ret.success @@ -35,7 +35,7 @@ def test_reorder(script_runner, monkeypatch): table[30] = tmp in_table = os.path.expanduser(tmp_dir.name) + "/in_table.txt" np.savetxt(in_table, table, header="Test") - ret = script_runner.run('scil_dwi_reorder_philips.py', in_dwi, in_bval, + ret = script_runner.run('scil_dwi_reorder_philips', in_dwi, in_bval, in_bvec, in_table, 'out1', '-f') assert ret.success @@ -58,7 +58,7 @@ def test_reorder_w_json_old_version(script_runner, monkeypatch): info = {'SoftwareVersions': '5.5'} with open(in_json, 'w') as f: json.dump(info, f) - ret = script_runner.run('scil_dwi_reorder_philips.py', in_dwi, in_bval, + ret = script_runner.run('scil_dwi_reorder_philips', in_dwi, in_bval, in_bvec, in_table, 'out2', '--json', in_json) assert ret.success @@ -81,6 +81,6 @@ def test_reorder_w_json_new_version(script_runner, monkeypatch): info = {'SoftwareVersions': '5.6'} with open(in_json, 'w') as f: json.dump(info, f) - ret = script_runner.run('scil_dwi_reorder_philips.py', in_dwi, in_bval, + ret = script_runner.run('scil_dwi_reorder_philips', in_dwi, in_bval, in_bvec, in_table, 'out3', '--json', in_json) assert not ret.success diff --git a/scripts/tests/test_dwi_split_by_indices.py b/src/scilpy/cli/tests/test_dwi_split_by_indices.py similarity index 83% rename from scripts/tests/test_dwi_split_by_indices.py rename to src/scilpy/cli/tests/test_dwi_split_by_indices.py index 9a89a14f3..b6c9d5c33 100644 --- a/scripts/tests/test_dwi_split_by_indices.py +++ b/src/scilpy/cli/tests/test_dwi_split_by_indices.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_split_by_indices.py', '--help') + ret = script_runner.run('scil_dwi_split_by_indices', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution_processing(script_runner, monkeypatch): in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop.nii.gz') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_split_by_indices.py', in_dwi, + ret = script_runner.run('scil_dwi_split_by_indices', in_dwi, in_bval, in_bvec, 'dwi', '5', '15', '25') assert ret.success @@ -32,9 +32,9 @@ def test_execution_processing_wrong_indices_given(script_runner, monkeypatch): in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop.nii.gz') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_dwi_split_by_indices.py', in_dwi, + ret = script_runner.run('scil_dwi_split_by_indices', in_dwi, in_bval, in_bvec, 'dwi', '0', '15', '25') assert (not ret.success) - ret = script_runner.run('scil_dwi_split_by_indices.py', in_dwi, + ret = script_runner.run('scil_dwi_split_by_indices', in_dwi, in_bval, in_bvec, 'dwi', '5', '15', '200') assert (not ret.success) diff --git a/scripts/tests/test_dwi_to_sh.py b/src/scilpy/cli/tests/test_dwi_to_sh.py similarity index 84% rename from scripts/tests/test_dwi_to_sh.py rename to src/scilpy/cli/tests/test_dwi_to_sh.py index ce417c823..3b6db3c88 100644 --- a/scripts/tests/test_dwi_to_sh.py +++ b/src/scilpy/cli/tests/test_dwi_to_sh.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_to_sh.py', '--help') + ret = script_runner.run('scil_dwi_to_sh', '--help') assert ret.success @@ -25,12 +25,12 @@ def test_execution_processing(script_runner, monkeypatch): '3000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '3000.bvec') - ret = script_runner.run('scil_dwi_to_sh.py', in_dwi, in_bval, + ret = script_runner.run('scil_dwi_to_sh', in_dwi, in_bval, in_bvec, 'sh_1000.nii.gz') assert ret.success # Test wrong b0. Current minimal b-value is 5. - ret = script_runner.run('scil_dwi_to_sh.py', in_dwi, in_bval, + ret = script_runner.run('scil_dwi_to_sh', in_dwi, in_bval, in_bvec, 'sh_1000.nii.gz', '--b0_threshold', '1', '-f') assert not ret.success diff --git a/scripts/tests/test_fibertube_compute_density.py b/src/scilpy/cli/tests/test_fibertube_compute_density.py similarity index 90% rename from scripts/tests/test_fibertube_compute_density.py rename to src/scilpy/cli/tests/test_fibertube_compute_density.py index ca05c9b0b..2a7135d55 100644 --- a/scripts/tests/test_fibertube_compute_density.py +++ b/src/scilpy/cli/tests/test_fibertube_compute_density.py @@ -38,14 +38,14 @@ def init_data(): def test_help_option(script_runner): - ret = script_runner.run('scil_fibertube_compute_density.py', '--help') + ret = script_runner.run('scil_fibertube_compute_density', '--help') assert ret.success def test_execution_density(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_compute_density.py', + ret = script_runner.run('scil_fibertube_compute_density', 'fibertubes.trk', '--out_density_map', 'density_map.nii.gz', '--out_density_measures', @@ -57,7 +57,7 @@ def test_execution_density(script_runner, monkeypatch): def test_execution_collisions(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_compute_density.py', + ret = script_runner.run('scil_fibertube_compute_density', 'fibertubes.trk', '--out_collision_map', 'collision_map.nii.gz', '--out_collision_measures', diff --git a/scripts/tests/test_fibertube_score_tractogram.py b/src/scilpy/cli/tests/test_fibertube_score_tractogram.py similarity index 93% rename from scripts/tests/test_fibertube_score_tractogram.py rename to src/scilpy/cli/tests/test_fibertube_score_tractogram.py index a1632993c..cff674b75 100644 --- a/scripts/tests/test_fibertube_score_tractogram.py +++ b/src/scilpy/cli/tests/test_fibertube_score_tractogram.py @@ -57,14 +57,14 @@ def init_data(): def test_help_option(script_runner): - ret = script_runner.run('scil_fibertube_score_tractogram.py', '--help') + ret = script_runner.run('scil_fibertube_score_tractogram', '--help') assert ret.success def test_execution(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_score_tractogram.py', + ret = script_runner.run('scil_fibertube_score_tractogram', 'fibertubes.trk', 'tracking.trk', 'config.json', 'metrics.json', '--save_error_tractogram', '-f') assert ret.success diff --git a/scripts/tests/test_fibertube_tracking.py b/src/scilpy/cli/tests/test_fibertube_tracking.py similarity index 88% rename from scripts/tests/test_fibertube_tracking.py rename to src/scilpy/cli/tests/test_fibertube_tracking.py index cedcb9384..a7ccea8f0 100644 --- a/scripts/tests/test_fibertube_tracking.py +++ b/src/scilpy/cli/tests/test_fibertube_tracking.py @@ -38,14 +38,14 @@ def init_data(): def test_help_option(script_runner): - ret = script_runner.run('scil_fibertube_tracking.py', '--help') + ret = script_runner.run('scil_fibertube_tracking', '--help') assert ret.success def test_execution(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run('scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--min_length', '0', '-f') assert ret.success @@ -54,7 +54,7 @@ def test_execution(script_runner, monkeypatch): def test_execution_rk(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run('scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--rk_order', '2', '--min_length', '0', '-f') assert ret.success @@ -63,7 +63,7 @@ def test_execution_rk(script_runner, monkeypatch): def test_execution_config(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run('scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--blur_radius', '0.3', '--step_size', '0.1', @@ -75,7 +75,7 @@ def test_execution_config(script_runner, monkeypatch): def test_execution_seeding(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run('scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--nb_fibertubes', '1', '--nb_seeds_per_fibertube', '3', '--skip', '3', @@ -87,7 +87,7 @@ def test_execution_seeding(script_runner, monkeypatch): def test_execution_FTODF(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run('scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--min_length', '0', '-f') assert ret.success @@ -96,7 +96,7 @@ def test_execution_FTODF(script_runner, monkeypatch): def test_execution_FTODF_rk(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run('scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--rk_order', '2', '--min_length', '0', '-f') assert ret.success @@ -105,7 +105,7 @@ def test_execution_FTODF_rk(script_runner, monkeypatch): def test_execution_FTODF_config(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run('scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--blur_radius', '0.3', '--step_size', '0.1', @@ -117,7 +117,7 @@ def test_execution_FTODF_config(script_runner, monkeypatch): def test_execution_FTODF_seeding(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run('scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--nb_fibertubes', '1', '--nb_seeds_per_fibertube', '3', '--skip', '3', @@ -129,7 +129,7 @@ def test_execution_FTODF_seeding(script_runner, monkeypatch): def test_execution_FTODF_sphere(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run('scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--sh_order', '4', '--sphere', 'symmetric362', @@ -144,7 +144,7 @@ def test_execution_FTODF_sphere(script_runner, monkeypatch): def test_execution_FTODF_det(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run('scil_fibertube_tracking.py', + ret = script_runner.run('scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--algo', 'det', '--min_length', '0', '-f') diff --git a/scripts/tests/test_fodf_bundleparc.py b/src/scilpy/cli/tests/test_fodf_bundleparc.py similarity index 80% rename from scripts/tests/test_fodf_bundleparc.py rename to src/scilpy/cli/tests/test_fodf_bundleparc.py index 0107934d6..a5ef8daf2 100644 --- a/scripts/tests/test_fodf_bundleparc.py +++ b/src/scilpy/cli/tests/test_fodf_bundleparc.py @@ -12,7 +12,7 @@ @pytest.mark.ml def test_help_option(script_runner, monkeypatch): - ret = script_runner.run('scil_fodf_bundleparc.py', '--help') + ret = script_runner.run('scil_fodf_bundleparc', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_help_option(script_runner, monkeypatch): def test_execution(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run('scil_fodf_bundleparc.py', in_fodf, '-f', + ret = script_runner.run('scil_fodf_bundleparc', in_fodf, '-f', '--bundles', 'FX_left') assert ret.success @@ -30,7 +30,7 @@ def test_execution(script_runner, monkeypatch): def test_execution_100_labels(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run('scil_fodf_bundleparc.py', in_fodf, + ret = script_runner.run('scil_fodf_bundleparc', in_fodf, '--nb_pts', '100', '-f', '--bundles', 'IFO_right') assert ret.success @@ -40,7 +40,7 @@ def test_execution_100_labels(script_runner, monkeypatch): def test_execution_keep_biggest_blob(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run('scil_fodf_bundleparc.py', in_fodf, + ret = script_runner.run('scil_fodf_bundleparc', in_fodf, '--keep_biggest_blob', '-f', '--bundles', 'CA') assert ret.success @@ -50,6 +50,6 @@ def test_execution_keep_biggest_blob(script_runner, monkeypatch): def test_execution_invalid_bundle(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run('scil_fodf_bundleparc.py', in_fodf, + ret = script_runner.run('scil_fodf_bundleparc', in_fodf, '-f', '--bundles', 'CC') assert not ret.success diff --git a/scripts/tests/test_fodf_max_in_ventricles.py b/src/scilpy/cli/tests/test_fodf_max_in_ventricles.py similarity index 86% rename from scripts/tests/test_fodf_max_in_ventricles.py rename to src/scilpy/cli/tests/test_fodf_max_in_ventricles.py index 1a8b07f7c..deef7b681 100644 --- a/scripts/tests/test_fodf_max_in_ventricles.py +++ b/src/scilpy/cli/tests/test_fodf_max_in_ventricles.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_fodf_max_in_ventricles.py', '--help') + ret = script_runner.run('scil_fodf_max_in_ventricles', '--help') assert ret.success @@ -25,6 +25,6 @@ def test_execution_processing(script_runner, monkeypatch): 'fa.nii.gz') in_md = os.path.join(SCILPY_HOME, 'processing', 'md.nii.gz') - ret = script_runner.run('scil_fodf_max_in_ventricles.py', in_fodf, + ret = script_runner.run('scil_fodf_max_in_ventricles', in_fodf, in_fa, in_md, '--sh_basis', 'tournier07') assert ret.success diff --git a/scripts/tests/test_fodf_memsmt.py b/src/scilpy/cli/tests/test_fodf_memsmt.py similarity index 94% rename from scripts/tests/test_fodf_memsmt.py rename to src/scilpy/cli/tests/test_fodf_memsmt.py index 16ce86540..88110dd96 100644 --- a/scripts/tests/test_fodf_memsmt.py +++ b/src/scilpy/cli/tests/test_fodf_memsmt.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_fodf_memsmt.py', '--help') + ret = script_runner.run('scil_fodf_memsmt', '--help') assert ret.success @@ -37,7 +37,7 @@ def test_inputs_check(script_runner, monkeypatch): in_csf_frf = os.path.join(SCILPY_HOME, 'btensor_testdata', 'csf_frf.txt') - ret = script_runner.run('scil_fodf_memsmt.py', in_wm_frf, + ret = script_runner.run('scil_fodf_memsmt', in_wm_frf, in_gm_frf, in_csf_frf, '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, '--in_bvecs', in_bvec_lin, @@ -49,7 +49,7 @@ def test_inputs_check(script_runner, monkeypatch): 'tournier07', '--processes', '1', '-f') assert (not ret.success) - ret = script_runner.run('scil_fodf_memsmt.py', in_wm_frf, + ret = script_runner.run('scil_fodf_memsmt', in_wm_frf, in_gm_frf, in_csf_frf, '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', @@ -84,7 +84,7 @@ def test_execution_processing(script_runner, monkeypatch): in_csf_frf = os.path.join(SCILPY_HOME, 'btensor_testdata', 'csf_frf.txt') - ret = script_runner.run('scil_fodf_memsmt.py', in_wm_frf, + ret = script_runner.run('scil_fodf_memsmt', in_wm_frf, in_gm_frf, in_csf_frf, '--in_dwis', in_dwi_lin, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_sph, diff --git a/scripts/tests/test_fodf_metrics.py b/src/scilpy/cli/tests/test_fodf_metrics.py similarity index 87% rename from scripts/tests/test_fodf_metrics.py rename to src/scilpy/cli/tests/test_fodf_metrics.py index 3b1bc536e..3bbd2e49f 100644 --- a/scripts/tests/test_fodf_metrics.py +++ b/src/scilpy/cli/tests/test_fodf_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_fodf_metrics.py', '--help') + ret = script_runner.run('scil_fodf_metrics', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf_descoteaux07.nii.gz') - ret = script_runner.run('scil_fodf_metrics.py', in_fodf, '--not_al', + ret = script_runner.run('scil_fodf_metrics', in_fodf, '--not_al', '--peaks', 'peaks.nii.gz', '--afd_max', 'afd_max.nii.gz', '--afd_total', 'afd_tot.nii.gz', diff --git a/scripts/tests/test_fodf_msmt.py b/src/scilpy/cli/tests/test_fodf_msmt.py similarity index 92% rename from scripts/tests/test_fodf_msmt.py rename to src/scilpy/cli/tests/test_fodf_msmt.py index d2adfdab2..866ca84b8 100644 --- a/scripts/tests/test_fodf_msmt.py +++ b/src/scilpy/cli/tests/test_fodf_msmt.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_fodf_msmt.py', '--help') + ret = script_runner.run('scil_fodf_msmt', '--help') assert ret.success @@ -26,7 +26,7 @@ def test_execution_processing(script_runner, monkeypatch): in_csf_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'csf_frf.txt') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_fodf_msmt.py', in_dwi, in_bval, + ret = script_runner.run('scil_fodf_msmt', in_dwi, in_bval, in_bvec, in_wm_frf, in_gm_frf, in_csf_frf, '--mask', mask, '--wm_out_fODF', 'wm_fodf.nii.gz', diff --git a/scripts/tests/test_fodf_ssst.py b/src/scilpy/cli/tests/test_fodf_ssst.py similarity index 87% rename from scripts/tests/test_fodf_ssst.py rename to src/scilpy/cli/tests/test_fodf_ssst.py index b1a79cf9b..86d564b14 100644 --- a/scripts/tests/test_fodf_ssst.py +++ b/src/scilpy/cli/tests/test_fodf_ssst.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_fodf_ssst.py', '--help') + ret = script_runner.run('scil_fodf_ssst', '--help') assert ret.success @@ -27,13 +27,13 @@ def test_execution_processing(script_runner, monkeypatch): '3000.bvec') in_frf = os.path.join(SCILPY_HOME, 'processing', 'frf.txt') - ret = script_runner.run('scil_fodf_ssst.py', in_dwi, in_bval, + ret = script_runner.run('scil_fodf_ssst', in_dwi, in_bval, in_bvec, in_frf, 'fodf.nii.gz', '--sh_order', '4', '--sh_basis', 'tournier07', '--processes', '1') assert ret.success # Test wrong b0. Current minimal b-value is 5. - ret = script_runner.run('scil_fodf_ssst.py', in_dwi, in_bval, + ret = script_runner.run('scil_fodf_ssst', in_dwi, in_bval, in_bvec, in_frf, 'fodf.nii.gz', '--sh_order', '4', '--sh_basis', 'tournier07', '--processes', '1', '--b0_threshold', '1', '-f') diff --git a/scripts/tests/test_fodf_to_bingham.py b/src/scilpy/cli/tests/test_fodf_to_bingham.py similarity index 91% rename from scripts/tests/test_fodf_to_bingham.py rename to src/scilpy/cli/tests/test_fodf_to_bingham.py index c0a27a667..094d03699 100644 --- a/scripts/tests/test_fodf_to_bingham.py +++ b/src/scilpy/cli/tests/test_fodf_to_bingham.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_fodf_to_bingham.py', + ret = script_runner.run('scil_fodf_to_bingham', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf_descoteaux07.nii.gz') - ret = script_runner.run('scil_fodf_to_bingham.py', + ret = script_runner.run('scil_fodf_to_bingham', in_fodf, 'bingham.nii.gz', '--max_lobes', '1', '--at', '0.0', @@ -39,7 +39,7 @@ def test_execution_processing_mask(script_runner, monkeypatch): 'fodf_descoteaux07.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') - ret = script_runner.run('scil_fodf_to_bingham.py', + ret = script_runner.run('scil_fodf_to_bingham', in_fodf, 'bingham.nii.gz', '--max_lobes', '1', '--at', '0.0', diff --git a/scripts/tests/test_freewater_maps.py b/src/scilpy/cli/tests/test_freewater_maps.py similarity index 91% rename from scripts/tests/test_freewater_maps.py rename to src/scilpy/cli/tests/test_freewater_maps.py index 54b4f6746..75bc30e71 100644 --- a/scripts/tests/test_freewater_maps.py +++ b/src/scilpy/cli/tests/test_freewater_maps.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_freewater_maps.py', '--help') + ret = script_runner.run('scil_freewater_maps', '--help') assert ret.success @@ -27,7 +27,7 @@ def test_execution_commit_amico(script_runner, monkeypatch): 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_freewater_maps.py', in_dwi, + ret = script_runner.run('scil_freewater_maps', in_dwi, in_bval, in_bvec, '--mask', mask, '--out_dir', 'freewater', '--b_thr', '30', '--para_diff', '0.0015', diff --git a/scripts/tests/test_freewater_priors.py b/src/scilpy/cli/tests/test_freewater_priors.py similarity index 62% rename from scripts/tests/test_freewater_priors.py rename to src/scilpy/cli/tests/test_freewater_priors.py index b2ff43fd6..b1fb536dd 100644 --- a/scripts/tests/test_freewater_priors.py +++ b/src/scilpy/cli/tests/test_freewater_priors.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_freewater_priors.py', '--help') + ret = script_runner.run('scil_freewater_priors', '--help') assert ret.success diff --git a/scripts/tests/test_frf_mean.py b/src/scilpy/cli/tests/test_frf_mean.py similarity index 82% rename from scripts/tests/test_frf_mean.py rename to src/scilpy/cli/tests/test_frf_mean.py index 436d7c144..5895eb05b 100644 --- a/scripts/tests/test_frf_mean.py +++ b/src/scilpy/cli/tests/test_frf_mean.py @@ -14,28 +14,28 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_frf_mean.py', '--help') + ret = script_runner.run('scil_frf_mean', '--help') assert ret.success def test_execution_processing_ssst(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'processing', 'frf.txt') - ret = script_runner.run('scil_frf_mean.py', in_frf, in_frf, 'mfrf1.txt') + ret = script_runner.run('scil_frf_mean', in_frf, in_frf, 'mfrf1.txt') assert ret.success def test_execution_processing_msmt(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run('scil_frf_mean.py', in_frf, in_frf, 'mfrf2.txt') + ret = script_runner.run('scil_frf_mean', in_frf, in_frf, 'mfrf2.txt') assert ret.success def test_outputs_precision(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run('scil_frf_mean.py', in_frf, in_frf, 'mfrfp.txt', + ret = script_runner.run('scil_frf_mean', in_frf, in_frf, 'mfrfp.txt', '--precision', '4') assert ret.success @@ -53,5 +53,5 @@ def test_execution_processing_bad_input(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_wm_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') in_frf = os.path.join(SCILPY_HOME, 'processing', 'frf.txt') - ret = script_runner.run('scil_frf_mean.py', in_wm_frf, in_frf, 'mfrf3.txt') + ret = script_runner.run('scil_frf_mean', in_wm_frf, in_frf, 'mfrf3.txt') assert not ret.success diff --git a/scripts/tests/test_frf_memsmt.py b/src/scilpy/cli/tests/test_frf_memsmt.py similarity index 94% rename from scripts/tests/test_frf_memsmt.py rename to src/scilpy/cli/tests/test_frf_memsmt.py index e60de7607..08d6c39e3 100644 --- a/scripts/tests/test_frf_memsmt.py +++ b/src/scilpy/cli/tests/test_frf_memsmt.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_frf_memsmt.py', '--help') + ret = script_runner.run('scil_frf_memsmt', '--help') assert ret.success @@ -37,7 +37,7 @@ def test_roi_center_shape_parameter(script_runner, monkeypatch): in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run('scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, @@ -68,7 +68,7 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): 'spherical.bvals') in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run('scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, @@ -77,7 +77,7 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): '--roi_radii', '37', '--min_nvox', '1', '-f') assert ret.success - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run('scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, @@ -87,7 +87,7 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): '--min_nvox', '1', '-f') assert ret.success - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run('scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, @@ -114,14 +114,14 @@ def test_inputs_check(script_runner, monkeypatch): in_bvec_plan = os.path.join(SCILPY_HOME, 'btensor_testdata', 'planar.bvecs') - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run('scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, '--in_bvecs', in_bvec_lin, '--in_bdeltas', '1', '--min_nvox', '1', '-f') assert (not ret.success) - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run('scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', @@ -150,7 +150,7 @@ def test_outputs_precision(script_runner, monkeypatch): 'spherical.bvals') in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run('scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, @@ -186,7 +186,7 @@ def test_execution_processing(script_runner, monkeypatch): 'spherical.bvals') in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') - ret = script_runner.run('scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run('scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, diff --git a/scripts/tests/test_frf_msmt.py b/src/scilpy/cli/tests/test_frf_msmt.py similarity index 89% rename from scripts/tests/test_frf_msmt.py rename to src/scilpy/cli/tests/test_frf_msmt.py index a919e5afc..c7aa050b6 100644 --- a/scripts/tests/test_frf_msmt.py +++ b/src/scilpy/cli/tests/test_frf_msmt.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_frf_msmt.py', '--help') + ret = script_runner.run('scil_frf_msmt', '--help') assert ret.success @@ -25,20 +25,20 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run('scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_center', '15', '15', '15', '-f') assert ret.success # Test wrong tolerance, leading to no b0. Current minimal b-val is 5. - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run('scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_center', '15', '15', '15', '-f', '--tol', '1') assert not ret.success - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run('scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_center', '15', '-f') @@ -55,19 +55,19 @@ def test_roi_radii_shape_parameter2(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run('scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_radii', '37', '-f') assert ret.success - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run('scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_radii', '37', '37', '37', '-f') assert ret.success - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run('scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_radii', '37', '37', '37', '37', '37', '-f') @@ -84,7 +84,7 @@ def test_outputs_precision(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run('scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--min_nvox', '20', '--precision', '4', '-f') @@ -105,7 +105,7 @@ def test_execution_processing(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run('scil_frf_msmt.py', in_dwi, + ret = script_runner.run('scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--min_nvox', '20', '-f') diff --git a/scripts/tests/test_frf_set_diffusivities.py b/src/scilpy/cli/tests/test_frf_set_diffusivities.py similarity index 84% rename from scripts/tests/test_frf_set_diffusivities.py rename to src/scilpy/cli/tests/test_frf_set_diffusivities.py index de40559fa..9bee98a63 100644 --- a/scripts/tests/test_frf_set_diffusivities.py +++ b/src/scilpy/cli/tests/test_frf_set_diffusivities.py @@ -15,14 +15,14 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_frf_set_diffusivities.py', '--help') + ret = script_runner.run('scil_frf_set_diffusivities', '--help') assert ret.success def test_execution_processing_ssst(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'processing', 'frf.txt') - ret = script_runner.run('scil_frf_set_diffusivities.py', in_frf, + ret = script_runner.run('scil_frf_set_diffusivities', in_frf, '15,4,4', 'new_frf.txt', '-f') assert ret.success @@ -30,7 +30,7 @@ def test_execution_processing_ssst(script_runner, monkeypatch): def test_execution_processing_msmt(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run('scil_frf_set_diffusivities.py', in_frf, + ret = script_runner.run('scil_frf_set_diffusivities', in_frf, '15,4,4,13,4,4,12,5,5', 'new_frf.txt', '-f') assert ret.success @@ -38,7 +38,7 @@ def test_execution_processing_msmt(script_runner, monkeypatch): def test_outputs_precision(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run('scil_frf_set_diffusivities.py', in_frf, + ret = script_runner.run('scil_frf_set_diffusivities', in_frf, '15,4,4,13,4,4,12,5,5', 'new_frf.txt', '--precision', '4', '-f') assert ret.success @@ -56,6 +56,6 @@ def test_outputs_precision(script_runner, monkeypatch): def test_execution_processing__wrong_input(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run('scil_frf_set_diffusivities.py', in_frf, + ret = script_runner.run('scil_frf_set_diffusivities', in_frf, '15,4,4,13,4,4', 'new_frf.txt', '-f') assert not ret.success diff --git a/scripts/tests/test_frf_ssst.py b/src/scilpy/cli/tests/test_frf_ssst.py similarity index 82% rename from scripts/tests/test_frf_ssst.py rename to src/scilpy/cli/tests/test_frf_ssst.py index 5f02d018e..5360f19b4 100644 --- a/scripts/tests/test_frf_ssst.py +++ b/src/scilpy/cli/tests/test_frf_ssst.py @@ -16,25 +16,25 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_frf_ssst.py', '--help') + ret = script_runner.run('scil_frf_ssst', '--help') assert ret.success def test_roi_center_parameter(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run('scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_center', '15', '15', '15', '-f') assert ret.success - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run('scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_center', '15', '-f') assert (not ret.success) # Test wrong b0 threshold. Current minimal b-value is 5. - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run('scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_center', '15', '15', '15', '-f', '--b0_threshold', '1') @@ -43,17 +43,17 @@ def test_roi_center_parameter(script_runner, monkeypatch): def test_roi_radii_shape_parameter(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run('scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_radii', '37', '-f') assert ret.success - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run('scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_radii', '37', '37', '37', '-f') assert ret.success - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run('scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_radii', '37', '37', '37', '37', '37', '-f') @@ -62,7 +62,7 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): def test_outputs_precision(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run('scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--precision', '4', '-f') assert ret.success @@ -74,6 +74,6 @@ def test_outputs_precision(script_runner, monkeypatch): def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_frf_ssst.py', in_dwi, + ret = script_runner.run('scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '-f') assert ret.success diff --git a/scripts/tests/test_gradients_apply_transform.py b/src/scilpy/cli/tests/test_gradients_apply_transform.py similarity index 86% rename from scripts/tests/test_gradients_apply_transform.py rename to src/scilpy/cli/tests/test_gradients_apply_transform.py index 8d27063cb..6ca928619 100644 --- a/scripts/tests/test_gradients_apply_transform.py +++ b/src/scilpy/cli/tests/test_gradients_apply_transform.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_apply_transform.py', '--help') + ret = script_runner.run('scil_gradients_apply_transform', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_bst(script_runner, monkeypatch): 'dwi.bvec') in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') - ret = script_runner.run('scil_gradients_apply_transform.py', + ret = script_runner.run('scil_gradients_apply_transform', in_bvecs, in_aff, 'bvecs_transformed.bvec', '--inverse') assert ret.success diff --git a/scripts/tests/test_gradients_convert.py b/src/scilpy/cli/tests/test_gradients_convert.py similarity index 91% rename from scripts/tests/test_gradients_convert.py rename to src/scilpy/cli/tests/test_gradients_convert.py index 6f4addbb8..eda9f7a86 100644 --- a/scripts/tests/test_gradients_convert.py +++ b/src/scilpy/cli/tests/test_gradients_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_convert.py', + ret = script_runner.run('scil_gradients_convert', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_processing_fsl(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_gradients_convert.py', + ret = script_runner.run('scil_gradients_convert', '--input_fsl', in_bval, in_bvec, '1000') assert ret.success @@ -34,7 +34,7 @@ def test_execution_processing_mrtrix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run('scil_gradients_convert.py', + ret = script_runner.run('scil_gradients_convert', '--input_mrtrix', in_encoding, '1000') assert ret.success @@ -46,7 +46,7 @@ def test_name_validation_mrtrix(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_gradients_convert.py', + ret = script_runner.run('scil_gradients_convert', '--input_fsl', in_bval, in_bvec, '1000_test.b') assert ret.success @@ -62,7 +62,7 @@ def test_name_validation_fsl_bval(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run('scil_gradients_convert.py', + ret = script_runner.run('scil_gradients_convert', '--input_mrtrix', in_encoding, '1000_test.bval') assert ret.success @@ -82,7 +82,7 @@ def test_name_validation_fsl_bvec(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run('scil_gradients_convert.py', + ret = script_runner.run('scil_gradients_convert', '--input_mrtrix', in_encoding, '1000_test.bvec') assert ret.success diff --git a/scripts/tests/test_gradients_generate_sampling.py b/src/scilpy/cli/tests/test_gradients_generate_sampling.py similarity index 82% rename from scripts/tests/test_gradients_generate_sampling.py rename to src/scilpy/cli/tests/test_gradients_generate_sampling.py index 2ee25ebb4..d9941d511 100644 --- a/scripts/tests/test_gradients_generate_sampling.py +++ b/src/scilpy/cli/tests/test_gradients_generate_sampling.py @@ -13,13 +13,13 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_generate_sampling.py', '--help') + ret = script_runner.run('scil_gradients_generate_sampling', '--help') assert ret.success def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_gradients_generate_sampling.py', + ret = script_runner.run('scil_gradients_generate_sampling', '6', '6', 'encoding.b', '--mrtrix', '--eddy', '--duty', '--b0_every', '25', '--b0_end', '--bvals', '800', '1200') diff --git a/scripts/tests/test_gradients_modify_axes.py b/src/scilpy/cli/tests/test_gradients_modify_axes.py similarity index 79% rename from scripts/tests/test_gradients_modify_axes.py rename to src/scilpy/cli/tests/test_gradients_modify_axes.py index c2b89c99b..0489a548f 100644 --- a/scripts/tests/test_gradients_modify_axes.py +++ b/src/scilpy/cli/tests/test_gradients_modify_axes.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_modify_axes.py', '--help') + ret = script_runner.run('scil_gradients_modify_axes', '--help') assert ret.success @@ -22,12 +22,12 @@ def test_execution_processing(script_runner, monkeypatch): # mrtrix in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run('scil_gradients_modify_axes.py', in_encoding, + ret = script_runner.run('scil_gradients_modify_axes', in_encoding, '1000_flip.b', '-1', '3', '2') assert ret.success # FSL in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_gradients_modify_axes.py', in_encoding, + ret = script_runner.run('scil_gradients_modify_axes', in_encoding, '1000_flip.bvec', '1', '-3', '2') assert ret.success diff --git a/scripts/tests/test_gradients_normalize_bvecs.py b/src/scilpy/cli/tests/test_gradients_normalize_bvecs.py similarity index 84% rename from scripts/tests/test_gradients_normalize_bvecs.py rename to src/scilpy/cli/tests/test_gradients_normalize_bvecs.py index d05c236cb..d88200634 100644 --- a/scripts/tests/test_gradients_normalize_bvecs.py +++ b/src/scilpy/cli/tests/test_gradients_normalize_bvecs.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_normalize_bvecs.py', + ret = script_runner.run('scil_gradients_normalize_bvecs', '--help') assert ret.success @@ -22,6 +22,6 @@ def test_execution_processing_fsl(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_gradients_normalize_bvecs.py', + ret = script_runner.run('scil_gradients_normalize_bvecs', in_bvec, '1000_norm.bvec') assert ret.success diff --git a/scripts/tests/test_gradients_round_bvals.py b/src/scilpy/cli/tests/test_gradients_round_bvals.py similarity index 86% rename from scripts/tests/test_gradients_round_bvals.py rename to src/scilpy/cli/tests/test_gradients_round_bvals.py index 8fc930a81..7e783a2ba 100644 --- a/scripts/tests/test_gradients_round_bvals.py +++ b/src/scilpy/cli/tests/test_gradients_round_bvals.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_round_bvals.py', + ret = script_runner.run('scil_gradients_round_bvals', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_help_option(script_runner): def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bval = os.path.join(SCILPY_HOME, 'processing', '1000.bval') - ret = script_runner.run('scil_gradients_round_bvals.py', + ret = script_runner.run('scil_gradients_round_bvals', in_bval, '0', '1000', '1000_resample.b', "20", "-v") assert ret.success diff --git a/scripts/tests/test_gradients_validate_correct.py b/src/scilpy/cli/tests/test_gradients_validate_correct.py similarity index 84% rename from scripts/tests/test_gradients_validate_correct.py rename to src/scilpy/cli/tests/test_gradients_validate_correct.py index 04e032dd3..b037ebfe6 100644 --- a/scripts/tests/test_gradients_validate_correct.py +++ b/src/scilpy/cli/tests/test_gradients_validate_correct.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_validate_correct.py', '--help') + ret = script_runner.run('scil_gradients_validate_correct', '--help') assert ret.success @@ -27,11 +27,11 @@ def test_execution_processing_dti_peaks(script_runner, monkeypatch): '1000.bvec') # generate the peaks file and fa map we'll use to test our script - script_runner.run('scil_dti_metrics.py', in_dwi, in_bval, in_bvec, + script_runner.run('scil_dti_metrics', in_dwi, in_bval, in_bvec, '--not_all', '--fa', 'fa.nii.gz', '--evecs', 'evecs.nii.gz') # test the actual script - ret = script_runner.run('scil_gradients_validate_correct.py', in_bvec, + ret = script_runner.run('scil_gradients_validate_correct', in_bvec, 'evecs_v1.nii.gz', 'fa.nii.gz', 'bvec_corr', '-v') assert ret.success @@ -46,6 +46,6 @@ def test_execution_processing_fodf_peaks(script_runner, monkeypatch): 'fa.nii.gz') # test the actual script - ret = script_runner.run('scil_gradients_validate_correct.py', in_bvec, + ret = script_runner.run('scil_gradients_validate_correct', in_bvec, in_peaks, in_fa, 'bvec_corr_fodf', '-v') assert ret.success diff --git a/scripts/tests/test_gradients_validate_correct_eddy.py b/src/scilpy/cli/tests/test_gradients_validate_correct_eddy.py similarity index 98% rename from scripts/tests/test_gradients_validate_correct_eddy.py rename to src/scilpy/cli/tests/test_gradients_validate_correct_eddy.py index 91b36626c..cdd114dc3 100644 --- a/scripts/tests/test_gradients_validate_correct_eddy.py +++ b/src/scilpy/cli/tests/test_gradients_validate_correct_eddy.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_validate_correct_eddy.py', + ret = script_runner.run('scil_gradients_validate_correct_eddy', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution_extract_half(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') - ret = script_runner.run('scil_gradients_validate_correct_eddy.py', + ret = script_runner.run('scil_gradients_validate_correct_eddy', in_bvec, in_bval, "32", 'out.bvec', 'out.bval', @@ -33,7 +33,7 @@ def test_execution_extract_total(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') - ret = script_runner.run('scil_gradients_validate_correct_eddy.py', + ret = script_runner.run('scil_gradients_validate_correct_eddy', in_bvec, in_bval, "64", 'out.bvec', 'out.bval', diff --git a/scripts/tests/test_gradients_validate_sampling.py b/src/scilpy/cli/tests/test_gradients_validate_sampling.py similarity index 81% rename from scripts/tests/test_gradients_validate_sampling.py rename to src/scilpy/cli/tests/test_gradients_validate_sampling.py index 59e1a4063..57f366866 100644 --- a/scripts/tests/test_gradients_validate_sampling.py +++ b/src/scilpy/cli/tests/test_gradients_validate_sampling.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_gradients_validate_sampling.py', '--help') + ret = script_runner.run('scil_gradients_validate_sampling', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_normal(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_gradients_validate_sampling.py', in_bval, + ret = script_runner.run('scil_gradients_validate_sampling', in_bval, in_bvec) assert ret.success @@ -34,5 +34,5 @@ def test_execution_mrtrix(script_runner, monkeypatch): in_b = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run('scil_gradients_validate_sampling.py', in_b) + ret = script_runner.run('scil_gradients_validate_sampling', in_b) assert ret.success diff --git a/scripts/tests/test_header_print_info.py b/src/scilpy/cli/tests/test_header_print_info.py similarity index 80% rename from scripts/tests/test_header_print_info.py rename to src/scilpy/cli/tests/test_header_print_info.py index 77c9d11a0..e3f6928ca 100644 --- a/scripts/tests/test_header_print_info.py +++ b/src/scilpy/cli/tests/test_header_print_info.py @@ -13,19 +13,19 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_header_print_info.py', '--help') + ret = script_runner.run('scil_header_print_info', '--help') assert ret.success def test_execution_img(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'fa.nii.gz') - ret = script_runner.run('scil_header_print_info.py', in_img) + ret = script_runner.run('scil_header_print_info', in_img) assert ret.success def test_execution_tractogram(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'others', 'IFGWM.trk') - ret = script_runner.run('scil_header_print_info.py', in_tracto) + ret = script_runner.run('scil_header_print_info', in_tracto) assert ret.success diff --git a/scripts/tests/test_header_validate_compatibility.py b/src/scilpy/cli/tests/test_header_validate_compatibility.py similarity index 83% rename from scripts/tests/test_header_validate_compatibility.py rename to src/scilpy/cli/tests/test_header_validate_compatibility.py index eeb124a4b..14cff0634 100644 --- a/scripts/tests/test_header_validate_compatibility.py +++ b/src/scilpy/cli/tests/test_header_validate_compatibility.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_header_validate_compatibility.py', '--help') + ret = script_runner.run('scil_header_validate_compatibility', '--help') assert ret.success @@ -21,6 +21,6 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') in_roi = os.path.join(SCILPY_HOME, 'filtering', 'mask.nii.gz') - ret = script_runner.run('scil_header_validate_compatibility.py', + ret = script_runner.run('scil_header_validate_compatibility', in_bundle, in_roi) assert ret.success diff --git a/scripts/tests/test_json_convert_entries_to_xlsx.py b/src/scilpy/cli/tests/test_json_convert_entries_to_xlsx.py similarity index 81% rename from scripts/tests/test_json_convert_entries_to_xlsx.py rename to src/scilpy/cli/tests/test_json_convert_entries_to_xlsx.py index 24bc117b7..ef1b11814 100644 --- a/scripts/tests/test_json_convert_entries_to_xlsx.py +++ b/src/scilpy/cli/tests/test_json_convert_entries_to_xlsx.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_json_convert_entries_to_xlsx.py', '--help') + ret = script_runner.run('scil_json_convert_entries_to_xlsx', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_json = os.path.join(SCILPY_HOME, 'tractometry', 'length_stats_1.json') - ret = script_runner.run('scil_json_convert_entries_to_xlsx.py', in_json, + ret = script_runner.run('scil_json_convert_entries_to_xlsx', in_json, 'length_stats.xlsx') assert ret.success diff --git a/src/scilpy/cli/tests/test_json_harmonize_entries.py b/src/scilpy/cli/tests/test_json_harmonize_entries.py new file mode 100644 index 000000000..e3ed51e97 --- /dev/null +++ b/src/scilpy/cli/tests/test_json_harmonize_entries.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +def test_help_option(script_runner): + ret = script_runner.run('scil_json_harmonize_entries', '--help') + assert ret.success diff --git a/scripts/tests/test_json_merge_entries.py b/src/scilpy/cli/tests/test_json_merge_entries.py similarity index 85% rename from scripts/tests/test_json_merge_entries.py rename to src/scilpy/cli/tests/test_json_merge_entries.py index 7f24c5025..44967514c 100644 --- a/scripts/tests/test_json_merge_entries.py +++ b/src/scilpy/cli/tests/test_json_merge_entries.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_json_merge_entries.py', '--help') + ret = script_runner.run('scil_json_merge_entries', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_tractometry(script_runner, monkeypatch): 'length_stats_1.json') in_json_2 = os.path.join(SCILPY_HOME, 'tractometry', 'length_stats_2.json') - ret = script_runner.run('scil_json_merge_entries.py', in_json_1, + ret = script_runner.run('scil_json_merge_entries', in_json_1, in_json_2, 'merge.json', '--keep_separate') assert ret.success diff --git a/scripts/tests/test_labels_combine.py b/src/scilpy/cli/tests/test_labels_combine.py similarity index 90% rename from scripts/tests/test_labels_combine.py rename to src/scilpy/cli/tests/test_labels_combine.py index 0dbbb89e6..65670f92d 100644 --- a/scripts/tests/test_labels_combine.py +++ b/src/scilpy/cli/tests/test_labels_combine.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_labels_combine.py', '--help') + ret = script_runner.run('scil_labels_combine', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution_atlas(script_runner, monkeypatch): in_atlas_1 = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') in_brainstem = os.path.join(SCILPY_HOME, 'atlas', 'brainstem.nii.gz') - ret = script_runner.run('scil_labels_combine.py', + ret = script_runner.run('scil_labels_combine', 'atlas_freesurfer_v2_single_brainstem.nii.gz', '--volume_ids', in_atlas_1, '8', '47', '251', '252', '253', '254', '1022', '1024', '2022', @@ -35,7 +35,7 @@ def test_execution_atlas_merge(script_runner, monkeypatch): in_atlas_1 = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') in_brainstem = os.path.join(SCILPY_HOME, 'atlas', 'brainstem.nii.gz') - ret = script_runner.run('scil_labels_combine.py', + ret = script_runner.run('scil_labels_combine', 'atlas_freesurfer_v2_merge_brainstem.nii.gz', '--volume_ids', in_atlas_1, '8', '47', '251', '252', '253', '254', '1022', '1024', '2022', diff --git a/scripts/tests/test_labels_dilate.py b/src/scilpy/cli/tests/test_labels_dilate.py similarity index 86% rename from scripts/tests/test_labels_dilate.py rename to src/scilpy/cli/tests/test_labels_dilate.py index eed7ec737..efc7ee78f 100644 --- a/scripts/tests/test_labels_dilate.py +++ b/src/scilpy/cli/tests/test_labels_dilate.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_labels_dilate.py', '--help') + ret = script_runner.run('scil_labels_dilate', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_single_brainstem.nii.gz') - ret = script_runner.run('scil_labels_dilate.py', in_atlas, + ret = script_runner.run('scil_labels_dilate', in_atlas, 'atlas_freesurfer_v2_single_brainstem_dil.nii.gz', '--processes', '1', '--distance', '2') assert ret.success diff --git a/scripts/tests/test_labels_from_mask.py b/src/scilpy/cli/tests/test_labels_from_mask.py similarity index 88% rename from scripts/tests/test_labels_from_mask.py rename to src/scilpy/cli/tests/test_labels_from_mask.py index dc6cb53d7..8dccbcc47 100644 --- a/scripts/tests/test_labels_from_mask.py +++ b/src/scilpy/cli/tests/test_labels_from_mask.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_labels_from_mask.py', '--help') + ret = script_runner.run('scil_labels_from_mask', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_labels_from_mask.py', + ret = script_runner.run('scil_labels_from_mask', in_mask, 'labels_from_mask.nii.gz', '--min_volume', '0', '-f') assert ret.success @@ -33,7 +33,7 @@ def test_execution_labels(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_labels_from_mask.py', + ret = script_runner.run('scil_labels_from_mask', in_mask, 'labels_from_mask.nii.gz', '--labels', '4', '6', '-f') assert ret.success @@ -44,7 +44,7 @@ def test_execution_background(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_labels_from_mask.py', + ret = script_runner.run('scil_labels_from_mask', in_mask, 'labels_from_mask.nii.gz', '--background_label', '9', '-f') assert ret.success @@ -55,7 +55,7 @@ def test_execution_error(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_labels_from_mask.py', + ret = script_runner.run('scil_labels_from_mask', in_mask, 'labels_from_mask.nii.gz', '--labels', '1') assert not ret.success @@ -66,7 +66,7 @@ def test_execution_warning(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_labels_from_mask.py', + ret = script_runner.run('scil_labels_from_mask', in_mask, 'labels_from_mask.nii.gz', '--labels', '1', '2', '3', '-f') assert ret.success @@ -78,7 +78,7 @@ def test_execution_background_warning(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_labels_from_mask.py', + ret = script_runner.run('scil_labels_from_mask', in_mask, 'labels_from_mask.nii.gz', '--background_label', '1', '-f') assert ret.success diff --git a/scripts/tests/test_labels_remove.py b/src/scilpy/cli/tests/test_labels_remove.py similarity index 85% rename from scripts/tests/test_labels_remove.py rename to src/scilpy/cli/tests/test_labels_remove.py index 31521bd37..9b651e2b8 100644 --- a/scripts/tests/test_labels_remove.py +++ b/src/scilpy/cli/tests/test_labels_remove.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_labels_remove.py', '--help') + ret = script_runner.run('scil_labels_remove', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run('scil_labels_remove.py', in_atlas, + ret = script_runner.run('scil_labels_remove', in_atlas, 'atlas_freesurfer_v2_no_brainstem.nii.gz', '-i', '173', '174', '175') assert ret.success diff --git a/scripts/tests/test_labels_split_volume_by_ids.py b/src/scilpy/cli/tests/test_labels_split_volume_by_ids.py similarity index 82% rename from scripts/tests/test_labels_split_volume_by_ids.py rename to src/scilpy/cli/tests/test_labels_split_volume_by_ids.py index 73c41a3e7..6211292bb 100644 --- a/scripts/tests/test_labels_split_volume_by_ids.py +++ b/src/scilpy/cli/tests/test_labels_split_volume_by_ids.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_labels_split_volume_by_ids.py', '--help') + ret = script_runner.run('scil_labels_split_volume_by_ids', '--help') assert ret.success @@ -21,6 +21,6 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run('scil_labels_split_volume_by_ids.py', in_atlas, + ret = script_runner.run('scil_labels_split_volume_by_ids', in_atlas, '--out_prefix', 'brainstem', '-r', '173', '175') assert ret.success diff --git a/scripts/tests/test_labels_split_volume_from_lut.py b/src/scilpy/cli/tests/test_labels_split_volume_from_lut.py similarity index 84% rename from scripts/tests/test_labels_split_volume_from_lut.py rename to src/scilpy/cli/tests/test_labels_split_volume_from_lut.py index 782ed7ac8..ed4019a55 100644 --- a/scripts/tests/test_labels_split_volume_from_lut.py +++ b/src/scilpy/cli/tests/test_labels_split_volume_from_lut.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_labels_split_volume_from_lut.py', '--help') + ret = script_runner.run('scil_labels_split_volume_from_lut', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_atlas(script_runner, monkeypatch): 'atlas_freesurfer_v2.nii.gz') in_json = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_LUT.json') - ret = script_runner.run('scil_labels_split_volume_from_lut.py', in_atlas, + ret = script_runner.run('scil_labels_split_volume_from_lut', in_atlas, '--out_prefix', 'brainstem', '--custom_lut', in_json) assert ret.success diff --git a/scripts/tests/test_lesions_generate_nawm.py b/src/scilpy/cli/tests/test_lesions_generate_nawm.py similarity index 84% rename from scripts/tests/test_lesions_generate_nawm.py rename to src/scilpy/cli/tests/test_lesions_generate_nawm.py index 9c3134d7d..a85379cbe 100644 --- a/scripts/tests/test_lesions_generate_nawm.py +++ b/src/scilpy/cli/tests/test_lesions_generate_nawm.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_lesions_generate_nawm.py', '--help') + ret = script_runner.run('scil_lesions_generate_nawm', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_single_brainstem.nii.gz') - ret = script_runner.run('scil_lesions_generate_nawm.py', in_atlas, + ret = script_runner.run('scil_lesions_generate_nawm', in_atlas, 'nawm.nii.gz', '--nb_ring', '3', '--ring_thickness', '2') assert ret.success diff --git a/scripts/tests/test_lesions_info.py b/src/scilpy/cli/tests/test_lesions_info.py similarity index 63% rename from scripts/tests/test_lesions_info.py rename to src/scilpy/cli/tests/test_lesions_info.py index 1c667997d..9a0bb8199 100644 --- a/scripts/tests/test_lesions_info.py +++ b/src/scilpy/cli/tests/test_lesions_info.py @@ -2,5 +2,5 @@ # -*- coding: utf-8 -*- def test_help_option(script_runner): - ret = script_runner.run('scil_lesions_info.py', '--help') + ret = script_runner.run('scil_lesions_info', '--help') assert ret.success diff --git a/scripts/tests/test_mrds_metrics.py b/src/scilpy/cli/tests/test_mrds_metrics.py similarity index 90% rename from scripts/tests/test_mrds_metrics.py rename to src/scilpy/cli/tests/test_mrds_metrics.py index 62b4a8cfc..8d3413b7d 100644 --- a/scripts/tests/test_mrds_metrics.py +++ b/src/scilpy/cli/tests/test_mrds_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_mrds_metrics.py', '--help') + ret = script_runner.run('scil_mrds_metrics', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_mrds_all_metrics(script_runner, monkeypatch): 'mrds', 'sub-01_MRDS_eigenvalues.nii.gz') # no option - ret = script_runner.run('scil_mrds_metrics.py', + ret = script_runner.run('scil_mrds_metrics', in_evals, '-f') assert ret.success @@ -38,7 +38,7 @@ def test_execution_mrds_not_all_metrics(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'mrds', 'sub-01_mask.nii.gz') # no option - ret = script_runner.run('scil_mrds_metrics.py', + ret = script_runner.run('scil_mrds_metrics', in_evals, '--mask', in_mask, '--not_all', diff --git a/scripts/tests/test_mrds_select_number_of_tensors.py b/src/scilpy/cli/tests/test_mrds_select_number_of_tensors.py similarity index 85% rename from scripts/tests/test_mrds_select_number_of_tensors.py rename to src/scilpy/cli/tests/test_mrds_select_number_of_tensors.py index 7602c3104..f72f7bf33 100644 --- a/scripts/tests/test_mrds_select_number_of_tensors.py +++ b/src/scilpy/cli/tests/test_mrds_select_number_of_tensors.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_mrds_select_number_of_tensors.py', '--help') + ret = script_runner.run('scil_mrds_select_number_of_tensors', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_mrds(script_runner, monkeypatch): in_nufo = os.path.join(SCILPY_HOME, 'mrds', 'sub-01_nufo.nii.gz') # no option - ret = script_runner.run('scil_mrds_select_number_of_tensors.py', + ret = script_runner.run('scil_mrds_select_number_of_tensors', SCILPY_HOME + '/mrds/sub-01', in_nufo, '-f') @@ -38,7 +38,7 @@ def test_execution_mrds_w_mask(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'mrds', 'sub-01_mask.nii.gz') - ret = script_runner.run('scil_mrds_select_number_of_tensors.py', + ret = script_runner.run('scil_mrds_select_number_of_tensors', SCILPY_HOME + '/mrds/sub-01', in_nufo, '--mask', in_mask, diff --git a/scripts/tests/test_mti_adjust_B1_header.py b/src/scilpy/cli/tests/test_mti_adjust_B1_header.py similarity index 85% rename from scripts/tests/test_mti_adjust_B1_header.py rename to src/scilpy/cli/tests/test_mti_adjust_B1_header.py index 2770403d8..490582286 100644 --- a/scripts/tests/test_mti_adjust_B1_header.py +++ b/src/scilpy/cli/tests/test_mti_adjust_B1_header.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_mti_adjust_B1_header.py', '--help') + ret = script_runner.run('scil_mti_adjust_B1_header', '--help') assert ret.success @@ -26,6 +26,6 @@ def test_execution_ihMT_no_option(script_runner, monkeypatch): 'MT', 'sub-001_run-01_B1map.json') # no option - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run('scil_mti_adjust_B1_header', in_b1_map, tmp_dir.name, in_b1_json, '-f') assert ret.success diff --git a/scripts/tests/test_mti_maps_MT.py b/src/scilpy/cli/tests/test_mti_maps_MT.py similarity index 91% rename from scripts/tests/test_mti_maps_MT.py rename to src/scilpy/cli/tests/test_mti_maps_MT.py index 3c893bd37..2938e6f31 100644 --- a/scripts/tests/test_mti_maps_MT.py +++ b/src/scilpy/cli/tests/test_mti_maps_MT.py @@ -58,7 +58,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_mti_maps_MT.py', '--help') + ret = script_runner.run('scil_mti_maps_MT', '--help') assert ret.success @@ -66,7 +66,7 @@ def test_execution_MT_no_option(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # no option - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -83,7 +83,7 @@ def test_execution_MT_prefix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --out_prefix - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -101,7 +101,7 @@ def test_execution_MT_extended(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --extended - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -119,7 +119,7 @@ def test_execution_MT_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --filtering - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -139,11 +139,11 @@ def test_execution_MT_B1_map(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run('scil_mti_adjust_B1_header', in_b1_map, out_b1_map, in_b1_json, '-f') # --in_B1_map - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -165,7 +165,7 @@ def test_execution_MT_wrong_echoes(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # Wrong number of echoes for negative - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -184,7 +184,7 @@ def test_execution_MT_single_echoe(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # Single echoe - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, '--in_positive', in_e1_mton, @@ -201,11 +201,11 @@ def test_execution_MT_B1_not_T1(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run('scil_mti_adjust_B1_header', in_b1_map, out_b1_map, in_b1_json, '-f') # B1 no T1 should raise warning. - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, '--in_positive', in_e1_mton, @@ -223,11 +223,11 @@ def test_execution_MT_B1_no_fit(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run('scil_mti_adjust_B1_header', in_b1_map, out_b1_map, in_b1_json, '-f') # B1 model_based but no fit values - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, '--in_positive', in_e1_mton, @@ -244,7 +244,7 @@ def test_execution_MT_acq_params(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # Acquisition parameters - ret = script_runner.run('scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, '--in_positive', in_e1_mton, diff --git a/scripts/tests/test_mti_maps_ihMT.py b/src/scilpy/cli/tests/test_mti_maps_ihMT.py similarity index 93% rename from scripts/tests/test_mti_maps_ihMT.py rename to src/scilpy/cli/tests/test_mti_maps_ihMT.py index 27476dd23..a3a6f0a5d 100644 --- a/scripts/tests/test_mti_maps_ihMT.py +++ b/src/scilpy/cli/tests/test_mti_maps_ihMT.py @@ -67,7 +67,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_mti_maps_ihMT.py', '--help') + ret = script_runner.run('scil_mti_maps_ihMT', '--help') assert ret.success @@ -75,7 +75,7 @@ def test_execution_ihMT_no_option(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # no option - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -97,7 +97,7 @@ def test_execution_ihMT_prefix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --out_prefix - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -122,7 +122,7 @@ def test_execution_ihMT_extended(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --extended - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -147,7 +147,7 @@ def test_execution_ihMT_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --filtering - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -173,10 +173,10 @@ def test_execution_ihMT_B1_map(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run('scil_mti_adjust_B1_header', in_b1_map, out_b1_map, in_b1_json, '-f') - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -203,10 +203,10 @@ def test_execution_ihMT_B1_no_T1(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run('scil_mti_adjust_B1_header', in_b1_map, out_b1_map, in_b1_json, '-f') - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -227,7 +227,7 @@ def test_execution_ihMT_B1_no_T1(script_runner, monkeypatch): def test_execution_ihMT_wrong_echoes(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -250,10 +250,10 @@ def test_execution_ihMT_B1_no_fit(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run('scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run('scil_mti_adjust_B1_header', in_b1_map, out_b1_map, in_b1_json, '-f') - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -277,7 +277,7 @@ def test_execution_ihMT_B1_no_fit(script_runner, monkeypatch): def test_execution_ihMT_single_echo(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, '--in_altpn', in_e1_altpn, @@ -294,7 +294,7 @@ def test_execution_ihMT_single_echo(script_runner, monkeypatch): def test_execution_ihMT_acq_params(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run('scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, '--in_altpn', in_e1_altpn, diff --git a/scripts/tests/test_plot_stats_per_point.py b/src/scilpy/cli/tests/test_plot_stats_per_point.py similarity index 83% rename from scripts/tests/test_plot_stats_per_point.py rename to src/scilpy/cli/tests/test_plot_stats_per_point.py index 3c72c7721..81f1a16f4 100644 --- a/scripts/tests/test_plot_stats_per_point.py +++ b/src/scilpy/cli/tests/test_plot_stats_per_point.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_plot_stats_per_point.py', '--help') + ret = script_runner.run('scil_plot_stats_per_point', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_json = os.path.join(SCILPY_HOME, 'tractometry', 'metric_label.json') - ret = script_runner.run('scil_plot_stats_per_point.py', in_json, + ret = script_runner.run('scil_plot_stats_per_point', in_json, 'out/', '--stats_over_population') assert ret.success diff --git a/scripts/tests/test_qball_metrics.py b/src/scilpy/cli/tests/test_qball_metrics.py similarity index 86% rename from scripts/tests/test_qball_metrics.py rename to src/scilpy/cli/tests/test_qball_metrics.py index 0a44b4659..9ed21223b 100644 --- a/scripts/tests/test_qball_metrics.py +++ b/src/scilpy/cli/tests/test_qball_metrics.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_qball_metrics.py', '--help') + ret = script_runner.run('scil_qball_metrics', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_processing(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_qball_metrics.py', in_dwi, + ret = script_runner.run('scil_qball_metrics', in_dwi, in_bval, in_bvec) assert ret.success @@ -37,12 +37,12 @@ def test_execution_not_all(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run('scil_qball_metrics.py', in_dwi, + ret = script_runner.run('scil_qball_metrics', in_dwi, in_bval, in_bvec, "--not_all", "--sh", "2.nii.gz") assert ret.success # Test wrong b0. Current minimal b-val is 5. - ret = script_runner.run('scil_qball_metrics.py', in_dwi, + ret = script_runner.run('scil_qball_metrics', in_dwi, in_bval, in_bvec, "--not_all", "--sh", "2.nii.gz", '--b0_threshold', '1', '-f') assert not ret.success diff --git a/scripts/tests/test_rgb_convert.py b/src/scilpy/cli/tests/test_rgb_convert.py similarity index 85% rename from scripts/tests/test_rgb_convert.py rename to src/scilpy/cli/tests/test_rgb_convert.py index 0936de0f0..1c9be4571 100644 --- a/scripts/tests/test_rgb_convert.py +++ b/src/scilpy/cli/tests/test_rgb_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_rgb_convert.py', '--help') + ret = script_runner.run('scil_rgb_convert', '--help') assert ret.success @@ -21,6 +21,6 @@ def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'rgb.nii.gz') - ret = script_runner.run('scil_rgb_convert.py', + ret = script_runner.run('scil_rgb_convert', in_img, 'rgb_4D.nii.gz') assert ret.success diff --git a/scripts/tests/test_search_keywords.py b/src/scilpy/cli/tests/test_search_keywords.py similarity index 58% rename from scripts/tests/test_search_keywords.py rename to src/scilpy/cli/tests/test_search_keywords.py index 44dd6c907..b34618266 100644 --- a/scripts/tests/test_search_keywords.py +++ b/src/scilpy/cli/tests/test_search_keywords.py @@ -3,21 +3,21 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_search_keywords.py', '--help') + ret = script_runner.run('scil_search_keywords', '--help') assert ret.success def test_search_category(script_runner): - ret = script_runner.run('scil_search_keywords.py', '--search_category', 'sh') + ret = script_runner.run('scil_search_keywords', '--search_category', 'sh') assert 'Available objects:' in ret.stdout def test_no_synonyms(script_runner): - ret = script_runner.run('scil_search_keywords.py', 'sh', '--no_synonyms') + ret = script_runner.run('scil_search_keywords', 'sh', '--no_synonyms') assert ret.success def test_not_found(script_runner): - ret = script_runner.run('scil_search_keywords.py', 'toto') + ret = script_runner.run('scil_search_keywords', 'toto') assert ret.success assert 'No results found!' in ret.stdout or 'No results found!' in ret.stderr diff --git a/scripts/tests/test_sh_convert.py b/src/scilpy/cli/tests/test_sh_convert.py similarity index 86% rename from scripts/tests/test_sh_convert.py rename to src/scilpy/cli/tests/test_sh_convert.py index ca8549893..c0f4ad21f 100644 --- a/scripts/tests/test_sh_convert.py +++ b/src/scilpy/cli/tests/test_sh_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_sh_convert.py', '--help') + ret = script_runner.run('scil_sh_convert', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf.nii.gz') - ret = script_runner.run('scil_sh_convert.py', in_fodf, + ret = script_runner.run('scil_sh_convert', in_fodf, 'fodf_descoteaux07.nii.gz', 'tournier07', 'descoteaux07_legacy', '--processes', '1') assert ret.success diff --git a/scripts/tests/test_sh_fusion.py b/src/scilpy/cli/tests/test_sh_fusion.py similarity index 84% rename from scripts/tests/test_sh_fusion.py rename to src/scilpy/cli/tests/test_sh_fusion.py index dc6b07a6e..475aa37e6 100644 --- a/scripts/tests/test_sh_fusion.py +++ b/src/scilpy/cli/tests/test_sh_fusion.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_sh_fusion.py', '--help') + ret = script_runner.run('scil_sh_fusion', '--help') assert ret.success @@ -23,5 +23,5 @@ def test_execution_processing(script_runner, monkeypatch): 'sh_1000.nii.gz') in_sh_2 = os.path.join(SCILPY_HOME, 'processing', 'sh_3000.nii.gz') - ret = script_runner.run('scil_sh_fusion.py', in_sh_1, in_sh_2, 'sh.nii.gz') + ret = script_runner.run('scil_sh_fusion', in_sh_1, in_sh_2, 'sh.nii.gz') assert ret.success diff --git a/scripts/tests/test_sh_to_aodf.py b/src/scilpy/cli/tests/test_sh_to_aodf.py similarity index 95% rename from scripts/tests/test_sh_to_aodf.py rename to src/scilpy/cli/tests/test_sh_to_aodf.py index 17a9c819d..36f7d9c38 100644 --- a/scripts/tests/test_sh_to_aodf.py +++ b/src/scilpy/cli/tests/test_sh_to_aodf.py @@ -17,7 +17,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_sh_to_aodf.py', '--help') + ret = script_runner.run('scil_sh_to_aodf', '--help') assert ret.success @@ -28,7 +28,7 @@ def test_help_option(script_runner): def test_asym_basis_output_gpu(script_runner, in_fodf, expected_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_sh_to_aodf.py', + ret = script_runner.run('scil_sh_to_aodf', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', '--sigma_align', '0.8', @@ -64,7 +64,7 @@ def test_asym_basis_output_gpu(script_runner, in_fodf, expected_fodf, monkeypatc def test_asym_basis_output(script_runner, in_fodf, expected_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_sh_to_aodf.py', + ret = script_runner.run('scil_sh_to_aodf', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', '--sigma_align', '0.8', @@ -91,7 +91,7 @@ def test_asym_basis_output(script_runner, in_fodf, expected_fodf, monkeypatch): def test_asym_input(script_runner, in_fodf, expected_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_sh_to_aodf.py', + ret = script_runner.run('scil_sh_to_aodf', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', '--sigma_align', '0.8', @@ -117,7 +117,7 @@ def test_asym_input(script_runner, in_fodf, expected_fodf, monkeypatch): def test_cosine_method(script_runner, in_fodf, out_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_sh_to_aodf.py', + ret = script_runner.run('scil_sh_to_aodf', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', '--method', 'cosine', '-f', diff --git a/scripts/tests/test_sh_to_rish.py b/src/scilpy/cli/tests/test_sh_to_rish.py similarity index 82% rename from scripts/tests/test_sh_to_rish.py rename to src/scilpy/cli/tests/test_sh_to_rish.py index 6568c29b9..1cfdf7a51 100644 --- a/scripts/tests/test_sh_to_rish.py +++ b/src/scilpy/cli/tests/test_sh_to_rish.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_sh_to_rish.py', '--help') + ret = script_runner.run('scil_sh_to_rish', '--help') assert ret.success @@ -21,5 +21,5 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sh = os.path.join(SCILPY_HOME, 'processing', 'sh.nii.gz') - ret = script_runner.run('scil_sh_to_rish.py', in_sh, 'rish.nii.gz') + ret = script_runner.run('scil_sh_to_rish', in_sh, 'rish.nii.gz') assert ret.success diff --git a/scripts/tests/test_sh_to_sf.py b/src/scilpy/cli/tests/test_sh_to_sf.py similarity index 90% rename from scripts/tests/test_sh_to_sf.py rename to src/scilpy/cli/tests/test_sh_to_sf.py index 8703876c3..1f78940ca 100644 --- a/scripts/tests/test_sh_to_sf.py +++ b/src/scilpy/cli/tests/test_sh_to_sf.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_sh_to_sf.py', '--help') + ret = script_runner.run('scil_sh_to_sf', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_in_sphere(script_runner, monkeypatch): in_bval = os.path.join(SCILPY_HOME, 'processing', '1000.bval') # Required: either --sphere or --in_bvec. Here, --sphere - ret = script_runner.run('scil_sh_to_sf.py', in_sh, + ret = script_runner.run('scil_sh_to_sf', in_sh, 'sf_724.nii.gz', '--in_bval', in_bval, '--in_b0', in_b0, '--out_bval', 'sf_724.bval', '--out_bvec', 'sf_724.bvec', @@ -40,7 +40,7 @@ def test_execution_in_bvec(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') # --in_bvec: in_bval is required. - ret = script_runner.run('scil_sh_to_sf.py', in_sh, + ret = script_runner.run('scil_sh_to_sf', in_sh, 'sf_724.nii.gz', '--in_bval', in_bval, '--out_bval', 'sf_724.bval', '--out_bvec', 'sf_724.bvec', @@ -49,7 +49,7 @@ def test_execution_in_bvec(script_runner, monkeypatch): assert ret.success # Test that fails if no bvals is given. - ret = script_runner.run('scil_sh_to_sf.py', in_sh, + ret = script_runner.run('scil_sh_to_sf', in_sh, 'sf_724.nii.gz', '--out_bvec', 'sf_724.bvec', '--in_bvec', in_bvec, '--dtype', 'float32', '-f', @@ -64,7 +64,7 @@ def test_execution_no_bval(script_runner, monkeypatch): # --sphere but no --bval # Testing multiprocessing option - ret = script_runner.run('scil_sh_to_sf.py', in_sh, + ret = script_runner.run('scil_sh_to_sf', in_sh, 'sf_724.nii.gz', '--in_b0', in_b0, '--out_bvec', 'sf_724.bvec', '--b0_scaling', '--sphere', 'symmetric724', '--dtype', 'float32', diff --git a/scripts/tests/test_stats_group_comparison.py b/src/scilpy/cli/tests/test_stats_group_comparison.py similarity index 90% rename from scripts/tests/test_stats_group_comparison.py rename to src/scilpy/cli/tests/test_stats_group_comparison.py index 70b7a9364..079663530 100644 --- a/scripts/tests/test_stats_group_comparison.py +++ b/src/scilpy/cli/tests/test_stats_group_comparison.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run( - 'scil_stats_group_comparison.py', + 'scil_stats_group_comparison', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_execution_bundles(script_runner, monkeypatch): in_participants = os.path.join(SCILPY_HOME, 'stats/group', 'meanstd_all.json') - ret = script_runner.run('scil_stats_group_comparison.py', + ret = script_runner.run('scil_stats_group_comparison', in_participants, in_json, 'Group', '-b', 'AF_L', '-m', 'FIT_FW', diff --git a/scripts/tests/test_surface_apply_transform.py b/src/scilpy/cli/tests/test_surface_apply_transform.py similarity index 84% rename from scripts/tests/test_surface_apply_transform.py rename to src/scilpy/cli/tests/test_surface_apply_transform.py index 80a0e6767..bbc74a48c 100644 --- a/scripts/tests/test_surface_apply_transform.py +++ b/src/scilpy/cli/tests/test_surface_apply_transform.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_surface_apply_transform.py', '--help') + ret = script_runner.run('scil_surface_apply_transform', '--help') assert ret.success @@ -23,6 +23,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): 'lhpialt.vtk') in_aff = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'affine.txt') - ret = script_runner.run('scil_surface_apply_transform.py', in_surf, + ret = script_runner.run('scil_surface_apply_transform', in_surf, in_aff, 'lhpialt_lin.vtk', '--inverse') assert ret.success diff --git a/scripts/tests/test_surface_convert.py b/src/scilpy/cli/tests/test_surface_convert.py similarity index 85% rename from scripts/tests/test_surface_convert.py rename to src/scilpy/cli/tests/test_surface_convert.py index d14cfc851..1aac34241 100644 --- a/scripts/tests/test_surface_convert.py +++ b/src/scilpy/cli/tests/test_surface_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_surface_convert.py', '--help') + ret = script_runner.run('scil_surface_convert', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lhpialt.vtk') - ret = script_runner.run('scil_surface_convert.py', in_surf, + ret = script_runner.run('scil_surface_convert', in_surf, 'rhpialt.ply') assert ret.success @@ -31,7 +31,7 @@ def test_execution_surface_vtk_xfrom(script_runner, monkeypatch): in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lh.pialt_xform') ref = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') - ret = script_runner.run('scil_surface_convert.py', in_surf, + ret = script_runner.run('scil_surface_convert', in_surf, 'lh.pialt_xform.vtk', '--reference', ref, '--flip_axes', '-1', '-1', '1') assert ret.success diff --git a/scripts/tests/test_surface_create.py b/src/scilpy/cli/tests/test_surface_create.py similarity index 90% rename from scripts/tests/test_surface_create.py rename to src/scilpy/cli/tests/test_surface_create.py index fe15cb64f..da272f126 100644 --- a/scripts/tests/test_surface_create.py +++ b/src/scilpy/cli/tests/test_surface_create.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_surface_create.py', '--help') + ret = script_runner.run('scil_surface_create', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run('scil_surface_create.py', + ret = script_runner.run('scil_surface_create', '--in_labels', in_atlas, 'surface.vtk', '--list_indices', '2024:2035 1024', @@ -39,7 +39,7 @@ def test_execution_atlas_each_index(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run('scil_surface_create.py', + ret = script_runner.run('scil_surface_create', '--in_labels', in_atlas, 'surface.vtk', '--each_index', @@ -57,7 +57,7 @@ def test_execution_atlas_no_index(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run('scil_surface_create.py', + ret = script_runner.run('scil_surface_create', '--in_labels', in_atlas, 'surface.vtk', '--fill', @@ -73,7 +73,7 @@ def test_execution_mask(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_mask = os.path.join(SCILPY_HOME, 'atlas', 'brainstem_bin.nii.gz') - ret = script_runner.run('scil_surface_create.py', + ret = script_runner.run('scil_surface_create', '--in_mask', in_mask, 'surface.vtk', '-f') assert ret.success @@ -83,7 +83,7 @@ def test_execution_volume(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_t1 = os.path.join(SCILPY_HOME, 'others', 't1.nii.gz') - ret = script_runner.run('scil_surface_create.py', + ret = script_runner.run('scil_surface_create', '--in_volume', in_t1, '--value', '0.2', 'surface.vtk', '-f') diff --git a/scripts/tests/test_surface_flip.py b/src/scilpy/cli/tests/test_surface_flip.py similarity index 85% rename from scripts/tests/test_surface_flip.py rename to src/scilpy/cli/tests/test_surface_flip.py index 6ebf77018..e4ac77c5d 100644 --- a/scripts/tests/test_surface_flip.py +++ b/src/scilpy/cli/tests/test_surface_flip.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_surface_flip.py', '--help') + ret = script_runner.run('scil_surface_flip', '--help') assert ret.success @@ -23,6 +23,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lhpialt.vtk') - ret = script_runner.run('scil_surface_flip.py', in_surf, 'rhpialt.vtk', + ret = script_runner.run('scil_surface_flip', in_surf, 'rhpialt.vtk', 'x') assert ret.success diff --git a/scripts/tests/test_surface_smooth.py b/src/scilpy/cli/tests/test_surface_smooth.py similarity index 85% rename from scripts/tests/test_surface_smooth.py rename to src/scilpy/cli/tests/test_surface_smooth.py index 11d0b8e58..591693e9b 100644 --- a/scripts/tests/test_surface_smooth.py +++ b/src/scilpy/cli/tests/test_surface_smooth.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_surface_smooth.py', '--help') + ret = script_runner.run('scil_surface_smooth', '--help') assert ret.success @@ -21,6 +21,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lhpialt.vtk') - ret = script_runner.run('scil_surface_smooth.py', in_surf, + ret = script_runner.run('scil_surface_smooth', in_surf, 'lhpialt_smooth.vtk', '-n', '5', '-s', '1') assert ret.success diff --git a/scripts/tests/test_tracking_local.py b/src/scilpy/cli/tests/test_tracking_local.py similarity index 89% rename from scripts/tests/test_tracking_local.py rename to src/scilpy/cli/tests/test_tracking_local.py index 38f89a3e9..9eaf46689 100644 --- a/scripts/tests/test_tracking_local.py +++ b/src/scilpy/cli/tests/test_tracking_local.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tracking_local.py', '--help') + ret = script_runner.run('scil_tracking_local', '--help') assert ret.success @@ -26,7 +26,7 @@ def test_execution_tracking_fodf_prob(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'local_prob.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200') @@ -38,7 +38,7 @@ def test_execution_tracking_fodf_det(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'local_det.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -51,7 +51,7 @@ def test_execution_tracking_ptt(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'local_ptt.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -64,7 +64,7 @@ def test_execution_sphere_subdivide(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'local_sphere.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', @@ -78,7 +78,7 @@ def test_execution_sphere_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'sphere_gpu.trk', '--use_gpu', '--sphere', 'symmetric362', '--npv', '1') @@ -91,7 +91,7 @@ def test_sh_interp_without_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'nearest_interp.trk', '--sh_interp', 'nearest', '--nt', '100') @@ -103,7 +103,7 @@ def test_forward_without_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'fwd_only.trk', '--forward_only', '--nt', '100') @@ -115,7 +115,7 @@ def test_batch_size_without_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'batch.trk', '--batch_size', 100) @@ -127,7 +127,7 @@ def test_algo_with_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'gpu_det.trk', '--algo', 'det', '--use_gpu', '--nt', '100') @@ -139,7 +139,7 @@ def test_execution_tracking_fodf_no_compression(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'local_prob2.trk', '--nt', '100', '--sh_basis', 'descoteaux07', '--max_length', '200') @@ -151,7 +151,7 @@ def test_execution_tracking_peaks(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_peaks = os.path.join(SCILPY_HOME, 'tracking', 'peaks.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_peaks, + ret = script_runner.run('scil_tracking_local', in_peaks, in_mask, in_mask, 'local_eudx.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -164,7 +164,7 @@ def test_execution_tracking_fodf_prob_pmf_mapping(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'local_prob3.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -177,7 +177,7 @@ def test_execution_tracking_ptt_with_probe(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'local_ptt.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -195,7 +195,7 @@ def test_execution_tracking_fodf_custom_seeds(script_runner, monkeypatch): custom_seeds = [[1., 1., 1.], [2., 2., 2.], [3., 3., 3.]] np.save(in_custom_seeds, custom_seeds) - ret = script_runner.run('scil_tracking_local.py', in_fodf, + ret = script_runner.run('scil_tracking_local', in_fodf, in_mask, in_mask, 'local_prob4.trk', '--in_custom_seeds', in_custom_seeds, '--compress', '0.1', '--sh_basis', 'descoteaux07', diff --git a/scripts/tests/test_tracking_local_dev.py b/src/scilpy/cli/tests/test_tracking_local_dev.py similarity index 92% rename from scripts/tests/test_tracking_local_dev.py rename to src/scilpy/cli/tests/test_tracking_local_dev.py index 38d79d01b..94f8dde29 100644 --- a/scripts/tests/test_tracking_local_dev.py +++ b/src/scilpy/cli/tests/test_tracking_local_dev.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tracking_local_dev.py', + ret = script_runner.run('scil_tracking_local_dev', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_execution_tracking_fodf(script_runner, monkeypatch): 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local_dev.py', in_fodf, + ret = script_runner.run('scil_tracking_local_dev', in_fodf, in_mask, in_mask, 'local_prob.trk', '--nt', '10', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -44,7 +44,7 @@ def test_execution_tracking_rap(script_runner, monkeypatch): in_rap_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_local_dev.py', in_fodf, + ret = script_runner.run('scil_tracking_local_dev', in_fodf, in_mask, in_mask, 'local_prob_rap.trk', '--nt', '10', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -67,7 +67,7 @@ def test_execution_tracking_fodf_custom_seeds(script_runner, monkeypatch): custom_seeds = [[1., 1., 1.], [2., 2., 2.], [3., 3., 3.]] np.save(in_custom_seeds, custom_seeds) - ret = script_runner.run('scil_tracking_local_dev.py', in_fodf, + ret = script_runner.run('scil_tracking_local_dev', in_fodf, in_mask, in_mask, 'local_prob2.trk', '--in_custom_seeds', in_custom_seeds, '--compress', '0.1', '--sh_basis', 'descoteaux07', diff --git a/scripts/tests/test_tracking_pft.py b/src/scilpy/cli/tests/test_tracking_pft.py similarity index 91% rename from scripts/tests/test_tracking_pft.py rename to src/scilpy/cli/tests/test_tracking_pft.py index 08529e281..9168aa96c 100644 --- a/scripts/tests/test_tracking_pft.py +++ b/src/scilpy/cli/tests/test_tracking_pft.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tracking_pft.py', + ret = script_runner.run('scil_tracking_pft', '--help') assert ret.success @@ -28,7 +28,7 @@ def test_execution_tracking(script_runner, monkeypatch): 'map_include.nii.gz') in_exclude = os.path.join(SCILPY_HOME, 'tracking', 'map_exclude.nii.gz') - ret = script_runner.run('scil_tracking_pft.py', in_fodf, + ret = script_runner.run('scil_tracking_pft', in_fodf, in_interface, in_include, in_exclude, 'pft.trk', '--nt', '1000', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', diff --git a/scripts/tests/test_tracking_pft_maps.py b/src/scilpy/cli/tests/test_tracking_pft_maps.py similarity index 88% rename from scripts/tests/test_tracking_pft_maps.py rename to src/scilpy/cli/tests/test_tracking_pft_maps.py index a21ad0d5d..c0340fa0e 100644 --- a/scripts/tests/test_tracking_pft_maps.py +++ b/src/scilpy/cli/tests/test_tracking_pft_maps.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tracking_pft_maps.py', + ret = script_runner.run('scil_tracking_pft_maps', '--help') assert ret.success @@ -26,6 +26,6 @@ def test_execution_tracking(script_runner, monkeypatch): 'map_gm.nii.gz') in_csf = os.path.join(SCILPY_HOME, 'tracking', 'map_csf.nii.gz') - ret = script_runner.run('scil_tracking_pft_maps.py', + ret = script_runner.run('scil_tracking_pft_maps', in_wm, in_gm, in_csf) assert ret.success diff --git a/scripts/tests/test_tracking_pft_maps_edit.py b/src/scilpy/cli/tests/test_tracking_pft_maps_edit.py similarity index 88% rename from scripts/tests/test_tracking_pft_maps_edit.py rename to src/scilpy/cli/tests/test_tracking_pft_maps_edit.py index b08fe6bac..c7ba25e7d 100644 --- a/scripts/tests/test_tracking_pft_maps_edit.py +++ b/src/scilpy/cli/tests/test_tracking_pft_maps_edit.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tracking_pft_maps_edit.py', '--help') + ret = script_runner.run('scil_tracking_pft_maps_edit', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_execution_tracking(script_runner, monkeypatch): 'map_exclude.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run('scil_tracking_pft_maps_edit.py', + ret = script_runner.run('scil_tracking_pft_maps_edit', in_include, in_exclude, in_mask, 'map_include_corr.nii.gz', 'map_exclude_corr.nii.gz') diff --git a/scripts/tests/test_tractogram_apply_transform.py b/src/scilpy/cli/tests/test_tractogram_apply_transform.py similarity index 87% rename from scripts/tests/test_tractogram_apply_transform.py rename to src/scilpy/cli/tests/test_tractogram_apply_transform.py index 475db0441..16da8ac82 100644 --- a/scripts/tests/test_tractogram_apply_transform.py +++ b/src/scilpy/cli/tests/test_tractogram_apply_transform.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_apply_transform.py', '--help') + ret = script_runner.run('scil_tractogram_apply_transform', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_inverse(script_runner, monkeypatch): in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') in_warp = os.path.join(SCILPY_HOME, 'bst', 'output1InverseWarp.nii.gz') - ret = script_runner.run('scil_tractogram_apply_transform.py', + ret = script_runner.run('scil_tractogram_apply_transform', in_model, in_fa, in_aff, 'rpt_m_warp.trk', '--inverse', '--in_deformation', in_warp, '--cut') diff --git a/scripts/tests/test_tractogram_apply_transform_to_hdf5.py b/src/scilpy/cli/tests/test_tractogram_apply_transform_to_hdf5.py similarity index 98% rename from scripts/tests/test_tractogram_apply_transform_to_hdf5.py rename to src/scilpy/cli/tests/test_tractogram_apply_transform_to_hdf5.py index a51d7fc1c..cfc782ea1 100644 --- a/scripts/tests/test_tractogram_apply_transform_to_hdf5.py +++ b/src/scilpy/cli/tests/test_tractogram_apply_transform_to_hdf5.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_apply_transform_to_hdf5.py', + ret = script_runner.run('scil_tractogram_apply_transform_to_hdf5', '--help') assert ret.success @@ -28,6 +28,6 @@ def test_execution_connectivity(script_runner, monkeypatch): # toDo. Add a --in_deformation file in our test data, fitting with hdf5. # (See test_tractogram_apply_transform) # toDo. Add some dps in the hdf5's data for more line coverage. - ret = script_runner.run('scil_tractogram_apply_transform_to_hdf5.py', + ret = script_runner.run('scil_tractogram_apply_transform_to_hdf5', in_h5, in_target, in_transfo, 'decompose_lin.h5') assert ret.success diff --git a/scripts/tests/test_tractogram_assign_custom_color.py b/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py similarity index 98% rename from scripts/tests/test_tractogram_assign_custom_color.py rename to src/scilpy/cli/tests/test_tractogram_assign_custom_color.py index 10c5887fe..7af51cb80 100644 --- a/scripts/tests/test_tractogram_assign_custom_color.py +++ b/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py @@ -18,7 +18,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_assign_custom_color.py', + ret = script_runner.run('scil_tractogram_assign_custom_color', '--help') assert ret.success @@ -28,7 +28,7 @@ def test_execution_from_anat(script_runner, monkeypatch): in_anat = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run('scil_tractogram_assign_custom_color.py', + ret = script_runner.run('scil_tractogram_assign_custom_color', in_bundle, 'colored.trk', '--from_anatomy', in_anat, '--out_colorbar', 'test_colorbar.png') assert ret.success @@ -37,7 +37,7 @@ def test_execution_from_anat(script_runner, monkeypatch): def test_execution_along_profile(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_assign_custom_color.py', + ret = script_runner.run('scil_tractogram_assign_custom_color', in_bundle, 'colored2.trk', '--along_profile') assert ret.success @@ -45,6 +45,6 @@ def test_execution_along_profile(script_runner, monkeypatch): def test_execution_from_angle(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_assign_custom_color.py', + ret = script_runner.run('scil_tractogram_assign_custom_color', in_bundle, 'colored3.trk', '--local_angle') assert ret.success diff --git a/scripts/tests/test_tractogram_assign_uniform_color.py b/src/scilpy/cli/tests/test_tractogram_assign_uniform_color.py similarity index 98% rename from scripts/tests/test_tractogram_assign_uniform_color.py rename to src/scilpy/cli/tests/test_tractogram_assign_uniform_color.py index d22d951cd..80f717bfe 100644 --- a/scripts/tests/test_tractogram_assign_uniform_color.py +++ b/src/scilpy/cli/tests/test_tractogram_assign_uniform_color.py @@ -16,7 +16,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_assign_uniform_color.py', + ret = script_runner.run('scil_tractogram_assign_uniform_color', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_help_option(script_runner): def test_execution_fill(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_assign_uniform_color.py', + ret = script_runner.run('scil_tractogram_assign_uniform_color', in_bundle, '--fill_color', '0x000000', '--out_tractogram', 'colored.trk', '-f') assert ret.success @@ -39,7 +39,7 @@ def test_execution_dict(script_runner, monkeypatch): with open(json_file, "w+") as f: json.dump(my_dict, f) - ret = script_runner.run('scil_tractogram_assign_uniform_color.py', + ret = script_runner.run('scil_tractogram_assign_uniform_color', in_bundle, '--dict_colors', json_file, '--out_suffix', 'colored', '-f') assert ret.success @@ -54,7 +54,7 @@ def test_execution_dict_new_color(script_runner, monkeypatch): json.dump(my_dict, f) shutil.copy2(in_bundle, 'dummy.trk') - ret = script_runner.run('scil_tractogram_assign_uniform_color.py', + ret = script_runner.run('scil_tractogram_assign_uniform_color', in_bundle, "dummy.trk", '--dict_colors', json_file, '--out_suffix', 'colored', '-f') diff --git a/scripts/tests/test_tractogram_commit.py b/src/scilpy/cli/tests/test_tractogram_commit.py similarity index 89% rename from scripts/tests/test_tractogram_commit.py rename to src/scilpy/cli/tests/test_tractogram_commit.py index ca67913e9..7a80bcc1c 100644 --- a/scripts/tests/test_tractogram_commit.py +++ b/src/scilpy/cli/tests/test_tractogram_commit.py @@ -20,7 +20,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_commit.py', '--help') + ret = script_runner.run('scil_tractogram_commit', '--help') assert ret.success @@ -29,7 +29,7 @@ def test_execution_commit_amico(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run( - 'scil_tractogram_commit.py', in_tracking, in_dwi, in_bval, in_bvec, + 'scil_tractogram_commit', in_tracking, in_dwi, in_bval, in_bvec, 'results_bzs/', '--tol', '30', '--nbr_dir', '500', '--nbr_iter', '500', '--in_peaks', in_peaks, '--in_tracking_mask', in_mask, @@ -45,7 +45,7 @@ def test_execution_commit2(script_runner, monkeypatch): # TODO Add a HDF5 in our test data that could be used here. ret = script_runner.run( - 'scil_tractogram_commit.py', in_tracking, in_dwi, in_bval, in_bvec, + 'scil_tractogram_commit', in_tracking, in_dwi, in_bval, in_bvec, 'results_bzs/', '--tol', '30', '--nbr_dir', '500', '--nbr_iter', '500', '--in_peaks', in_peaks, '--in_tracking_mask', in_mask, diff --git a/scripts/tests/test_tractogram_compress.py b/src/scilpy/cli/tests/test_tractogram_compress.py similarity index 84% rename from scripts/tests/test_tractogram_compress.py rename to src/scilpy/cli/tests/test_tractogram_compress.py index 67d935a90..6a20ac171 100644 --- a/scripts/tests/test_tractogram_compress.py +++ b/src/scilpy/cli/tests/test_tractogram_compress.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_compress.py', '--help') + ret = script_runner.run('scil_tractogram_compress', '--help') assert ret.success @@ -21,6 +21,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fib = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'gyri_fanning.trk') - ret = script_runner.run('scil_tractogram_compress.py', in_fib, + ret = script_runner.run('scil_tractogram_compress', in_fib, 'gyri_fanning_c.trk', '-e', '0.1') assert ret.success diff --git a/scripts/tests/test_tractogram_compute_TODI.py b/src/scilpy/cli/tests/test_tractogram_compute_TODI.py similarity index 86% rename from scripts/tests/test_tractogram_compute_TODI.py rename to src/scilpy/cli/tests/test_tractogram_compute_TODI.py index f95ed1e92..7c91747b6 100644 --- a/scripts/tests/test_tractogram_compute_TODI.py +++ b/src/scilpy/cli/tests/test_tractogram_compute_TODI.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_compute_TODI.py', '--help') + ret = script_runner.run('scil_tractogram_compute_TODI', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution_bst(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'bst', 'rpt_m_warp.trk') in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') - ret = script_runner.run('scil_tractogram_compute_TODI.py', in_bundle, + ret = script_runner.run('scil_tractogram_compute_TODI', in_bundle, '--mask', in_mask, '--out_mask', 'todi_mask.nii.gz', '--out_tdi', 'tdi.nii.gz', @@ -37,7 +37,7 @@ def test_execution_bst(script_runner, monkeypatch): def test_execution_asym(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'bst', 'rpt_m_warp.trk') - ret = script_runner.run('scil_tractogram_compute_TODI.py', in_bundle, + ret = script_runner.run('scil_tractogram_compute_TODI', in_bundle, '--out_todi_sh', 'atodi_sh_8.nii.gz', '--asymmetric', '--n_steps', '2') diff --git a/scripts/tests/test_tractogram_compute_density_map.py b/src/scilpy/cli/tests/test_tractogram_compute_density_map.py similarity index 98% rename from scripts/tests/test_tractogram_compute_density_map.py rename to src/scilpy/cli/tests/test_tractogram_compute_density_map.py index 81cd495fe..4d177456c 100644 --- a/scripts/tests/test_tractogram_compute_density_map.py +++ b/src/scilpy/cli/tests/test_tractogram_compute_density_map.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_compute_density_map.py', + ret = script_runner.run('scil_tractogram_compute_density_map', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_help_option(script_runner): def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'others', 'IFGWM.trk') - ret = script_runner.run('scil_tractogram_compute_density_map.py', + ret = script_runner.run('scil_tractogram_compute_density_map', in_bundle, 'binary.nii.gz', '--endpoints_only') assert ret.success @@ -29,6 +29,6 @@ def test_execution_others(script_runner, monkeypatch): def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') - ret = script_runner.run('scil_tractogram_compute_density_map.py', + ret = script_runner.run('scil_tractogram_compute_density_map', in_bundle, 'IFGWM.nii.gz', '--binary') assert ret.success diff --git a/scripts/tests/test_tractogram_convert.py b/src/scilpy/cli/tests/test_tractogram_convert.py similarity index 85% rename from scripts/tests/test_tractogram_convert.py rename to src/scilpy/cli/tests/test_tractogram_convert.py index 6354f15fc..e4f18d442 100644 --- a/scripts/tests/test_tractogram_convert.py +++ b/src/scilpy/cli/tests/test_tractogram_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_convert.py', '--help') + ret = script_runner.run('scil_tractogram_convert', '--help') assert ret.success @@ -23,6 +23,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): 'gyri_fanning.fib') in_fa = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') - ret = script_runner.run('scil_tractogram_convert.py', in_fib, + ret = script_runner.run('scil_tractogram_convert', in_fib, 'gyri_fanning.trk', '--reference', in_fa) assert ret.success diff --git a/scripts/tests/test_tractogram_convert_hdf5_to_trk.py b/src/scilpy/cli/tests/test_tractogram_convert_hdf5_to_trk.py similarity index 98% rename from scripts/tests/test_tractogram_convert_hdf5_to_trk.py rename to src/scilpy/cli/tests/test_tractogram_convert_hdf5_to_trk.py index 720eaad1e..a507bacb9 100644 --- a/scripts/tests/test_tractogram_convert_hdf5_to_trk.py +++ b/src/scilpy/cli/tests/test_tractogram_convert_hdf5_to_trk.py @@ -14,13 +14,13 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk.py', '--help') + ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk', '--help') assert ret.success def test_execution_all_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk.py', + ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk', in_h5, 'save_trk/') assert ret.success @@ -31,7 +31,7 @@ def test_execution_all_keys(script_runner, monkeypatch): def test_execution_edge_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk.py', + ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk', in_h5, 'save_trk2/', '--edge_keys', '1_10', '1_7') assert ret.success @@ -42,7 +42,7 @@ def test_execution_edge_keys(script_runner, monkeypatch): def test_execution_node_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk.py', + ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk', in_h5, 'save_trk3/', '--node_keys', '7') assert ret.success @@ -58,7 +58,7 @@ def test_execution_save_empty(script_runner, monkeypatch): # connections. with open('labels_list.txt', 'w') as f: f.write('1\n10\n100') - ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk.py', + ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk', in_h5, 'save_trk4/', '--save_empty', 'labels_list.txt', '--edge_keys', '1_10', '1_100', diff --git a/scripts/tests/test_tractogram_convert_trk_to_hdf5.py b/src/scilpy/cli/tests/test_tractogram_convert_trk_to_hdf5.py similarity index 98% rename from scripts/tests/test_tractogram_convert_trk_to_hdf5.py rename to src/scilpy/cli/tests/test_tractogram_convert_trk_to_hdf5.py index fd564f939..4e47957a5 100644 --- a/scripts/tests/test_tractogram_convert_trk_to_hdf5.py +++ b/src/scilpy/cli/tests/test_tractogram_convert_trk_to_hdf5.py @@ -18,13 +18,13 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_convert_trk_to_hdf5.py', '--help') + ret = script_runner.run('scil_tractogram_convert_trk_to_hdf5', '--help') assert ret.success def test_execution_edge_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk.py', + ret = script_runner.run('scil_tractogram_convert_hdf5_to_trk', in_h5, 'save_trk/', '--edge_keys', '1_10', '1_7') assert ret.success @@ -32,7 +32,7 @@ def test_execution_edge_keys(script_runner, monkeypatch): out_files = glob.glob('save_trk/*') assert len(out_files) == 2 - ret = script_runner.run('scil_tractogram_convert_trk_to_hdf5.py', + ret = script_runner.run('scil_tractogram_convert_trk_to_hdf5', 'save_trk/1_10.trk', 'save_trk/1_7.trk', 'two_edges.h5', '--stored_space', 'voxmm', diff --git a/scripts/tests/test_tractogram_count_streamlines.py b/src/scilpy/cli/tests/test_tractogram_count_streamlines.py similarity index 80% rename from scripts/tests/test_tractogram_count_streamlines.py rename to src/scilpy/cli/tests/test_tractogram_count_streamlines.py index 7b2e4aa47..0a540e36b 100644 --- a/scripts/tests/test_tractogram_count_streamlines.py +++ b/src/scilpy/cli/tests/test_tractogram_count_streamlines.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_count_streamlines.py', '--help') + ret = script_runner.run('scil_tractogram_count_streamlines', '--help') assert ret.success @@ -21,5 +21,5 @@ def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'others', 'IFGWM_sub.trk') - ret = script_runner.run('scil_tractogram_count_streamlines.py', in_bundle) + ret = script_runner.run('scil_tractogram_count_streamlines', in_bundle) assert ret.success diff --git a/scripts/tests/test_tractogram_cut_streamlines.py b/src/scilpy/cli/tests/test_tractogram_cut_streamlines.py similarity index 91% rename from scripts/tests/test_tractogram_cut_streamlines.py rename to src/scilpy/cli/tests/test_tractogram_cut_streamlines.py index 91267c8ef..9e5d7ceb6 100644 --- a/scripts/tests/test_tractogram_cut_streamlines.py +++ b/src/scilpy/cli/tests/test_tractogram_cut_streamlines.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run('scil_tractogram_cut_streamlines', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution(script_runner, monkeypatch): in_tractogram = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') in_mask = os.path.join(SCILPY_HOME, 'filtering', 'mask.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run('scil_tractogram_cut_streamlines', in_tractogram, 'out_tractogram_cut.trk', '--mask', in_mask, '--min_length', '0', '-f', '--reference', in_mask, @@ -40,7 +40,7 @@ def test_execution_two_rois(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run('scil_tractogram_cut_streamlines', in_tractogram, '--mask', in_mask, 'out_tractogram_cut.trk', '-f', '--mask', in_mask, '--min_length', '0', @@ -57,7 +57,7 @@ def test_execution_keep_longest(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run('scil_tractogram_cut_streamlines', in_tractogram, '--mask', in_mask, 'out_tractogram_cut.trk', '-f', '--keep_longest', '--mask', in_mask, @@ -75,7 +75,7 @@ def test_execution_trim_endpoints(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run('scil_tractogram_cut_streamlines', in_tractogram, '--mask', in_mask, 'out_tractogram_cut.trk', '-f', '--trim_endpoints', '--mask', in_mask, @@ -91,7 +91,7 @@ def test_execution_labels(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run('scil_tractogram_cut_streamlines', in_tractogram, '--labels', in_labels, 'out_tractogram_cut.trk', '-f', '--label_ids', '1', '10', @@ -105,7 +105,7 @@ def test_execution_labels_error_trim(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run('scil_tractogram_cut_streamlines', in_tractogram, '--labels', in_labels, 'out_tractogram_cut2.trk', '-f', '--label_ids', '1', '10', @@ -120,7 +120,7 @@ def test_execution_labels_no_point(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run('scil_tractogram_cut_streamlines', in_tractogram, '--labels', in_labels, 'out_tractogram_cut.trk', '-f', '--no_point_in_roi', '--label_ids', '1', '10') @@ -133,7 +133,7 @@ def test_execution_labels_one_point(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run('scil_tractogram_cut_streamlines.py', + ret = script_runner.run('scil_tractogram_cut_streamlines', in_tractogram, '--labels', in_labels, 'out_tractogram_cut.trk', '-f', '--one_point_in_roi', '--label_ids', '1', '10') diff --git a/scripts/tests/test_tractogram_detect_loops.py b/src/scilpy/cli/tests/test_tractogram_detect_loops.py similarity index 87% rename from scripts/tests/test_tractogram_detect_loops.py rename to src/scilpy/cli/tests/test_tractogram_detect_loops.py index 73bc88209..72de8cbdc 100644 --- a/scripts/tests/test_tractogram_detect_loops.py +++ b/src/scilpy/cli/tests/test_tractogram_detect_loops.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_detect_loops.py', '--help') + ret = script_runner.run('scil_tractogram_detect_loops', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4_filtered.trk') - ret = script_runner.run('scil_tractogram_detect_loops.py', + ret = script_runner.run('scil_tractogram_detect_loops', in_bundle, 'bundle_4_filtered_no_loops.trk', '--looping_tractogram', 'bundle_4_filtered_loops.trk', diff --git a/scripts/tests/test_tractogram_dpp_math.py b/src/scilpy/cli/tests/test_tractogram_dpp_math.py similarity index 90% rename from scripts/tests/test_tractogram_dpp_math.py rename to src/scilpy/cli/tests/test_tractogram_dpp_math.py index 0471961ed..144c0e68b 100644 --- a/scripts/tests/test_tractogram_dpp_math.py +++ b/src/scilpy/cli/tests/test_tractogram_dpp_math.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_dpp_math.py', '--help') + ret = script_runner.run('scil_tractogram_dpp_math', '--help') assert ret.success @@ -26,12 +26,12 @@ def test_execution_tractogram_point_math_mean_3D_defaults(script_runner, t1_on_bundle = 't1_on_streamlines.trk' # Create some dpp. Could have test data with dpp instead. - script_runner.run('scil_tractogram_project_map_to_streamlines.py', + script_runner.run('scil_tractogram_project_map_to_streamlines', in_bundle, t1_on_bundle, '--in_maps', in_t1, '--out_dpp_name', 't1') # Test dps mode - ret = script_runner.run('scil_tractogram_dpp_math.py', + ret = script_runner.run('scil_tractogram_dpp_math', 'mean', t1_on_bundle, 't1_mean_on_streamlines.trk', '--mode', 'dps', '--in_dpp_name', 't1', '--out_keys', 't1_mean') @@ -39,7 +39,7 @@ def test_execution_tractogram_point_math_mean_3D_defaults(script_runner, assert ret.success # Test dpp mode - ret = script_runner.run('scil_tractogram_dpp_math.py', + ret = script_runner.run('scil_tractogram_dpp_math', 'mean', t1_on_bundle, 't1_mean_on_streamlines2.trk', '--mode', 'dpp', '--in_dpp_name', 't1', @@ -55,12 +55,12 @@ def test_execution_tractogram_point_math_mean_4D_correlation(script_runner, in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') fodf_on_bundle = 'fodf_on_streamlines.trk' - script_runner.run('scil_tractogram_project_map_to_streamlines.py', + script_runner.run('scil_tractogram_project_map_to_streamlines', in_bundle, fodf_on_bundle, '--in_maps', in_fodf, in_fodf, '--out_dpp_name', 'fodf', 'fodf2') - ret = script_runner.run('scil_tractogram_dpp_math.py', + ret = script_runner.run('scil_tractogram_dpp_math', 'correlation', fodf_on_bundle, 'fodf_correlation_on_streamlines.trk', '--mode', 'dps', '--endpoints_only', diff --git a/scripts/tests/test_tractogram_dps_math.py b/src/scilpy/cli/tests/test_tractogram_dps_math.py similarity index 90% rename from scripts/tests/test_tractogram_dps_math.py rename to src/scilpy/cli/tests/test_tractogram_dps_math.py index 8a133633e..0eb2cedef 100644 --- a/scripts/tests/test_tractogram_dps_math.py +++ b/src/scilpy/cli/tests/test_tractogram_dps_math.py @@ -16,7 +16,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run('scil_tractogram_dps_math', '--help') assert ret.success @@ -29,7 +29,7 @@ def test_execution_dps_math_import(script_runner, monkeypatch): filename = 'vals.npy' outname = 'out.trk' np.save(filename, np.arange(len(sft))) - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run('scil_tractogram_dps_math', in_bundle, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname, @@ -43,7 +43,7 @@ def test_execution_dps_math_import_single_value(script_runner, in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') outname = 'out.trk' - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run('scil_tractogram_dps_math', in_bundle, 'import', 'key', '--in_dps_single_value', '42', '--out_tractogram', outname, @@ -57,7 +57,7 @@ def test_execution_dps_math_import_single_value_array(script_runner, in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') outname = 'out.trk' - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run('scil_tractogram_dps_math', in_bundle, 'import', 'key', '--in_dps_single_value', '1', '1.1', '1.2', '--out_tractogram', outname, @@ -74,7 +74,7 @@ def test_execution_dps_math_import_with_missing_vals(script_runner, filename = 'vals.npy' outname = 'out.trk' np.save(filename, np.arange(len(sft) - 10)) - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run('scil_tractogram_dps_math', in_bundle, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname, @@ -92,13 +92,13 @@ def test_execution_dps_math_import_with_existing_key(script_runner, outname = 'out.trk' outname2 = 'out_2.trk' np.save(filename, np.arange(len(sft))) - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run('scil_tractogram_dps_math', in_bundle, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname, '-f') assert ret.success - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run('scil_tractogram_dps_math', outname, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname2,) @@ -113,7 +113,7 @@ def test_execution_dps_math_tck_output(script_runner, monkeypatch): filename = 'vals.npy' outname = 'out.tck' np.save(filename, np.arange(len(sft))) - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run('scil_tractogram_dps_math', in_bundle, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname, @@ -132,7 +132,7 @@ def test_execution_dps_math_delete(script_runner, monkeypatch): } save_tractogram(sft, in_bundle) outname = 'out.trk' - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run('scil_tractogram_dps_math', in_bundle, 'delete', 'key', '--out_tractogram', outname, '-f') @@ -144,7 +144,7 @@ def test_execution_dps_math_delete_no_key(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') outname = 'out.trk' - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run('scil_tractogram_dps_math', in_bundle, 'delete', 'key', '--out_tractogram', outname, '-f') @@ -162,7 +162,7 @@ def test_execution_dps_math_export(script_runner, monkeypatch): } save_tractogram(sft, in_bundle) filename = 'out.txt' - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run('scil_tractogram_dps_math', in_bundle, 'export', 'key', '--out_dps_file', filename, '-f') @@ -174,7 +174,7 @@ def test_execution_dps_math_export_no_key(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') filename = 'out.txt' - ret = script_runner.run('scil_tractogram_dps_math.py', + ret = script_runner.run('scil_tractogram_dps_math', in_bundle, 'export', 'key', '--out_dps_file', filename, '-f') diff --git a/scripts/tests/test_tractogram_extract_ushape.py b/src/scilpy/cli/tests/test_tractogram_extract_ushape.py similarity index 88% rename from scripts/tests/test_tractogram_extract_ushape.py rename to src/scilpy/cli/tests/test_tractogram_extract_ushape.py index bbcfed761..f3774a9d6 100644 --- a/scripts/tests/test_tractogram_extract_ushape.py +++ b/src/scilpy/cli/tests/test_tractogram_extract_ushape.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_extract_ushape.py', + ret = script_runner.run('scil_tractogram_extract_ushape', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_processing(script_runner, monkeypatch): in_trk = os.path.join(SCILPY_HOME, 'tracking', 'union.trk') out_trk = 'ushape.trk' remaining_trk = 'remaining.trk' - ret = script_runner.run('scil_tractogram_extract_ushape.py', + ret = script_runner.run('scil_tractogram_extract_ushape', in_trk, out_trk, '--minU', '0.5', '--maxU', '1', diff --git a/scripts/tests/test_tractogram_filter_by_anatomy.py b/src/scilpy/cli/tests/test_tractogram_filter_by_anatomy.py similarity index 91% rename from scripts/tests/test_tractogram_filter_by_anatomy.py rename to src/scilpy/cli/tests/test_tractogram_filter_by_anatomy.py index 2b8e04d8c..466266848 100644 --- a/scripts/tests/test_tractogram_filter_by_anatomy.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_by_anatomy.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_filter_by_anatomy.py', + ret = script_runner.run('scil_tractogram_filter_by_anatomy', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_filtering_all_options(script_runner, monkeypatch): 'tractogram_filter_ana.trk') in_wmparc = os.path.join(SCILPY_HOME, 'anatomical_filtering', 'wmparc_filter_ana.nii.gz') - ret = script_runner.run('scil_tractogram_filter_by_anatomy.py', + ret = script_runner.run('scil_tractogram_filter_by_anatomy', in_tractogram, in_wmparc, os.path.expanduser(tmp_dir.name), '--minL', '40', '--maxL', '200', '--angle', '300', @@ -43,7 +43,7 @@ def test_execution_filtering_rejected(script_runner, monkeypatch): 'tractogram_filter_ana.trk') in_wmparc = os.path.join(SCILPY_HOME, 'anatomical_filtering', 'wmparc_filter_ana.nii.gz') - ret = script_runner.run('scil_tractogram_filter_by_anatomy.py', + ret = script_runner.run('scil_tractogram_filter_by_anatomy', in_tractogram, in_wmparc, os.path.expanduser(tmp_dir.name), '--minL', '40', '--maxL', '200', '--angle', '300', @@ -61,7 +61,7 @@ def test_execution_filtering_save_intermediate(script_runner, monkeypatch): 'tractogram_filter_ana.trk') in_wmparc = os.path.join(SCILPY_HOME, 'anatomical_filtering', 'wmparc_filter_ana.nii.gz') - ret = script_runner.run('scil_tractogram_filter_by_anatomy.py', + ret = script_runner.run('scil_tractogram_filter_by_anatomy', in_tractogram, in_wmparc, os.path.expanduser(tmp_dir.name), '--minL', '40', '--maxL', '200', '--angle', '300', diff --git a/scripts/tests/test_tractogram_filter_by_length.py b/src/scilpy/cli/tests/test_tractogram_filter_by_length.py similarity index 90% rename from scripts/tests/test_tractogram_filter_by_length.py rename to src/scilpy/cli/tests/test_tractogram_filter_by_length.py index d5f4eda7d..7979ad558 100644 --- a/scripts/tests/test_tractogram_filter_by_length.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_by_length.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_filter_by_length.py', + ret = script_runner.run('scil_tractogram_filter_by_length', '--help') assert ret.success @@ -26,7 +26,7 @@ def test_execution_filtering(script_runner, monkeypatch): # script execution. in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') - ret = script_runner.run('scil_tractogram_filter_by_length.py', + ret = script_runner.run('scil_tractogram_filter_by_length', in_bundle, 'bundle_4_filtered.trk', '--minL', '125', '--maxL', '130') @@ -40,7 +40,7 @@ def test_rejected_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') - ret = script_runner.run('scil_tractogram_filter_by_length.py', + ret = script_runner.run('scil_tractogram_filter_by_length', in_bundle, 'bundle_all_1mm_filtered.trk', '--minL', '125', '--maxL', '130', '--out_rejected', 'bundle_all_1mm_rejected.trk') @@ -59,7 +59,7 @@ def test_rejected_filtering_no_rejection(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') - ret = script_runner.run('scil_tractogram_filter_by_length.py', + ret = script_runner.run('scil_tractogram_filter_by_length', in_bundle, 'bundle_4_filtered_no_rejection.trk', '--minL', '125', '--maxL', '130', '--out_rejected', 'bundle_4_rejected.trk') diff --git a/scripts/tests/test_tractogram_filter_by_orientation.py b/src/scilpy/cli/tests/test_tractogram_filter_by_orientation.py similarity index 98% rename from scripts/tests/test_tractogram_filter_by_orientation.py rename to src/scilpy/cli/tests/test_tractogram_filter_by_orientation.py index 727cf22c9..171466cd7 100644 --- a/scripts/tests/test_tractogram_filter_by_orientation.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_by_orientation.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_filter_by_orientation.py', + ret = script_runner.run('scil_tractogram_filter_by_orientation', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') - ret = script_runner.run('scil_tractogram_filter_by_orientation.py', + ret = script_runner.run('scil_tractogram_filter_by_orientation', in_bundle, 'bundle_4_filtered.trk', '--min_x', '20', '--max_y', '230', '--min_z', '30', '--use_abs') diff --git a/scripts/tests/test_tractogram_filter_by_roi.py b/src/scilpy/cli/tests/test_tractogram_filter_by_roi.py similarity index 87% rename from scripts/tests/test_tractogram_filter_by_roi.py rename to src/scilpy/cli/tests/test_tractogram_filter_by_roi.py index 52470a943..5d5b797fa 100644 --- a/scripts/tests/test_tractogram_filter_by_roi.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_by_roi.py @@ -19,14 +19,14 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_filter_by_roi.py', '--help') + ret = script_runner.run('scil_tractogram_filter_by_roi', '--help') assert ret.success def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_filter_by_roi.py', in_tractogram, + ret = script_runner.run('scil_tractogram_filter_by_roi', in_tractogram, 'bundle_1.trk', '--display_counts', '--drawn_roi', in_roi, 'any', 'include', '--bdo', in_bdo, 'any', 'include', @@ -40,7 +40,7 @@ def test_execution_filtering(script_runner, monkeypatch): def test_execution_filtering_overwrite_distance(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_filter_by_roi.py', in_tractogram, + ret = script_runner.run('scil_tractogram_filter_by_roi', in_tractogram, 'bundle_2.trk', '--display_counts', '--drawn_roi', in_roi, 'any', 'include', '2', '--overwrite_distance', 'any', 'include', '4') @@ -57,7 +57,7 @@ def test_execution_filtering_list(script_runner, monkeypatch): f.write('bdo {} "any" "include"\n'.format(in_bdo)) f.write("bdo {} 'any' include".format(in_bdo)) - ret = script_runner.run('scil_tractogram_filter_by_roi.py', in_tractogram, + ret = script_runner.run('scil_tractogram_filter_by_roi', in_tractogram, 'bundle_3.trk', '--display_counts', '--filtering_list', filelist) assert ret.success diff --git a/scripts/tests/test_tractogram_filter_collisions.py b/src/scilpy/cli/tests/test_tractogram_filter_collisions.py similarity index 86% rename from scripts/tests/test_tractogram_filter_collisions.py rename to src/scilpy/cli/tests/test_tractogram_filter_collisions.py index 037f585e4..3cdcee957 100644 --- a/scripts/tests/test_tractogram_filter_collisions.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_collisions.py @@ -33,7 +33,7 @@ def init_data(): def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_filter_collisions.py', '--help') + ret = script_runner.run('scil_tractogram_filter_collisions', '--help') assert ret.success @@ -44,7 +44,7 @@ def test_execution_filtering(script_runner, monkeypatch): diameters = [5, 1] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run('scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '-f') assert ret.success @@ -57,7 +57,7 @@ def test_execution_filtering_out_colliding_prefix(script_runner, monkeypatch): diameters = [5, 1] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run('scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '--out_colliding_prefix', 'tractogram', '-f') assert ret.success @@ -70,7 +70,7 @@ def test_execution_filtering_single_diameter(script_runner, monkeypatch): diameters = [5] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run('scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '-f') assert ret.success @@ -83,7 +83,7 @@ def test_execution_filtering_no_shuffle(script_runner, monkeypatch): diameters = [5, 1] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run('scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '--disable_shuffling', '-f') assert ret.success @@ -96,7 +96,7 @@ def test_execution_filtering_min_distance(script_runner, monkeypatch): diameters = [0.001, 0.001] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run('scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '--min_distance', '5', '-f') assert ret.success @@ -110,7 +110,7 @@ def test_execution_filtering_metrics(script_runner, monkeypatch): diameters = [0.001, 0.001] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run('scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '--out_metrics', 'metrics.json', '-f') assert ret.success @@ -124,7 +124,7 @@ def test_execution_rotation_matrix(script_runner, monkeypatch): diameters = [0.001, 0.001] np.savetxt('diameters.txt', diameters) - ret = script_runner.run('scil_tractogram_filter_collisions.py', + ret = script_runner.run('scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '--out_rotation_matrix', 'rotation.mat', '-f') assert ret.success diff --git a/scripts/tests/test_tractogram_flip.py b/src/scilpy/cli/tests/test_tractogram_flip.py similarity index 86% rename from scripts/tests/test_tractogram_flip.py rename to src/scilpy/cli/tests/test_tractogram_flip.py index eb0d55ee6..bf4732351 100644 --- a/scripts/tests/test_tractogram_flip.py +++ b/src/scilpy/cli/tests/test_tractogram_flip.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_flip.py', '--help') + ret = script_runner.run('scil_tractogram_flip', '--help') assert ret.success @@ -23,6 +23,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): 'gyri_fanning.fib') in_fa = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') - ret = script_runner.run('scil_tractogram_flip.py', in_fib, + ret = script_runner.run('scil_tractogram_flip', in_fib, 'gyri_fanning.tck', 'x', '--reference', in_fa) assert ret.success diff --git a/scripts/tests/test_tractogram_math.py b/src/scilpy/cli/tests/test_tractogram_math.py similarity index 84% rename from scripts/tests/test_tractogram_math.py rename to src/scilpy/cli/tests/test_tractogram_math.py index e4b3a85f8..3a35949f3 100644 --- a/scripts/tests/test_tractogram_math.py +++ b/src/scilpy/cli/tests/test_tractogram_math.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_math.py', '--help') + ret = script_runner.run('scil_tractogram_math', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution_lazy_concatenate_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'lazy_concatenate', + ret = script_runner.run('scil_tractogram_math', 'lazy_concatenate', in_tracto_1, in_tracto_2, 'lazy_concatenate.trk') assert ret.success @@ -32,7 +32,7 @@ def test_execution_lazy_concatenate_mix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'lazy_concatenate', + ret = script_runner.run('scil_tractogram_math', 'lazy_concatenate', in_tracto_1, in_tracto_2, 'lazy_concatenate_mix.trk') assert ret.success @@ -42,7 +42,7 @@ def test_execution_union_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'union', + ret = script_runner.run('scil_tractogram_math', 'union', in_tracto_1, in_tracto_2, 'union.trk') assert ret.success @@ -51,7 +51,7 @@ def test_execution_intersection_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'intersection', + ret = script_runner.run('scil_tractogram_math', 'intersection', in_tracto_1, in_tracto_2, 'intersection.trk') assert ret.success @@ -60,7 +60,7 @@ def test_execution_difference_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'difference', + ret = script_runner.run('scil_tractogram_math', 'difference', in_tracto_1, in_tracto_2, 'difference.trk') assert ret.success @@ -69,7 +69,7 @@ def test_execution_concatenate_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'concatenate', + ret = script_runner.run('scil_tractogram_math', 'concatenate', in_tracto_1, in_tracto_2, 'concatenate.trk') assert ret.success @@ -78,7 +78,7 @@ def test_execution_union_no_color_robust(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'union', + ret = script_runner.run('scil_tractogram_math', 'union', in_tracto_1, in_tracto_2, 'union_r.trk', '--robust') assert ret.success @@ -88,7 +88,7 @@ def test_execution_intersection_no_color_robust(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'intersection', + ret = script_runner.run('scil_tractogram_math', 'intersection', in_tracto_1, in_tracto_2, 'intersection_r.trk', '--robust') assert ret.success @@ -98,7 +98,7 @@ def test_execution_difference_no_color_robust(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'difference', + ret = script_runner.run('scil_tractogram_math', 'difference', in_tracto_1, in_tracto_2, 'difference_r.trk', '--robust') assert ret.success @@ -108,7 +108,7 @@ def test_execution_union_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run('scil_tractogram_math.py', 'union', + ret = script_runner.run('scil_tractogram_math', 'union', in_tracto_1, in_tracto_2, 'union_color.trk') assert ret.success @@ -117,7 +117,7 @@ def test_execution_intersection_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run('scil_tractogram_math.py', 'intersection', + ret = script_runner.run('scil_tractogram_math', 'intersection', in_tracto_1, in_tracto_2, 'intersection_color.trk') assert ret.success @@ -126,7 +126,7 @@ def test_execution_difference_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run('scil_tractogram_math.py', 'difference', + ret = script_runner.run('scil_tractogram_math', 'difference', in_tracto_1, in_tracto_2, 'difference_color.trk') assert ret.success @@ -135,7 +135,7 @@ def test_execution_concatenate_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run('scil_tractogram_math.py', 'concatenate', + ret = script_runner.run('scil_tractogram_math', 'concatenate', in_tracto_1, in_tracto_2, 'concatenate_color.trk') assert ret.success @@ -145,7 +145,7 @@ def test_execution_union_mix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'union', + ret = script_runner.run('scil_tractogram_math', 'union', in_tracto_1, in_tracto_2, 'union_mix.trk') assert not ret.success @@ -154,7 +154,7 @@ def test_execution_intersection_mix_fake(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run('scil_tractogram_math.py', 'intersection', + ret = script_runner.run('scil_tractogram_math', 'intersection', in_tracto_1, in_tracto_2, 'intersection_mix.trk', '--fake_metadata') assert ret.success @@ -164,7 +164,7 @@ def test_execution_difference_empty_result(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundle_0.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run('scil_tractogram_math.py', 'difference', + ret = script_runner.run('scil_tractogram_math', 'difference', in_tracto_1, in_tracto_2, 'difference_empty_results.trk', '--no_metadata') assert ret.success @@ -174,7 +174,7 @@ def test_execution_difference_empty_input_1(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'empty.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run('scil_tractogram_math.py', 'difference', + ret = script_runner.run('scil_tractogram_math', 'difference', in_tracto_1, in_tracto_2, 'difference_empty_1.trk', '--no_metadata') assert ret.success @@ -184,7 +184,7 @@ def test_execution_difference_empty_input_2(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') in_tracto_2 = os.path.join(trk_path, 'empty.trk') - ret = script_runner.run('scil_tractogram_math.py', 'difference', + ret = script_runner.run('scil_tractogram_math', 'difference', in_tracto_1, in_tracto_2, 'difference_empty_2.trk', '--no_metadata') assert ret.success diff --git a/scripts/tests/test_tractogram_pairwise_comparison.py b/src/scilpy/cli/tests/test_tractogram_pairwise_comparison.py similarity index 95% rename from scripts/tests/test_tractogram_pairwise_comparison.py rename to src/scilpy/cli/tests/test_tractogram_pairwise_comparison.py index 5393ce273..1d44e2cc7 100644 --- a/scripts/tests/test_tractogram_pairwise_comparison.py +++ b/src/scilpy/cli/tests/test_tractogram_pairwise_comparison.py @@ -17,13 +17,13 @@ def test_help_option(script_runner): ret = script_runner.run( - 'scil_tractogram_pairwise_comparison.py', '--help') + 'scil_tractogram_pairwise_comparison', '--help') assert ret.success def test_execution_bundles_skip(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_pairwise_comparison.py', + ret = script_runner.run('scil_tractogram_pairwise_comparison', in_1, in_2, '--out_dir', tmp_dir.name, '--reference', in_ref, '--skip_streamlines_distance') @@ -32,7 +32,7 @@ def test_execution_bundles_skip(script_runner, monkeypatch): def test_execution_bundles(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_pairwise_comparison.py', + ret = script_runner.run('scil_tractogram_pairwise_comparison', in_1, in_2, '--out_dir', tmp_dir.name, '--reference', in_ref, '-f', '--skip_streamlines_distance') diff --git a/scripts/tests/test_tractogram_print_info.py b/src/scilpy/cli/tests/test_tractogram_print_info.py similarity index 81% rename from scripts/tests/test_tractogram_print_info.py rename to src/scilpy/cli/tests/test_tractogram_print_info.py index 2691b29e8..dbebde613 100644 --- a/scripts/tests/test_tractogram_print_info.py +++ b/src/scilpy/cli/tests/test_tractogram_print_info.py @@ -13,12 +13,12 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_print_info.py', '--help') + ret = script_runner.run('scil_tractogram_print_info', '--help') assert ret.success def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') - ret = script_runner.run('scil_tractogram_print_info.py', in_bundle) + ret = script_runner.run('scil_tractogram_print_info', in_bundle) assert ret.success diff --git a/scripts/tests/test_tractogram_project_map_to_streamlines.py b/src/scilpy/cli/tests/test_tractogram_project_map_to_streamlines.py similarity index 95% rename from scripts/tests/test_tractogram_project_map_to_streamlines.py rename to src/scilpy/cli/tests/test_tractogram_project_map_to_streamlines.py index 2567601e1..7cecc03fd 100644 --- a/scripts/tests/test_tractogram_project_map_to_streamlines.py +++ b/src/scilpy/cli/tests/test_tractogram_project_map_to_streamlines.py @@ -18,14 +18,14 @@ def test_help_option(script_runner): ret = script_runner.run( - 'scil_tractogram_project_map_to_streamlines.py', '--help') + 'scil_tractogram_project_map_to_streamlines', '--help') assert ret.success def test_execution_3D_map(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run('scil_tractogram_project_map_to_streamlines', in_tracto_1, 't1_on_streamlines.trk', '--in_maps', in_3d_map, '--out_dpp_name', 't1') @@ -35,7 +35,7 @@ def test_execution_3D_map(script_runner, monkeypatch): def test_execution_4D_map(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run('scil_tractogram_project_map_to_streamlines', in_tracto_1, 'rgb_on_streamlines.trk', '--in_maps', in_4d_map, '--out_dpp_name', 'rgb') @@ -45,7 +45,7 @@ def test_execution_4D_map(script_runner, monkeypatch): def test_execution_3D_map_endpoints_only(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run('scil_tractogram_project_map_to_streamlines', in_tracto_1, 't1_on_streamlines_endpoints.trk', '--in_maps', in_3d_map, @@ -57,7 +57,7 @@ def test_execution_3D_map_endpoints_only(script_runner, monkeypatch): def test_execution_4D_map_endpoints_only(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run('scil_tractogram_project_map_to_streamlines', in_tracto_1, 'rgb_on_streamlines_endpoints.trk', '--in_maps', in_4d_map, @@ -69,7 +69,7 @@ def test_execution_4D_map_endpoints_only(script_runner, monkeypatch): def test_execution_3D_map_trilinear(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run('scil_tractogram_project_map_to_streamlines', in_tracto_1, 't1_on_streamlines_trilinear.trk', '--in_maps', in_3d_map, diff --git a/scripts/tests/test_tractogram_project_streamlines_to_map.py b/src/scilpy/cli/tests/test_tractogram_project_streamlines_to_map.py similarity index 95% rename from scripts/tests/test_tractogram_project_streamlines_to_map.py rename to src/scilpy/cli/tests/test_tractogram_project_streamlines_to_map.py index bd2aded71..8a4afeb15 100644 --- a/scripts/tests/test_tractogram_project_streamlines_to_map.py +++ b/src/scilpy/cli/tests/test_tractogram_project_streamlines_to_map.py @@ -16,7 +16,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run('scil_tractogram_project_streamlines_to_map', '--help') assert ret.success @@ -29,24 +29,24 @@ def test_execution_dpp(script_runner, monkeypatch): # Create our test data with dpp: add metrics as dpp. # Or get a tractogram that already as some dpp in the test data. - script_runner.run('scil_tractogram_project_map_to_streamlines.py', + script_runner.run('scil_tractogram_project_map_to_streamlines', in_bundle, in_bundle_with_dpp, '-f', '--in_maps', in_mni, '--out_dpp_name', 'some_metric') # Tests with dpp. - ret = script_runner.run('scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run('scil_tractogram_project_streamlines_to_map', in_bundle_with_dpp, 'project_dpp_', '--use_dpp', 'some_metric', '--point_by_point', '--to_endpoints') assert ret.success - ret = script_runner.run('scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run('scil_tractogram_project_streamlines_to_map', in_bundle_with_dpp, 'project_mean_to_endpoints_', '--use_dpp', 'some_metric', '--mean_streamline', '--to_endpoints') assert ret.success - ret = script_runner.run('scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run('scil_tractogram_project_streamlines_to_map', in_bundle_with_dpp, 'project_end_to_wm', '--use_dpp', 'some_metric', '--mean_endpoints', '--to_wm') @@ -62,16 +62,16 @@ def test_execution_dps(script_runner, monkeypatch): # Create our test data with dps: add metrics as dps. # Or get a tractogram that already as some dps in the test data. - script_runner.run('scil_tractogram_project_map_to_streamlines.py', + script_runner.run('scil_tractogram_project_map_to_streamlines', in_bundle, in_bundle_with_dpp, '-f', '--in_maps', in_mni, '--out_dpp_name', 'some_metric') - script_runner.run('scil_tractogram_dpp_math.py', 'min', in_bundle_with_dpp, + script_runner.run('scil_tractogram_dpp_math', 'min', in_bundle_with_dpp, in_bundle_with_dps, '--in_dpp_name', 'some_metric', '--out_keys', 'some_metric_dps', '--mode', 'dps', '--keep_all') # Tests with dps. - ret = script_runner.run('scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run('scil_tractogram_project_streamlines_to_map', in_bundle_with_dps, 'project_dps_', '--use_dps', 'some_metric_dps', '--point_by_point', '--to_wm') diff --git a/scripts/tests/test_tractogram_qbx.py b/src/scilpy/cli/tests/test_tractogram_qbx.py similarity index 84% rename from scripts/tests/test_tractogram_qbx.py rename to src/scilpy/cli/tests/test_tractogram_qbx.py index 1357fe728..af967dfb3 100644 --- a/scripts/tests/test_tractogram_qbx.py +++ b/src/scilpy/cli/tests/test_tractogram_qbx.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_qbx.py', '--help') + ret = script_runner.run('scil_tractogram_qbx', '--help') assert ret.success @@ -21,6 +21,6 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') - ret = script_runner.run('scil_tractogram_qbx.py', in_bundle, '12', + ret = script_runner.run('scil_tractogram_qbx', in_bundle, '12', 'clusters/', '--out_centroids', 'centroids.trk') assert ret.success diff --git a/scripts/tests/test_tractogram_register.py b/src/scilpy/cli/tests/test_tractogram_register.py similarity index 87% rename from scripts/tests/test_tractogram_register.py rename to src/scilpy/cli/tests/test_tractogram_register.py index 8d5084060..9deda4f79 100644 --- a/scripts/tests/test_tractogram_register.py +++ b/src/scilpy/cli/tests/test_tractogram_register.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_register.py', '--help') + ret = script_runner.run('scil_tractogram_register', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_execution_bundles(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') - ret = script_runner.run('scil_tractogram_register.py', in_moving, + ret = script_runner.run('scil_tractogram_register', in_moving, in_static, '--only_rigid', '--moving_tractogram_ref', in_ref) assert ret.success diff --git a/scripts/tests/test_tractogram_remove_invalid.py b/src/scilpy/cli/tests/test_tractogram_remove_invalid.py similarity index 85% rename from scripts/tests/test_tractogram_remove_invalid.py rename to src/scilpy/cli/tests/test_tractogram_remove_invalid.py index e06f0da95..027157031 100644 --- a/scripts/tests/test_tractogram_remove_invalid.py +++ b/src/scilpy/cli/tests/test_tractogram_remove_invalid.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_remove_invalid.py', '--help') + ret = script_runner.run('scil_tractogram_remove_invalid', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_bundles(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tractogram = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.trk') - ret = script_runner.run('scil_tractogram_remove_invalid.py', + ret = script_runner.run('scil_tractogram_remove_invalid', in_tractogram, 'bundle_all_1mm.trk', '--cut', '--remove_overlapping', '--remove_single', '-f') assert ret.success diff --git a/scripts/tests/test_tractogram_resample.py b/src/scilpy/cli/tests/test_tractogram_resample.py similarity index 80% rename from scripts/tests/test_tractogram_resample.py rename to src/scilpy/cli/tests/test_tractogram_resample.py index abe856a94..bc76eac9c 100644 --- a/scripts/tests/test_tractogram_resample.py +++ b/src/scilpy/cli/tests/test_tractogram_resample.py @@ -16,18 +16,18 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_resample.py', '--help') + ret = script_runner.run('scil_tractogram_resample', '--help') assert ret.success def test_execution_downsample(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_resample.py', in_tracto, + ret = script_runner.run('scil_tractogram_resample', in_tracto, '500', 'union_shuffle_sub_downsampled.trk') assert ret.success - ret = script_runner.run('scil_tractogram_resample.py', in_tracto, + ret = script_runner.run('scil_tractogram_resample', in_tracto, '200', 'union_shuffle_sub_downsampled.trk', '-f', '--downsample_per_cluster') assert ret.success @@ -37,7 +37,7 @@ def test_execution_upsample_noise(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # point-wise only - ret = script_runner.run('scil_tractogram_resample.py', in_tracto, + ret = script_runner.run('scil_tractogram_resample', in_tracto, '2000', 'union_shuffle_sub_upsampled.trk', '-f', '--point_wise_std', '0.5') assert ret.success @@ -47,13 +47,13 @@ def test_execution_upsample_ptt(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # ptt only - ret = script_runner.run('scil_tractogram_resample.py', in_tracto, + ret = script_runner.run('scil_tractogram_resample', in_tracto, '500', 'union_shuffle_sub_upsampled.trk', '-f', '--tube_radius', '5') assert ret.success # both upsampling methods - ret = script_runner.run('scil_tractogram_resample.py', in_tracto, + ret = script_runner.run('scil_tractogram_resample', in_tracto, '500', 'union_shuffle_sub_upsampled.trk', '-f', '--point_wise_std', '10', '--tube_radius', '5') assert ret.success diff --git a/scripts/tests/test_tractogram_resample_nb_points.py b/src/scilpy/cli/tests/test_tractogram_resample_nb_points.py similarity index 83% rename from scripts/tests/test_tractogram_resample_nb_points.py rename to src/scilpy/cli/tests/test_tractogram_resample_nb_points.py index ffdd3915c..2b5c2cf3f 100644 --- a/scripts/tests/test_tractogram_resample_nb_points.py +++ b/src/scilpy/cli/tests/test_tractogram_resample_nb_points.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_resample_nb_points.py', '--help') + ret = script_runner.run('scil_tractogram_resample_nb_points', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni_c.trk') - ret = script_runner.run('scil_tractogram_resample_nb_points.py', + ret = script_runner.run('scil_tractogram_resample_nb_points', in_bundle, 'IFGWM_uni_c_10.trk', '--nb_pts_per_streamline', '10') assert ret.success diff --git a/scripts/tests/test_tractogram_seed_density_map.py b/src/scilpy/cli/tests/test_tractogram_seed_density_map.py similarity index 80% rename from scripts/tests/test_tractogram_seed_density_map.py rename to src/scilpy/cli/tests/test_tractogram_seed_density_map.py index ec9e2626c..0176cb338 100644 --- a/scripts/tests/test_tractogram_seed_density_map.py +++ b/src/scilpy/cli/tests/test_tractogram_seed_density_map.py @@ -13,13 +13,13 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_seed_density_map.py', '--help') + ret = script_runner.run('scil_tractogram_seed_density_map', '--help') assert ret.success def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracking = os.path.join(SCILPY_HOME, 'processing', 'tracking.trk') - ret = script_runner.run('scil_tractogram_seed_density_map.py', in_tracking, + ret = script_runner.run('scil_tractogram_seed_density_map', in_tracking, 'seeds_density.nii.gz') assert ret.success diff --git a/scripts/tests/test_tractogram_segment_connections_from_labels.py b/src/scilpy/cli/tests/test_tractogram_segment_connections_from_labels.py similarity index 88% rename from scripts/tests/test_tractogram_segment_connections_from_labels.py rename to src/scilpy/cli/tests/test_tractogram_segment_connections_from_labels.py index e0ae13ae2..e093010bd 100644 --- a/scripts/tests/test_tractogram_segment_connections_from_labels.py +++ b/src/scilpy/cli/tests/test_tractogram_segment_connections_from_labels.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run( - 'scil_tractogram_segment_connections_from_labels.py', '--help') + 'scil_tractogram_segment_connections_from_labels', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_connectivity(script_runner, monkeypatch): in_atlas = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') ret = script_runner.run( - 'scil_tractogram_segment_connections_from_labels.py', in_bundle, + 'scil_tractogram_segment_connections_from_labels', in_bundle, in_atlas, 'decompose.h5', '--min_length', '20', '--max_length', '200', '--outlier_threshold', '0.5', '--loop_max_angle', '330', '--curv_qb_distance', '10', '--processes', '1', '-v', 'DEBUG', diff --git a/scripts/tests/test_tractogram_segment_with_ROI_and_score.py b/src/scilpy/cli/tests/test_tractogram_segment_with_ROI_and_score.py similarity index 98% rename from scripts/tests/test_tractogram_segment_with_ROI_and_score.py rename to src/scilpy/cli/tests/test_tractogram_segment_with_ROI_and_score.py index c7b0769fd..743e75a4a 100644 --- a/scripts/tests/test_tractogram_segment_with_ROI_and_score.py +++ b/src/scilpy/cli/tests/test_tractogram_segment_with_ROI_and_score.py @@ -11,7 +11,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_segment_with_ROI_and_score.py', + ret = script_runner.run('scil_tractogram_segment_with_ROI_and_score', '--help') assert ret.success @@ -35,7 +35,7 @@ def test_score_bundles(script_runner, monkeypatch): with open(os.path.join("config_file.json"), "w") as f: json.dump(json_contents, f) - ret = script_runner.run('scil_tractogram_segment_with_ROI_and_score.py', + ret = script_runner.run('scil_tractogram_segment_with_ROI_and_score', in_tractogram, "config_file.json", 'scoring_tractogram/', '--no_empty', '--use_gt_masks_as_all_masks') diff --git a/scripts/tests/test_tractogram_segment_with_bundleseg.py b/src/scilpy/cli/tests/test_tractogram_segment_with_bundleseg.py similarity index 98% rename from scripts/tests/test_tractogram_segment_with_bundleseg.py rename to src/scilpy/cli/tests/test_tractogram_segment_with_bundleseg.py index 1de079e0e..c984f8cef 100644 --- a/scripts/tests/test_tractogram_segment_with_bundleseg.py +++ b/src/scilpy/cli/tests/test_tractogram_segment_with_bundleseg.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_segment_with_bundleseg.py', + ret = script_runner.run('scil_tractogram_segment_with_bundleseg', '--help') assert ret.success @@ -34,7 +34,7 @@ def test_execution_bundles(script_runner, monkeypatch): with open('config.json', 'w') as outfile: json.dump(tmp_config, outfile) - ret = script_runner.run('scil_tractogram_segment_with_bundleseg.py', + ret = script_runner.run('scil_tractogram_segment_with_bundleseg', in_tractogram, 'config.json', in_models, in_aff, '--inverse', diff --git a/scripts/tests/test_tractogram_segment_with_recobundles.py b/src/scilpy/cli/tests/test_tractogram_segment_with_recobundles.py similarity index 98% rename from scripts/tests/test_tractogram_segment_with_recobundles.py rename to src/scilpy/cli/tests/test_tractogram_segment_with_recobundles.py index 786ceb456..939684f34 100644 --- a/scripts/tests/test_tractogram_segment_with_recobundles.py +++ b/src/scilpy/cli/tests/test_tractogram_segment_with_recobundles.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_segment_with_recobundles.py', + ret = script_runner.run('scil_tractogram_segment_with_recobundles', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_bundles(script_runner, monkeypatch): in_model = os.path.join(SCILPY_HOME, 'bundles', 'fibercup_atlas', 'subj_1', 'bundle_0.trk') in_aff = os.path.join(SCILPY_HOME, 'bundles', 'affine.txt') - ret = script_runner.run('scil_tractogram_segment_with_recobundles.py', + ret = script_runner.run('scil_tractogram_segment_with_recobundles', in_tractogram, in_model, in_aff, 'bundle_0_reco.tck', '--inverse', '--tractogram_clustering_thr', '12', diff --git a/scripts/tests/test_tractogram_shuffle.py b/src/scilpy/cli/tests/test_tractogram_shuffle.py similarity index 82% rename from scripts/tests/test_tractogram_shuffle.py rename to src/scilpy/cli/tests/test_tractogram_shuffle.py index c2fbacf00..5f4b2a017 100644 --- a/scripts/tests/test_tractogram_shuffle.py +++ b/src/scilpy/cli/tests/test_tractogram_shuffle.py @@ -13,13 +13,13 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_shuffle.py', '--help') + ret = script_runner.run('scil_tractogram_shuffle', '--help') assert ret.success def test_execution_tracking(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'tracking', 'union.trk') - ret = script_runner.run('scil_tractogram_shuffle.py', in_tracto, + ret = script_runner.run('scil_tractogram_shuffle', in_tracto, 'union_shuffle.trk') assert ret.success diff --git a/scripts/tests/test_tractogram_smooth.py b/src/scilpy/cli/tests/test_tractogram_smooth.py similarity index 85% rename from scripts/tests/test_tractogram_smooth.py rename to src/scilpy/cli/tests/test_tractogram_smooth.py index 67bf99f2b..fba38770d 100644 --- a/scripts/tests/test_tractogram_smooth.py +++ b/src/scilpy/cli/tests/test_tractogram_smooth.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_smooth.py', '--help') + ret = script_runner.run('scil_tractogram_smooth', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_tracking(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'tracking', 'union_shuffle_sub.trk') - ret = script_runner.run('scil_tractogram_smooth.py', in_tracto, + ret = script_runner.run('scil_tractogram_smooth', in_tracto, 'union_shuffle_sub_smooth.trk', '--gaussian', '10', '--compress', '0.05') assert ret.success diff --git a/scripts/tests/test_tractogram_split.py b/src/scilpy/cli/tests/test_tractogram_split.py similarity index 78% rename from scripts/tests/test_tractogram_split.py rename to src/scilpy/cli/tests/test_tractogram_split.py index cbcaa3d21..d42adba0c 100644 --- a/scripts/tests/test_tractogram_split.py +++ b/src/scilpy/cli/tests/test_tractogram_split.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_tractogram_split.py', '--help') + ret = script_runner.run('scil_tractogram_split', '--help') assert ret.success @@ -21,16 +21,16 @@ def test_execution_tracking(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'tracking', 'local.trk') - ret = script_runner.run('scil_tractogram_split.py', in_tracto, + ret = script_runner.run('scil_tractogram_split', in_tracto, 'local_split', '--nb_chunks', '3', '-f') assert ret.success - ret = script_runner.run('scil_tractogram_split.py', in_tracto, + ret = script_runner.run('scil_tractogram_split', in_tracto, 'local_split', '--nb_chunks', '3', '-f', '--split_per_cluster') assert ret.success - ret = script_runner.run('scil_tractogram_split.py', in_tracto, + ret = script_runner.run('scil_tractogram_split', in_tracto, 'local_split', '--nb_chunks', '3', '-f', '--do_not_randomize') assert ret.success diff --git a/scripts/tests/test_viz_bingham_fit.py b/src/scilpy/cli/tests/test_viz_bingham_fit.py similarity index 83% rename from scripts/tests/test_viz_bingham_fit.py rename to src/scilpy/cli/tests/test_viz_bingham_fit.py index 8b14b4cae..5bb5eb053 100644 --- a/scripts/tests/test_viz_bingham_fit.py +++ b/src/scilpy/cli/tests/test_viz_bingham_fit.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_bingham_fit.py', '--help') + ret = script_runner.run('scil_viz_bingham_fit', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_silent_without_output(script_runner, monkeypatch): # dummy dataset (the script should raise an error before using it) in_dummy = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run('scil_viz_bingham_fit.py', in_dummy, + ret = script_runner.run('scil_viz_bingham_fit', in_dummy, '--silent') assert (not ret.success) diff --git a/scripts/tests/test_viz_bundle.py b/src/scilpy/cli/tests/test_viz_bundle.py similarity index 86% rename from scripts/tests/test_viz_bundle.py rename to src/scilpy/cli/tests/test_viz_bundle.py index 87631065b..7b4b3b691 100644 --- a/scripts/tests/test_viz_bundle.py +++ b/src/scilpy/cli/tests/test_viz_bundle.py @@ -8,7 +8,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_bundle.py', '--help') + ret = script_runner.run('scil_viz_bundle', '--help') assert ret.success # Tests including VTK do not work on a server without a display @@ -20,6 +20,6 @@ def test_help_option(script_runner): # in_bundle = os.path.join( # SCILPY_HOME, 'bundles', 'fibercup_atlas', 'subj_1', 'bundle_0.trk') -# ret = script_runner.run('scil_viz_bundle.py', +# ret = script_runner.run('scil_viz_bundle', # in_vol, in_bundle, 'out.png') # assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_bundle_screenshot_mni.py b/src/scilpy/cli/tests/test_viz_bundle_screenshot_mni.py new file mode 100644 index 000000000..60277863b --- /dev/null +++ b/src/scilpy/cli/tests/test_viz_bundle_screenshot_mni.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + + +def test_help_option(script_runner): + ret = script_runner.run('scil_viz_bundle_screenshot_mni', '--help') + assert ret.success diff --git a/scripts/tests/test_dwi_prepare_topup_command.py b/src/scilpy/cli/tests/test_viz_bundle_screenshot_mosaic.py similarity index 65% rename from scripts/tests/test_dwi_prepare_topup_command.py rename to src/scilpy/cli/tests/test_viz_bundle_screenshot_mosaic.py index e8380bbca..7181113eb 100644 --- a/scripts/tests/test_dwi_prepare_topup_command.py +++ b/src/scilpy/cli/tests/test_viz_bundle_screenshot_mosaic.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_prepare_topup_command.py', '--help') + ret = script_runner.run('scil_viz_bundle_screenshot_mosaic', '--help') assert ret.success diff --git a/scripts/tests/test_viz_connectivity.py b/src/scilpy/cli/tests/test_viz_connectivity.py similarity index 88% rename from scripts/tests/test_viz_connectivity.py rename to src/scilpy/cli/tests/test_viz_connectivity.py index ea091be5d..d00140f29 100644 --- a/scripts/tests/test_viz_connectivity.py +++ b/src/scilpy/cli/tests/test_viz_connectivity.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_connectivity.py', '--help') + ret = script_runner.run('scil_viz_connectivity', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_connectivity(script_runner, monkeypatch): 'sc_norm.npy') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run('scil_viz_connectivity.py', in_sc, + ret = script_runner.run('scil_viz_connectivity', in_sc, 'sc_norm.png', '--log', '--display_legend', '--labels_list', in_labels_list, '--histogram', 'hist.png', '--nb_bins', '50', diff --git a/scripts/tests/test_dwi_convert_FDF.py b/src/scilpy/cli/tests/test_viz_dti_screenshot.py similarity index 63% rename from scripts/tests/test_dwi_convert_FDF.py rename to src/scilpy/cli/tests/test_viz_dti_screenshot.py index 582473264..8e3202809 100644 --- a/scripts/tests/test_dwi_convert_FDF.py +++ b/src/scilpy/cli/tests/test_viz_dti_screenshot.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_convert_FDF.py', '--help') + ret = script_runner.run('scil_viz_dti_screenshot', '--help') assert ret.success diff --git a/scripts/tests/test_viz_fodf.py b/src/scilpy/cli/tests/test_viz_fodf.py similarity index 84% rename from scripts/tests/test_viz_fodf.py rename to src/scilpy/cli/tests/test_viz_fodf.py index c033143f3..9c4b596cf 100644 --- a/scripts/tests/test_viz_fodf.py +++ b/src/scilpy/cli/tests/test_viz_fodf.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_fodf.py', '--help') + ret = script_runner.run('scil_viz_fodf', '--help') assert ret.success @@ -20,7 +20,7 @@ def test_silent_without_output(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run('scil_viz_fodf.py', in_fodf, '--silent') + ret = script_runner.run('scil_viz_fodf', in_fodf, '--silent') # Should say that requires an output with --silent mode assert (not ret.success) @@ -31,7 +31,7 @@ def test_run(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') out_name = os.path.join(tmp_dir.name, 'out.png') - ret = script_runner.run('scil_viz_fodf.py', in_fodf, '--silent', + ret = script_runner.run('scil_viz_fodf', in_fodf, '--silent', '--in_transparency_mask', in_mask, '--output', out_name) diff --git a/src/scilpy/cli/tests/test_viz_gradients_screenshot.py b/src/scilpy/cli/tests/test_viz_gradients_screenshot.py new file mode 100644 index 000000000..45fec0b60 --- /dev/null +++ b/src/scilpy/cli/tests/test_viz_gradients_screenshot.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + + +def test_help_option(script_runner): + ret = script_runner.run('scil_viz_gradients_screenshot', '--help') + assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_tractogram_collisions.py b/src/scilpy/cli/tests/test_viz_tractogram_collisions.py new file mode 100644 index 000000000..1e62fb39f --- /dev/null +++ b/src/scilpy/cli/tests/test_viz_tractogram_collisions.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + + +def test_help_option(script_runner): + ret = script_runner.run('scil_viz_tractogram_collisions', '--help') + assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_tractogram_seeds.py b/src/scilpy/cli/tests/test_viz_tractogram_seeds.py new file mode 100644 index 000000000..f665833b7 --- /dev/null +++ b/src/scilpy/cli/tests/test_viz_tractogram_seeds.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + + +def test_help_option(script_runner): + ret = script_runner.run('scil_viz_tractogram_seeds', '--help') + assert ret.success diff --git a/scripts/tests/test_viz_tractogram_seeds.py b/src/scilpy/cli/tests/test_viz_tractogram_seeds_3d.py similarity index 63% rename from scripts/tests/test_viz_tractogram_seeds.py rename to src/scilpy/cli/tests/test_viz_tractogram_seeds_3d.py index 46baeb10e..a73900c7f 100644 --- a/scripts/tests/test_viz_tractogram_seeds.py +++ b/src/scilpy/cli/tests/test_viz_tractogram_seeds_3d.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- - def test_help_option(script_runner): - ret = script_runner.run('scil_viz_tractogram_seeds.py', '--help') + ret = script_runner.run('scil_viz_tractogram_seeds_3d', '--help') assert ret.success diff --git a/scripts/tests/test_viz_volume_histogram.py b/src/scilpy/cli/tests/test_viz_volume_histogram.py similarity index 84% rename from scripts/tests/test_viz_volume_histogram.py rename to src/scilpy/cli/tests/test_viz_volume_histogram.py index 41cc09b29..056ba9944 100644 --- a/scripts/tests/test_viz_volume_histogram.py +++ b/src/scilpy/cli/tests/test_viz_volume_histogram.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_volume_histogram.py', '--help') + ret = script_runner.run('scil_viz_volume_histogram', '--help') assert ret.success @@ -23,6 +23,6 @@ def test_execution_processing(script_runner, monkeypatch): 'fa.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') - ret = script_runner.run('scil_viz_volume_histogram.py', in_fa, in_mask, + ret = script_runner.run('scil_viz_volume_histogram', in_fa, in_mask, '20', 'histogram.png') assert ret.success diff --git a/scripts/tests/test_viz_volume_scatterplot.py b/src/scilpy/cli/tests/test_viz_volume_scatterplot.py similarity index 88% rename from scripts/tests/test_viz_volume_scatterplot.py rename to src/scilpy/cli/tests/test_viz_volume_scatterplot.py index 207b09698..396dcdd66 100644 --- a/scripts/tests/test_viz_volume_scatterplot.py +++ b/src/scilpy/cli/tests/test_viz_volume_scatterplot.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_volume_scatterplot.py', '--help') + ret = script_runner.run('scil_viz_volume_scatterplot', '--help') assert ret.success @@ -23,7 +23,7 @@ def test_execution_processing(script_runner, monkeypatch): 'fa.nii.gz') in_y = os.path.join(SCILPY_HOME, 'plot', 'ad.nii.gz') - ret = script_runner.run('scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run('scil_viz_volume_scatterplot', in_x, in_y, 'scatter_plot.png') assert ret.success @@ -36,7 +36,7 @@ def test_execution_processing_bin_mask(script_runner, monkeypatch): 'ad.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'plot', 'mask_wm.nii.gz') - ret = script_runner.run('scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run('scil_viz_volume_scatterplot', in_x, in_y, 'scatter_plot_m.png', '--in_bin_mask', in_mask) assert ret.success @@ -51,7 +51,7 @@ def test_execution_processing_prob_map(script_runner, monkeypatch): 'map_wm.nii.gz') in_prob_2 = os.path.join(SCILPY_HOME, 'plot', 'map_gm.nii.gz') - ret = script_runner.run('scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run('scil_viz_volume_scatterplot', in_x, in_y, 'scatter_plot_prob.png', '--in_prob_maps', in_prob_1, in_prob_2) assert ret.success @@ -67,7 +67,7 @@ def test_execution_processing_atlas(script_runner, monkeypatch): 'atlas_brainnetome.nii.gz') atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') - ret = script_runner.run('scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run('scil_viz_volume_scatterplot', in_x, in_y, 'scatter_plot', '--in_atlas', in_atlas, '--atlas_lut', atlas_lut) assert ret.success @@ -83,7 +83,7 @@ def test_execution_processing_atlas_folder(script_runner, monkeypatch): 'atlas_brainnetome.nii.gz') atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') - ret = script_runner.run('scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run('scil_viz_volume_scatterplot', in_x, in_y, 'scatter_plot', '--in_atlas', in_atlas, '--atlas_lut', atlas_lut, '--in_folder') @@ -101,7 +101,7 @@ def test_execution_processing_atlas_folder_specific_label(script_runner, 'atlas_brainnetome.nii.gz') atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') - ret = script_runner.run('scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run('scil_viz_volume_scatterplot', in_x, in_y, 'scatter_plot', '--in_atlas', in_atlas, '--atlas_lut', atlas_lut, '--specific_label', '2', '5', '7', diff --git a/scripts/tests/test_viz_volume_screenshot.py b/src/scilpy/cli/tests/test_viz_volume_screenshot.py similarity index 81% rename from scripts/tests/test_viz_volume_screenshot.py rename to src/scilpy/cli/tests/test_viz_volume_screenshot.py index 2c9509e39..99e50065f 100644 --- a/scripts/tests/test_viz_volume_screenshot.py +++ b/src/scilpy/cli/tests/test_viz_volume_screenshot.py @@ -16,11 +16,11 @@ def test_screenshot(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fa = os.path.join(SCILPY_HOME, 'bst', 'fa.nii.gz') - ret = script_runner.run("scil_viz_volume_screenshot.py", in_fa, 'fa.png', + ret = script_runner.run("scil_viz_volume_screenshot", in_fa, 'fa.png', '--display_slice_number', '--display_lr') assert ret.success def test_help_option(script_runner): - ret = script_runner.run("scil_viz_volume_screenshot.py", "--help") + ret = script_runner.run("scil_viz_volume_screenshot", "--help") assert ret.success diff --git a/scripts/tests/test_bundle_clean_qbx_clusters.py b/src/scilpy/cli/tests/test_viz_volume_screenshot_mosaic.py similarity index 59% rename from scripts/tests/test_bundle_clean_qbx_clusters.py rename to src/scilpy/cli/tests/test_viz_volume_screenshot_mosaic.py index 53df060a1..b871564b2 100644 --- a/scripts/tests/test_bundle_clean_qbx_clusters.py +++ b/src/scilpy/cli/tests/test_viz_volume_screenshot_mosaic.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_bundle_clean_qbx_clusters.py', '--help') + ret = script_runner.run("scil_viz_volume_screenshot_mosaic", "--help") assert ret.success diff --git a/scripts/tests/test_volume_apply_transform.py b/src/scilpy/cli/tests/test_volume_apply_transform.py similarity index 89% rename from scripts/tests/test_volume_apply_transform.py rename to src/scilpy/cli/tests/test_volume_apply_transform.py index 1b9ba4407..05086180d 100644 --- a/scripts/tests/test_volume_apply_transform.py +++ b/src/scilpy/cli/tests/test_volume_apply_transform.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_apply_transform.py', '--help') + ret = script_runner.run('scil_volume_apply_transform', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_execution_bst(script_runner, monkeypatch): 'fa.nii.gz') in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') - ret = script_runner.run('scil_volume_apply_transform.py', + ret = script_runner.run('scil_volume_apply_transform', in_model, in_fa, in_aff, 'template_lin.nii.gz', '--inverse', '-f') @@ -40,7 +40,7 @@ def test_execution_interp_nearest(script_runner, monkeypatch): 'fa.nii.gz') in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') - ret = script_runner.run('scil_volume_apply_transform.py', + ret = script_runner.run('scil_volume_apply_transform', in_model, in_fa, in_aff, 'template_lin.nii.gz', '--inverse', '--interp', 'nearest', '-f') @@ -55,7 +55,7 @@ def test_execution_interp_lin(script_runner, monkeypatch): 'fa.nii.gz') in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') - ret = script_runner.run('scil_volume_apply_transform.py', + ret = script_runner.run('scil_volume_apply_transform', in_model, in_fa, in_aff, 'template_lin.nii.gz', '--inverse', '--interp', 'linear', '-f') diff --git a/scripts/tests/test_volume_b0_synthesis.py b/src/scilpy/cli/tests/test_volume_b0_synthesis.py similarity index 92% rename from scripts/tests/test_volume_b0_synthesis.py rename to src/scilpy/cli/tests/test_volume_b0_synthesis.py index a9c811dc7..75476f774 100644 --- a/scripts/tests/test_volume_b0_synthesis.py +++ b/src/scilpy/cli/tests/test_volume_b0_synthesis.py @@ -24,7 +24,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_b0_synthesis.py', '--help') + ret = script_runner.run('scil_volume_b0_synthesis', '--help') assert ret.success @@ -45,7 +45,7 @@ def test_synthesis(script_runner, monkeypatch): nib.save(nib.Nifti1Image(b0_data.astype(np.uint8), b0_img.affine), 'b0_mask.nii.gz') - ret = script_runner.run('scil_volume_b0_synthesis.py', + ret = script_runner.run('scil_volume_b0_synthesis', in_t1, 't1_mask.nii.gz', in_b0, 'b0_mask.nii.gz', 'b0_synthesized.nii.gz', '-v') diff --git a/scripts/tests/test_volume_count_non_zero_voxels.py b/src/scilpy/cli/tests/test_volume_count_non_zero_voxels.py similarity index 76% rename from scripts/tests/test_volume_count_non_zero_voxels.py rename to src/scilpy/cli/tests/test_volume_count_non_zero_voxels.py index cec9c23bc..d42ba1ffb 100644 --- a/scripts/tests/test_volume_count_non_zero_voxels.py +++ b/src/scilpy/cli/tests/test_volume_count_non_zero_voxels.py @@ -13,25 +13,25 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_count_non_zero_voxels.py', '--help') + ret = script_runner.run('scil_volume_count_non_zero_voxels', '--help') assert ret.success def test_execution_simple_print(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'rgb.nii.gz') - ret = script_runner.run('scil_volume_count_non_zero_voxels.py', in_img) + ret = script_runner.run('scil_volume_count_non_zero_voxels', in_img) assert ret.success def test_execution_save_in_file(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'rgb.nii.gz') - ret = script_runner.run('scil_volume_count_non_zero_voxels.py', in_img, + ret = script_runner.run('scil_volume_count_non_zero_voxels', in_img, '--out', 'printed.txt') assert ret.success # Then re-use the same out file with --stats - ret = script_runner.run('scil_volume_count_non_zero_voxels.py', in_img, + ret = script_runner.run('scil_volume_count_non_zero_voxels', in_img, '--out', 'printed.txt', '--stats') assert ret.success diff --git a/scripts/tests/test_volume_crop.py b/src/scilpy/cli/tests/test_volume_crop.py similarity index 78% rename from scripts/tests/test_volume_crop.py rename to src/scilpy/cli/tests/test_volume_crop.py index 9d3066726..437bdbdf8 100644 --- a/scripts/tests/test_volume_crop.py +++ b/src/scilpy/cli/tests/test_volume_crop.py @@ -13,18 +13,18 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_crop.py', '--help') + ret = script_runner.run('scil_volume_crop', '--help') assert ret.success def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi.nii.gz') - ret = script_runner.run('scil_volume_crop.py', in_dwi, 'dwi_crop.nii.gz', + ret = script_runner.run('scil_volume_crop', in_dwi, 'dwi_crop.nii.gz', '--output_bbox', 'bbox.json') assert ret.success # Then try to load back the same box - ret = script_runner.run('scil_volume_crop.py', in_dwi, 'dwi_crop2.nii.gz', + ret = script_runner.run('scil_volume_crop', in_dwi, 'dwi_crop2.nii.gz', '--input_bbox', 'bbox.json') assert ret.success diff --git a/scripts/tests/test_volume_distance_map.py b/src/scilpy/cli/tests/test_volume_distance_map.py similarity index 89% rename from scripts/tests/test_volume_distance_map.py rename to src/scilpy/cli/tests/test_volume_distance_map.py index ed5802019..7429f19b0 100644 --- a/scripts/tests/test_volume_distance_map.py +++ b/src/scilpy/cli/tests/test_volume_distance_map.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_distance_map.py', '--help') + ret = script_runner.run('scil_volume_distance_map', '--help') assert ret.success @@ -27,7 +27,7 @@ def test_execution(script_runner, monkeypatch): in_mask_2 = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') - ret = script_runner.run('scil_volume_distance_map.py', + ret = script_runner.run('scil_volume_distance_map', in_mask_1, in_mask_2, 'distance_map.nii.gz') diff --git a/scripts/tests/test_volume_flip.py b/src/scilpy/cli/tests/test_volume_flip.py similarity index 83% rename from scripts/tests/test_volume_flip.py rename to src/scilpy/cli/tests/test_volume_flip.py index 2f6a57e53..7d7be26ef 100644 --- a/scripts/tests/test_volume_flip.py +++ b/src/scilpy/cli/tests/test_volume_flip.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_flip.py', '--help') + ret = script_runner.run('scil_volume_flip', '--help') assert ret.success @@ -21,6 +21,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fa = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') - ret = script_runner.run('scil_volume_flip.py', in_fa, 'fa_flip.nii.gz', + ret = script_runner.run('scil_volume_flip', in_fa, 'fa_flip.nii.gz', 'x') assert ret.success diff --git a/scripts/tests/test_volume_math.py b/src/scilpy/cli/tests/test_volume_math.py similarity index 87% rename from scripts/tests/test_volume_math.py rename to src/scilpy/cli/tests/test_volume_math.py index 6631a749f..4ffcca799 100644 --- a/scripts/tests/test_volume_math.py +++ b/src/scilpy/cli/tests/test_volume_math.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_math.py', '--help') + ret = script_runner.run('scil_volume_math', '--help') assert ret.success @@ -25,7 +25,7 @@ def test_execution_add(script_runner, monkeypatch): 'brainstem_174.nii.gz') in_img_3 = os.path.join(SCILPY_HOME, 'atlas', 'brainstem_175.nii.gz') - ret = script_runner.run('scil_volume_math.py', 'addition', + ret = script_runner.run('scil_volume_math', 'addition', in_img_1, in_img_2, in_img_3, 'brainstem.nii.gz') assert ret.success @@ -33,7 +33,7 @@ def test_execution_add(script_runner, monkeypatch): def test_execution_low_thresh(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'atlas', 'brainstem.nii.gz') - ret = script_runner.run('scil_volume_math.py', 'lower_threshold', + ret = script_runner.run('scil_volume_math', 'lower_threshold', in_img, '1', 'brainstem_bin.nii.gz') assert ret.success @@ -41,7 +41,7 @@ def test_execution_low_thresh(script_runner, monkeypatch): def test_execution_low_mult(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'atlas', 'brainstem_bin.nii.gz') - ret = script_runner.run('scil_volume_math.py', 'multiplication', + ret = script_runner.run('scil_volume_math', 'multiplication', in_img, '16', 'brainstem_unified.nii.gz') assert ret.success @@ -54,7 +54,7 @@ def test_execution_concatenate(script_runner, monkeypatch): in_img_4 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '13.nii.gz') in_img_5 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '17.nii.gz') in_img_6 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '18.nii.gz') - ret = script_runner.run('scil_volume_math.py', 'concatenate', + ret = script_runner.run('scil_volume_math', 'concatenate', in_img_1, in_img_2, in_img_3, in_img_4, in_img_5, in_img_6, 'concat_ids.nii.gz') assert ret.success @@ -66,7 +66,7 @@ def test_execution_concatenate_4D(script_runner, monkeypatch): in_img_2 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '8_10.nii.gz') in_img_3 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '12.nii.gz') in_img_4 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '8_10.nii.gz') - ret = script_runner.run('scil_volume_math.py', 'concatenate', + ret = script_runner.run('scil_volume_math', 'concatenate', in_img_1, in_img_2, in_img_3, in_img_4, 'concat_ids_4d.nii.gz') assert ret.success diff --git a/scripts/tests/test_volume_pairwise_comparison.py b/src/scilpy/cli/tests/test_volume_pairwise_comparison.py similarity index 90% rename from scripts/tests/test_volume_pairwise_comparison.py rename to src/scilpy/cli/tests/test_volume_pairwise_comparison.py index bb61d3ea2..de1d6fcb2 100644 --- a/scripts/tests/test_volume_pairwise_comparison.py +++ b/src/scilpy/cli/tests/test_volume_pairwise_comparison.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_pairwise_comparison.py', '--help') + ret = script_runner.run('scil_volume_pairwise_comparison', '--help') assert ret.success @@ -26,7 +26,7 @@ def test_label_comparison(script_runner, monkeypatch): in_atlas_dilated = os.path.join( SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_single_brainstem_dil.nii.gz') - ret = script_runner.run('scil_volume_pairwise_comparison.py', + ret = script_runner.run('scil_volume_pairwise_comparison', in_atlas, in_atlas_dilated, 'atlas.json') assert ret.success @@ -40,7 +40,7 @@ def test_binary_comparison(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run('scil_volume_pairwise_comparison.py', + ret = script_runner.run('scil_volume_pairwise_comparison', in_bin_1, in_bin_2, 'binary.json') assert ret.success @@ -58,7 +58,7 @@ def test_multiple_compare(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') - ret = script_runner.run('scil_volume_pairwise_comparison.py', + ret = script_runner.run('scil_volume_pairwise_comparison', in_bin_1, in_bin_2, in_bin_3, 'multiple.json') assert ret.success @@ -76,7 +76,7 @@ def test_single_compare(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') - ret = script_runner.run('scil_volume_pairwise_comparison.py', + ret = script_runner.run('scil_volume_pairwise_comparison', in_bin_1, in_bin_2, 'single.json', '--single_compare', in_bin_3) assert ret.success @@ -95,7 +95,7 @@ def test_ratio_compare(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') - ret = script_runner.run('scil_volume_pairwise_comparison.py', + ret = script_runner.run('scil_volume_pairwise_comparison', in_bin_1, in_bin_2, 'ratio.json', '--single_compare', in_bin_3, '--ratio') @@ -109,7 +109,7 @@ def test_labels_to_mask_compare(script_runner, monkeypatch): in_mask = os.path.join( SCILPY_HOME, 'atlas', 'brainstem_bin.nii.gz') - ret = script_runner.run('scil_volume_pairwise_comparison.py', + ret = script_runner.run('scil_volume_pairwise_comparison', in_atlas, 'labels_to_maskjson', '--single_compare', in_mask, '--labels_to_mask') diff --git a/scripts/tests/test_volume_remove_outliers_ransac.py b/src/scilpy/cli/tests/test_volume_remove_outliers_ransac.py similarity index 81% rename from scripts/tests/test_volume_remove_outliers_ransac.py rename to src/scilpy/cli/tests/test_volume_remove_outliers_ransac.py index 834442f86..a7043e221 100644 --- a/scripts/tests/test_volume_remove_outliers_ransac.py +++ b/src/scilpy/cli/tests/test_volume_remove_outliers_ransac.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_remove_outliers_ransac.py', '--help') + ret = script_runner.run('scil_volume_remove_outliers_ransac', '--help') assert ret.success @@ -21,6 +21,6 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_ad = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') - ret = script_runner.run('scil_volume_remove_outliers_ransac.py', in_ad, + ret = script_runner.run('scil_volume_remove_outliers_ransac', in_ad, 'ad_ransanc.nii.gz') assert ret.success diff --git a/scripts/tests/test_volume_resample.py b/src/scilpy/cli/tests/test_volume_resample.py similarity index 82% rename from scripts/tests/test_volume_resample.py rename to src/scilpy/cli/tests/test_volume_resample.py index 9133e5dbe..bb317456f 100644 --- a/scripts/tests/test_volume_resample.py +++ b/src/scilpy/cli/tests/test_volume_resample.py @@ -14,20 +14,20 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_resample.py', '--help') + ret = script_runner.run('scil_volume_resample', '--help') assert ret.success def test_execution_given_size(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_volume_resample.py', in_img, + ret = script_runner.run('scil_volume_resample', in_img, 'fa_resample_2.nii.gz', '--voxel_size', '2') assert ret.success def test_execution_force_voxel(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_volume_resample.py', in_img, + ret = script_runner.run('scil_volume_resample', in_img, 'fa_resample_4.nii.gz', '--voxel_size', '4', '--enforce_voxel_size') assert ret.success @@ -36,7 +36,7 @@ def test_execution_force_voxel(script_runner, monkeypatch): def test_execution_ref(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ref = os.path.join(SCILPY_HOME, 'others', 'fa_resample.nii.gz') - ret = script_runner.run('scil_volume_resample.py', in_img, + ret = script_runner.run('scil_volume_resample', in_img, 'fa_resample2.nii.gz', '--ref', ref) assert ret.success @@ -44,7 +44,7 @@ def test_execution_ref(script_runner, monkeypatch): def test_execution_ref_force(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ref = os.path.join(SCILPY_HOME, 'others', 'fa_resample.nii.gz') - ret = script_runner.run('scil_volume_resample.py', in_img, + ret = script_runner.run('scil_volume_resample', in_img, 'fa_resample_ref.nii.gz', '--ref', ref, '--enforce_dimensions') assert ret.success diff --git a/scripts/tests/test_volume_reshape.py b/src/scilpy/cli/tests/test_volume_reshape.py similarity index 82% rename from scripts/tests/test_volume_reshape.py rename to src/scilpy/cli/tests/test_volume_reshape.py index 0fab76ee8..35e5fa778 100644 --- a/scripts/tests/test_volume_reshape.py +++ b/src/scilpy/cli/tests/test_volume_reshape.py @@ -15,13 +15,13 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_reshape.py', '--help') + ret = script_runner.run('scil_volume_reshape', '--help') assert ret.success def test_execution_crop(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_volume_reshape.py', in_img, + ret = script_runner.run('scil_volume_reshape', in_img, 'fa_reshape.nii.gz', '--volume_size', '90', '-f') assert ret.success @@ -29,7 +29,7 @@ def test_execution_crop(script_runner, monkeypatch): def test_execution_pad(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_volume_reshape.py', in_img, + ret = script_runner.run('scil_volume_reshape', in_img, 'fa_reshape.nii.gz', '--volume_size', '150', '-f') assert ret.success @@ -37,7 +37,7 @@ def test_execution_pad(script_runner, monkeypatch): def test_execution_full_size(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_volume_reshape.py', in_img, + ret = script_runner.run('scil_volume_reshape', in_img, 'fa_reshape.nii.gz', '--volume_size', '164', '164', '164', '-f') assert ret.success @@ -45,7 +45,7 @@ def test_execution_full_size(script_runner, monkeypatch): def test_execution_dtype(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_volume_reshape.py', in_img, + ret = script_runner.run('scil_volume_reshape', in_img, 'fa_reshape.nii.gz', '--volume_size', '111', '133', '109', '--data_type', 'uint8', '-f') @@ -55,6 +55,6 @@ def test_execution_dtype(script_runner, monkeypatch): def test_execution_ref(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ref = os.path.join(SCILPY_HOME, 'others', 'fa_resample.nii.gz') - ret = script_runner.run('scil_volume_reshape.py', in_img, + ret = script_runner.run('scil_volume_reshape', in_img, 'fa_reshape.nii.gz', '--ref', ref, '-f') assert ret.success diff --git a/scripts/tests/test_volume_reslice_to_reference.py b/src/scilpy/cli/tests/test_volume_reslice_to_reference.py similarity index 83% rename from scripts/tests/test_volume_reslice_to_reference.py rename to src/scilpy/cli/tests/test_volume_reslice_to_reference.py index 9c62c48f0..ece84a1fb 100644 --- a/scripts/tests/test_volume_reslice_to_reference.py +++ b/src/scilpy/cli/tests/test_volume_reslice_to_reference.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_reslice_to_reference.py', '--help') + ret = script_runner.run('scil_volume_reslice_to_reference', '--help') assert ret.success @@ -21,7 +21,7 @@ def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 't1_crop.nii.gz') in_ref = os.path.join(SCILPY_HOME, 'others', 't1.nii.gz') - ret = script_runner.run('scil_volume_reslice_to_reference.py', in_img, + ret = script_runner.run('scil_volume_reslice_to_reference', in_img, in_ref, 't1_reslice.nii.gz', '--interpolation', 'nearest') assert ret.success @@ -31,7 +31,7 @@ def test_execution_4D(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.nii.gz') in_ref = os.path.join(SCILPY_HOME, 'others', 't1.nii.gz') - ret = script_runner.run('scil_volume_reslice_to_reference.py', in_img, + ret = script_runner.run('scil_volume_reslice_to_reference', in_img, in_ref, 'dwi_reslice.nii.gz', '--interpolation', 'nearest') assert ret.success diff --git a/scripts/tests/test_volume_stats_in_ROI.py b/src/scilpy/cli/tests/test_volume_stats_in_ROI.py similarity index 80% rename from scripts/tests/test_volume_stats_in_ROI.py rename to src/scilpy/cli/tests/test_volume_stats_in_ROI.py index c03593858..42fb995ec 100644 --- a/scripts/tests/test_volume_stats_in_ROI.py +++ b/src/scilpy/cli/tests/test_volume_stats_in_ROI.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_stats_in_ROI.py', '--help') + ret = script_runner.run('scil_volume_stats_in_ROI', '--help') assert ret.success @@ -25,28 +25,28 @@ def test_execution_tractometry(script_runner, monkeypatch): 'mni_masked.nii.gz') # Test with a single ROI input - ret = script_runner.run('scil_volume_stats_in_ROI.py', + ret = script_runner.run('scil_volume_stats_in_ROI', in_roi, '--metrics', in_ref) assert ret.success # Test with multiple ROIs input - ret = script_runner.run('scil_volume_stats_in_ROI.py', + ret = script_runner.run('scil_volume_stats_in_ROI', in_roi, in_roi, in_roi, '--metrics', in_ref) assert ret.success # Test with multiple metric input - ret = script_runner.run('scil_volume_stats_in_ROI.py', + ret = script_runner.run('scil_volume_stats_in_ROI', in_roi, '--metrics', in_ref, in_ref, in_ref) assert ret.success # Test with multiple metric and ROIs input - ret = script_runner.run('scil_volume_stats_in_ROI.py', + ret = script_runner.run('scil_volume_stats_in_ROI', in_roi, in_roi, '--metrics', in_ref, in_ref) assert ret.success # Test with a metric folder metrics_dir = os.path.join(SCILPY_HOME, 'plot') in_roi = os.path.join(SCILPY_HOME, 'plot', 'mask_wm.nii.gz') - ret = script_runner.run('scil_volume_stats_in_ROI.py', + ret = script_runner.run('scil_volume_stats_in_ROI', in_roi, '--metrics_dir', metrics_dir) assert ret.success diff --git a/scripts/tests/test_volume_stats_in_labels.py b/src/scilpy/cli/tests/test_volume_stats_in_labels.py similarity index 81% rename from scripts/tests/test_volume_stats_in_labels.py rename to src/scilpy/cli/tests/test_volume_stats_in_labels.py index 4a4471384..40b219610 100644 --- a/scripts/tests/test_volume_stats_in_labels.py +++ b/src/scilpy/cli/tests/test_volume_stats_in_labels.py @@ -11,7 +11,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_volume_stats_in_labels.py', '--help') + ret = script_runner.run('scil_volume_stats_in_labels', '--help') assert ret.success @@ -22,19 +22,19 @@ def test_execution(script_runner, monkeypatch): atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') # Test with a single metric - ret = script_runner.run('scil_volume_stats_in_labels.py', + ret = script_runner.run('scil_volume_stats_in_labels', in_atlas, atlas_lut, "--metrics", in_metric) assert ret.success # Test with multiple metrics - ret = script_runner.run('scil_volume_stats_in_labels.py', + ret = script_runner.run('scil_volume_stats_in_labels', in_atlas, atlas_lut, "--metrics", in_metric, in_metric, in_metric) assert ret.success # Test with a metric folder metrics_dir = os.path.join(SCILPY_HOME, 'plot') - ret = script_runner.run('scil_volume_stats_in_labels.py', + ret = script_runner.run('scil_volume_stats_in_labels', in_atlas, atlas_lut, "--metrics_dir", metrics_dir) assert ret.success diff --git a/scilpy/dwi/__init__.py b/src/scilpy/connectivity/__init__.py similarity index 100% rename from scilpy/dwi/__init__.py rename to src/scilpy/connectivity/__init__.py diff --git a/scilpy/connectivity/connectivity.py b/src/scilpy/connectivity/connectivity.py similarity index 100% rename from scilpy/connectivity/connectivity.py rename to src/scilpy/connectivity/connectivity.py diff --git a/scilpy/connectivity/matrix_tools.py b/src/scilpy/connectivity/matrix_tools.py similarity index 100% rename from scilpy/connectivity/matrix_tools.py rename to src/scilpy/connectivity/matrix_tools.py diff --git a/scilpy/connectivity/tests/test_connectivity_tools.py b/src/scilpy/connectivity/tests/test_connectivity_tools.py similarity index 100% rename from scilpy/connectivity/tests/test_connectivity_tools.py rename to src/scilpy/connectivity/tests/test_connectivity_tools.py diff --git a/data/LUT/dk_aggregate_structures.json b/src/scilpy/data/LUT/dk_aggregate_structures.json similarity index 100% rename from data/LUT/dk_aggregate_structures.json rename to src/scilpy/data/LUT/dk_aggregate_structures.json diff --git a/data/LUT/freesurfer_desikan_killiany.json b/src/scilpy/data/LUT/freesurfer_desikan_killiany.json similarity index 100% rename from data/LUT/freesurfer_desikan_killiany.json rename to src/scilpy/data/LUT/freesurfer_desikan_killiany.json diff --git a/data/LUT/freesurfer_subcortical.json b/src/scilpy/data/LUT/freesurfer_subcortical.json similarity index 100% rename from data/LUT/freesurfer_subcortical.json rename to src/scilpy/data/LUT/freesurfer_subcortical.json diff --git a/scilpy/dwi/tests/__init__.py b/src/scilpy/data/__init__.py similarity index 100% rename from scilpy/dwi/tests/__init__.py rename to src/scilpy/data/__init__.py diff --git a/data/mni_icbm152_t1_tal_nlin_asym_09c_masked_2_5.nii.gz b/src/scilpy/data/mni_icbm152_t1_tal_nlin_asym_09c_masked_2_5.nii.gz similarity index 100% rename from data/mni_icbm152_t1_tal_nlin_asym_09c_masked_2_5.nii.gz rename to src/scilpy/data/mni_icbm152_t1_tal_nlin_asym_09c_masked_2_5.nii.gz diff --git a/data/vocabulary.json b/src/scilpy/data/vocabulary.json similarity index 100% rename from data/vocabulary.json rename to src/scilpy/data/vocabulary.json diff --git a/scilpy/gpuparallel/__init__.py b/src/scilpy/denoise/__init__.py similarity index 100% rename from scilpy/gpuparallel/__init__.py rename to src/scilpy/denoise/__init__.py diff --git a/scilpy/denoise/aodf_filter.cl b/src/scilpy/denoise/aodf_filter.cl similarity index 100% rename from scilpy/denoise/aodf_filter.cl rename to src/scilpy/denoise/aodf_filter.cl diff --git a/scilpy/denoise/asym_filtering.py b/src/scilpy/denoise/asym_filtering.py similarity index 100% rename from scilpy/denoise/asym_filtering.py rename to src/scilpy/denoise/asym_filtering.py diff --git a/scilpy/denoise/tests/test_asym_filtering.py b/src/scilpy/denoise/tests/test_asym_filtering.py similarity index 100% rename from scilpy/denoise/tests/test_asym_filtering.py rename to src/scilpy/denoise/tests/test_asym_filtering.py diff --git a/scilpy/gradients/__init__.py b/src/scilpy/dwi/__init__.py similarity index 100% rename from scilpy/gradients/__init__.py rename to src/scilpy/dwi/__init__.py diff --git a/scilpy/dwi/operations.py b/src/scilpy/dwi/operations.py similarity index 100% rename from scilpy/dwi/operations.py rename to src/scilpy/dwi/operations.py diff --git a/scilpy/image/__init__.py b/src/scilpy/dwi/tests/__init__.py similarity index 100% rename from scilpy/image/__init__.py rename to src/scilpy/dwi/tests/__init__.py diff --git a/scilpy/dwi/tests/test_operations.py b/src/scilpy/dwi/tests/test_operations.py similarity index 100% rename from scilpy/dwi/tests/test_operations.py rename to src/scilpy/dwi/tests/test_operations.py diff --git a/scilpy/dwi/tests/test_utils.py b/src/scilpy/dwi/tests/test_utils.py similarity index 100% rename from scilpy/dwi/tests/test_utils.py rename to src/scilpy/dwi/tests/test_utils.py diff --git a/scilpy/dwi/utils.py b/src/scilpy/dwi/utils.py similarity index 100% rename from scilpy/dwi/utils.py rename to src/scilpy/dwi/utils.py diff --git a/scilpy/image/tests/__init__.py b/src/scilpy/gpuparallel/__init__.py similarity index 100% rename from scilpy/image/tests/__init__.py rename to src/scilpy/gpuparallel/__init__.py diff --git a/scilpy/gpuparallel/opencl_utils.py b/src/scilpy/gpuparallel/opencl_utils.py similarity index 100% rename from scilpy/gpuparallel/opencl_utils.py rename to src/scilpy/gpuparallel/opencl_utils.py diff --git a/scilpy/io/__init__.py b/src/scilpy/gradients/__init__.py similarity index 100% rename from scilpy/io/__init__.py rename to src/scilpy/gradients/__init__.py diff --git a/scilpy/gradients/bvec_bval_tools.py b/src/scilpy/gradients/bvec_bval_tools.py similarity index 100% rename from scilpy/gradients/bvec_bval_tools.py rename to src/scilpy/gradients/bvec_bval_tools.py diff --git a/scilpy/gradients/gen_gradient_sampling.py b/src/scilpy/gradients/gen_gradient_sampling.py similarity index 100% rename from scilpy/gradients/gen_gradient_sampling.py rename to src/scilpy/gradients/gen_gradient_sampling.py diff --git a/scilpy/gradients/optimize_gradient_sampling.py b/src/scilpy/gradients/optimize_gradient_sampling.py similarity index 100% rename from scilpy/gradients/optimize_gradient_sampling.py rename to src/scilpy/gradients/optimize_gradient_sampling.py diff --git a/scilpy/gradients/tests/test_bvec_bval_tools.py b/src/scilpy/gradients/tests/test_bvec_bval_tools.py similarity index 100% rename from scilpy/gradients/tests/test_bvec_bval_tools.py rename to src/scilpy/gradients/tests/test_bvec_bval_tools.py diff --git a/scilpy/gradients/tests/test_gen_gradient_sampling.py b/src/scilpy/gradients/tests/test_gen_gradient_sampling.py similarity index 100% rename from scilpy/gradients/tests/test_gen_gradient_sampling.py rename to src/scilpy/gradients/tests/test_gen_gradient_sampling.py diff --git a/scilpy/gradients/tests/test_gradients_utils.py b/src/scilpy/gradients/tests/test_gradients_utils.py similarity index 100% rename from scilpy/gradients/tests/test_gradients_utils.py rename to src/scilpy/gradients/tests/test_gradients_utils.py diff --git a/scilpy/gradients/tests/test_optimize_gradient_sampling.py b/src/scilpy/gradients/tests/test_optimize_gradient_sampling.py similarity index 100% rename from scilpy/gradients/tests/test_optimize_gradient_sampling.py rename to src/scilpy/gradients/tests/test_optimize_gradient_sampling.py diff --git a/scilpy/gradients/utils.py b/src/scilpy/gradients/utils.py similarity index 100% rename from scilpy/gradients/utils.py rename to src/scilpy/gradients/utils.py diff --git a/scilpy/ml/__init__.py b/src/scilpy/image/__init__.py similarity index 100% rename from scilpy/ml/__init__.py rename to src/scilpy/image/__init__.py diff --git a/scilpy/image/labels.py b/src/scilpy/image/labels.py similarity index 96% rename from scilpy/image/labels.py rename to src/scilpy/image/labels.py index 98b97a989..10b568855 100644 --- a/scilpy/image/labels.py +++ b/src/scilpy/image/labels.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -import importlib.resources as resources -import inspect +from importlib.resources import files import json import logging import os @@ -9,14 +8,14 @@ from scipy import ndimage as ndi from scipy.spatial import cKDTree +SCILPY_LUT_DIR = files("scilpy").joinpath("data/LUT/") def load_wmparc_labels(): """ Load labels dictionary of different parcellations from the Desikan-Killiany atlas. """ - lut_package = resources.files('data').joinpath('LUT') - labels_path = lut_package.joinpath('dk_aggregate_structures.json') + labels_path = SCILPY_LUT_DIR.joinpath('dk_aggregate_structures.json') with open(labels_path) as labels_file: labels = json.load(labels_file) return labels @@ -146,25 +145,6 @@ def get_labels_from_mask(mask_data, labels=None, background_label=0, return label_map -def get_lut_dir(): - """ - Return LUT directory in scilpy repository - - Returns - ------- - lut_dir: string - LUT path - """ - # Get the valid LUT choices. - import scilpy # ToDo. Is this the only way? - module_path = inspect.getfile(scilpy) - - lut_dir = os.path.join(os.path.dirname( - os.path.dirname(module_path)) + "/data/LUT/") - - return lut_dir - - def split_labels(labels_volume, label_indices): """ For each label in list, return a separate volume containing only that diff --git a/scilpy/image/reslice.py b/src/scilpy/image/reslice.py similarity index 100% rename from scilpy/image/reslice.py rename to src/scilpy/image/reslice.py diff --git a/scilpy/ml/bundleparc/__init__.py b/src/scilpy/image/tests/__init__.py similarity index 100% rename from scilpy/ml/bundleparc/__init__.py rename to src/scilpy/image/tests/__init__.py diff --git a/scilpy/image/tests/test_labels.py b/src/scilpy/image/tests/test_labels.py similarity index 96% rename from scilpy/image/tests/test_labels.py rename to src/scilpy/image/tests/test_labels.py index 026f0d9d1..5d7af9256 100644 --- a/scilpy/image/tests/test_labels.py +++ b/src/scilpy/image/tests/test_labels.py @@ -11,7 +11,7 @@ from scilpy.image.labels import (combine_labels, dilate_labels, get_data_as_labels, get_labels_from_mask, - get_lut_dir, remove_labels, split_labels) + remove_labels, split_labels) from scilpy.tests.arrays import ref_in_labels, ref_out_labels @@ -180,14 +180,6 @@ def test_get_labels_from_mask_custom_background(): assert_equal(labels, data) -def test_get_lut_dir(): - lut_dir = get_lut_dir() - assert os.path.isdir(lut_dir) - - lut_files = glob(os.path.join(lut_dir, '*.json')) - assert len(lut_files) == 3 - - def test_remove_labels(): in_labels = deepcopy(ref_in_labels) out_labels = remove_labels(in_labels, [3, 4, 5, 6, 7, 7]) diff --git a/scilpy/image/tests/test_volume_math.py b/src/scilpy/image/tests/test_volume_math.py similarity index 100% rename from scilpy/image/tests/test_volume_math.py rename to src/scilpy/image/tests/test_volume_math.py diff --git a/scilpy/image/tests/test_volume_metrics.py b/src/scilpy/image/tests/test_volume_metrics.py similarity index 100% rename from scilpy/image/tests/test_volume_metrics.py rename to src/scilpy/image/tests/test_volume_metrics.py diff --git a/scilpy/image/tests/test_volume_operations.py b/src/scilpy/image/tests/test_volume_operations.py similarity index 100% rename from scilpy/image/tests/test_volume_operations.py rename to src/scilpy/image/tests/test_volume_operations.py diff --git a/scilpy/image/utils.py b/src/scilpy/image/utils.py similarity index 100% rename from scilpy/image/utils.py rename to src/scilpy/image/utils.py diff --git a/scilpy/image/volume_b0_synthesis.py b/src/scilpy/image/volume_b0_synthesis.py similarity index 100% rename from scilpy/image/volume_b0_synthesis.py rename to src/scilpy/image/volume_b0_synthesis.py diff --git a/scilpy/image/volume_math.py b/src/scilpy/image/volume_math.py similarity index 100% rename from scilpy/image/volume_math.py rename to src/scilpy/image/volume_math.py diff --git a/scilpy/image/volume_metrics.py b/src/scilpy/image/volume_metrics.py similarity index 100% rename from scilpy/image/volume_metrics.py rename to src/scilpy/image/volume_metrics.py diff --git a/scilpy/image/volume_operations.py b/src/scilpy/image/volume_operations.py similarity index 100% rename from scilpy/image/volume_operations.py rename to src/scilpy/image/volume_operations.py diff --git a/scilpy/image/volume_space_management.py b/src/scilpy/image/volume_space_management.py similarity index 100% rename from scilpy/image/volume_space_management.py rename to src/scilpy/image/volume_space_management.py diff --git a/scilpy/preprocessing/__init__.py b/src/scilpy/io/__init__.py similarity index 100% rename from scilpy/preprocessing/__init__.py rename to src/scilpy/io/__init__.py diff --git a/scilpy/io/btensor.py b/src/scilpy/io/btensor.py similarity index 100% rename from scilpy/io/btensor.py rename to src/scilpy/io/btensor.py diff --git a/scilpy/io/deprecator.py b/src/scilpy/io/deprecator.py similarity index 100% rename from scilpy/io/deprecator.py rename to src/scilpy/io/deprecator.py diff --git a/scilpy/io/dvc.py b/src/scilpy/io/dvc.py similarity index 100% rename from scilpy/io/dvc.py rename to src/scilpy/io/dvc.py diff --git a/scilpy/io/fetcher.py b/src/scilpy/io/fetcher.py similarity index 100% rename from scilpy/io/fetcher.py rename to src/scilpy/io/fetcher.py diff --git a/scilpy/io/gradients.py b/src/scilpy/io/gradients.py similarity index 100% rename from scilpy/io/gradients.py rename to src/scilpy/io/gradients.py diff --git a/scilpy/io/hdf5.py b/src/scilpy/io/hdf5.py similarity index 100% rename from scilpy/io/hdf5.py rename to src/scilpy/io/hdf5.py diff --git a/scilpy/io/image.py b/src/scilpy/io/image.py similarity index 100% rename from scilpy/io/image.py rename to src/scilpy/io/image.py diff --git a/scilpy/io/mti.py b/src/scilpy/io/mti.py similarity index 100% rename from scilpy/io/mti.py rename to src/scilpy/io/mti.py diff --git a/scilpy/io/streamlines.py b/src/scilpy/io/streamlines.py similarity index 100% rename from scilpy/io/streamlines.py rename to src/scilpy/io/streamlines.py diff --git a/scilpy/io/tensor.py b/src/scilpy/io/tensor.py similarity index 100% rename from scilpy/io/tensor.py rename to src/scilpy/io/tensor.py diff --git a/scilpy/io/utils.py b/src/scilpy/io/utils.py similarity index 100% rename from scilpy/io/utils.py rename to src/scilpy/io/utils.py diff --git a/scilpy/io/varian_fdf.py b/src/scilpy/io/varian_fdf.py similarity index 100% rename from scilpy/io/varian_fdf.py rename to src/scilpy/io/varian_fdf.py diff --git a/scilpy/reconst/__init__.py b/src/scilpy/ml/__init__.py similarity index 100% rename from scilpy/reconst/__init__.py rename to src/scilpy/ml/__init__.py diff --git a/scilpy/segment/__init__.py b/src/scilpy/ml/bundleparc/__init__.py similarity index 100% rename from scilpy/segment/__init__.py rename to src/scilpy/ml/bundleparc/__init__.py diff --git a/scilpy/ml/bundleparc/attention.py b/src/scilpy/ml/bundleparc/attention.py similarity index 100% rename from scilpy/ml/bundleparc/attention.py rename to src/scilpy/ml/bundleparc/attention.py diff --git a/scilpy/ml/bundleparc/bundleparcnet.py b/src/scilpy/ml/bundleparc/bundleparcnet.py similarity index 100% rename from scilpy/ml/bundleparc/bundleparcnet.py rename to src/scilpy/ml/bundleparc/bundleparcnet.py diff --git a/scilpy/ml/bundleparc/encodings.py b/src/scilpy/ml/bundleparc/encodings.py similarity index 100% rename from scilpy/ml/bundleparc/encodings.py rename to src/scilpy/ml/bundleparc/encodings.py diff --git a/scilpy/ml/bundleparc/predict.py b/src/scilpy/ml/bundleparc/predict.py similarity index 100% rename from scilpy/ml/bundleparc/predict.py rename to src/scilpy/ml/bundleparc/predict.py diff --git a/scilpy/ml/bundleparc/tests/test_bundleparc_utils.py b/src/scilpy/ml/bundleparc/tests/test_bundleparc_utils.py similarity index 100% rename from scilpy/ml/bundleparc/tests/test_bundleparc_utils.py rename to src/scilpy/ml/bundleparc/tests/test_bundleparc_utils.py diff --git a/scilpy/ml/bundleparc/utils.py b/src/scilpy/ml/bundleparc/utils.py similarity index 100% rename from scilpy/ml/bundleparc/utils.py rename to src/scilpy/ml/bundleparc/utils.py diff --git a/scilpy/ml/utils.py b/src/scilpy/ml/utils.py similarity index 100% rename from scilpy/ml/utils.py rename to src/scilpy/ml/utils.py diff --git a/scilpy/stats/__init__.py b/src/scilpy/preprocessing/__init__.py similarity index 100% rename from scilpy/stats/__init__.py rename to src/scilpy/preprocessing/__init__.py diff --git a/scilpy/preprocessing/distortion_correction.py b/src/scilpy/preprocessing/distortion_correction.py similarity index 100% rename from scilpy/preprocessing/distortion_correction.py rename to src/scilpy/preprocessing/distortion_correction.py diff --git a/scilpy/surfaces/__init__.py b/src/scilpy/reconst/__init__.py similarity index 100% rename from scilpy/surfaces/__init__.py rename to src/scilpy/reconst/__init__.py diff --git a/scilpy/reconst/aodf.py b/src/scilpy/reconst/aodf.py similarity index 100% rename from scilpy/reconst/aodf.py rename to src/scilpy/reconst/aodf.py diff --git a/scilpy/reconst/bingham.py b/src/scilpy/reconst/bingham.py similarity index 100% rename from scilpy/reconst/bingham.py rename to src/scilpy/reconst/bingham.py diff --git a/scilpy/reconst/divide.py b/src/scilpy/reconst/divide.py similarity index 100% rename from scilpy/reconst/divide.py rename to src/scilpy/reconst/divide.py diff --git a/scilpy/reconst/fiber_coherence.py b/src/scilpy/reconst/fiber_coherence.py similarity index 100% rename from scilpy/reconst/fiber_coherence.py rename to src/scilpy/reconst/fiber_coherence.py diff --git a/scilpy/reconst/fodf.py b/src/scilpy/reconst/fodf.py similarity index 100% rename from scilpy/reconst/fodf.py rename to src/scilpy/reconst/fodf.py diff --git a/scilpy/reconst/frf.py b/src/scilpy/reconst/frf.py similarity index 100% rename from scilpy/reconst/frf.py rename to src/scilpy/reconst/frf.py diff --git a/scilpy/reconst/mti.py b/src/scilpy/reconst/mti.py similarity index 100% rename from scilpy/reconst/mti.py rename to src/scilpy/reconst/mti.py diff --git a/scilpy/reconst/sh.py b/src/scilpy/reconst/sh.py similarity index 100% rename from scilpy/reconst/sh.py rename to src/scilpy/reconst/sh.py diff --git a/scilpy/reconst/tests/test_aodf.py b/src/scilpy/reconst/tests/test_aodf.py similarity index 100% rename from scilpy/reconst/tests/test_aodf.py rename to src/scilpy/reconst/tests/test_aodf.py diff --git a/scilpy/reconst/tests/test_bingham.py b/src/scilpy/reconst/tests/test_bingham.py similarity index 100% rename from scilpy/reconst/tests/test_bingham.py rename to src/scilpy/reconst/tests/test_bingham.py diff --git a/scilpy/reconst/tests/test_divide.py b/src/scilpy/reconst/tests/test_divide.py similarity index 100% rename from scilpy/reconst/tests/test_divide.py rename to src/scilpy/reconst/tests/test_divide.py diff --git a/scilpy/reconst/tests/test_fiber_coherence.py b/src/scilpy/reconst/tests/test_fiber_coherence.py similarity index 100% rename from scilpy/reconst/tests/test_fiber_coherence.py rename to src/scilpy/reconst/tests/test_fiber_coherence.py diff --git a/scilpy/reconst/tests/test_fodf.py b/src/scilpy/reconst/tests/test_fodf.py similarity index 100% rename from scilpy/reconst/tests/test_fodf.py rename to src/scilpy/reconst/tests/test_fodf.py diff --git a/scilpy/reconst/tests/test_frf.py b/src/scilpy/reconst/tests/test_frf.py similarity index 100% rename from scilpy/reconst/tests/test_frf.py rename to src/scilpy/reconst/tests/test_frf.py diff --git a/scilpy/reconst/tests/test_mti.py b/src/scilpy/reconst/tests/test_mti.py similarity index 100% rename from scilpy/reconst/tests/test_mti.py rename to src/scilpy/reconst/tests/test_mti.py diff --git a/scilpy/reconst/tests/test_sh.py b/src/scilpy/reconst/tests/test_sh.py similarity index 100% rename from scilpy/reconst/tests/test_sh.py rename to src/scilpy/reconst/tests/test_sh.py diff --git a/scilpy/reconst/tests/test_utils.py b/src/scilpy/reconst/tests/test_utils.py similarity index 100% rename from scilpy/reconst/tests/test_utils.py rename to src/scilpy/reconst/tests/test_utils.py diff --git a/scilpy/reconst/utils.py b/src/scilpy/reconst/utils.py similarity index 100% rename from scilpy/reconst/utils.py rename to src/scilpy/reconst/utils.py diff --git a/scilpy/tracking/__init__.py b/src/scilpy/segment/__init__.py similarity index 100% rename from scilpy/tracking/__init__.py rename to src/scilpy/segment/__init__.py diff --git a/scilpy/segment/bundleseg.py b/src/scilpy/segment/bundleseg.py similarity index 100% rename from scilpy/segment/bundleseg.py rename to src/scilpy/segment/bundleseg.py diff --git a/scilpy/segment/models.py b/src/scilpy/segment/models.py similarity index 100% rename from scilpy/segment/models.py rename to src/scilpy/segment/models.py diff --git a/scilpy/segment/streamlines.py b/src/scilpy/segment/streamlines.py similarity index 100% rename from scilpy/segment/streamlines.py rename to src/scilpy/segment/streamlines.py diff --git a/scilpy/segment/tests/test_tractogram_from_roi.py b/src/scilpy/segment/tests/test_tractogram_from_roi.py similarity index 100% rename from scilpy/segment/tests/test_tractogram_from_roi.py rename to src/scilpy/segment/tests/test_tractogram_from_roi.py diff --git a/scilpy/segment/tractogram_from_roi.py b/src/scilpy/segment/tractogram_from_roi.py similarity index 100% rename from scilpy/segment/tractogram_from_roi.py rename to src/scilpy/segment/tractogram_from_roi.py diff --git a/scilpy/segment/voting_scheme.py b/src/scilpy/segment/voting_scheme.py similarity index 100% rename from scilpy/segment/voting_scheme.py rename to src/scilpy/segment/voting_scheme.py diff --git a/scilpy/tractanalysis/__init__.py b/src/scilpy/stats/__init__.py similarity index 100% rename from scilpy/tractanalysis/__init__.py rename to src/scilpy/stats/__init__.py diff --git a/scilpy/stats/matrix_stats.py b/src/scilpy/stats/matrix_stats.py similarity index 100% rename from scilpy/stats/matrix_stats.py rename to src/scilpy/stats/matrix_stats.py diff --git a/scilpy/stats/stats.py b/src/scilpy/stats/stats.py similarity index 100% rename from scilpy/stats/stats.py rename to src/scilpy/stats/stats.py diff --git a/scilpy/stats/tests/test_matrix_stats.py b/src/scilpy/stats/tests/test_matrix_stats.py similarity index 100% rename from scilpy/stats/tests/test_matrix_stats.py rename to src/scilpy/stats/tests/test_matrix_stats.py diff --git a/scilpy/stats/utils.py b/src/scilpy/stats/utils.py similarity index 100% rename from scilpy/stats/utils.py rename to src/scilpy/stats/utils.py diff --git a/scilpy/tractograms/__init__.py b/src/scilpy/surfaces/__init__.py similarity index 100% rename from scilpy/tractograms/__init__.py rename to src/scilpy/surfaces/__init__.py diff --git a/scilpy/surfaces/surface_operations.py b/src/scilpy/surfaces/surface_operations.py similarity index 100% rename from scilpy/surfaces/surface_operations.py rename to src/scilpy/surfaces/surface_operations.py diff --git a/scilpy/surfaces/tests/test_surface_operations.py b/src/scilpy/surfaces/tests/test_surface_operations.py similarity index 100% rename from scilpy/surfaces/tests/test_surface_operations.py rename to src/scilpy/surfaces/tests/test_surface_operations.py diff --git a/scilpy/surfaces/tests/test_surfaces_utils.py b/src/scilpy/surfaces/tests/test_surfaces_utils.py similarity index 100% rename from scilpy/surfaces/tests/test_surfaces_utils.py rename to src/scilpy/surfaces/tests/test_surfaces_utils.py diff --git a/scilpy/surfaces/utils.py b/src/scilpy/surfaces/utils.py similarity index 100% rename from scilpy/surfaces/utils.py rename to src/scilpy/surfaces/utils.py diff --git a/scilpy/tests/arrays.py b/src/scilpy/tests/arrays.py similarity index 100% rename from scilpy/tests/arrays.py rename to src/scilpy/tests/arrays.py diff --git a/scilpy/tests/dict.py b/src/scilpy/tests/dict.py similarity index 100% rename from scilpy/tests/dict.py rename to src/scilpy/tests/dict.py diff --git a/scilpy/tests/streamlines.py b/src/scilpy/tests/streamlines.py similarity index 100% rename from scilpy/tests/streamlines.py rename to src/scilpy/tests/streamlines.py diff --git a/scilpy/tests/utils.py b/src/scilpy/tests/utils.py similarity index 100% rename from scilpy/tests/utils.py rename to src/scilpy/tests/utils.py diff --git a/scilpy/tractograms/tests/__init__.py b/src/scilpy/tracking/__init__.py similarity index 100% rename from scilpy/tractograms/tests/__init__.py rename to src/scilpy/tracking/__init__.py diff --git a/scilpy/tracking/fibertube_utils.py b/src/scilpy/tracking/fibertube_utils.py similarity index 100% rename from scilpy/tracking/fibertube_utils.py rename to src/scilpy/tracking/fibertube_utils.py diff --git a/scilpy/tracking/local_tracking.cl b/src/scilpy/tracking/local_tracking.cl similarity index 100% rename from scilpy/tracking/local_tracking.cl rename to src/scilpy/tracking/local_tracking.cl diff --git a/scilpy/tracking/propagator.py b/src/scilpy/tracking/propagator.py similarity index 100% rename from scilpy/tracking/propagator.py rename to src/scilpy/tracking/propagator.py diff --git a/scilpy/tracking/rap.py b/src/scilpy/tracking/rap.py similarity index 100% rename from scilpy/tracking/rap.py rename to src/scilpy/tracking/rap.py diff --git a/scilpy/tracking/seed.py b/src/scilpy/tracking/seed.py similarity index 100% rename from scilpy/tracking/seed.py rename to src/scilpy/tracking/seed.py diff --git a/scilpy/tracking/tests/test_propagator.py b/src/scilpy/tracking/tests/test_propagator.py similarity index 100% rename from scilpy/tracking/tests/test_propagator.py rename to src/scilpy/tracking/tests/test_propagator.py diff --git a/scilpy/tracking/tests/test_seed.py b/src/scilpy/tracking/tests/test_seed.py similarity index 100% rename from scilpy/tracking/tests/test_seed.py rename to src/scilpy/tracking/tests/test_seed.py diff --git a/scilpy/tracking/tests/test_tracker.py b/src/scilpy/tracking/tests/test_tracker.py similarity index 100% rename from scilpy/tracking/tests/test_tracker.py rename to src/scilpy/tracking/tests/test_tracker.py diff --git a/scilpy/tracking/tracker.py b/src/scilpy/tracking/tracker.py similarity index 100% rename from scilpy/tracking/tracker.py rename to src/scilpy/tracking/tracker.py diff --git a/scilpy/tracking/utils.py b/src/scilpy/tracking/utils.py similarity index 100% rename from scilpy/tracking/utils.py rename to src/scilpy/tracking/utils.py diff --git a/scilpy/viz/__init__.py b/src/scilpy/tractanalysis/__init__.py similarity index 100% rename from scilpy/viz/__init__.py rename to src/scilpy/tractanalysis/__init__.py diff --git a/scilpy/tractanalysis/afd_along_streamlines.py b/src/scilpy/tractanalysis/afd_along_streamlines.py similarity index 100% rename from scilpy/tractanalysis/afd_along_streamlines.py rename to src/scilpy/tractanalysis/afd_along_streamlines.py diff --git a/scilpy/tractanalysis/bingham_metric_along_streamlines.py b/src/scilpy/tractanalysis/bingham_metric_along_streamlines.py similarity index 100% rename from scilpy/tractanalysis/bingham_metric_along_streamlines.py rename to src/scilpy/tractanalysis/bingham_metric_along_streamlines.py diff --git a/scilpy/tractanalysis/bundle_operations.py b/src/scilpy/tractanalysis/bundle_operations.py similarity index 100% rename from scilpy/tractanalysis/bundle_operations.py rename to src/scilpy/tractanalysis/bundle_operations.py diff --git a/scilpy/tractanalysis/connectivity_segmentation.py b/src/scilpy/tractanalysis/connectivity_segmentation.py similarity index 100% rename from scilpy/tractanalysis/connectivity_segmentation.py rename to src/scilpy/tractanalysis/connectivity_segmentation.py diff --git a/scilpy/tractanalysis/distance_to_centroid.py b/src/scilpy/tractanalysis/distance_to_centroid.py similarity index 100% rename from scilpy/tractanalysis/distance_to_centroid.py rename to src/scilpy/tractanalysis/distance_to_centroid.py diff --git a/scilpy/tractanalysis/fibertube_scoring.py b/src/scilpy/tractanalysis/fibertube_scoring.py similarity index 100% rename from scilpy/tractanalysis/fibertube_scoring.py rename to src/scilpy/tractanalysis/fibertube_scoring.py diff --git a/scilpy/tractanalysis/fixel_density.py b/src/scilpy/tractanalysis/fixel_density.py similarity index 100% rename from scilpy/tractanalysis/fixel_density.py rename to src/scilpy/tractanalysis/fixel_density.py diff --git a/scilpy/tractanalysis/json_utils.py b/src/scilpy/tractanalysis/json_utils.py similarity index 100% rename from scilpy/tractanalysis/json_utils.py rename to src/scilpy/tractanalysis/json_utils.py diff --git a/scilpy/tractanalysis/mrds_along_streamlines.py b/src/scilpy/tractanalysis/mrds_along_streamlines.py similarity index 100% rename from scilpy/tractanalysis/mrds_along_streamlines.py rename to src/scilpy/tractanalysis/mrds_along_streamlines.py diff --git a/scilpy/tractanalysis/reproducibility_measures.py b/src/scilpy/tractanalysis/reproducibility_measures.py similarity index 100% rename from scilpy/tractanalysis/reproducibility_measures.py rename to src/scilpy/tractanalysis/reproducibility_measures.py diff --git a/scilpy/tractanalysis/scoring.py b/src/scilpy/tractanalysis/scoring.py similarity index 100% rename from scilpy/tractanalysis/scoring.py rename to src/scilpy/tractanalysis/scoring.py diff --git a/scilpy/tractanalysis/streamlines_metrics.pyx b/src/scilpy/tractanalysis/streamlines_metrics.pyx similarity index 100% rename from scilpy/tractanalysis/streamlines_metrics.pyx rename to src/scilpy/tractanalysis/streamlines_metrics.pyx diff --git a/scilpy/tractanalysis/tests/test_fixel_density.py b/src/scilpy/tractanalysis/tests/test_fixel_density.py similarity index 100% rename from scilpy/tractanalysis/tests/test_fixel_density.py rename to src/scilpy/tractanalysis/tests/test_fixel_density.py diff --git a/scilpy/tractanalysis/tests/test_json_utils.py b/src/scilpy/tractanalysis/tests/test_json_utils.py similarity index 100% rename from scilpy/tractanalysis/tests/test_json_utils.py rename to src/scilpy/tractanalysis/tests/test_json_utils.py diff --git a/scilpy/tractanalysis/tests/test_reproducibility_measures.py b/src/scilpy/tractanalysis/tests/test_reproducibility_measures.py similarity index 100% rename from scilpy/tractanalysis/tests/test_reproducibility_measures.py rename to src/scilpy/tractanalysis/tests/test_reproducibility_measures.py diff --git a/scilpy/tractanalysis/todi.py b/src/scilpy/tractanalysis/todi.py similarity index 100% rename from scilpy/tractanalysis/todi.py rename to src/scilpy/tractanalysis/todi.py diff --git a/scilpy/tractanalysis/todi_util.py b/src/scilpy/tractanalysis/todi_util.py similarity index 100% rename from scilpy/tractanalysis/todi_util.py rename to src/scilpy/tractanalysis/todi_util.py diff --git a/scilpy/tractanalysis/voxel_boundary_intersection.pyx b/src/scilpy/tractanalysis/voxel_boundary_intersection.pyx similarity index 100% rename from scilpy/tractanalysis/voxel_boundary_intersection.pyx rename to src/scilpy/tractanalysis/voxel_boundary_intersection.pyx diff --git a/scilpy/viz/backends/__init__.py b/src/scilpy/tractograms/__init__.py similarity index 100% rename from scilpy/viz/backends/__init__.py rename to src/scilpy/tractograms/__init__.py diff --git a/scilpy/tractograms/dps_and_dpp_management.py b/src/scilpy/tractograms/dps_and_dpp_management.py similarity index 100% rename from scilpy/tractograms/dps_and_dpp_management.py rename to src/scilpy/tractograms/dps_and_dpp_management.py diff --git a/scilpy/tractograms/intersection_finder.py b/src/scilpy/tractograms/intersection_finder.py similarity index 100% rename from scilpy/tractograms/intersection_finder.py rename to src/scilpy/tractograms/intersection_finder.py diff --git a/scilpy/tractograms/lazy_tractogram_operations.py b/src/scilpy/tractograms/lazy_tractogram_operations.py similarity index 100% rename from scilpy/tractograms/lazy_tractogram_operations.py rename to src/scilpy/tractograms/lazy_tractogram_operations.py diff --git a/scilpy/tractograms/streamline_and_mask_operations.py b/src/scilpy/tractograms/streamline_and_mask_operations.py similarity index 100% rename from scilpy/tractograms/streamline_and_mask_operations.py rename to src/scilpy/tractograms/streamline_and_mask_operations.py diff --git a/scilpy/tractograms/streamline_operations.py b/src/scilpy/tractograms/streamline_operations.py similarity index 100% rename from scilpy/tractograms/streamline_operations.py rename to src/scilpy/tractograms/streamline_operations.py diff --git a/scripts/__init__.py b/src/scilpy/tractograms/tests/__init__.py similarity index 100% rename from scripts/__init__.py rename to src/scilpy/tractograms/tests/__init__.py diff --git a/scilpy/tractograms/tests/test_dps_and_dpp_management.py b/src/scilpy/tractograms/tests/test_dps_and_dpp_management.py similarity index 100% rename from scilpy/tractograms/tests/test_dps_and_dpp_management.py rename to src/scilpy/tractograms/tests/test_dps_and_dpp_management.py diff --git a/scilpy/tractograms/tests/test_lazy_tractogram_operations.py b/src/scilpy/tractograms/tests/test_lazy_tractogram_operations.py similarity index 100% rename from scilpy/tractograms/tests/test_lazy_tractogram_operations.py rename to src/scilpy/tractograms/tests/test_lazy_tractogram_operations.py diff --git a/scilpy/tractograms/tests/test_streamline_and_mask_operations.py b/src/scilpy/tractograms/tests/test_streamline_and_mask_operations.py similarity index 100% rename from scilpy/tractograms/tests/test_streamline_and_mask_operations.py rename to src/scilpy/tractograms/tests/test_streamline_and_mask_operations.py diff --git a/scilpy/tractograms/tests/test_streamline_operations.py b/src/scilpy/tractograms/tests/test_streamline_operations.py similarity index 100% rename from scilpy/tractograms/tests/test_streamline_operations.py rename to src/scilpy/tractograms/tests/test_streamline_operations.py diff --git a/scilpy/tractograms/tests/test_tractogram_operations.py b/src/scilpy/tractograms/tests/test_tractogram_operations.py similarity index 100% rename from scilpy/tractograms/tests/test_tractogram_operations.py rename to src/scilpy/tractograms/tests/test_tractogram_operations.py diff --git a/scilpy/tractograms/tractogram_operations.py b/src/scilpy/tractograms/tractogram_operations.py similarity index 100% rename from scilpy/tractograms/tractogram_operations.py rename to src/scilpy/tractograms/tractogram_operations.py diff --git a/scilpy/tractograms/uncompress.pyx b/src/scilpy/tractograms/uncompress.pyx similarity index 100% rename from scilpy/tractograms/uncompress.pyx rename to src/scilpy/tractograms/uncompress.pyx diff --git a/scilpy/utils/__init__.py b/src/scilpy/utils/__init__.py similarity index 100% rename from scilpy/utils/__init__.py rename to src/scilpy/utils/__init__.py diff --git a/scilpy/utils/filenames.py b/src/scilpy/utils/filenames.py similarity index 100% rename from scilpy/utils/filenames.py rename to src/scilpy/utils/filenames.py diff --git a/scilpy/utils/metrics_tools.py b/src/scilpy/utils/metrics_tools.py similarity index 100% rename from scilpy/utils/metrics_tools.py rename to src/scilpy/utils/metrics_tools.py diff --git a/scilpy/utils/scilpy_bot.py b/src/scilpy/utils/scilpy_bot.py similarity index 96% rename from scilpy/utils/scilpy_bot.py rename to src/scilpy/utils/scilpy_bot.py index 0bd3563e0..303b0cf11 100644 --- a/scilpy/utils/scilpy_bot.py +++ b/src/scilpy/utils/scilpy_bot.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import ast from colorama import Fore, Style +from importlib.resources import files import pathlib import re import subprocess @@ -9,6 +10,8 @@ from nltk.stem import PorterStemmer from tqdm import tqdm +from scilpy import SCILPY_HOME + SPACING_LEN = 80 stemmer = PorterStemmer() @@ -20,8 +23,7 @@ "Please run 'pip install nltk'.") # Path to the JSON file containing script information and keywords -VOCAB_FILE_PATH = pathlib.Path( - __file__).parent.parent.parent/'data' / 'vocabulary.json' +VOCAB_FILE_PATH = files("scilpy").joinpath("data/vocabulary.json") OBJECTS = [ @@ -205,26 +207,24 @@ def _generate_help_files(): the main scripts directory. """ - scripts_dir = pathlib.Path(__file__).parent.parent.parent / 'scripts' - help_dir = scripts_dir / '.hidden' + scripts_dir = files("scilpy").joinpath("cli") + # Hidden directory to store help files + hidden_dir = pathlib.Path(SCILPY_HOME) / ".hidden" + hidden_dir.mkdir(exist_ok=True) scripts = [script for script in scripts_dir.glob('*.py') if script.name not in ['__init__.py', 'scil_search_keywords.py']] - helps = [help for help in help_dir.glob('*.help')] + helps = [help for help in hidden_dir.glob('*.help')] scripts_to_regenerate = [script for script in scripts - if help_dir / f'{script.name}.help' not in helps] + if hidden_dir / f'{script.name}.help' not in helps] # Check if all help files are present if len(scripts_to_regenerate) == 0: print("All help files are already generated.") return - # Hidden directory to store help files - hidden_dir = scripts_dir / '.hidden' - hidden_dir.mkdir(exist_ok=True) - # Iterate over all scripts and generate help files for script in tqdm(scripts_to_regenerate): help_file = hidden_dir / f'{script.name}.help' diff --git a/scilpy/utils/spatial.py b/src/scilpy/utils/spatial.py similarity index 100% rename from scilpy/utils/spatial.py rename to src/scilpy/utils/spatial.py diff --git a/scilpy/utils/tests/test_scilpy_bot.py b/src/scilpy/utils/tests/test_scilpy_bot.py similarity index 100% rename from scilpy/utils/tests/test_scilpy_bot.py rename to src/scilpy/utils/tests/test_scilpy_bot.py diff --git a/scilpy/version.py b/src/scilpy/version.py similarity index 100% rename from scilpy/version.py rename to src/scilpy/version.py diff --git a/scripts/legacy/__init__.py b/src/scilpy/viz/__init__.py similarity index 100% rename from scripts/legacy/__init__.py rename to src/scilpy/viz/__init__.py diff --git a/scripts/tests/__init__.py b/src/scilpy/viz/backends/__init__.py similarity index 100% rename from scripts/tests/__init__.py rename to src/scilpy/viz/backends/__init__.py diff --git a/scilpy/viz/backends/fury.py b/src/scilpy/viz/backends/fury.py similarity index 100% rename from scilpy/viz/backends/fury.py rename to src/scilpy/viz/backends/fury.py diff --git a/scilpy/viz/backends/pil.py b/src/scilpy/viz/backends/pil.py similarity index 100% rename from scilpy/viz/backends/pil.py rename to src/scilpy/viz/backends/pil.py diff --git a/scilpy/viz/backends/vtk.py b/src/scilpy/viz/backends/vtk.py similarity index 100% rename from scilpy/viz/backends/vtk.py rename to src/scilpy/viz/backends/vtk.py diff --git a/scilpy/viz/color.py b/src/scilpy/viz/color.py similarity index 100% rename from scilpy/viz/color.py rename to src/scilpy/viz/color.py diff --git a/scilpy/viz/gradients.py b/src/scilpy/viz/gradients.py similarity index 100% rename from scilpy/viz/gradients.py rename to src/scilpy/viz/gradients.py diff --git a/scilpy/viz/legacy/__init__.py b/src/scilpy/viz/legacy/__init__.py similarity index 100% rename from scilpy/viz/legacy/__init__.py rename to src/scilpy/viz/legacy/__init__.py diff --git a/scilpy/viz/legacy/chord_chart.py b/src/scilpy/viz/legacy/chord_chart.py similarity index 100% rename from scilpy/viz/legacy/chord_chart.py rename to src/scilpy/viz/legacy/chord_chart.py diff --git a/scilpy/viz/plot.py b/src/scilpy/viz/plot.py similarity index 100% rename from scilpy/viz/plot.py rename to src/scilpy/viz/plot.py diff --git a/scilpy/viz/screenshot.py b/src/scilpy/viz/screenshot.py similarity index 100% rename from scilpy/viz/screenshot.py rename to src/scilpy/viz/screenshot.py diff --git a/scilpy/viz/slice.py b/src/scilpy/viz/slice.py similarity index 100% rename from scilpy/viz/slice.py rename to src/scilpy/viz/slice.py diff --git a/scilpy/viz/utils.py b/src/scilpy/viz/utils.py similarity index 100% rename from scilpy/viz/utils.py rename to src/scilpy/viz/utils.py From 622af7bfddec176e53facc97ddbc591ca32e8c80 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Mon, 21 Jul 2025 16:52:45 -0400 Subject: [PATCH 20/90] fix manifest --- MANIFEST.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 7a77a5739..81139b11f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,6 @@ include requirements.txt include .python-version recursive-include src/scilpy/data * -recursive-include scilpy *.c -recursive-include scilpy *.cpp -recursive-include scilpy *.pyx +recursive-include src/scilpy *.c +recursive-include src/scilpy *.cpp +recursive-include src/scilpy *.pyx From 0d25bf083a3612de8d266dcbe3e7629846d25a59 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Tue, 22 Jul 2025 15:35:56 -0400 Subject: [PATCH 21/90] try some test --- .github/workflows/test.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e968a600e..d3d4762f9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,6 +38,7 @@ jobs: - name: Install non-python dependencies run: | + curl -LsSf https://astral.sh/uv/install.sh | sh sudo apt-get update sudo apt-get install -y \ build-essential \ @@ -51,9 +52,11 @@ jobs: - name: Install Scilpy run: | export SETUPTOOLS_USE_DISTUTILS=stdlib - python -m pip install --upgrade pip wheel - python -m pip install --upgrade "setuptools<71.0.0" - python -m pip install -e . + uv venv ~/.venvs/scilpy --python=${{ steps.python-selector.outputs.python-version }} + source ~/.venvs/scilpy/bin/activate + uv pip install --upgrade pip wheel + uv pip install --upgrade "setuptools<71.0.0" + uv pip install -e . - name: Run tests run: | From 06c6807732be74e76232fef1d0a8d53fea1c9988 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Tue, 22 Jul 2025 15:38:55 -0400 Subject: [PATCH 22/90] source env --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3d4762f9..48bef0c38 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,6 +61,7 @@ jobs: - name: Run tests run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH + source ~/.venvs/scilpy/bin/activate pytest --cov-report term-missing:skip-covered - name: Save test results and coverage From 09df7c193dae60e45f33eb03856168dd06311b31 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 22 Jul 2025 22:30:02 -0400 Subject: [PATCH 23/90] install VTK osmesa in the workflow, not provided with runner image anymore --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e968a600e..8f38828b9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,6 +54,10 @@ jobs: python -m pip install --upgrade pip wheel python -m pip install --upgrade "setuptools<71.0.0" python -m pip install -e . + # TODO: to adapt once Scilpy passes to VTK 9.4.0, which selects OSMesa at runtime + # https://discourse.vtk.org/t/status-update-runtime-opengl-render-window-selection-in-vtk/14583 + VTK_VERSION=$(cat requirements.txt | grep 'vtk==' | sed 's/vtk==//g') + python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==$VTK_VERSION - name: Run tests run: | From 11131019a65cf68f48891908cb1f9dcb8031a107 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Wed, 23 Jul 2025 10:02:30 -0400 Subject: [PATCH 24/90] tets add setup --- setup.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 000000000..255611d63 --- /dev/null +++ b/setup.py @@ -0,0 +1,32 @@ +import os + +from setuptools import setup, find_packages, Extension +from setuptools.command.build_ext import build_ext +from Cython.Build import cythonize +from numpy import get_include + + +define_macros = [('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')] +# Modules to be compiled and include_dirs when necessary +extensions = [ + Extension('scilpy.tractograms.uncompress', + ['src/scilpy/tractograms/uncompress.pyx'], + define_macros=define_macros), + Extension('scilpy.tractanalysis.voxel_boundary_intersection', + ['src/scilpy/tractanalysis/voxel_boundary_intersection.pyx'], + define_macros=define_macros), + Extension('scilpy.tractanalysis.streamlines_metrics', + ['src/scilpy/tractanalysis/streamlines_metrics.pyx'], + define_macros=define_macros) +] + +# This is the function that is executed +setup( + name='scilpy', # Required + + # A list of compiler Directives is available at + # https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#compiler-directives + + # external to be compiled + ext_modules = cythonize(extensions, compiler_directives={"language_level": 3, "profile": False}) +) \ No newline at end of file From 4c512f0fdf19541f8871d4c9d239c82c034be56f Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Wed, 23 Jul 2025 10:31:35 -0400 Subject: [PATCH 25/90] fix setup --- pyproject.toml | 3 +-- setup.py | 17 +++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8ff54b319..13043807b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,12 +14,11 @@ description = "Scilpy: diffusion MRI tools and utilities" authors = [{ name = "SCIL Team" }] readme = "README.md" requires-python = ">=3.9, <3.12" -license = { file = "LICENSE" } +license-files = ["LICENSE"] classifiers = [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Scientific/Engineering" diff --git a/setup.py b/setup.py index 255611d63..acd3dd7e2 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,6 @@ -import os - -from setuptools import setup, find_packages, Extension -from setuptools.command.build_ext import build_ext from Cython.Build import cythonize -from numpy import get_include +import numpy +from setuptools import setup, Extension define_macros = [('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')] @@ -17,16 +14,16 @@ define_macros=define_macros), Extension('scilpy.tractanalysis.streamlines_metrics', ['src/scilpy/tractanalysis/streamlines_metrics.pyx'], - define_macros=define_macros) -] + define_macros=define_macros)] # This is the function that is executed setup( - name='scilpy', # Required + name='scilpy', # A list of compiler Directives is available at # https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#compiler-directives # external to be compiled - ext_modules = cythonize(extensions, compiler_directives={"language_level": 3, "profile": False}) -) \ No newline at end of file + ext_modules=cythonize(extensions), + include_dirs=[numpy.get_include()] +) From aaa52bb677f3346a5c2a2f735c11b5211c0b2f59 Mon Sep 17 00:00:00 2001 From: frheault Date: Wed, 23 Jul 2025 11:40:43 -0400 Subject: [PATCH 26/90] Support 3.10 --- .python-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.python-version b/.python-version index 4ff528a2f..885016e20 100644 --- a/.python-version +++ b/.python-version @@ -1,2 +1,2 @@ 3.12 ->=3.11, < 3.13 +>=3.10, < 3.13 From 1e671bbc13eb80e54ddf6625fa33bf0703c2954d Mon Sep 17 00:00:00 2001 From: frheault Date: Wed, 23 Jul 2025 11:49:21 -0400 Subject: [PATCH 27/90] Fix Antoine comments --- scilpy/io/utils.py | 14 -- .../test_streamline_and_mask_operations.py | 2 +- scripts/scil_surface_assign_custom_color.py | 104 ------------- scripts/scil_surface_assign_uniform_color.py | 140 ------------------ 4 files changed, 1 insertion(+), 259 deletions(-) delete mode 100755 scripts/scil_surface_assign_custom_color.py delete mode 100755 scripts/scil_surface_assign_uniform_color.py diff --git a/scilpy/io/utils.py b/scilpy/io/utils.py index f22f1b526..96e3f78f0 100644 --- a/scilpy/io/utils.py +++ b/scilpy/io/utils.py @@ -1273,17 +1273,3 @@ def get_default_screenshotting_data(args, peaks=True): ovl_imgs, ovl_colors, peaks_imgs) - - -def convert_stateful_str_to_enum(args): - """ - Convert spatial arguments from string to enum for stateful operations. - """ - - for space in ['source_space', 'destination_space']: - if hasattr(args, space): - setattr(args, space, Space(args.__getattribute__(space))) - - for origin in ['source_origin', 'destination_origin']: - if hasattr(args, origin): - setattr(args, origin, Origin(args.__getattribute__(origin))) diff --git a/scilpy/tractograms/tests/test_streamline_and_mask_operations.py b/scilpy/tractograms/tests/test_streamline_and_mask_operations.py index 099b0576f..0289c0db6 100644 --- a/scilpy/tractograms/tests/test_streamline_and_mask_operations.py +++ b/scilpy/tractograms/tests/test_streamline_and_mask_operations.py @@ -89,7 +89,7 @@ def test_get_endpoints_density_map_five_points(): """ sft, reference, *_ = _setup_files() - print(sft.streamlines._data.dtype) + endpoints_map = get_endpoints_density_map( sft, point_to_select=5, to_millimeters=True) diff --git a/scripts/scil_surface_assign_custom_color.py b/scripts/scil_surface_assign_custom_color.py deleted file mode 100755 index 92e879120..000000000 --- a/scripts/scil_surface_assign_custom_color.py +++ /dev/null @@ -1,104 +0,0 @@ -""" - -""" - -import argparse -import logging - -from dipy.io.surface import load_surface, save_surface -import nibabel as nib -import numpy as np -from scipy.ndimage import map_coordinates - -from scilpy.io.utils import (assert_inputs_exist, - assert_outputs_exist, - add_overwrite_arg, - add_verbose_arg, - add_reference_arg, - add_surface_spatial_arg, - add_vtk_legacy_arg, - convert_stateful_str_to_enum, - load_matrix_in_any_format) -from scilpy.viz.color import get_lookup_table - - -def _build_arg_parser(): - p = argparse.ArgumentParser( - description=__doc__, - formatter_class=argparse.RawTextHelpFormatter) - - p.add_argument('in_surface', - help='Input surface(s) (VTK + PIAL + GII supported).') - p.add_argument('out_surface', - help='Output surface(s) (VTK supported).') - - g1 = p.add_argument_group(title='Coloring method') - p1 = g1.add_mutually_exclusive_group(required=True) - p1.add_argument('--load_dpp', metavar='DPP_FILE', - help='Load data per point (scalar) for coloring') - p1.add_argument('--from_anatomy', metavar='FILE', - help='Use the voxel data for coloring,\n' - 'linear scaling from minmax.') - - g2 = p.add_argument_group(title='Coloring options') - g2.add_argument('--colormap', default='jet', - help='Select the colormap for colored trk (dps/dpp) ' - '[%(default)s].\nUse two Matplotlib named color separeted ' - 'by a - to create your own colormap.') - g2.add_argument('--log', action='store_true', - help='Apply a base 10 logarithm for colored trk (dps/dpp).') - - add_surface_spatial_arg(p) - add_vtk_legacy_arg(p) - add_reference_arg(p) - add_verbose_arg(p) - add_overwrite_arg(p) - - return p - - -def main(): - parser = _build_arg_parser() - args = parser.parse_args() - logging.getLogger().setLevel(logging.getLevelName(args.verbose)) - - # Verifications - assert_inputs_exist(parser, args.in_surface, args.reference) - assert_outputs_exist(parser, args, args.out_surface) - convert_stateful_str_to_enum(args) - - # Loading - sfs = load_surface(args.in_surface, args.reference, - from_space=args.source_space, - from_origin=args.source_origin) - - cmap = get_lookup_table(args.colormap) - - expected_shape = len(sfs.vertices) - if args.load_dpp: - data = np.squeeze(load_matrix_in_any_format(args.load_dpp)) - if len(data) != expected_shape: - parser.error('Wrong dpp size! Expected a total of {} points, ' - 'but got {}'.format(expected_shape, len(data))) - else: # args.from_anatomy: - data = nib.load(args.from_anatomy).get_fdata() - sfs.to_vox() - data = map_coordinates(data, sfs.vertices.T, order=0) - - # Simple post-processing - if args.log: - data = np.log10(data + 1e-3) - data -= data.min() - data /= data.max() - data = cmap(data) * 255 - data = data.astype(np.uint8) - - sfs.data_per_point['RGB'] = data - save_surface(sfs, args.out_surface, - to_space=args.destination_space, - to_origin=args.destination_origin, - legacy_vtk_format=args.legacy_vtk_format) - - -if __name__ == '__main__': - main() diff --git a/scripts/scil_surface_assign_uniform_color.py b/scripts/scil_surface_assign_uniform_color.py deleted file mode 100755 index 9dc7eaed5..000000000 --- a/scripts/scil_surface_assign_uniform_color.py +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -""" - -""" - -import argparse -import json -import logging -import os - -from dipy.io.surface import load_surface, save_surface -import numpy as np - -from scilpy.io.utils import (assert_inputs_exist, - assert_outputs_exist, - add_overwrite_arg, - add_verbose_arg, - add_reference_arg, - add_surface_spatial_arg, - add_vtk_legacy_arg, - convert_stateful_str_to_enum) -from scilpy.viz.color import format_hexadecimal_color_to_rgb - - -def _build_arg_parser(): - p = argparse.ArgumentParser( - description=__doc__, - formatter_class=argparse.RawTextHelpFormatter) - - p.add_argument('in_surfaces', nargs='+', - help='Input surface(s) (VTK + PIAL + GII supported).') - - g1 = p.add_argument_group(title='Coloring Methods') - p1 = g1.add_mutually_exclusive_group(required=True) - p1.add_argument('--fill_color', metavar='str', - help='Can be hexadecimal (ie. either "#RRGGBB" ' - 'or 0xRRGGBB).') - p1.add_argument('--dict_colors', metavar='file.json', - help="Json file: dictionnary mapping each tractogram's " - "basename to a color.\nDo not put your file's " - "extension in your dict.\n" - "Same convention as --fill_color.") - - g2 = p.add_argument_group(title='Output options') - p2 = g2.add_mutually_exclusive_group(required=True) - p2.add_argument('--out_suffix', nargs='?', const='colored', - metavar='suffix', - help='Specify suffix to append to input basename.\n' - 'Mandatory choice if you run this script on multiple ' - 'tractograms.\nMandatory choice with --dict_colors.\n' - '[%(default)s]') - p2.add_argument('--out_surface', metavar='FILE', - help='Output filename of colored Surface (VTK supported).') - - add_surface_spatial_arg(p) - add_vtk_legacy_arg(p) - add_reference_arg(p) - add_verbose_arg(p) - add_overwrite_arg(p) - - return p - - -def main(): - parser = _build_arg_parser() - args = parser.parse_args() - - logging.getLogger().setLevel(logging.getLevelName(args.verbose)) - - # Verifications - if len(args.in_surfaces) > 1 and args.out_surface: - parser.error('Using multiple inputs, use --out_suffix.') - if args.dict_colors and args.out_surface: - parser.error('Using --dict_colors, use --out_suffix.') - - assert_inputs_exist(parser, args.in_surfaces, args.reference) - convert_stateful_str_to_enum(args) - - if args.reference is None: - parser.error('A reference file is required to determine the space.\n' - 'Please provide one using --reference') - - if args.out_suffix and args.out_suffix[0] != '_': - args.out_suffix = '_' + args.out_suffix - - if args.out_surface: - out_filenames = [args.out_surface] - _, ext = os.path.splitext(args.out_surface) - else: # args.out_suffix - out_filenames = [] - for filename in args.in_surfaces: - base, ext = os.path.splitext(filename) - out_filenames.append('{}{}{}' - .format(base, args.out_suffix, ext)) - assert_outputs_exist(parser, args, out_filenames) - - # Loading (except tractograms, in loop) - dict_colors = None - if args.dict_colors: - with open(args.dict_colors, 'r') as data: - dict_colors = json.load(data) - - # Processing - for i, filename in enumerate(args.in_surfaces): - color = None - - sfs = load_surface(filename, args.reference, - from_space=args.source_space, - from_origin=args.source_origin) - - if args.dict_colors: - base, ext = os.path.splitext(filename) - base = os.path.basename(base) - pos = base.index('__') if '__' in base else -2 - base = base[pos + 2:] - - for key in dict_colors.keys(): - if key in base: - color = dict_colors[key] - if color is None: - parser.error("Basename of file {} ({}) not found in your " - "dict_colors keys.".format(filename, base)) - else: # args.fill_color is not None: - color = args.fill_color - - red, green, blue = format_hexadecimal_color_to_rgb(color) - - colors = np.tile([red, green, blue], (len(sfs.vertices), 1)) - - sfs.data_per_point['RGB'] = colors - save_surface(sfs, out_filenames[i], - to_space=args.destination_space, - to_origin=args.destination_origin, - legacy_vtk_format=args.legacy_vtk_format) - - -if __name__ == '__main__': - main() From 5682e5942245e8ce219b358f02b9854fac3c7d10 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Thu, 24 Jul 2025 09:12:33 -0400 Subject: [PATCH 28/90] use uv --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 657eed6f0..25488ac79 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,12 +60,12 @@ jobs: # TODO: to adapt once Scilpy passes to VTK 9.4.0, which selects OSMesa at runtime # https://discourse.vtk.org/t/status-update-runtime-opengl-render-window-selection-in-vtk/14583 VTK_VERSION=$(cat requirements.txt | grep 'vtk==' | sed 's/vtk==//g') - python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==$VTK_VERSION + uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==$VTK_VERSION - name: Run tests run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH source ~/.venvs/scilpy/bin/activate - pytest --cov-report term-missing:skip-covered + uv run --active pytest --cov-report term-missing:skip-covered - name: Save test results and coverage uses: actions/upload-artifact@v4 From a48a9563c364a967b35a4dc1b74244604d278f33 Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 24 Jul 2025 11:49:25 -0400 Subject: [PATCH 29/90] Fix errors in all python version --- .github/workflows/test.yml | 8 +++-- scilpy/image/volume_operations.py | 2 +- scilpy/tractograms/dps_and_dpp_management.py | 35 +++++++++----------- scripts/scil_tractogram_dps_math.py | 2 +- scripts/tests/test_tractogram_dps_math.py | 4 +-- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f38828b9..341f184dc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true - + env: MPLBACKEND: agg OPENBLAS_NUM_THREADS: 1 @@ -48,9 +48,13 @@ jobs: libfreetype6-dev \ libdrm-dev - - name: Install Scilpy + - name: stdlib checkout + if: ${{ !contains(${{ steps.python-selector.outputs.python-version }}, '3.12') }} run: | export SETUPTOOLS_USE_DISTUTILS=stdlib + + - name: Install Scilpy + run: | python -m pip install --upgrade pip wheel python -m pip install --upgrade "setuptools<71.0.0" python -m pip install -e . diff --git a/scilpy/image/volume_operations.py b/scilpy/image/volume_operations.py index 577e20878..727f8847f 100644 --- a/scilpy/image/volume_operations.py +++ b/scilpy/image/volume_operations.py @@ -453,7 +453,7 @@ def remove_outliers_ransac(in_data, min_fit, fit_thr, max_iter): X = in_nzr_ind[0][:, np.newaxis] model_ransac = linear_model.RANSACRegressor( - base_estimator=linear_model.LinearRegression(), min_samples=min_fit, + estimator=linear_model.LinearRegression(), min_samples=min_fit, residual_threshold=fit_thr, max_trials=max_iter) model_ransac.fit(X, in_nzr_val) diff --git a/scilpy/tractograms/dps_and_dpp_management.py b/scilpy/tractograms/dps_and_dpp_management.py index 5390bf063..92ebee1a1 100644 --- a/scilpy/tractograms/dps_and_dpp_management.py +++ b/scilpy/tractograms/dps_and_dpp_management.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import numpy as np +from nibabel.streamlines.array_sequence import ArraySequence from scilpy.viz.color import clip_and_normalize_data_for_cmap @@ -105,9 +106,10 @@ def convert_dps_to_dpp(sft, keys, overwrite=False): if key in sft.data_per_point and not overwrite: raise ValueError("Dpp key {} already existed. Please allow " "overwriting.".format(key)) - sft.data_per_point[key] = [[val]*len(s) for val, s in - zip(sft.data_per_streamline[key], - sft.streamlines)] + dps_data = sft.data_per_streamline[key] + dpp_data = ArraySequence([np.tile(dps_data[i], (len(s), 1)) + for i, s in enumerate(sft.streamlines)]) + sft.data_per_point[key] = dpp_data del sft.data_per_streamline[key] return sft @@ -252,26 +254,21 @@ def perform_operation_on_dpp(op_name, sft, dpp_name, endpoints_only=False): Returns ------- - new_data_per_point: list[np.ndarray] + new_data_per_point: ArraySequence The values that could now be associated to a new data_per_point key. """ call_op = OPERATIONS[op_name] if endpoints_only: new_data_per_point = [] for s in sft.data_per_point[dpp_name]: - this_data_per_point = np.nan * np.ones((len(s), 1)) - this_data_per_point[0] = call_op(s[0]) - this_data_per_point[-1] = call_op(s[-1]) - new_data_per_point.append(np.asarray(this_data_per_point)[:, None]) + this_data_per_point = [call_op(s[0]), call_op(s[-1])] + new_data_per_point.append(this_data_per_point) else: new_data_per_point = [] for s in sft.data_per_point[dpp_name]: - this_data_per_point = [] - for p in s: - this_data_per_point.append(call_op(p)) - new_data_per_point.append(np.asarray(this_data_per_point)[:, None]) + new_data_per_point.append([call_op(p) for p in s]) - return new_data_per_point + return ArraySequence(new_data_per_point) def perform_operation_dpp_to_dps(op_name, sft, dpp_name, endpoints_only=False): @@ -315,7 +312,7 @@ def perform_operation_dpp_to_dps(op_name, sft, dpp_name, endpoints_only=False): s_np = np.asarray(s) new_data_per_streamline.append(call_op(s_np)) - return new_data_per_streamline + return np.array(new_data_per_streamline) def perform_correlation_on_endpoints(sft, dpp_name='metric'): @@ -339,23 +336,23 @@ def perform_correlation_on_endpoints(sft, dpp_name='metric'): for s in sft.data_per_point[dpp_name]: new_data_per_streamline.append(np.corrcoef(s[0], s[-1])[0, 1]) - return new_data_per_streamline + return np.array(new_data_per_streamline) def _stream_mean(array): - return np.squeeze(np.mean(array, axis=0)) + return np.atleast_1d(np.mean(array, axis=0)) def _stream_sum(array): - return np.squeeze(np.sum(array, axis=0)) + return np.atleast_1d(np.sum(array, axis=0)) def _stream_min(array): - return np.squeeze(np.min(array, axis=0)) + return np.atleast_1d(np.min(array, axis=0)) def _stream_max(array): - return np.squeeze(np.max(array, axis=0)) + return np.atleast_1d(np.max(array, axis=0)) OPERATIONS = { diff --git a/scripts/scil_tractogram_dps_math.py b/scripts/scil_tractogram_dps_math.py index 90b6527d7..62c036cec 100755 --- a/scripts/scil_tractogram_dps_math.py +++ b/scripts/scil_tractogram_dps_math.py @@ -140,7 +140,7 @@ def main(): if len(data) == 1: data = data[0] - data = [data] * len(sft.streamlines) + data = np.array([data] * len(sft), dtype=data.dtype) sft.data_per_streamline[args.dps_key] = data diff --git a/scripts/tests/test_tractogram_dps_math.py b/scripts/tests/test_tractogram_dps_math.py index 6834325cd..abc73464f 100644 --- a/scripts/tests/test_tractogram_dps_math.py +++ b/scripts/tests/test_tractogram_dps_math.py @@ -128,7 +128,7 @@ def test_execution_dps_math_delete(script_runner, monkeypatch): in_bundle = 'bundle_4.trk' sft = load_tractogram(in_bundle_no_key, 'same') sft.data_per_streamline = { - "key": [0] * len(sft) + "key": np.zeros(len(sft), dtype=np.float32) } save_tractogram(sft, in_bundle) outname = 'out.trk' @@ -158,7 +158,7 @@ def test_execution_dps_math_export(script_runner, monkeypatch): in_bundle = 'bundle_4.trk' sft = load_tractogram(in_bundle_no_key, 'same') sft.data_per_streamline = { - "key": [0] * len(sft) + "key": np.zeros(len(sft), dtype=np.float32) } save_tractogram(sft, in_bundle) filename = 'out.txt' From 43b827df5e034782407694e3d583e29a9947bc5d Mon Sep 17 00:00:00 2001 From: Francois Rheault Date: Thu, 24 Jul 2025 13:53:02 -0400 Subject: [PATCH 30/90] Update .github/workflows/test.yml Co-authored-by: Alex Valcourt Caron --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 341f184dc..a29343440 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,9 +49,9 @@ jobs: libdrm-dev - name: stdlib checkout - if: ${{ !contains(${{ steps.python-selector.outputs.python-version }}, '3.12') }} + if: ${{ !contains(steps.python-selector.outputs.python-version, '3.12') }} run: | - export SETUPTOOLS_USE_DISTUTILS=stdlib + echo "SETUPTOOLS_USE_DISTUTILS=stdlib" >> "$GITHUB_ENV" - name: Install Scilpy run: | From 870f3a859b472148d11cb9b5ea4c2ffa18112e46 Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 24 Jul 2025 14:08:03 -0400 Subject: [PATCH 31/90] Fix sparse in bundleseg --- scilpy/segment/bundleseg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scilpy/segment/bundleseg.py b/scilpy/segment/bundleseg.py index a4d16d89a..f12ba728b 100644 --- a/scilpy/segment/bundleseg.py +++ b/scilpy/segment/bundleseg.py @@ -284,7 +284,7 @@ def prune_far_from_model(self, pruning_thr=10): tmp_dist_mat = fss.radius_search( neighb_streamlines[chuck_id:chuck_id+CHUNK_SIZE], pruning_thr) - tmp_dist_mat.data = tmp_dist_mat.data.astype(np.float16) + tmp_dist_mat.data = tmp_dist_mat.data.astype(np.float32) dist_mat_list.append(tmp_dist_mat.copy()) del tmp_dist_mat gc.collect() @@ -293,7 +293,7 @@ def prune_far_from_model(self, pruning_thr=10): for tmp_dist_mat in dist_mat_list: del tmp_dist_mat gc.collect() - dist_mat.data = dist_mat.data.astype(np.float16) + dist_mat.data = dist_mat.data.astype(np.float32) dist_mat = dist_mat.T logger.debug(f'Fast search took of dimensions {dist_mat.shape}: ' From 7e08decc85cf8f403e6bacdba639b425375d7428 Mon Sep 17 00:00:00 2001 From: frheault Date: Thu, 24 Jul 2025 16:24:34 -0400 Subject: [PATCH 32/90] Fix last error --- scilpy/tractograms/intersection_finder.py | 2 +- scripts/scil_tractogram_commit.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scilpy/tractograms/intersection_finder.py b/scilpy/tractograms/intersection_finder.py index 20e1e95a0..bdcdcd350 100644 --- a/scilpy/tractograms/intersection_finder.py +++ b/scilpy/tractograms/intersection_finder.py @@ -227,7 +227,7 @@ def build_tractograms(self, save_colliding): out_collisions.append(self._collisions[si]) elif not self._excluded[si]: out_streamlines.append(s) - out_diameters.append(self.diameters[si]) + out_diameters.append(np.array([self.diameters[si]])) if self._obstacle[si]: out_obstacle.append(s) diff --git a/scripts/scil_tractogram_commit.py b/scripts/scil_tractogram_commit.py index 4014516b7..ef9dc2a40 100755 --- a/scripts/scil_tractogram_commit.py +++ b/scripts/scil_tractogram_commit.py @@ -259,8 +259,8 @@ def _save_results(args, tmp_dir, ext, in_hdf5_file, offsets_list, sub_dir, shutil.copy(os.path.join(commit_results_dir, f), out_dir) dps_key = 'commit2_weights' if is_commit_2 else 'commit1_weights' - dps_key_tot = 'tot_commit2_weights' if is_commit_2 else \ - 'tot_commit1_weights' + dps_key_tot = 'tot_commit2_w' if is_commit_2 else \ + 'tot_commit_w' # Reload is needed because of COMMIT handling its file by itself sft.data_per_streamline[dps_key] = streamline_weights sft.data_per_streamline[dps_key_tot] = streamline_weights * length_list @@ -322,8 +322,8 @@ def _save_out_hdf5(commit_results_dir, sft, in_hdf5_file, dps_commit_key = 'commit2_weights' if is_commit_2 else \ 'commit1_weights' dps[dps_commit_key] = tmp_streamline_weights - dps_key_tot = 'tot_commit2_weights' if is_commit_2 else \ - 'tot_commit1_weights' + dps_key_tot = 'tot_commit2_w' if is_commit_2 else \ + 'tot_commit_w' dps[dps_key_tot] = tmp_streamline_weights * tmp_length_list # Replacing the data with the one above the threshold From d035e71f3aec95fba7f5f3366eddacbbf2cc4fb1 Mon Sep 17 00:00:00 2001 From: frheault Date: Fri, 25 Jul 2025 12:23:14 -0400 Subject: [PATCH 33/90] Fix Arnaud and Emmanuel comments --- README.md | 5 +++-- scilpy/io/utils.py | 18 ------------------ scilpy/tractograms/dps_and_dpp_management.py | 4 +++- .../tests/test_dps_and_dpp_management.py | 1 + 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index d83703c43..3e98883a0 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ on or are wrappers of the [DIPY] library, and most of them will eventually be mi The library is now built for Python 3.12 so be sure to create a virtual environnement for Python 3.12. If this version is not installed on your computer: ``` sudo add-apt-repository ppa:deadsnakes/ppa -sudo apt-get install python3.12 python3.12-dev python3.12-venv python3.12-minimal python3.12-tk +sudo apt-get install python3.12 python3.12-dev python3.12-venv python3.12-tk ``` Make sure your pip is up-to-date before trying to install: @@ -29,7 +29,8 @@ The library's structure is mostly aligned on that of [DIPY]. The library and scripts can be installed locally by using: ``` -export SETUPTOOLS_USE_DISTUTILS=stdlib +# If you are using Python3.10 or Python3.11, export this variable before installing +# export SETUPTOOLS_USE_DISTUTILS=stdlib pip install -e . ``` diff --git a/scilpy/io/utils.py b/scilpy/io/utils.py index 96e3f78f0..bcaf4670f 100644 --- a/scilpy/io/utils.py +++ b/scilpy/io/utils.py @@ -308,24 +308,6 @@ def add_bbox_arg(parser): 'streamlines).') -def add_surface_spatial_arg(parser): - SPACES = ['vox', 'voxmm', 'rasmm', 'lpsmm'] - ORIGINS = ['corner', 'center'] - surf = parser.add_argument_group(title='Surface spatial options') - surf.add_argument('--source_space', - default='rasmm', choices=SPACES, - help='Source space of the input surface [%(default)s].') - surf.add_argument('--destination_space', - default='rasmm', choices=SPACES, - help='Destination space of the output surface [%(default)s].') - surf.add_argument('--source_origin', - default='center', choices=ORIGINS, - help='Source origin of the input surface [%(default)s].') - surf.add_argument('--destination_origin', - default='center', choices=ORIGINS, - help='Destination origin of the output surface [%(default)s].') - - def add_vtk_legacy_arg(parser): parser.add_argument('--legacy_vtk_format', action='store_true', help='Save the VTK file in the legacy format.') diff --git a/scilpy/tractograms/dps_and_dpp_management.py b/scilpy/tractograms/dps_and_dpp_management.py index 92ebee1a1..0ffb433f3 100644 --- a/scilpy/tractograms/dps_and_dpp_management.py +++ b/scilpy/tractograms/dps_and_dpp_management.py @@ -261,7 +261,9 @@ def perform_operation_on_dpp(op_name, sft, dpp_name, endpoints_only=False): if endpoints_only: new_data_per_point = [] for s in sft.data_per_point[dpp_name]: - this_data_per_point = [call_op(s[0]), call_op(s[-1])] + this_data_per_point = np.nan * np.ones((len(s), 1)) + this_data_per_point[0] = call_op(s[0]) + this_data_per_point[-1] = call_op(s[-1]) new_data_per_point.append(this_data_per_point) else: new_data_per_point = [] diff --git a/scilpy/tractograms/tests/test_dps_and_dpp_management.py b/scilpy/tractograms/tests/test_dps_and_dpp_management.py index 2df398b8e..6f3dd7e07 100644 --- a/scilpy/tractograms/tests/test_dps_and_dpp_management.py +++ b/scilpy/tractograms/tests/test_dps_and_dpp_management.py @@ -183,6 +183,7 @@ def test_perform_operation_on_dpp(): # Option 'endpoints only': dpp = perform_operation_on_dpp('max', fake_sft, 'my_dpp', endpoints_only=True) + fake_sft.data_per_point['my_dpp2'] = dpp assert nan_array_equal(dpp[0].squeeze(), [1.0, np.nan, 1]) assert nan_array_equal(dpp[1].squeeze(), [2.0, np.nan, 2]) From 1c5e442643faa4cdb73282c541880fb3cca2e632 Mon Sep 17 00:00:00 2001 From: frheault Date: Fri, 25 Jul 2025 14:58:14 -0400 Subject: [PATCH 34/90] Added back the pypi install --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e98883a0..192360483 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,8 @@ The library and scripts can be installed locally by using: ``` # If you are using Python3.10 or Python3.11, export this variable before installing # export SETUPTOOLS_USE_DISTUTILS=stdlib -pip install -e . +pip install scilpy # For the most recent release from PyPi +pip install -e . # Install from source code (for development) ``` If you don't want to install legacy scripts: From fc299ce9ef4d54e529ccda34c0d442ee69c07800 Mon Sep 17 00:00:00 2001 From: Arnaud Bore Date: Fri, 25 Jul 2025 16:26:57 -0400 Subject: [PATCH 35/90] Update README.md update readme --- README.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 192360483..ea545a172 100644 --- a/README.md +++ b/README.md @@ -27,21 +27,34 @@ pip install --upgrade pip The library's structure is mostly aligned on that of [DIPY]. -The library and scripts can be installed locally by using: +We highly encourage to install scilpy in a virtual environnement. Once done and you're in your virtual environnement, the library and scripts can be installed locally by running these commands: + +## Install scilpy as a user + ``` # If you are using Python3.10 or Python3.11, export this variable before installing -# export SETUPTOOLS_USE_DISTUTILS=stdlib +export SETUPTOOLS_USE_DISTUTILS=stdlib + +# If you don't want to install legacy scripts +export SCILPY_LEGACY='False' + pip install scilpy # For the most recent release from PyPi -pip install -e . # Install from source code (for development) ``` -If you don't want to install legacy scripts: +## Install scilpy as a developer + ``` +# If you are using Python3.10 or Python3.11, export this variable before installing +export SETUPTOOLS_USE_DISTUTILS=stdlib + +# If you don't want to install legacy scripts export SCILPY_LEGACY='False' -pip install -e . +pip install -e . # Install from source code (for development) ``` -(Then, without the legacy scripts, if you want to use pytest, use:) +## EXTRAS + +Then, without the legacy scripts, if you want to use pytest, use: ``` pytest --ignore=scripts/legacy ``` From 22a1f5e385347f5fdd70938170b819d4ddaaf34e Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Mon, 3 Feb 2025 10:20:16 -0500 Subject: [PATCH 36/90] Ignore some coverage --- scilpy/viz/backends/fury.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scilpy/viz/backends/fury.py b/scilpy/viz/backends/fury.py index 30f6ab5c3..1c43dbe19 100644 --- a/scilpy/viz/backends/fury.py +++ b/scilpy/viz/backends/fury.py @@ -202,7 +202,9 @@ def create_scene(actors, orientation, slice_index, volume_shape, aspect_ratio, def create_interactive_window(scene, window_size, interactor, *, - title="Viewer", open_window=True): + title="Viewer", open_window=True + ): # pragma: no cover + # (Function ignored from coverage statistics) """ Create a 3D window with the content of scene, equiped with an interactor. @@ -294,7 +296,8 @@ def snapshot_scenes(scenes, window_size): def create_contours_actor(contours, opacity=1., linewidth=3., - color=[255, 0, 0]): + color=[255, 0, 0]): # pragma: no cover + # (Function ignored from coverage statistics) """ Create an actor from a vtkPolyData of contours From 6b44564baa7875c2170aa6393b6049e9072aabf0 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Fri, 4 Apr 2025 15:21:20 -0400 Subject: [PATCH 37/90] Add test for viz_seeds_3d --- scripts/scil_viz_tractogram_seeds_3d.py | 11 +++++++---- scripts/tests/test_viz_tractogram_seeds_3d.py | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/scripts/scil_viz_tractogram_seeds_3d.py b/scripts/scil_viz_tractogram_seeds_3d.py index 87ac3fc75..5204bc6cd 100755 --- a/scripts/scil_viz_tractogram_seeds_3d.py +++ b/scripts/scil_viz_tractogram_seeds_3d.py @@ -59,7 +59,9 @@ def _build_arg_parser(): default=[0, 0, 0], type=parser_color_type, help='RBG values [0, 255] of the color of the background.' '\n[Default: %(default)s]') - + p.add_argument('--no-show', action='store_true', + help="If set, runs the script but does not display the " + "window. For debugging purposes.") add_verbose_arg(p) return p @@ -114,9 +116,10 @@ def main(): scene.add(line_actor) # Showtime ! - showm = window.ShowManager(scene, reset_camera=True) - showm.initialize() - showm.start() + if not args.no_show: + showm = window.ShowManager(scene, reset_camera=True) + showm.initialize() + showm.start() if __name__ == '__main__': diff --git a/scripts/tests/test_viz_tractogram_seeds_3d.py b/scripts/tests/test_viz_tractogram_seeds_3d.py index d93a5a14b..6f69b6bfa 100644 --- a/scripts/tests/test_viz_tractogram_seeds_3d.py +++ b/scripts/tests/test_viz_tractogram_seeds_3d.py @@ -1,6 +1,21 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +import os + +from scilpy import SCILPY_HOME +from scilpy.io.fetcher import fetch_data, get_testing_files_dict + +fetch_data(get_testing_files_dict(), keys=['processing.zip']) def test_help_option(script_runner): ret = script_runner.run(['scil_viz_tractogram_seeds_3d.py', '--help']) assert ret.success + + +def test_run_option(script_runner): + seed_map = os.path.join(SCILPY_HOME, 'processing', 'fa.nii.gz') + + # To test option --tractogram, we would need a tractogram with seeds saved. + ret = script_runner.run('scil_viz_tractogram_seeds_3d.py', seed_map, + '--no-show') + assert ret.success From 0708beb4f3af2b76fa8d024076286a6679811381 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Fri, 4 Apr 2025 15:26:25 -0400 Subject: [PATCH 38/90] Add option 'ambiant_occlusion' and 'local_orientation` --- scilpy/viz/backends/pil.py | 1 + scripts/tests/test_tractogram_assign_custom_color.py | 9 +++++++++ scripts/tests/test_viz_volume_screenshot.py | 10 +++++----- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/scilpy/viz/backends/pil.py b/scilpy/viz/backends/pil.py index d4c51cf26..731229807 100644 --- a/scilpy/viz/backends/pil.py +++ b/scilpy/viz/backends/pil.py @@ -21,6 +21,7 @@ def any2grayscale(array_2d): Returns ------- + Data: np.ndarray Grayscale `unit8` data in [0, 255] range. """ diff --git a/scripts/tests/test_tractogram_assign_custom_color.py b/scripts/tests/test_tractogram_assign_custom_color.py index bc4fa6048..65c2576c9 100644 --- a/scripts/tests/test_tractogram_assign_custom_color.py +++ b/scripts/tests/test_tractogram_assign_custom_color.py @@ -48,3 +48,12 @@ def test_execution_from_angle(script_runner, monkeypatch): ret = script_runner.run(['scil_tractogram_assign_custom_color.py', in_bundle, 'colored3.trk', '--local_angle']) assert ret.success + + +def test_execution_ambiant_occlusion(script_runner, monkeypatch): + monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) + + ret = script_runner.run('scil_tractogram_assign_custom_color.py', + in_bundle, 'colored4.trk', '--local_orientation', + '--ambiant_occlusion') + assert ret.success \ No newline at end of file diff --git a/scripts/tests/test_viz_volume_screenshot.py b/scripts/tests/test_viz_volume_screenshot.py index 2dca31ac8..21d1ce534 100644 --- a/scripts/tests/test_viz_volume_screenshot.py +++ b/scripts/tests/test_viz_volume_screenshot.py @@ -12,6 +12,11 @@ tmp_dir = tempfile.TemporaryDirectory() +def test_help_option(script_runner): + ret = script_runner.run(["scil_viz_volume_screenshot.py", "--help"]) + assert ret.success + + def test_screenshot(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fa = os.path.join(SCILPY_HOME, 'bst', 'fa.nii.gz') @@ -19,8 +24,3 @@ def test_screenshot(script_runner, monkeypatch): ret = script_runner.run(["scil_viz_volume_screenshot.py", in_fa, 'fa.png', '--display_slice_number', '--display_lr']) assert ret.success - - -def test_help_option(script_runner): - ret = script_runner.run(["scil_viz_volume_screenshot.py", "--help"]) - assert ret.success From f591b04e2148b96e164e8a6ef37164d0621e5e55 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Wed, 30 Apr 2025 15:14:09 -0400 Subject: [PATCH 39/90] Add option in test_bundle_diameter --- scripts/tests/test_bundle_diameter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/tests/test_bundle_diameter.py b/scripts/tests/test_bundle_diameter.py index 440dec81b..013c2f8d2 100644 --- a/scripts/tests/test_bundle_diameter.py +++ b/scripts/tests/test_bundle_diameter.py @@ -23,5 +23,6 @@ def test_execution_tractometry(script_runner, monkeypatch): in_labels = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') ret = script_runner.run(['scil_bundle_diameter.py', in_bundle, in_labels, - '--wireframe', '--fitting_func', 'lin_up']) + '--wireframe', '--fitting_func', 'lin_up', + '--save_rendering', tmp_dir.name]) assert ret.success From 95e27ca5777f77f139706651dd6805ef9efb793a Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Wed, 30 Apr 2025 15:37:29 -0400 Subject: [PATCH 40/90] Ignoring functions in viz.gradients --- scilpy/viz/gradients.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scilpy/viz/gradients.py b/scilpy/viz/gradients.py index cfcc8cabb..1959b0bf1 100644 --- a/scilpy/viz/gradients.py +++ b/scilpy/viz/gradients.py @@ -14,7 +14,8 @@ def plot_each_shell(ms, centroids, plot_sym_vecs=True, use_sphere=True, same_color=False, rad=0.025, opacity=1.0, ofile=None, - ores=(300, 300), titles=None): + ores=(300, 300), titles=None): # pragma: no cover + # (Function ignored from coverage statistics) """ Plot each shell @@ -94,7 +95,8 @@ def plot_each_shell(ms, centroids, plot_sym_vecs=True, use_sphere=True, def plot_proj_shell(ms, use_sym=True, use_sphere=True, same_color=False, rad=0.025, opacity=1.0, ofile=None, ores=(300, 300), - title=None): + title=None): # pragma: no cover + # (Function ignored from coverage statistics) """ Plot each shell @@ -177,7 +179,7 @@ def build_ms_from_shell_idx(bvecs, shell_idx): """ S = len(set(shell_idx)) - if (-1 in set(shell_idx)): + if -1 in set(shell_idx): S -= 1 ms = [] From b03270a5694ba051a314b94c362a2aad737f6f20 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Wed, 30 Apr 2025 15:47:15 -0400 Subject: [PATCH 41/90] Add test in viz_volume_screenshot_mosaic --- .../test_viz_volume_screenshot_mosaic.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/tests/test_viz_volume_screenshot_mosaic.py b/scripts/tests/test_viz_volume_screenshot_mosaic.py index 1c94df323..0253cfbd9 100644 --- a/scripts/tests/test_viz_volume_screenshot_mosaic.py +++ b/scripts/tests/test_viz_volume_screenshot_mosaic.py @@ -1,7 +1,27 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +import os +import tempfile + +from scilpy import SCILPY_HOME +from scilpy.io.fetcher import fetch_data, get_testing_files_dict + +# If they already exist, this only takes 5 seconds (check md5sum) +fetch_data(get_testing_files_dict(), keys=['bst.zip']) +tmp_dir = tempfile.TemporaryDirectory() + def test_help_option(script_runner): ret = script_runner.run(["scil_viz_volume_screenshot_mosaic.py", "--help"]) assert ret.success + + +def test_screenshot(script_runner, monkeypatch): + monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) + in_fa = os.path.join(SCILPY_HOME, 'bst', 'fa.nii.gz') + in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') + + ret = script_runner.run("scil_viz_volume_screenshot_mosaic.py", '1', '1', + in_fa, in_mask, 'fa.png', '50') + assert ret.success \ No newline at end of file From d75a151fed602a48ef086b13d1bdb6a982ace183 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Thu, 1 May 2025 13:20:37 -0400 Subject: [PATCH 42/90] Simplify scil_viz_fodf --- scripts/scil_bundle_diameter.py | 5 +- scripts/scil_viz_bingham_fit.py | 3 ++ scripts/scil_viz_fodf.py | 86 ++++++++++++++------------------- 3 files changed, 44 insertions(+), 50 deletions(-) diff --git a/scripts/scil_bundle_diameter.py b/scripts/scil_bundle_diameter.py index 0df1afe38..bd08ef8b8 100755 --- a/scripts/scil_bundle_diameter.py +++ b/scripts/scil_bundle_diameter.py @@ -74,7 +74,10 @@ def _build_arg_parser(): p2 = p.add_argument_group(title='Visualization options') p3 = p2.add_mutually_exclusive_group() p3.add_argument('--show_rendering', action='store_true', - help='Display VTK window (optional).') + help='Display VTK window (optional).\n' + '(Note. This option is not verified by tests. If ' + 'you encounter any bug, \nplease report it to our ' + 'team.)') p3.add_argument('--save_rendering', metavar='OUT_FOLDER', help='Save VTK render in the specified folder (optional)') p2.add_argument('--wireframe', action='store_true', diff --git a/scripts/scil_viz_bingham_fit.py b/scripts/scil_viz_bingham_fit.py index ecacd11da..50310e21a 100755 --- a/scripts/scil_viz_bingham_fit.py +++ b/scripts/scil_viz_bingham_fit.py @@ -6,6 +6,9 @@ Given an image of Bingham coefficients, this script displays a slice in a given orientation. + +Note. The interactive visualization is not verified by tests. If you encounter +any bug, please report it to our team or use --silent. """ import argparse diff --git a/scripts/scil_viz_fodf.py b/scripts/scil_viz_fodf.py index 8180e5747..b87c3d2da 100755 --- a/scripts/scil_viz_fodf.py +++ b/scripts/scil_viz_fodf.py @@ -14,6 +14,9 @@ !!! CAUTION !!! The script is memory intensive about (9kB of allocated RAM per voxel, or 9GB for a 1M voxel volume) with a sphere interpolated to 362 points. + +Note. The interactive visualization is not verified by tests. If you encounter +any bug, please report it to our team or use --silent. """ import argparse @@ -217,21 +220,24 @@ def _get_data_from_inputs(args): Load data given by args. Perform checks to ensure dimensions agree between the data for mask, background, peaks and fODF. """ - fodf = nib.load(args.in_fodf).get_fdata(dtype=np.float32) - data = {'fodf': fodf} + + # Optional: + bg = None + transparency_mask = None + mask = None + peaks = None + peak_vals = None + variance = None if args.background: assert_same_resolution([args.background, args.in_fodf]) bg = nib.load(args.background).get_fdata() - data['bg'] = bg if args.in_transparency_mask: transparency_mask = get_data_as_mask( nib.load(args.in_transparency_mask), dtype=bool) - data['transparency_mask'] = transparency_mask if args.mask: assert_same_resolution([args.mask, args.in_fodf]) mask = get_data_as_mask(nib.load(args.mask), dtype=bool) - data['mask'] = mask if args.peaks: assert_same_resolution([args.peaks, args.in_fodf]) peaks = nib.load(args.peaks).get_fdata() @@ -244,12 +250,10 @@ def _get_data_from_inputs(args): raise ValueError('Peaks volume last dimension ({0}) cannot ' 'be reshaped as (npeaks, 3).' .format(peaks.shape[-1])) - data['peaks'] = peaks if args.peaks_values: assert_same_resolution([args.peaks_values, args.in_fodf]) peak_vals =\ nib.load(args.peaks_values).get_fdata() - data['peaks_values'] = peak_vals if args.variance: assert_same_resolution([args.variance, args.in_fodf]) variance = nib.load(args.variance).get_fdata(dtype=np.float32) @@ -259,37 +263,30 @@ def _get_data_from_inputs(args): raise ValueError('Dimensions mismatch between fODF {0} and ' 'variance {1}.' .format(fodf.shape, variance.shape)) - data['variance'] = variance - return data + return fodf, bg, transparency_mask, mask, peaks, peak_vals, variance def main(): parser = _build_arg_parser() args = _parse_args(parser) - data = _get_data_from_inputs(args) + (fodf, bg, transparency_mask, mask, peaks, peaks_values, + variance) = _get_data_from_inputs(args) sph = get_sphere(name=args.sphere) - sh_order, full_basis = get_sh_order_and_fullness(data['fodf'].shape[-1]) + sh_order, full_basis = get_sh_order_and_fullness(fodf.shape[-1]) sh_basis, is_legacy = parse_sh_basis_arg(args) logging.getLogger().setLevel(logging.getLevelName(args.verbose)) actors = [] - # Retrieve the mask if supplied - if 'mask' in data: - mask = data['mask'] - else: - mask = None - if args.color_rgb: color_rgb = np.round(np.asarray(args.color_rgb) * 255) else: color_rgb = None - - variance = data['variance'] if args.variance else None var_color = np.asarray(args.var_color) * 255 + # Instantiate the ODF slicer actor - odf_actor, var_actor = create_odf_slicer(data['fodf'], args.axis_name, + odf_actor, var_actor = create_odf_slicer(fodf, args.axis_name, args.slice_index, sph, sh_order, sh_basis, full_basis, args.scale, variance, mask, @@ -303,12 +300,12 @@ def main(): actors.append(odf_actor) # Instantiate a variance slicer actor if a variance image is supplied - if 'variance' in data: + if variance is not None: actors.append(var_actor) # Instantiate a texture slicer actor if a background image is supplied - if 'bg' in data: - bg_actor = create_texture_slicer(data['bg'], + if bg is not None: + bg_actor = create_texture_slicer(bg, args.axis_name, args.slice_index, mask=mask, @@ -319,14 +316,10 @@ def main(): actors.append(bg_actor) # Instantiate a peaks slicer actor if peaks are supplied - if 'peaks' in data: - - if 'peaks_values' in data: - peaks_values = data['peaks_values'] - else: - peaks_values =\ - np.ones(data['peaks'].shape[:-1]) * args.peaks_length - peaks_actor = create_peaks_slicer(data['peaks'], + if peaks is not None: + if peaks_values is None: + peaks_values = np.ones(peaks.shape[:-1]) * args.peaks_length + peaks_actor = create_peaks_slicer(peaks, args.axis_name, args.slice_index, peak_values=peaks_values, @@ -341,30 +334,25 @@ def main(): # Prepare and display the scene scene = create_scene(actors, args.axis_name, args.slice_index, - data['fodf'].shape[:3], + fodf.shape[:3], args.win_dims[0] / args.win_dims[1], bg_color=args.bg_color) mask_scene = None - if 'transparency_mask' in data: - mask_actor = create_texture_slicer( - data['transparency_mask'].astype("uint8"), - args.axis_name, - args.slice_index, - offset=0.0, - ) - - mask_scene = create_scene( - [mask_actor], - args.axis_name, - args.slice_index, - data['transparency_mask'].shape, - args.win_dims[0] / args.win_dims[1], - bg_color=args.bg_color) + if transparency_mask is not None: + mask_actor = create_texture_slicer(transparency_mask.astype("uint8"), + args.axis_name, + args.slice_index, + offset=0.0) + + mask_scene = create_scene([mask_actor], args.axis_name, + args.slice_index, + transparency_mask.shape, + args.win_dims[0] / args.win_dims[1], + bg_color=args.bg_color) if not args.silent: - create_interactive_window( - scene, args.win_dims, args.interactor) + create_interactive_window(scene, args.win_dims, args.interactor) if args.output: snapshots = snapshot_scenes(filter(None, [mask_scene, scene]), From 1387f67a8f64a76b19dc7cdf2009f16992fe661b Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Wed, 30 Apr 2025 15:38:26 -0400 Subject: [PATCH 43/90] New test for scil_viz_volume_screenshot --- scilpy/viz/screenshot.py | 2 +- scripts/scil_viz_volume_screenshot.py | 12 ++++++++---- scripts/tests/test_viz_volume_screenshot.py | 7 +++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/scilpy/viz/screenshot.py b/scilpy/viz/screenshot.py index 9424890b0..37a0ca61b 100644 --- a/scilpy/viz/screenshot.py +++ b/scilpy/viz/screenshot.py @@ -157,7 +157,7 @@ def compose_image(img_scene, img_size, slice_number, *, corner_position=(0, 0), Labelmap scene data. labelmap_alpha : float Alpha value for labelmap overlay in range [0, 1]. - overlays_scene : np.ndarray, optional + overlays_scene : list[np.ndarray], optional Overlays scene data. overlays_alpha : float Alpha value for the overlays in range [0, 1]. diff --git a/scripts/scil_viz_volume_screenshot.py b/scripts/scil_viz_volume_screenshot.py index 0f7921959..9b3886016 100755 --- a/scripts/scil_viz_volume_screenshot.py +++ b/scripts/scil_viz_volume_screenshot.py @@ -62,7 +62,8 @@ add_verbose_arg, assert_headers_compatible, assert_inputs_exist, assert_overlay_colors, - get_default_screenshotting_data) + get_default_screenshotting_data, + assert_outputs_exist, add_overwrite_arg) from scilpy.image.utils import check_slice_indices from scilpy.utils.spatial import get_axis_index from scilpy.version import version_string @@ -96,7 +97,7 @@ def _build_arg_parser(): add_overlays_screenshot_args(xg, 0.5, og) add_peaks_screenshot_args(xg, rendering_parsing_group=pg) add_verbose_arg(p) - + add_overwrite_arg(p) return p @@ -141,6 +142,9 @@ def empty_generator(): else: ax_idx = get_axis_index(args.axis) slice_ids = np.arange(vol_img.shape[ax_idx]) + name, ext = splitext(args.out_fname) + names = ["{}_slice_{}{}".format(name, s, ext) for s in slice_ids] + assert_outputs_exist(parser, args, names) # Generate the image slices volume_screenhots_generator = screenshot_volume(vol_img, args.axis, @@ -182,11 +186,10 @@ def empty_generator(): screenshot_peaks, ([peaks, args.axis, slice_ids, args.size] for peaks in peaks_imgs))) - name, ext = splitext(args.out_fname) - names = ["{}_slice_{}{}".format(name, s, ext) for s in slice_ids] sides_labels = ["P", "A"] if args.axis == "sagittal" else ["L", "R"] # Compose and save each slice + logging.info("Preparing all {} slices: ".format(len(slice_ids))) for volume, trans, label, contour, peaks, name, slice_id in zip_longest( volume_screenhots_generator, transparency_screenshots_generator, @@ -197,6 +200,7 @@ def empty_generator(): slice_ids, fillvalue=None): + logging.info(" - Slice {}".format(slice_id)) img = compose_image(volume, args.size, slice_id, transparency_scene=trans, image_alpha=args.volume_opacity, diff --git a/scripts/tests/test_viz_volume_screenshot.py b/scripts/tests/test_viz_volume_screenshot.py index 21d1ce534..b0cd4e146 100644 --- a/scripts/tests/test_viz_volume_screenshot.py +++ b/scripts/tests/test_viz_volume_screenshot.py @@ -20,7 +20,10 @@ def test_help_option(script_runner): def test_screenshot(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fa = os.path.join(SCILPY_HOME, 'bst', 'fa.nii.gz') - + in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') ret = script_runner.run(["scil_viz_volume_screenshot.py", in_fa, 'fa.png', - '--display_slice_number', '--display_lr']) + '--slices', '50', + '--display_slice_number', '--display_lr', + '--overlays', in_mask, + '--overlays_as_contours']) assert ret.success From 0c5c0bba914882c71f4b284058296701557775d6 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Tue, 22 Jul 2025 15:38:09 -0400 Subject: [PATCH 44/90] Fixed color --- scilpy/tractograms/dps_and_dpp_management.py | 5 +++-- scilpy/viz/color.py | 9 +-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/scilpy/tractograms/dps_and_dpp_management.py b/scilpy/tractograms/dps_and_dpp_management.py index 0ffb433f3..d4e9ed308 100644 --- a/scilpy/tractograms/dps_and_dpp_management.py +++ b/scilpy/tractograms/dps_and_dpp_management.py @@ -60,8 +60,9 @@ def add_data_as_color_dpp(sft, cmap, data, clip_outliers=False, min_range=None, data = np.hstack(data) values, lbound, ubound = clip_and_normalize_data_for_cmap( - data, clip_outliers, min_range, max_range, - min_cmap, max_cmap, log, LUT) + data, clip_outliers=clip_outliers, + min_range=min_range, max_range=max_range, + min_cmap=min_cmap, max_cmap=max_cmap, log=log, LUT=LUT) # Important: values are in float after clip_and_normalize. color = np.asarray(cmap(values)[:, 0:3]) * 255 diff --git a/scilpy/viz/color.py b/scilpy/viz/color.py index a91a8c8f9..eb2a8655a 100644 --- a/scilpy/viz/color.py +++ b/scilpy/viz/color.py @@ -41,7 +41,7 @@ def convert_color_names_to_rgb(names): def generate_n_colors(n, generator=colormap.distinguishable_colormap, - pick_from_base10=True, shuffle=False): + pick_from_base10=True): """ Generate a set of N colors. When using the default parameters, colors will always be unique. When using a custom generator, ensure it generates unique @@ -58,8 +58,6 @@ def generate_n_colors(n, generator=colormap.distinguishable_colormap, pick_from_base10 : bool When True, start picking from the base 10 colors before using the generator funtion (see BASE_COLORS_10). - shuffle : bool - Shuffle the color list before returning. Returns ------- @@ -77,9 +75,6 @@ def generate_n_colors(n, generator=colormap.distinguishable_colormap, (_colors, generator(nb_colors=n - len(_colors), exclude=_colors)), axis=0) - if shuffle: - np.random.shuffle(_colors) - return _colors @@ -167,8 +162,6 @@ def clip_and_normalize_data_for_cmap( the first value of the LUT is set everywhere where data==1, etc. """ # Make sure data type is float - if isinstance(data, list): - data = np.asarray(data) data = data.astype(float) if LUT is not None: From 40322b2180258a7453c01a2278419fbfbe725bba Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Tue, 22 Jul 2025 16:03:45 -0400 Subject: [PATCH 45/90] Add test for viz_gradients_screenshot --- scripts/scil_viz_gradients_screenshot.py | 13 +++++++--- .../tests/test_viz_gradients_screenshot.py | 24 +++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/scripts/scil_viz_gradients_screenshot.py b/scripts/scil_viz_gradients_screenshot.py index 72a991fca..f86f20ebe 100755 --- a/scripts/scil_viz_gradients_screenshot.py +++ b/scripts/scil_viz_gradients_screenshot.py @@ -73,6 +73,9 @@ def _build_arg_parser(): '--opacity', type=float, default=1.0, help='Opacity for the shells.') + p.add_argument('--test_run', action='store_true', + help="If set, will not show anything. For debugging " + "purposes.") add_verbose_arg(p) add_overwrite_arg(p) @@ -133,9 +136,8 @@ def main(): bvals = tmp[:, 3] centroids, shell_idx = identify_shells(bvals) - if args.verbose: - logging.info("Found {} centroids: {}".format( - len(centroids), centroids)) + logging.info("Found {} centroids: {}" + .format(len(centroids), centroids)) if args.out_basename: out_basename, ext = os.path.splitext(args.out_basename) @@ -170,6 +172,11 @@ def main(): sph = args.enable_sph same = args.same_color + if args.test_run: + logging.warning("Tested everything. Exiting before launching " + "vizualisation.") + exit(0) + if proj: plot_proj_shell(ms, use_sym=sym, use_sphere=sph, same_color=same, rad=0.025, opacity=args.opacity, diff --git a/scripts/tests/test_viz_gradients_screenshot.py b/scripts/tests/test_viz_gradients_screenshot.py index 23bd93e11..a4dc77421 100644 --- a/scripts/tests/test_viz_gradients_screenshot.py +++ b/scripts/tests/test_viz_gradients_screenshot.py @@ -1,7 +1,31 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +import os +import tempfile + +from scilpy import SCILPY_HOME +from scilpy.io.fetcher import fetch_data, get_testing_files_dict + +fetch_data(get_testing_files_dict(), keys=['processing.zip']) +tmp_dir = tempfile.TemporaryDirectory() def test_help_option(script_runner): ret = script_runner.run(['scil_viz_gradients_screenshot.py', '--help']) assert ret.success + + +def test_run_bval(script_runner): + bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') + bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') + ret = script_runner.run('scil_viz_gradients_screenshot.py', + '--in_gradient_scheme', bval, bvec, + '--test_run') + assert ret.success + + +def test_run_dipy_sphere(script_runner): + ret = script_runner.run('scil_viz_gradients_screenshot.py', + '--dipy_sphere', 'symmetric362', + '--test_run') + assert ret.success \ No newline at end of file From 9be5ae8a8c081a6daa37c031bd84b6e9760c56e6 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Wed, 23 Jul 2025 15:53:45 -0400 Subject: [PATCH 46/90] Improving coverage in sclice --- scilpy/viz/screenshot.py | 2 ++ scilpy/viz/slice.py | 6 +++++- scripts/scil_viz_bingham_fit.py | 24 +++++++++------------ scripts/scil_viz_fodf.py | 20 +++++++---------- scripts/tests/test_viz_bingham_fit.py | 7 +++--- scripts/tests/test_viz_fodf.py | 5 +++++ scripts/tests/test_viz_volume_screenshot.py | 3 ++- 7 files changed, 35 insertions(+), 32 deletions(-) diff --git a/scilpy/viz/screenshot.py b/scilpy/viz/screenshot.py index 37a0ca61b..4c509d92a 100644 --- a/scilpy/viz/screenshot.py +++ b/scilpy/viz/screenshot.py @@ -31,6 +31,8 @@ def screenshot_volume(img, orientation, slice_ids, size, labelmap=None): Slice indices. size : array-like Size of the screenshot image (pixels). + labelmap: str, vtkLookupTable, optional + Either a vtk lookup table or a matplotlib colormap name. Returns ------- diff --git a/scilpy/viz/slice.py b/scilpy/viz/slice.py index 5f10d3705..c56cfbf05 100644 --- a/scilpy/viz/slice.py +++ b/scilpy/viz/slice.py @@ -41,7 +41,7 @@ def create_texture_slicer(texture, orientation, slice_index, *, mask=None, offset : float The offset of the texture image. Defaults to 0.5. lut : str, vtkLookupTable, optional - Either a vtk lookup table or a matplotlib name for one. + Either a vtk lookup table or a matplotlib colormap name. interpolation : str Interpolation mode for the texture image. Choices are nearest or linear. Defaults to nearest. @@ -235,6 +235,8 @@ def create_odf_slicer(sh_fodf, orientation, slice_index, sphere, sh_order, Factor that multiplies sqrt(variance). variance_color : tuple, optional Color of the variance fODF data, in RGB. + is_legacy: bool + Whether the SH basis is used in legacy formats [True]. Returns ------- @@ -304,7 +306,9 @@ def create_bingham_slicer(data, orientation, slice_index, colors = [c * 255 for c in generate_n_colors(nb_lobes)] # lmax norm for normalization + print("???????? data", data.shape) lmaxnorm = np.max(np.abs(data[..., 0]), axis=-1) + print("???????? lmaxnorm", lmaxnorm.shape) bingham_sf = bingham_to_sf(data, sphere.vertices) actors = [] diff --git a/scripts/scil_viz_bingham_fit.py b/scripts/scil_viz_bingham_fit.py index 50310e21a..19cf8e0c1 100755 --- a/scripts/scil_viz_bingham_fit.py +++ b/scripts/scil_viz_bingham_fit.py @@ -39,7 +39,9 @@ def _build_arg_parser(): epilog=version_string) # Positional arguments - p.add_argument('in_bingham', help='Input SH image file.') + p.add_argument('in_bingham', + help='Input SH image file. Expecting data to be of size ' + '(X, Y, Z, 9 * nb_lobes)') # Window configuration options p.add_argument('--slice_index', type=int, @@ -62,7 +64,7 @@ def _build_arg_parser(): p.add_argument('--silent', action='store_true', help='Disable interactive visualization.') - p.add_argument('--output', help='Path to output file.') + p.add_argument('--output', help='Path to output image file.') add_verbose_arg(p) add_overwrite_arg(p) @@ -81,18 +83,12 @@ def _build_arg_parser(): def _parse_args(parser): args = parser.parse_args() - inputs = [] - output = [] - inputs.append(args.in_bingham) - if args.output: - output.append(args.output) - else: - if args.silent: - parser.error('Silent mode is enabled but no output is specified.' - 'Specify an output with --output to use silent mode.') + if not args.output and args.silent: + parser.error('Silent mode is enabled but no output is specified.' + 'Specify an output with --output to use silent mode.') - assert_inputs_exist(parser, inputs) - assert_outputs_exist(parser, args, output) + assert_inputs_exist(parser, [args.in_bingham]) + assert_outputs_exist(parser, args, [args.output]) return args @@ -131,7 +127,7 @@ def main(): actors = create_bingham_slicer(data, args.axis_name, args.slice_index, sph, - args.color_per_lobe) + color_per_lobe=args.color_per_lobe) # Prepare and display the scene scene = create_scene(actors, args.axis_name, diff --git a/scripts/scil_viz_fodf.py b/scripts/scil_viz_fodf.py index b87c3d2da..753eae950 100755 --- a/scripts/scil_viz_fodf.py +++ b/scripts/scil_viz_fodf.py @@ -182,7 +182,7 @@ def _build_arg_parser(): 'as follow: mean + k * sqrt(variance), where ' 'mean is the input fodf (in_fodf) and k is the ' 'scaling factor (variance_k).') - var.add_argument('--variance', help='FODF variance file.') + var.add_argument('--variance', help='FODF variance file (nifti).') var.add_argument('--variance_k', default=1, type=float, help='Scaling factor (k) for the computation of the fodf ' 'uncertainty. [%(default)s]') @@ -286,17 +286,13 @@ def main(): var_color = np.asarray(args.var_color) * 255 # Instantiate the ODF slicer actor - odf_actor, var_actor = create_odf_slicer(fodf, args.axis_name, - args.slice_index, sph, sh_order, - sh_basis, full_basis, - args.scale, variance, mask, - args.sph_subdivide, - not args.radial_scale_off, - not args.norm_off, - args.colormap or color_rgb, - variance_k=args.variance_k, - variance_color=var_color, - is_legacy=is_legacy) + odf_actor, var_actor = create_odf_slicer( + fodf, args.axis_name, args.slice_index, sph, sh_order, + sh_basis, full_basis, args.scale, + sh_variance=variance, mask=mask, nb_subdivide=args.sph_subdivide, + radial_scale=not args.radial_scale_off, norm=not args.norm_off, + colormap=args.colormap or color_rgb, variance_k=args.variance_k, + variance_color=var_color, is_legacy=is_legacy) actors.append(odf_actor) # Instantiate a variance slicer actor if a variance image is supplied diff --git a/scripts/tests/test_viz_bingham_fit.py b/scripts/tests/test_viz_bingham_fit.py index cb54ea830..618700830 100644 --- a/scripts/tests/test_viz_bingham_fit.py +++ b/scripts/tests/test_viz_bingham_fit.py @@ -21,8 +21,7 @@ def test_silent_without_output(script_runner, monkeypatch): # dummy dataset (the script should raise an error before using it) in_dummy = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - + out = os.path.join(tmp_dir.name, 'fodf.png') ret = script_runner.run(['scil_viz_bingham_fit.py', in_dummy, - '--silent']) - - assert (not ret.success) + '--silent', '--output', out]) + assert ret.success #(not ret.success) diff --git a/scripts/tests/test_viz_fodf.py b/scripts/tests/test_viz_fodf.py index a546daedd..fbd09c941 100644 --- a/scripts/tests/test_viz_fodf.py +++ b/scripts/tests/test_viz_fodf.py @@ -30,9 +30,14 @@ def test_run(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') + # No variance file in data, but faking it with the fodf file. + in_variance = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') out_name = os.path.join(tmp_dir.name, 'out.png') ret = script_runner.run(['scil_viz_fodf.py', in_fodf, '--silent', '--in_transparency_mask', in_mask, + '--mask', in_mask, '--sph_subdivide', '2', '--output', out_name]) + # toDo: With additional option ['--variance', in_variance], tests + # crash locally.. assert ret.success diff --git a/scripts/tests/test_viz_volume_screenshot.py b/scripts/tests/test_viz_volume_screenshot.py index b0cd4e146..3aa9d5bba 100644 --- a/scripts/tests/test_viz_volume_screenshot.py +++ b/scripts/tests/test_viz_volume_screenshot.py @@ -25,5 +25,6 @@ def test_screenshot(script_runner, monkeypatch): '--slices', '50', '--display_slice_number', '--display_lr', '--overlays', in_mask, - '--overlays_as_contours']) + '--overlays_as_contours', + '--volume_cmap_name', 'viridis']) assert ret.success From 6632a6fe9766029f92ff3b620cec3cf6ea822d4d Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Wed, 23 Jul 2025 16:07:24 -0400 Subject: [PATCH 47/90] Fixed test_viz_bingham_fit + added options in test_viz_fodf --- scilpy/reconst/bingham.py | 20 +++++++++------- .../bingham_metric_along_streamlines.py | 2 +- scilpy/viz/slice.py | 14 +++++++---- scripts/scil_fodf_to_bingham.py | 2 +- scripts/scil_viz_bingham_fit.py | 2 +- scripts/tests/test_viz_bingham_fit.py | 10 ++++---- scripts/tests/test_viz_fodf.py | 24 +++++++++++++++---- 7 files changed, 48 insertions(+), 26 deletions(-) diff --git a/scilpy/reconst/bingham.py b/scilpy/reconst/bingham.py index 59ee29932..e27f50038 100644 --- a/scilpy/reconst/bingham.py +++ b/scilpy/reconst/bingham.py @@ -72,8 +72,9 @@ def bingham_to_sf(bingham_volume, vertices): Parameters ---------- - bingham_volume: Bingham parameters volume. - A Bingham distributions volume. + bingham_volume: Array + Volume of shape (X, Y, Z, N_LOBES, NB_PARAMS) containing + the Bingham distributions parameters. Note, NB_PARAMS is usually 7. vertices: ndarray (n_vertices, 3) Sampling directions. @@ -110,8 +111,9 @@ def bingham_to_peak_direction(bingham_volume): Parameters ---------- - bingham_volume: ndarray (..., max_lobes, 9) - Bingham volume. + bingham_volume: Array + Volume of shape (X, Y, Z, N_LOBES, NB_PARAMS) containing + the Bingham distributions parameters. Note, NB_PARAMS is usually 7. Returns ------- @@ -357,8 +359,9 @@ def compute_fiber_density(bingham, m=50, mask=None, nbr_processes=None): Parameters ---------- - bingham: ndarray (X, Y, Z, max_lobes*9) - Input Bingham volume. + bingham: Array + Volume of shape (X, Y, Z, N_LOBES, NB_PARAMS) containing + the Bingham distributions parameters. Note, NB_PARAMS is usually 7. m: unsigned int, optional Number of steps along theta axis for the integration. The number of steps along the phi axis is 2*m. @@ -448,8 +451,9 @@ def compute_fiber_spread(binghams, fd): Parameters ---------- - binghams: ndarray (X, Y, Z, max_lobes*9) - Bingham volume. + binghams: Array + Volume of shape (X, Y, Z, N_LOBES, NB_PARAMS) containing + the Bingham distributions parameters. Note, NB_PARAMS is usually 7. fd: ndarray (X, Y, Z, max_lobes) Fiber density image. diff --git a/scilpy/tractanalysis/bingham_metric_along_streamlines.py b/scilpy/tractanalysis/bingham_metric_along_streamlines.py index 91eaf7a5a..567feb08c 100644 --- a/scilpy/tractanalysis/bingham_metric_along_streamlines.py +++ b/scilpy/tractanalysis/bingham_metric_along_streamlines.py @@ -18,7 +18,7 @@ def bingham_metric_map_along_streamlines(sft, bingham_coeffs, StatefulTractogram containing the streamlines needed. bingham_coeffs : ndarray Array of shape (X, Y, Z, N_LOBES, NB_PARAMS) containing - the Bingham distributions parameters. + the Bingham distributions parameters. Note, NB_PARAMS is usually 7. metric : ndarray Array of shape (X, Y, Z) containing the Bingham metric of interest. max_theta : float diff --git a/scilpy/viz/slice.py b/scilpy/viz/slice.py index c56cfbf05..a53bb9d3e 100644 --- a/scilpy/viz/slice.py +++ b/scilpy/viz/slice.py @@ -284,8 +284,10 @@ def create_bingham_slicer(data, orientation, slice_index, Parameters ---------- - data: ndarray (X, Y, Z, 9 * nb_lobes) - The Bingham volume. + data: Array + Volume of shape (X, Y, Z, N_LOBES, NB_PARAMS) containing + the Bingham distributions parameters. Note, NB_PARAMS is usually 7. + One of X, Y, Z should be of value 1 (one slice). orientation: str Name of the axis to visualize. Choices are axial, coronal and sagittal. slice_index: int @@ -302,13 +304,15 @@ def create_bingham_slicer(data, orientation, slice_index, ODF slicer actors representing the Bingham distributions. """ shape = data.shape + if len(shape) != 5: + raise ValueError('Expecting bingham data to be 5D ' + '(x, y, z, N_LOBES, NB_PARAMS), but got {}' + .format(shape)) nb_lobes = shape[-2] colors = [c * 255 for c in generate_n_colors(nb_lobes)] - # lmax norm for normalization - print("???????? data", data.shape) + # lmax norm for normalization: first bingham param, averaged on lobes lmaxnorm = np.max(np.abs(data[..., 0]), axis=-1) - print("???????? lmaxnorm", lmaxnorm.shape) bingham_sf = bingham_to_sf(data, sphere.vertices) actors = [] diff --git a/scripts/scil_fodf_to_bingham.py b/scripts/scil_fodf_to_bingham.py index 025b8e158..0b30935a2 100755 --- a/scripts/scil_fodf_to_bingham.py +++ b/scripts/scil_fodf_to_bingham.py @@ -37,7 +37,7 @@ assert_outputs_exist, validate_nbr_processes, assert_headers_compatible) from scilpy.io.image import get_data_as_mask -from scilpy.reconst.bingham import (bingham_fit_sh) +from scilpy.reconst.bingham import bingham_fit_sh from scilpy.version import version_string diff --git a/scripts/scil_viz_bingham_fit.py b/scripts/scil_viz_bingham_fit.py index 19cf8e0c1..735bcfce1 100755 --- a/scripts/scil_viz_bingham_fit.py +++ b/scripts/scil_viz_bingham_fit.py @@ -41,7 +41,7 @@ def _build_arg_parser(): # Positional arguments p.add_argument('in_bingham', help='Input SH image file. Expecting data to be of size ' - '(X, Y, Z, 9 * nb_lobes)') + '(X, Y, Z, nb_lobes, 7)') # Window configuration options p.add_argument('--slice_index', type=int, diff --git a/scripts/tests/test_viz_bingham_fit.py b/scripts/tests/test_viz_bingham_fit.py index 618700830..5725b3251 100644 --- a/scripts/tests/test_viz_bingham_fit.py +++ b/scripts/tests/test_viz_bingham_fit.py @@ -7,7 +7,7 @@ from scilpy import SCILPY_HOME from scilpy.io.fetcher import fetch_data, get_testing_files_dict -fetch_data(get_testing_files_dict(), keys=['tracking.zip']) +fetch_data(get_testing_files_dict(), keys=['processing.zip']) tmp_dir = tempfile.TemporaryDirectory() @@ -19,9 +19,9 @@ def test_help_option(script_runner): def test_silent_without_output(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - # dummy dataset (the script should raise an error before using it) - in_dummy = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - out = os.path.join(tmp_dir.name, 'fodf.png') + in_dummy = os.path.join(SCILPY_HOME, 'processing', 'fodf_bingham.nii.gz') + out = os.path.join(tmp_dir.name, 'test_bingham.png') ret = script_runner.run(['scil_viz_bingham_fit.py', in_dummy, '--silent', '--output', out]) - assert ret.success #(not ret.success) + + assert ret.success diff --git a/scripts/tests/test_viz_fodf.py b/scripts/tests/test_viz_fodf.py index fbd09c941..a4500d175 100644 --- a/scripts/tests/test_viz_fodf.py +++ b/scripts/tests/test_viz_fodf.py @@ -30,14 +30,28 @@ def test_run(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - # No variance file in data, but faking it with the fodf file. + # No variance file in our test data, but faking it with the fodf file. in_variance = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') out_name = os.path.join(tmp_dir.name, 'out.png') ret = script_runner.run(['scil_viz_fodf.py', in_fodf, '--silent', '--in_transparency_mask', in_mask, - '--mask', in_mask, '--sph_subdivide', '2', + '--mask', in_mask, + '--variance', in_variance, '--output', out_name]) - # toDo: With additional option ['--variance', in_variance], tests - # crash locally.. - assert ret.success + + +def test_run_sphsubdivide(script_runner, monkeypatch): + monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) + in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') + in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') + out_name = os.path.join(tmp_dir.name, 'out2.png') + + # Note. Cannot add --sph_subdivide to the test above, causes a memory + # crash. Without the variance, lighter. + ret = script_runner.run('scil_viz_fodf.py', in_fodf, '--silent', + '--mask', in_mask, + '--sph_subdivide', '2', + '--output', out_name) + + assert ret.success \ No newline at end of file From 4d259ca0821f5078c4ddb84345491e4d779e3b52 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Thu, 24 Jul 2025 09:37:03 -0400 Subject: [PATCH 48/90] Remove ignore decorator, now ok --- scilpy/viz/backends/fury.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scilpy/viz/backends/fury.py b/scilpy/viz/backends/fury.py index 1c43dbe19..3cd8888a5 100644 --- a/scilpy/viz/backends/fury.py +++ b/scilpy/viz/backends/fury.py @@ -296,8 +296,7 @@ def snapshot_scenes(scenes, window_size): def create_contours_actor(contours, opacity=1., linewidth=3., - color=[255, 0, 0]): # pragma: no cover - # (Function ignored from coverage statistics) + color=[255, 0, 0]): """ Create an actor from a vtkPolyData of contours From cb9ee2545aa0584171c19b2dbc19346854231d08 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Mon, 28 Jul 2025 16:33:11 -0400 Subject: [PATCH 49/90] fix filtering_list when using multiple id for atlas_roi --- scripts/scil_tractogram_filter_by_roi.py | 16 +++++++--- .../tests/test_tractogram_filter_by_roi.py | 31 ++++++++++--------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/scripts/scil_tractogram_filter_by_roi.py b/scripts/scil_tractogram_filter_by_roi.py index fa94bd418..9ecca42b9 100755 --- a/scripts/scil_tractogram_filter_by_roi.py +++ b/scripts/scil_tractogram_filter_by_roi.py @@ -181,11 +181,16 @@ def _convert_filering_list_to_roi_args(parser, args): for roi_opt in content: # Convert the line with spaces to a list of args. - tmp_opt = roi_opt.split() + # tmp_opt = roi_opt.split() + tmp_opt = [] + if "\"" in roi_opt: + tmp_tmp = [i.strip() for i in roi_opt.strip().split("\"")] + tmp_opt.append( + tmp_tmp[0].split() + [tmp_tmp[1]] + tmp_tmp[2].split()) + else: + tmp_opt.append(roi_opt.strip().split()) - # Manage cases with " " or ' ' around options - tmp_opt = [i.replace("\"", '') for i in tmp_opt] - tmp_opt = [i.replace("'", '') for i in tmp_opt] + tmp_opt = tmp_opt[0] if tmp_opt[0] == 'drawn_roi': args.drawn_roi.append(tmp_opt[1:]) @@ -202,7 +207,8 @@ def _convert_filering_list_to_roi_args(parser, args): else: parser.error("Filtering list option {} not understood." .format(tmp_opt[0])) - + print(args.atlas_roi) + print(args.bdo) return args diff --git a/scripts/tests/test_tractogram_filter_by_roi.py b/scripts/tests/test_tractogram_filter_by_roi.py index 742abd341..423e93be7 100644 --- a/scripts/tests/test_tractogram_filter_by_roi.py +++ b/scripts/tests/test_tractogram_filter_by_roi.py @@ -16,6 +16,7 @@ 'bundle_all_1mm_inliers.trk') in_roi = os.path.join(SCILPY_HOME, 'filtering', 'mask.nii.gz') in_bdo = os.path.join(SCILPY_HOME, 'filtering', 'sc.bdo') +in_labels = os.path.join(SCILPY_HOME, 'filtering', 'labels.nii.gz') def test_help_option(script_runner): @@ -27,13 +28,13 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_filter_by_roi.py', in_tractogram, - 'bundle_1.trk', '--display_counts', - '--drawn_roi', in_roi, 'any', 'include', - '--bdo', in_bdo, 'any', 'include', - '--x_plane', '0', 'either_end', 'exclude', - '--y_plane', '0', 'all', 'exclude', '0', - '--z_plane', '0', 'either_end', 'exclude', '1', - '--save_rejected', 'bundle_1_rejected.trk']) + 'bundle_1.trk', '--display_counts', + '--drawn_roi', in_roi, 'any', 'include', + '--bdo', in_bdo, 'any', 'include', + '--x_plane', '0', 'either_end', 'exclude', + '--y_plane', '0', 'all', 'exclude', '0', + '--z_plane', '0', 'either_end', 'exclude', '1', + '--save_rejected', 'bundle_1_rejected.trk']) assert ret.success @@ -41,9 +42,9 @@ def test_execution_filtering_overwrite_distance(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_filter_by_roi.py', in_tractogram, - 'bundle_2.trk', '--display_counts', - '--drawn_roi', in_roi, 'any', 'include', '2', - '--overwrite_distance', 'any', 'include', '4']) + 'bundle_2.trk', '--display_counts', + '--drawn_roi', in_roi, 'any', 'include', '2', + '--overwrite_distance', 'any', 'include', '4']) assert ret.success @@ -53,11 +54,11 @@ def test_execution_filtering_list(script_runner, monkeypatch): # Write a list of options filelist = 'my_filelist.txt' with open(filelist, 'w') as f: - f.write('drawn_roi {} any include\n'.format(in_roi)) - f.write('bdo {} "any" "include"\n'.format(in_bdo)) - f.write("bdo {} 'any' include".format(in_bdo)) + f.write('atlas_roi {} "1:2 3:4" any include\n'.format(in_labels)) + f.write('bdo {} any include\n'.format(in_bdo)) + f.write("bdo {} any include".format(in_bdo)) ret = script_runner.run(['scil_tractogram_filter_by_roi.py', in_tractogram, - 'bundle_3.trk', '--display_counts', - '--filtering_list', filelist]) + 'bundle_3.trk', '--display_counts', + '--filtering_list', filelist]) assert ret.success From 071e28ecc472b50b5a82667a877395c134305b75 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Mon, 28 Jul 2025 16:37:05 -0400 Subject: [PATCH 50/90] fix typo and add comment --- scripts/scil_tractogram_filter_by_roi.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/scil_tractogram_filter_by_roi.py b/scripts/scil_tractogram_filter_by_roi.py index 9ecca42b9..7a6c35c63 100755 --- a/scripts/scil_tractogram_filter_by_roi.py +++ b/scripts/scil_tractogram_filter_by_roi.py @@ -180,8 +180,7 @@ def _convert_filering_list_to_roi_args(parser, args): content = txt.readlines() for roi_opt in content: - # Convert the line with spaces to a list of args. - # tmp_opt = roi_opt.split() + # Handle args when using multiple IDs with atlas_roi tmp_opt = [] if "\"" in roi_opt: tmp_tmp = [i.strip() for i in roi_opt.strip().split("\"")] @@ -207,8 +206,6 @@ def _convert_filering_list_to_roi_args(parser, args): else: parser.error("Filtering list option {} not understood." .format(tmp_opt[0])) - print(args.atlas_roi) - print(args.bdo) return args From 3c1dd2039bda33249a7d69f6510ba2a16b15e116 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Tue, 29 Jul 2025 09:45:40 -0400 Subject: [PATCH 51/90] update filtering.zip thanks to Alex --- scilpy/io/fetcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scilpy/io/fetcher.py b/scilpy/io/fetcher.py index 563d01b67..a67fe6401 100644 --- a/scilpy/io/fetcher.py +++ b/scilpy/io/fetcher.py @@ -43,7 +43,7 @@ def get_testing_files_dict(): "bundles.zip": "54b6e2bf2dda579886efe4e2a8989486", "stats.zip": "2aeac4da5ab054b3a460fc5fdc5e4243", "bst.zip": "eed227fd246255e7417f92d49eb1066a", - "filtering.zip": "19116ff4244d057c8214ee3fe8e05f71", + "filtering.zip": "aa35388a791d803e3051a3236577ae19", "ihMT.zip": "08fcf44848ba2649aad5a5a470b3cb06", "tractometry.zip": "890bfa70e44b15c0d044085de54e00c6", "bids_json.zip": "97fd9a414849567fbfdfdb0ef400488b", From 83541601bb08eaca895cbde8efd8ae4cfe1a71e0 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Tue, 29 Jul 2025 12:00:17 -0400 Subject: [PATCH 52/90] Use more lightweight data in test_viz_fodf.sh --- scripts/tests/test_viz_fodf.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/tests/test_viz_fodf.py b/scripts/tests/test_viz_fodf.py index a4500d175..b2798ef26 100644 --- a/scripts/tests/test_viz_fodf.py +++ b/scripts/tests/test_viz_fodf.py @@ -7,7 +7,7 @@ from scilpy import SCILPY_HOME from scilpy.io.fetcher import fetch_data, get_testing_files_dict -fetch_data(get_testing_files_dict(), keys=['tracking.zip']) +fetch_data(get_testing_files_dict(), keys=['processing.zip']) tmp_dir = tempfile.TemporaryDirectory() @@ -18,7 +18,7 @@ def test_help_option(script_runner): def test_silent_without_output(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') + in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf.nii.gz') ret = script_runner.run(['scil_viz_fodf.py', in_fodf, '--silent']) @@ -28,10 +28,10 @@ def test_silent_without_output(script_runner, monkeypatch): def test_run(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') + in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf.nii.gz') + in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') # No variance file in our test data, but faking it with the fodf file. - in_variance = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') + in_variance = os.path.join(SCILPY_HOME, 'processing', 'fodf.nii.gz') out_name = os.path.join(tmp_dir.name, 'out.png') ret = script_runner.run(['scil_viz_fodf.py', in_fodf, '--silent', '--in_transparency_mask', in_mask, @@ -43,8 +43,8 @@ def test_run(script_runner, monkeypatch): def test_run_sphsubdivide(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') + in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf.nii.gz') + in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') out_name = os.path.join(tmp_dir.name, 'out2.png') # Note. Cannot add --sph_subdivide to the test above, causes a memory From 3d2a98aa5f8868bc4a1f9412fd8bb5f3180714b4 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Tue, 29 Jul 2025 13:26:06 -0400 Subject: [PATCH 53/90] Use smaller sphere in viz_fodf --- scripts/tests/test_viz_fodf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/tests/test_viz_fodf.py b/scripts/tests/test_viz_fodf.py index b2798ef26..172111d15 100644 --- a/scripts/tests/test_viz_fodf.py +++ b/scripts/tests/test_viz_fodf.py @@ -49,9 +49,10 @@ def test_run_sphsubdivide(script_runner, monkeypatch): # Note. Cannot add --sph_subdivide to the test above, causes a memory # crash. Without the variance, lighter. - ret = script_runner.run('scil_viz_fodf.py', in_fodf, '--silent', + ret = script_runner.run(['scil_viz_fodf.py', in_fodf, '--silent', '--mask', in_mask, '--sph_subdivide', '2', - '--output', out_name) + '--sphere', 'repulsion100', + '--output', out_name]) assert ret.success \ No newline at end of file From 0e57a51f340d0c23ae330d85556feb548c667299 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Tue, 29 Jul 2025 14:45:59 -0400 Subject: [PATCH 54/90] Fix test_tractogram_assigh_custom_color --- scilpy/viz/color.py | 14 +++++++++++++- scripts/scil_tractogram_assign_custom_color.py | 2 +- .../tests/test_tractogram_assign_custom_color.py | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/scilpy/viz/color.py b/scilpy/viz/color.py index eb2a8655a..a76159b25 100644 --- a/scilpy/viz/color.py +++ b/scilpy/viz/color.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import logging from dipy.io.stateful_tractogram import StatefulTractogram from fury import colormap @@ -281,7 +282,7 @@ def prepare_colorbar_figure(cmap, lbound, ubound, nb_values=255, nb_ticks=10, def ambiant_occlusion(sft, colors, factor=4): """ Apply ambiant occlusion to a set of colors based on point density - around each points. + around each point. Parameters ---------- @@ -299,6 +300,17 @@ def ambiant_occlusion(sft, colors, factor=4): """ pts = sft.streamlines._data + + if np.min(colors) < 0: + logging.warning("Minimal color in 'color' was less than 0 ({}). Are " + "you sure that this dpp contains colors?" + .format(np.min(colors))) + if np.max(colors) > 1: + # Normalizing + logging.debug("'colors' contained data between 0 and {}, normalizing." + .format(np.max(colors))) + colors = colors / np.max(colors) + hsv = mcolors.rgb_to_hsv(colors) tree = KDTree(pts) diff --git a/scripts/scil_tractogram_assign_custom_color.py b/scripts/scil_tractogram_assign_custom_color.py index 4e716f7bb..430135c17 100755 --- a/scripts/scil_tractogram_assign_custom_color.py +++ b/scripts/scil_tractogram_assign_custom_color.py @@ -120,7 +120,7 @@ def _build_arg_parser(): g2 = p.add_argument_group(title='Coloring options') g2.add_argument('--ambiant_occlusion', nargs='?', const=4, type=int, help='Impact factor of the ambiant occlusion ' - 'approximation. [%(default)s]') + 'approximation. Default if set is 4.') g2.add_argument('--colormap', default='jet', help='Select the colormap for colored trk (dps/dpp) ' '[%(default)s].\nUse two Matplotlib named color separeted ' diff --git a/scripts/tests/test_tractogram_assign_custom_color.py b/scripts/tests/test_tractogram_assign_custom_color.py index 65c2576c9..96aa5215d 100644 --- a/scripts/tests/test_tractogram_assign_custom_color.py +++ b/scripts/tests/test_tractogram_assign_custom_color.py @@ -53,7 +53,7 @@ def test_execution_from_angle(script_runner, monkeypatch): def test_execution_ambiant_occlusion(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run('scil_tractogram_assign_custom_color.py', + ret = script_runner.run(['scil_tractogram_assign_custom_color.py', in_bundle, 'colored4.trk', '--local_orientation', - '--ambiant_occlusion') + '--ambiant_occlusion']) assert ret.success \ No newline at end of file From 61526785de224a85fb8a2be5978328108a3d76b0 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Wed, 30 Jul 2025 11:37:08 -0400 Subject: [PATCH 55/90] Answer Alex: add --silent to plot each shell/proj shell --- scilpy/viz/gradients.py | 50 +++++++++++-------- scripts/scil_gradients_validate_sampling.py | 34 ++++++------- scripts/scil_viz_gradients_screenshot.py | 17 +++---- .../tests/test_viz_gradients_screenshot.py | 4 +- 4 files changed, 55 insertions(+), 50 deletions(-) diff --git a/scilpy/viz/gradients.py b/scilpy/viz/gradients.py index 1959b0bf1..263075f36 100644 --- a/scilpy/viz/gradients.py +++ b/scilpy/viz/gradients.py @@ -14,8 +14,7 @@ def plot_each_shell(ms, centroids, plot_sym_vecs=True, use_sphere=True, same_color=False, rad=0.025, opacity=1.0, ofile=None, - ores=(300, 300), titles=None): # pragma: no cover - # (Function ignored from coverage statistics) + ores=(300, 300), titles=None, silent=False): """ Plot each shell @@ -36,11 +35,14 @@ def plot_each_shell(ms, centroids, plot_sym_vecs=True, use_sphere=True, opacity: float opacity for the shells ofile: str - output filename + output filename. If not set, no output will be saved. ores: tuple resolution of the output png titles: list of str titles for the windows, one per shell + silent: bool + If True, skips interactive visualization. Note that, then, titles will + not be added to the window. """ _colors = generate_n_colors(len(ms)) @@ -70,19 +72,20 @@ def plot_each_shell(ms, centroids, plot_sym_vecs=True, use_sphere=True, if plot_sym_vecs: pts_actor = actor.point(-shell, _colors[i], point_radius=rad) scene.add(pts_actor) - if titles is not None: - if len(titles) == len(ms): - window.show(scene, title=titles[i]) - elif isinstance(titles, str): - window.show(scene, title=titles) - elif len(titles) == 1: - window.show(scene, title=titles[0]) + if not silent: + if titles is not None: + if len(titles) == len(ms): + window.show(scene, title=titles[i]) + elif isinstance(titles, str): + window.show(scene, title=titles) + elif len(titles) == 1: + window.show(scene, title=titles[0]) + else: + logging.warning('No title could be added to the windows ' + 'since the given format is incorrect.') + window.show(scene) else: - logging.warning('No title could be added to the windows since ' - 'the given format is incorrect.') window.show(scene) - else: - window.show(scene) if ofile: filename = ofile + '_shell_' + str(int(centroids[i])) + '.png' @@ -95,8 +98,7 @@ def plot_each_shell(ms, centroids, plot_sym_vecs=True, use_sphere=True, def plot_proj_shell(ms, use_sym=True, use_sphere=True, same_color=False, rad=0.025, opacity=1.0, ofile=None, ores=(300, 300), - title=None): # pragma: no cover - # (Function ignored from coverage statistics) + title=None, silent=None): """ Plot each shell @@ -115,11 +117,15 @@ def plot_proj_shell(ms, use_sym=True, use_sphere=True, same_color=False, opacity: float opacity for the shells ofile: str - output filename + output filename. If not set, no output will be saved. ores: tuple resolution of the output png title: str title for the window + silent: bool + If True, skips interactive visualization. Useful for debugging. + Note that, then, titles will not be added to the window and will not + be tested. """ _colors = generate_n_colors(len(ms)) @@ -148,10 +154,12 @@ def plot_proj_shell(ms, use_sym=True, use_sphere=True, same_color=False, if use_sym: pts_actor = actor.point(-shell, _colors[i], point_radius=rad) scene.add(pts_actor) - if title is not None: - window.show(scene, title=title) - else: - window.show(scene) + if not silent: + if title is not None: + window.show(scene, title=title) + else: + window.show(scene) + if ofile: filename = ofile + '.png' # Legacy. When this snapshotting gets updated to align with the diff --git a/scripts/scil_gradients_validate_sampling.py b/scripts/scil_gradients_validate_sampling.py index 7483b485d..98eb17bd3 100644 --- a/scripts/scil_gradients_validate_sampling.py +++ b/scripts/scil_gradients_validate_sampling.py @@ -19,11 +19,10 @@ value, the script raises a warning. The user might want to use the -v verbose option to see the computed energies. -The --viz option displays both the inputed and optimal b-vectors on a -single shell. The --viz_and_save option first displays both the inputed and -optimal b-vectors on a single shell and then saves them as png. Use one or the -other, not both. For more options on visualization, please use -scil_viz_gradients_screenshot.py. +The --viz option displays both the input and optimal b-vectors on a single +shell. The --save_viz option this image as png. If --save_viz is used without +--viz, the image will be saved but not shown. For more options on +visualization, please use scil_viz_gradients_screenshot.py. ------------------------------------------------------------------------------ Reference: [1] Emmanuel Caruyer, Christophe Lenglet, Guillermo Sapiro, @@ -70,13 +69,13 @@ def _build_arg_parser(): 'energy \nand the optimal b-vectors\' energy ' '(input_energy/optimal_energy). [%(default)s]') - p2 = p.add_mutually_exclusive_group() - p2.add_argument('--viz', action='store_true', - help='Visualize the inputed gradient scheme, then the ' - 'optimal one.') - p2.add_argument('--viz_and_save', metavar='OUT_FOLDER', - help='Save the inputed and optimal gradient schemes in ' - 'the specified folder.') + p.add_argument('--viz', action='store_true', + help='Visualize the inputed gradient scheme, then the ' + 'optimal one.') + p.add_argument('--save_viz', metavar='OUT_FOLDER', + help='Save the input and optimal gradient schemes in ' + 'the specified folder. If --viz is not set, then ' + 'the window is not shown but will be saved.') add_b0_thresh_arg(p) add_skip_b0_check_arg(p, will_overwrite_with_min=False) @@ -110,8 +109,8 @@ def main(): # Check output files out_files = [None, None] - if args.viz_and_save: - out_path = args.viz_and_save + if args.save_viz is not None: + out_path = args.save_viz out_files = [os.path.join(out_path, "inputed_gradient_scheme"), os.path.join(out_path, "optimized_gradient_scheme")] assert_outputs_exist(parser, args, [], @@ -150,13 +149,14 @@ def main(): verbose=0) # Visualize the gradient schemes - if args.viz or args.viz_and_save: + if args.viz or (args.save_viz is not None): viz_bvecs = build_ms_from_shell_idx(bvecs, shell_idx) viz_opt_bvecs = build_ms_from_shell_idx(opt_bvecs, shell_idx) plot_proj_shell(viz_bvecs, use_sym=True, title="Inputed b-vectors", - ofile=out_files[0]) + ofile=out_files[0], silent=not args.viz) plot_proj_shell(viz_opt_bvecs, use_sym=True, - title="Optimized b-vectors", ofile=out_files[1]) + title="Optimized b-vectors", ofile=out_files[1], + silent=not args.viz) # Compute the energy for both the input bvecs and optimal bvecs. energy, opt_energy = energy_comparison(bvecs, opt_bvecs, nb_shells, diff --git a/scripts/scil_viz_gradients_screenshot.py b/scripts/scil_viz_gradients_screenshot.py index f86f20ebe..8b4132700 100755 --- a/scripts/scil_viz_gradients_screenshot.py +++ b/scripts/scil_viz_gradients_screenshot.py @@ -73,9 +73,9 @@ def _build_arg_parser(): '--opacity', type=float, default=1.0, help='Opacity for the shells.') - p.add_argument('--test_run', action='store_true', - help="If set, will not show anything. For debugging " - "purposes.") + p.add_argument('--silent', action='store_true', + help="If set, will not show anything, but will save " + "image to disc only.") add_verbose_arg(p) add_overwrite_arg(p) @@ -172,19 +172,16 @@ def main(): sph = args.enable_sph same = args.same_color - if args.test_run: - logging.warning("Tested everything. Exiting before launching " - "vizualisation.") - exit(0) - if proj: plot_proj_shell(ms, use_sym=sym, use_sphere=sph, same_color=same, rad=0.025, opacity=args.opacity, - ofile=out_basename, ores=(args.res, args.res)) + ofile=out_basename, ores=(args.res, args.res), + silent=args.silent) if each: plot_each_shell(ms, centroids, plot_sym_vecs=sym, use_sphere=sph, same_color=same, rad=0.025, opacity=args.opacity, - ofile=out_basename, ores=(args.res, args.res)) + ofile=out_basename, ores=(args.res, args.res), + silent=args.silent) if __name__ == "__main__": diff --git a/scripts/tests/test_viz_gradients_screenshot.py b/scripts/tests/test_viz_gradients_screenshot.py index a4dc77421..56ce4dfa8 100644 --- a/scripts/tests/test_viz_gradients_screenshot.py +++ b/scripts/tests/test_viz_gradients_screenshot.py @@ -20,12 +20,12 @@ def test_run_bval(script_runner): bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') ret = script_runner.run('scil_viz_gradients_screenshot.py', '--in_gradient_scheme', bval, bvec, - '--test_run') + '--silent') assert ret.success def test_run_dipy_sphere(script_runner): ret = script_runner.run('scil_viz_gradients_screenshot.py', '--dipy_sphere', 'symmetric362', - '--test_run') + '--silent') assert ret.success \ No newline at end of file From ed2504fbf9597a499ccb415007c0a084a5ea6e27 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Wed, 30 Jul 2025 11:54:14 -0400 Subject: [PATCH 56/90] Answer other comments Alex and Arnaud --- scripts/scil_viz_bingham_fit.py | 24 ++++++++----------- scripts/scil_viz_tractogram_seeds_3d.py | 4 ++-- .../tests/test_viz_gradients_screenshot.py | 8 +++---- scripts/tests/test_viz_tractogram_seeds_3d.py | 4 ++-- .../test_viz_volume_screenshot_mosaic.py | 4 ++-- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/scripts/scil_viz_bingham_fit.py b/scripts/scil_viz_bingham_fit.py index 735bcfce1..1e5c37b1d 100755 --- a/scripts/scil_viz_bingham_fit.py +++ b/scripts/scil_viz_bingham_fit.py @@ -81,18 +81,6 @@ def _build_arg_parser(): return p -def _parse_args(parser): - args = parser.parse_args() - if not args.output and args.silent: - parser.error('Silent mode is enabled but no output is specified.' - 'Specify an output with --output to use silent mode.') - - assert_inputs_exist(parser, [args.in_bingham]) - assert_outputs_exist(parser, args, [args.output]) - - return args - - def _get_slicing_for_axis(axis_name, index, shape): """ Get a tuple of slice representing the slice of interest at `index` @@ -120,10 +108,18 @@ def _get_data_from_inputs(args): def main(): parser = _build_arg_parser() - args = _parse_args(parser) + args = parser.parse_args() + logging.getLogger().setLevel(logging.getLevelName(args.verbose)) + + if not args.output and args.silent: + parser.error('Silent mode is enabled but no output is specified.' + 'Specify an output with --output to use silent mode.') + + assert_inputs_exist(parser, args.in_bingham) + assert_outputs_exist(parser, args, [], args.output) + data = _get_data_from_inputs(args) sph = get_sphere(name=args.sphere) - logging.getLogger().setLevel(logging.getLevelName(args.verbose)) actors = create_bingham_slicer(data, args.axis_name, args.slice_index, sph, diff --git a/scripts/scil_viz_tractogram_seeds_3d.py b/scripts/scil_viz_tractogram_seeds_3d.py index 5204bc6cd..0ebc77208 100755 --- a/scripts/scil_viz_tractogram_seeds_3d.py +++ b/scripts/scil_viz_tractogram_seeds_3d.py @@ -59,7 +59,7 @@ def _build_arg_parser(): default=[0, 0, 0], type=parser_color_type, help='RBG values [0, 255] of the color of the background.' '\n[Default: %(default)s]') - p.add_argument('--no-show', action='store_true', + p.add_argument('--silent', action='store_true', help="If set, runs the script but does not display the " "window. For debugging purposes.") add_verbose_arg(p) @@ -116,7 +116,7 @@ def main(): scene.add(line_actor) # Showtime ! - if not args.no_show: + if not args.silent: showm = window.ShowManager(scene, reset_camera=True) showm.initialize() showm.start() diff --git a/scripts/tests/test_viz_gradients_screenshot.py b/scripts/tests/test_viz_gradients_screenshot.py index 56ce4dfa8..1c554611e 100644 --- a/scripts/tests/test_viz_gradients_screenshot.py +++ b/scripts/tests/test_viz_gradients_screenshot.py @@ -18,14 +18,14 @@ def test_help_option(script_runner): def test_run_bval(script_runner): bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run('scil_viz_gradients_screenshot.py', + ret = script_runner.run(['scil_viz_gradients_screenshot.py', '--in_gradient_scheme', bval, bvec, - '--silent') + '--silent']) assert ret.success def test_run_dipy_sphere(script_runner): - ret = script_runner.run('scil_viz_gradients_screenshot.py', + ret = script_runner.run(['scil_viz_gradients_screenshot.py', '--dipy_sphere', 'symmetric362', - '--silent') + '--silent']) assert ret.success \ No newline at end of file diff --git a/scripts/tests/test_viz_tractogram_seeds_3d.py b/scripts/tests/test_viz_tractogram_seeds_3d.py index 6f69b6bfa..9c49b9e6f 100644 --- a/scripts/tests/test_viz_tractogram_seeds_3d.py +++ b/scripts/tests/test_viz_tractogram_seeds_3d.py @@ -16,6 +16,6 @@ def test_run_option(script_runner): seed_map = os.path.join(SCILPY_HOME, 'processing', 'fa.nii.gz') # To test option --tractogram, we would need a tractogram with seeds saved. - ret = script_runner.run('scil_viz_tractogram_seeds_3d.py', seed_map, - '--no-show') + ret = script_runner.run(['scil_viz_tractogram_seeds_3d.py', seed_map, + '--silent']) assert ret.success diff --git a/scripts/tests/test_viz_volume_screenshot_mosaic.py b/scripts/tests/test_viz_volume_screenshot_mosaic.py index 0253cfbd9..03d5c70de 100644 --- a/scripts/tests/test_viz_volume_screenshot_mosaic.py +++ b/scripts/tests/test_viz_volume_screenshot_mosaic.py @@ -22,6 +22,6 @@ def test_screenshot(script_runner, monkeypatch): in_fa = os.path.join(SCILPY_HOME, 'bst', 'fa.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') - ret = script_runner.run("scil_viz_volume_screenshot_mosaic.py", '1', '1', - in_fa, in_mask, 'fa.png', '50') + ret = script_runner.run(["scil_viz_volume_screenshot_mosaic.py", '1', '1', + in_fa, in_mask, 'fa.png', '50']) assert ret.success \ No newline at end of file From 8c89abba2d39bb73ce64139293882ca4e7024d0a Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Wed, 30 Jul 2025 12:31:04 -0400 Subject: [PATCH 57/90] Fix typos --- scilpy/viz/gradients.py | 5 ++--- scripts/scil_gradients_validate_sampling.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scilpy/viz/gradients.py b/scilpy/viz/gradients.py index 263075f36..9dc72b2ae 100644 --- a/scilpy/viz/gradients.py +++ b/scilpy/viz/gradients.py @@ -41,7 +41,7 @@ def plot_each_shell(ms, centroids, plot_sym_vecs=True, use_sphere=True, titles: list of str titles for the windows, one per shell silent: bool - If True, skips interactive visualization. Note that, then, titles will + If True, skips interactive visualization. In that case, titles will not be added to the window. """ @@ -124,8 +124,7 @@ def plot_proj_shell(ms, use_sym=True, use_sphere=True, same_color=False, title for the window silent: bool If True, skips interactive visualization. Useful for debugging. - Note that, then, titles will not be added to the window and will not - be tested. + In that case, titles will not be added to the window. """ _colors = generate_n_colors(len(ms)) diff --git a/scripts/scil_gradients_validate_sampling.py b/scripts/scil_gradients_validate_sampling.py index 98eb17bd3..3ea46aa36 100644 --- a/scripts/scil_gradients_validate_sampling.py +++ b/scripts/scil_gradients_validate_sampling.py @@ -20,8 +20,8 @@ The user might want to use the -v verbose option to see the computed energies. The --viz option displays both the input and optimal b-vectors on a single -shell. The --save_viz option this image as png. If --save_viz is used without ---viz, the image will be saved but not shown. For more options on +shell. The --save_viz option saves this image as png. If --save_viz is used +without --viz, the image will be saved but not shown. For more options on visualization, please use scil_viz_gradients_screenshot.py. ------------------------------------------------------------------------------ Reference: From 9f2a79c367d7ea2408f0f9e66334796b4bd24a71 Mon Sep 17 00:00:00 2001 From: Thoumyre Stanislas Date: Thu, 31 Jul 2025 08:33:39 -0400 Subject: [PATCH 58/90] add test_lesions_harmonize_labels --- .../tests/test_lesions_harmonize_labels.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 scripts/tests/test_lesions_harmonize_labels.py diff --git a/scripts/tests/test_lesions_harmonize_labels.py b/scripts/tests/test_lesions_harmonize_labels.py new file mode 100644 index 000000000..35ddc285f --- /dev/null +++ b/scripts/tests/test_lesions_harmonize_labels.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import os +import tempfile + +from scilpy import SCILPY_HOME +from scilpy.io.fetcher import fetch_data, get_testing_files_dict + +# If they already exist, this only takes 5 seconds (check md5sum) +fetch_data(get_testing_files_dict(), keys=['lesions.zip']) +tmp_dir = tempfile.TemporaryDirectory() + + +def test_help_option(script_runner): + ret = script_runner.run(['scil_lesions_harmonize_labels.py', '--help']) + assert ret.success + +def test_harmonize_label(script_runner, monkeypatch): + monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) + original_data = os.path.join(SCILPY_HOME, 'lesions', + '*_lesions_labels.nii.gz') + ret = script_runner.run(['scil_lesions_harmonize_labels.py', + original_data, 'test', '--max_adjacency', + '5.0', '--min_voxel_overlap', '1', '-f']) + assert ret.success \ No newline at end of file From 4bb8c43be798eba9ef16b1a8934aeece6f596b23 Mon Sep 17 00:00:00 2001 From: Thoumyre Stanislas Date: Fri, 1 Aug 2025 02:49:38 -0400 Subject: [PATCH 59/90] add lesions.zip in fetcher.py --- scilpy/io/fetcher.py | 3 ++- scripts/tests/test_lesions_harmonize_labels.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scilpy/io/fetcher.py b/scilpy/io/fetcher.py index 563d01b67..d2a920e80 100644 --- a/scilpy/io/fetcher.py +++ b/scilpy/io/fetcher.py @@ -59,7 +59,8 @@ def get_testing_files_dict(): "processing.zip": "1ba6869c9d8b58a9b911ba71fdd50a07", "surface_vtk_fib.zip": "241f3afd6344c967d7176b43e4a99a41", "tractograms.zip": "964113f307213523d784b3dbf3a5117a", - "mrds.zip": "5abe6092400e11e9bb2423e2c387e774" + "mrds.zip": "5abe6092400e11e9bb2423e2c387e774", + "lesions.zip": "dbd160b4c0c5d2db9cada875c0bbb00c" } diff --git a/scripts/tests/test_lesions_harmonize_labels.py b/scripts/tests/test_lesions_harmonize_labels.py index 35ddc285f..cc95ea7f7 100644 --- a/scripts/tests/test_lesions_harmonize_labels.py +++ b/scripts/tests/test_lesions_harmonize_labels.py @@ -19,8 +19,8 @@ def test_help_option(script_runner): def test_harmonize_label(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) original_data = os.path.join(SCILPY_HOME, 'lesions', - '*_lesions_labels.nii.gz') + '*_lesions_labels.nii.gz') ret = script_runner.run(['scil_lesions_harmonize_labels.py', - original_data, 'test', '--max_adjacency', - '5.0', '--min_voxel_overlap', '1', '-f']) + original_data, 'test', '--max_adjacency', + '5.0', '--min_voxel_overlap', '1', '-f']) assert ret.success \ No newline at end of file From af49082d56b522fcd20a873887356dd1729070e9 Mon Sep 17 00:00:00 2001 From: Francois Rheault Date: Fri, 1 Aug 2025 09:58:31 -0400 Subject: [PATCH 60/90] Update scripts/tests/test_lesions_harmonize_labels.py Co-authored-by: Arnaud Bore --- scripts/tests/test_lesions_harmonize_labels.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tests/test_lesions_harmonize_labels.py b/scripts/tests/test_lesions_harmonize_labels.py index cc95ea7f7..2d0000930 100644 --- a/scripts/tests/test_lesions_harmonize_labels.py +++ b/scripts/tests/test_lesions_harmonize_labels.py @@ -18,7 +18,7 @@ def test_help_option(script_runner): def test_harmonize_label(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - original_data = os.path.join(SCILPY_HOME, 'lesions', + t1 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T1_lesions_labels.nii.gz') '*_lesions_labels.nii.gz') ret = script_runner.run(['scil_lesions_harmonize_labels.py', original_data, 'test', '--max_adjacency', From cc2185c6627083dfc50cc40d3692b7558d59ddef Mon Sep 17 00:00:00 2001 From: Francois Rheault Date: Fri, 1 Aug 2025 09:58:38 -0400 Subject: [PATCH 61/90] Update scripts/tests/test_lesions_harmonize_labels.py Co-authored-by: Arnaud Bore --- scripts/tests/test_lesions_harmonize_labels.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tests/test_lesions_harmonize_labels.py b/scripts/tests/test_lesions_harmonize_labels.py index 2d0000930..2b66e5371 100644 --- a/scripts/tests/test_lesions_harmonize_labels.py +++ b/scripts/tests/test_lesions_harmonize_labels.py @@ -19,7 +19,7 @@ def test_help_option(script_runner): def test_harmonize_label(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) t1 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T1_lesions_labels.nii.gz') - '*_lesions_labels.nii.gz') + t2 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T2_lesions_labels.nii.gz') ret = script_runner.run(['scil_lesions_harmonize_labels.py', original_data, 'test', '--max_adjacency', '5.0', '--min_voxel_overlap', '1', '-f']) From 94554ec65bc83ea7e8f552cc5a48434cbe5e22c5 Mon Sep 17 00:00:00 2001 From: Francois Rheault Date: Fri, 1 Aug 2025 09:58:47 -0400 Subject: [PATCH 62/90] Update scripts/tests/test_lesions_harmonize_labels.py Co-authored-by: Arnaud Bore --- scripts/tests/test_lesions_harmonize_labels.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tests/test_lesions_harmonize_labels.py b/scripts/tests/test_lesions_harmonize_labels.py index 2b66e5371..cedf19913 100644 --- a/scripts/tests/test_lesions_harmonize_labels.py +++ b/scripts/tests/test_lesions_harmonize_labels.py @@ -21,6 +21,6 @@ def test_harmonize_label(script_runner, monkeypatch): t1 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T1_lesions_labels.nii.gz') t2 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T2_lesions_labels.nii.gz') ret = script_runner.run(['scil_lesions_harmonize_labels.py', - original_data, 'test', '--max_adjacency', + t1, t2, 'test', '--max_adjacency', '5.0', '--min_voxel_overlap', '1', '-f']) assert ret.success \ No newline at end of file From 803569bfdf377b408534ff347f5d111ef370ef41 Mon Sep 17 00:00:00 2001 From: frheault Date: Fri, 1 Aug 2025 11:02:49 -0400 Subject: [PATCH 63/90] Add tests for incremental --- scripts/tests/test_lesions_harmonize_labels.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/tests/test_lesions_harmonize_labels.py b/scripts/tests/test_lesions_harmonize_labels.py index cedf19913..0a6560a27 100644 --- a/scripts/tests/test_lesions_harmonize_labels.py +++ b/scripts/tests/test_lesions_harmonize_labels.py @@ -23,4 +23,15 @@ def test_harmonize_label(script_runner, monkeypatch): ret = script_runner.run(['scil_lesions_harmonize_labels.py', t1, t2, 'test', '--max_adjacency', '5.0', '--min_voxel_overlap', '1', '-f']) + assert ret.success + + +def test_harmonize_label_incremental(script_runner, monkeypatch): + monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) + t1 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T1_lesions_labels.nii.gz') + t2 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T2_lesions_labels.nii.gz') + ret = script_runner.run(['scil_lesions_harmonize_labels.py', + t1, t2, 'test', '--max_adjacency', + '5.0', '--min_voxel_overlap', '1', + '--incremental_lesions', '-f']) assert ret.success \ No newline at end of file From c9360404b6818816dc8dc77e3a3adc3a688291cd Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 1 Aug 2025 15:49:54 -0400 Subject: [PATCH 64/90] fix warning get_version + pytest multithread --- .github/workflows/test.yml | 4 ++-- pytest.ini | 4 +++- src/scilpy/cli/scil_get_version.py | 24 +++++++++++++++--------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 25488ac79..f79546e5f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ env: jobs: test: - runs-on: scilus-runners + runs-on: scilus-bigmem-runners if: github.repository == 'scilus/scilpy' steps: @@ -94,7 +94,7 @@ jobs: cache: 'pip' - name: Install pycoverage - run: pip install coverage + run: uv pip install coverage - name: Download test results and coverage uses: actions/download-artifact@v4 diff --git a/pytest.ini b/pytest.ini index a9acefdde..32729106b 100644 --- a/pytest.ini +++ b/pytest.ini @@ -36,4 +36,6 @@ addopts = --junit-xml=.test_reports/junit.xml --cov --cov-report html - --cov-report xml \ No newline at end of file + --cov-report xml + -n auto + --cov-append diff --git a/src/scilpy/cli/scil_get_version.py b/src/scilpy/cli/scil_get_version.py index 046ab1e19..fbf6c332f 100755 --- a/src/scilpy/cli/scil_get_version.py +++ b/src/scilpy/cli/scil_get_version.py @@ -14,12 +14,13 @@ import datetime import git import pathlib -import pkg_resources +from importlib.metadata import distributions import platform import os import time from scilpy.io.utils import add_verbose_arg + def _build_arg_parser(): p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter) @@ -41,22 +42,27 @@ def main(): print('Your {} version is: {}'.format(_bold('Python'), _bold(platform.python_version()))) - dists = [d for d in pkg_resources.working_set] + dists = [] + for d in distributions(): + dists.append({"version": d.version, + "project_name": d.metadata['Name'], + "location": str(d.locate_file(''))}) + important_deps = ['dipy', 'numpy', 'nibabel', 'dmri-commit', 'dmri-amico'] for dist in dists: - if dist.project_name == 'scilpy': - date = time.ctime(os.path.getctime(dist.location)) + if dist['project_name'] == 'scilpy': + date = time.ctime(os.path.getctime(dist['location'])) date = datetime.datetime.strptime(date, "%a %b %d %H:%M:%S %Y") date = date.strftime('%Y-%m-%d') print('You installed {} with pip on {}'.format(_bold('Scilpy'), _bold(date))) - print('The closest release is {}\n'.format(_bold(dist.version))) - if args.show_dependencies and dist.project_name in important_deps: - print(' {}: {}'.format(_bold(dist.project_name), - _bold(dist.version))) + print('The closest release is {}\n'.format(_bold(dist['version']))) + if args.show_dependencies and dist['project_name'] in important_deps: + print(' {}: {}'.format(_bold(dist['project_name']), + _bold(dist['version']))) - repo_dir = pathlib.Path(__file__).parent.parent + repo_dir = pathlib.Path(__file__).parent.parent.parent.parent try: repo = git.Repo(repo_dir) except git.InvalidGitRepositoryError: From d32f343b5d80c63a17eb338c78212e41241f1245 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 1 Aug 2025 16:26:29 -0400 Subject: [PATCH 65/90] fix dependancies --- pyproject.toml | 83 +++++++++++++++++++++++------------------------- requirements.txt | 49 ---------------------------- 2 files changed, 40 insertions(+), 92 deletions(-) delete mode 100644 requirements.txt diff --git a/pyproject.toml b/pyproject.toml index 322edb085..b83c922e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,57 +24,54 @@ classifiers = [ "Topic :: Scientific/Engineering" ] dependencies = [ - "bids-validator==1.11.*", - "bctpy==0.5.*", - "bz2file==0.98.*", + "bctpy==0.6.*", + "bids-validator==1.14.*", + "bz2file==0.98", "coloredlogs==15.0.*", - "cvxpy==1.4.*", - "cycler==0.11.*", - "Cython==3.0.*", - "dipy==1.10.*", - "deepdiff==6.3.0", + "cvxpy==1.6.*", + "cycler==0.12.*", + "deepdiff==8.1.*", + "dipy==1.11.*", "dmri-amico==2.1.*", "dmri-commit==2.3.*", "docopt==0.6.*", - "dvc==3.48.*", - "dvc-http==2.32.*", - "formulaic==0.3.*", - "fury==0.11.*", - "future==0.18.*", + "dvc==3.59.*", + "formulaic==0.5.*", + "fury==0.12.*", + "future==1.0.*", "GitPython==3.1.*", - "h5py==3.10.*", - "joblib==1.2.*", + "h5py==3.12.*", + "joblib==1.4.*", "kiwisolver==1.4.*", - "matplotlib==3.6.*", + "matplotlib==3.10.*", + "nibabel==5.3.*", + "nilearn==0.11.*", + "nltk==3.9.*", + "numba==0.61.*", + "numba-kdtree==0.4.*", + "numpy==1.26.*", + "openpyxl==3.1.*", + "packaging==24.*", + "pybids==0.18.*", "PyMCubes==0.1.*", - "nibabel==5.2.*", - "nilearn==0.9.*", - "numba==0.59.1", - "numba-kdtree==0.4.0", - "nltk==3.8.*", - "numpy==1.25.*", - "openpyxl==3.0.*", - "packaging == 23.2.*", - "Pillow==10.2.*", - "pybids==0.16.*", - "pyparsing==3.0.*", + "pyparsing==3.2.*", "PySocks==1.7.*", - "pytest==7.2.*", - "pytest-console-scripts==1.3.*", - "pytest-cov==4.1.0", - "pytest-html==4.1.1", - "pytest-mock==3.10.*", - "python-dateutil==2.8.*", - "pytz==2022.6.*", - "requests==2.28.*", - "scikit-learn==1.2.*", - "scikit-image==0.22.*", - "scipy==1.11.*", - "six==1.16.*", - "spams==2.6.*", - "statsmodels==0.13.*", - "trimeshpy==0.0.4", - "vtk==9.2.*" + "pytest==8.3.*", + "pytest-console-scripts==1.4.*", + "pytest-cov==6.0.*", + "pytest-html==4.1.*", + "pytest-metadata==3.1.*", + "pytest-mock==3.14.*", + "python-dateutil==2.9.*", + "pytz==2024.2", + "requests==2.32.*", + "scikit-image==0.25.*", + "scikit-learn==1.6.*", + "scipy==1.15.*", + "six==1.17.*", + "statsmodels==0.14.*", + "trimeshpy==0.0.*", + "vtk==9.3.*" ] [project.optional-dependencies] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 18ea1681f..000000000 --- a/requirements.txt +++ /dev/null @@ -1,49 +0,0 @@ -bctpy==0.6.* -bids-validator==1.14.* -bz2file==0.98 -coloredlogs==15.0.* -cvxpy==1.6.* -cycler==0.12.* -# Cython==3.0.* -deepdiff==8.1.* -dipy==1.11.* -dmri-amico==2.1.* -dmri-commit==2.3.* -docopt==0.6.* -dvc==3.59.* -formulaic==0.5.* -fury==0.12.* -future==1.0.* -GitPython==3.1.* -h5py==3.12.* -joblib==1.4.* -kiwisolver==1.4.* -matplotlib==3.10.* -nibabel==5.3.* -nilearn==0.11.* -nltk==3.9.* -numba==0.61.* -numba-kdtree==0.4.* -numpy==1.26.* -openpyxl==3.1.* -packaging==24.* -pybids==0.18.* -PyMCubes==0.1.* -pyparsing==3.2.* -PySocks==1.7.* -pytest==8.3.* -pytest-console-scripts==1.4.* -pytest-cov==6.0.* -pytest-html==4.1.* -pytest-metadata==3.1.* -pytest-mock==3.14.* -python-dateutil==2.9.* -pytz==2024.2 -requests==2.32.* -scikit-image==0.25.* -scikit-learn==1.6.* -scipy==1.15.* -six==1.17.* -statsmodels==0.14.* -trimeshpy==0.0.* -vtk==9.3.* From 405cda71450625bc809e3eb7f97303653817f5f1 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 1 Aug 2025 16:33:02 -0400 Subject: [PATCH 66/90] fix some automatic fusion --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e7863e9f7..97355e9ac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,7 +56,6 @@ jobs: - name: Install Scilpy run: | - export SETUPTOOLS_USE_DISTUTILS=stdlib uv venv ~/.venvs/scilpy --python=${{ steps.python-selector.outputs.python-version }} source ~/.venvs/scilpy/bin/activate uv pip install --upgrade pip wheel From 4dc10eb3c0bb4c81bb8c346495b5d612436c8acd Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 1 Aug 2025 22:17:39 -0400 Subject: [PATCH 67/90] fix workflow vtk version --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 97355e9ac..13dd0f188 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,7 +63,7 @@ jobs: uv pip install -e . # TODO: to adapt once Scilpy passes to VTK 9.4.0, which selects OSMesa at runtime # https://discourse.vtk.org/t/status-update-runtime-opengl-render-window-selection-in-vtk/14583 - VTK_VERSION=$(cat requirements.txt | grep 'vtk==' | sed 's/vtk==//g') + VTK_VERSION=$(cat pyproject.toml | grep 'vtk==' | sed 's/vtk==//g' | sed 's/\"//g' ) uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==$VTK_VERSION - name: Run tests run: | From bdf2543755f211ed5d43ba04541becfeb5fe1b94 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 1 Aug 2025 22:22:42 -0400 Subject: [PATCH 68/90] try pyproject wo space for dependancies --- pyproject.toml | 96 +++++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b83c922e9..62bdbc373 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,54 +24,54 @@ classifiers = [ "Topic :: Scientific/Engineering" ] dependencies = [ - "bctpy==0.6.*", - "bids-validator==1.14.*", - "bz2file==0.98", - "coloredlogs==15.0.*", - "cvxpy==1.6.*", - "cycler==0.12.*", - "deepdiff==8.1.*", - "dipy==1.11.*", - "dmri-amico==2.1.*", - "dmri-commit==2.3.*", - "docopt==0.6.*", - "dvc==3.59.*", - "formulaic==0.5.*", - "fury==0.12.*", - "future==1.0.*", - "GitPython==3.1.*", - "h5py==3.12.*", - "joblib==1.4.*", - "kiwisolver==1.4.*", - "matplotlib==3.10.*", - "nibabel==5.3.*", - "nilearn==0.11.*", - "nltk==3.9.*", - "numba==0.61.*", - "numba-kdtree==0.4.*", - "numpy==1.26.*", - "openpyxl==3.1.*", - "packaging==24.*", - "pybids==0.18.*", - "PyMCubes==0.1.*", - "pyparsing==3.2.*", - "PySocks==1.7.*", - "pytest==8.3.*", - "pytest-console-scripts==1.4.*", - "pytest-cov==6.0.*", - "pytest-html==4.1.*", - "pytest-metadata==3.1.*", - "pytest-mock==3.14.*", - "python-dateutil==2.9.*", - "pytz==2024.2", - "requests==2.32.*", - "scikit-image==0.25.*", - "scikit-learn==1.6.*", - "scipy==1.15.*", - "six==1.17.*", - "statsmodels==0.14.*", - "trimeshpy==0.0.*", - "vtk==9.3.*" +"bctpy==0.6.*", +"bids-validator==1.14.*", +"bz2file==0.98", +"coloredlogs==15.0.*", +"cvxpy==1.6.*", +"cycler==0.12.*", +"deepdiff==8.1.*", +"dipy==1.11.*", +"dmri-amico==2.1.*", +"dmri-commit==2.3.*", +"docopt==0.6.*", +"dvc==3.59.*", +"formulaic==0.5.*", +"fury==0.12.*", +"future==1.0.*", +"GitPython==3.1.*", +"h5py==3.12.*", +"joblib==1.4.*", +"kiwisolver==1.4.*", +"matplotlib==3.10.*", +"nibabel==5.3.*", +"nilearn==0.11.*", +"nltk==3.9.*", +"numba==0.61.*", +"numba-kdtree==0.4.*", +"numpy==1.26.*", +"openpyxl==3.1.*", +"packaging==24.*", +"pybids==0.18.*", +"PyMCubes==0.1.*", +"pyparsing==3.2.*", +"PySocks==1.7.*", +"pytest==8.3.*", +"pytest-console-scripts==1.4.*", +"pytest-cov==6.0.*", +"pytest-html==4.1.*", +"pytest-metadata==3.1.*", +"pytest-mock==3.14.*", +"python-dateutil==2.9.*", +"pytz==2024.2", +"requests==2.32.*", +"scikit-image==0.25.*", +"scikit-learn==1.6.*", +"scipy==1.15.*", +"six==1.17.*", +"statsmodels==0.14.*", +"trimeshpy==0.0.*", +"vtk==9.3.*" ] [project.optional-dependencies] From c962c00627b76c46b09d0679ba81c365856a0548 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 1 Aug 2025 22:31:11 -0400 Subject: [PATCH 69/90] fix python version and tests calls --- pyproject.toml | 2 +- src/scilpy/cli/tests/test_NODDI_maps.py | 6 +-- src/scilpy/cli/tests/test_NODDI_priors.py | 4 +- src/scilpy/cli/tests/test_aodf_metrics.py | 12 +++--- src/scilpy/cli/tests/test_bids_validate.py | 10 ++--- src/scilpy/cli/tests/test_bingham_metrics.py | 8 ++-- src/scilpy/cli/tests/test_btensor_metrics.py | 14 +++---- .../tests/test_bundle_alter_to_target_dice.py | 12 +++--- .../tests/test_bundle_clean_qbx_clusters.py | 2 +- .../cli/tests/test_bundle_compute_centroid.py | 4 +- .../test_bundle_compute_endpoints_map.py | 6 +-- src/scilpy/cli/tests/test_bundle_diameter.py | 4 +- .../tests/test_bundle_explore_bundleseg.py | 2 +- .../tests/test_bundle_filter_by_occurence.py | 4 +- .../cli/tests/test_bundle_fixel_analysis.py | 8 ++-- .../cli/tests/test_bundle_generate_priors.py | 4 +- src/scilpy/cli/tests/test_bundle_label_map.py | 6 +-- .../cli/tests/test_bundle_mean_fixel_afd.py | 4 +- .../test_bundle_mean_fixel_afd_from_hdf5.py | 4 +- .../test_bundle_mean_fixel_bingham_metric.py | 4 +- .../test_bundle_mean_fixel_mrds_metric.py | 2 +- src/scilpy/cli/tests/test_bundle_mean_std.py | 6 +-- .../tests/test_bundle_pairwise_comparison.py | 12 +++--- .../cli/tests/test_bundle_reject_outliers.py | 4 +- ...undle_score_many_bundles_one_tractogram.py | 4 +- ...le_score_same_bundle_many_segmentations.py | 4 +- .../cli/tests/test_bundle_shape_measures.py | 4 +- .../tests/test_bundle_uniformize_endpoints.py | 6 +-- .../cli/tests/test_bundle_volume_per_label.py | 4 +- .../test_connectivity_compare_populations.py | 4 +- .../test_connectivity_compute_matrices.py | 4 +- .../tests/test_connectivity_compute_pca.py | 4 +- ...test_connectivity_compute_simple_matrix.py | 4 +- .../cli/tests/test_connectivity_filter.py | 4 +- .../tests/test_connectivity_graph_measures.py | 4 +- ...t_connectivity_hdf5_average_density_map.py | 6 +-- .../cli/tests/test_connectivity_math.py | 8 ++-- .../cli/tests/test_connectivity_normalize.py | 4 +- .../test_connectivity_pairwise_agreement.py | 4 +- .../test_connectivity_print_filenames.py | 4 +- .../tests/test_connectivity_reorder_rois.py | 6 +-- .../cli/tests/test_denoising_nlmeans.py | 10 ++--- src/scilpy/cli/tests/test_dki_metrics.py | 4 +- .../cli/tests/test_dti_convert_tensors.py | 6 +-- src/scilpy/cli/tests/test_dti_metrics.py | 14 +++---- .../cli/tests/test_dwi_apply_bias_field.py | 4 +- src/scilpy/cli/tests/test_dwi_compute_snr.py | 4 +- src/scilpy/cli/tests/test_dwi_concatenate.py | 4 +- src/scilpy/cli/tests/test_dwi_convert_FDF.py | 2 +- .../tests/test_dwi_detect_volume_outliers.py | 6 +-- src/scilpy/cli/tests/test_dwi_extract_b0.py | 6 +-- .../cli/tests/test_dwi_extract_shell.py | 8 ++-- .../cli/tests/test_dwi_powder_average.py | 4 +- .../tests/test_dwi_prepare_eddy_command.py | 2 +- .../tests/test_dwi_prepare_topup_command.py | 2 +- .../cli/tests/test_dwi_reorder_philips.py | 8 ++-- .../cli/tests/test_dwi_split_by_indices.py | 8 ++-- src/scilpy/cli/tests/test_dwi_to_sh.py | 6 +-- .../tests/test_fibertube_compute_density.py | 6 +-- .../tests/test_fibertube_score_tractogram.py | 4 +- .../cli/tests/test_fibertube_tracking.py | 22 +++++------ src/scilpy/cli/tests/test_fodf_bundleparc.py | 10 ++--- .../cli/tests/test_fodf_max_in_ventricles.py | 4 +- src/scilpy/cli/tests/test_fodf_memsmt.py | 8 ++-- src/scilpy/cli/tests/test_fodf_metrics.py | 4 +- src/scilpy/cli/tests/test_fodf_msmt.py | 4 +- src/scilpy/cli/tests/test_fodf_ssst.py | 6 +-- src/scilpy/cli/tests/test_fodf_to_bingham.py | 6 +-- src/scilpy/cli/tests/test_freewater_maps.py | 4 +- src/scilpy/cli/tests/test_freewater_priors.py | 2 +- src/scilpy/cli/tests/test_frf_mean.py | 10 ++--- src/scilpy/cli/tests/test_frf_memsmt.py | 18 ++++----- src/scilpy/cli/tests/test_frf_msmt.py | 18 ++++----- .../cli/tests/test_frf_set_diffusivities.py | 10 ++--- src/scilpy/cli/tests/test_frf_ssst.py | 18 ++++----- .../tests/test_gradients_apply_transform.py | 4 +- .../cli/tests/test_gradients_convert.py | 12 +++--- .../tests/test_gradients_generate_sampling.py | 4 +- .../cli/tests/test_gradients_modify_axes.py | 6 +-- .../tests/test_gradients_normalize_bvecs.py | 4 +- .../cli/tests/test_gradients_round_bvals.py | 4 +- .../tests/test_gradients_validate_correct.py | 8 ++-- .../test_gradients_validate_correct_eddy.py | 6 +-- .../tests/test_gradients_validate_sampling.py | 6 +-- .../cli/tests/test_header_print_info.py | 6 +-- .../test_header_validate_compatibility.py | 4 +- .../test_json_convert_entries_to_xlsx.py | 4 +- .../cli/tests/test_json_harmonize_entries.py | 2 +- .../cli/tests/test_json_merge_entries.py | 4 +- src/scilpy/cli/tests/test_labels_combine.py | 6 +-- src/scilpy/cli/tests/test_labels_dilate.py | 4 +- src/scilpy/cli/tests/test_labels_from_mask.py | 14 +++---- src/scilpy/cli/tests/test_labels_remove.py | 4 +- .../tests/test_labels_split_volume_by_ids.py | 4 +- .../test_labels_split_volume_from_lut.py | 4 +- .../cli/tests/test_lesions_generate_nawm.py | 4 +- .../tests/test_lesions_harmonize_labels.py | 6 +-- src/scilpy/cli/tests/test_lesions_info.py | 2 +- src/scilpy/cli/tests/test_mrds_metrics.py | 6 +-- .../test_mrds_select_number_of_tensors.py | 6 +-- .../cli/tests/test_mti_adjust_B1_header.py | 4 +- src/scilpy/cli/tests/test_mti_maps_MT.py | 28 +++++++------- src/scilpy/cli/tests/test_mti_maps_ihMT.py | 28 +++++++------- .../cli/tests/test_plot_stats_per_point.py | 4 +- src/scilpy/cli/tests/test_qball_metrics.py | 8 ++-- src/scilpy/cli/tests/test_rgb_convert.py | 4 +- src/scilpy/cli/tests/test_search_keywords.py | 8 ++-- src/scilpy/cli/tests/test_sh_convert.py | 4 +- src/scilpy/cli/tests/test_sh_fusion.py | 4 +- src/scilpy/cli/tests/test_sh_to_aodf.py | 10 ++--- src/scilpy/cli/tests/test_sh_to_rish.py | 4 +- src/scilpy/cli/tests/test_sh_to_sf.py | 10 ++--- .../cli/tests/test_stats_group_comparison.py | 4 +- .../cli/tests/test_surface_apply_transform.py | 4 +- src/scilpy/cli/tests/test_surface_convert.py | 6 +-- src/scilpy/cli/tests/test_surface_create.py | 12 +++--- src/scilpy/cli/tests/test_surface_flip.py | 4 +- src/scilpy/cli/tests/test_surface_smooth.py | 4 +- src/scilpy/cli/tests/test_tracking_local.py | 30 +++++++-------- .../cli/tests/test_tracking_local_dev.py | 8 ++-- src/scilpy/cli/tests/test_tracking_pft.py | 4 +- .../cli/tests/test_tracking_pft_maps.py | 4 +- .../cli/tests/test_tracking_pft_maps_edit.py | 4 +- .../tests/test_tractogram_apply_transform.py | 4 +- ...test_tractogram_apply_transform_to_hdf5.py | 4 +- .../test_tractogram_assign_custom_color.py | 10 ++--- .../test_tractogram_assign_uniform_color.py | 8 ++-- .../cli/tests/test_tractogram_commit.py | 6 +-- .../cli/tests/test_tractogram_compress.py | 4 +- .../cli/tests/test_tractogram_compute_TODI.py | 6 +-- .../test_tractogram_compute_density_map.py | 6 +-- .../cli/tests/test_tractogram_convert.py | 4 +- .../test_tractogram_convert_hdf5_to_trk.py | 10 ++--- .../test_tractogram_convert_trk_to_hdf5.py | 6 +-- .../test_tractogram_count_streamlines.py | 4 +- .../tests/test_tractogram_cut_streamlines.py | 18 ++++----- .../cli/tests/test_tractogram_detect_loops.py | 4 +- .../cli/tests/test_tractogram_dpp_math.py | 12 +++--- .../cli/tests/test_tractogram_dps_math.py | 24 ++++++------ .../tests/test_tractogram_extract_ushape.py | 4 +- .../test_tractogram_filter_by_anatomy.py | 8 ++-- .../tests/test_tractogram_filter_by_length.py | 8 ++-- .../test_tractogram_filter_by_orientation.py | 4 +- .../tests/test_tractogram_filter_by_roi.py | 8 ++-- .../test_tractogram_filter_collisions.py | 16 ++++---- src/scilpy/cli/tests/test_tractogram_flip.py | 4 +- src/scilpy/cli/tests/test_tractogram_math.py | 38 +++++++++---------- .../test_tractogram_pairwise_comparison.py | 6 +-- .../cli/tests/test_tractogram_print_info.py | 4 +- ...t_tractogram_project_map_to_streamlines.py | 12 +++--- ...t_tractogram_project_streamlines_to_map.py | 16 ++++---- src/scilpy/cli/tests/test_tractogram_qbx.py | 4 +- .../cli/tests/test_tractogram_register.py | 4 +- .../tests/test_tractogram_remove_invalid.py | 4 +- .../cli/tests/test_tractogram_resample.py | 12 +++--- .../test_tractogram_resample_nb_points.py | 4 +- .../tests/test_tractogram_seed_density_map.py | 4 +- ...ctogram_segment_connections_from_labels.py | 4 +- ...t_tractogram_segment_with_ROI_and_score.py | 4 +- .../test_tractogram_segment_with_bundleseg.py | 4 +- ...est_tractogram_segment_with_recobundles.py | 4 +- .../cli/tests/test_tractogram_shuffle.py | 4 +- .../cli/tests/test_tractogram_smooth.py | 4 +- src/scilpy/cli/tests/test_tractogram_split.py | 8 ++-- src/scilpy/cli/tests/test_viz_bingham_fit.py | 4 +- src/scilpy/cli/tests/test_viz_bundle.py | 4 +- .../tests/test_viz_bundle_screenshot_mni.py | 2 +- .../test_viz_bundle_screenshot_mosaic.py | 2 +- src/scilpy/cli/tests/test_viz_connectivity.py | 4 +- .../cli/tests/test_viz_dti_screenshot.py | 2 +- src/scilpy/cli/tests/test_viz_fodf.py | 8 ++-- .../tests/test_viz_gradients_screenshot.py | 2 +- .../tests/test_viz_tractogram_collisions.py | 2 +- .../cli/tests/test_viz_tractogram_seeds.py | 2 +- .../cli/tests/test_viz_tractogram_seeds_3d.py | 2 +- .../cli/tests/test_viz_volume_histogram.py | 4 +- .../cli/tests/test_viz_volume_scatterplot.py | 14 +++---- .../cli/tests/test_viz_volume_screenshot.py | 4 +- .../test_viz_volume_screenshot_mosaic.py | 2 +- .../cli/tests/test_volume_apply_transform.py | 8 ++-- .../cli/tests/test_volume_b0_synthesis.py | 4 +- .../test_volume_count_non_zero_voxels.py | 8 ++-- src/scilpy/cli/tests/test_volume_crop.py | 6 +-- .../cli/tests/test_volume_distance_map.py | 4 +- src/scilpy/cli/tests/test_volume_flip.py | 4 +- src/scilpy/cli/tests/test_volume_math.py | 12 +++--- .../tests/test_volume_pairwise_comparison.py | 14 +++---- .../test_volume_remove_outliers_ransac.py | 4 +- src/scilpy/cli/tests/test_volume_resample.py | 10 ++--- src/scilpy/cli/tests/test_volume_reshape.py | 12 +++--- .../tests/test_volume_reslice_to_reference.py | 6 +-- .../cli/tests/test_volume_stats_in_ROI.py | 12 +++--- .../cli/tests/test_volume_stats_in_labels.py | 8 ++-- 193 files changed, 650 insertions(+), 650 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 62bdbc373..acdcecf29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ version = "2.2.0" description = "Scilpy: diffusion MRI tools and utilities" authors = [{ name = "SCIL Team" }] readme = "README.md" -requires-python = ">=3.9, <3.12" +requires-python = ">=3.10, < 3.13" license-files = ["LICENSE"] classifiers = [ "Development Status :: 3 - Alpha", diff --git a/src/scilpy/cli/tests/test_NODDI_maps.py b/src/scilpy/cli/tests/test_NODDI_maps.py index 05b646d2b..70fcf3a7e 100644 --- a/src/scilpy/cli/tests/test_NODDI_maps.py +++ b/src/scilpy/cli/tests/test_NODDI_maps.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_NODDI_maps.py', '--help']) + ret = script_runner.run(['scil_NODDI_maps', '--help']) assert ret.success @@ -28,7 +28,7 @@ def test_execution_commit_amico(script_runner, monkeypatch): 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run(['scil_NODDI_maps.py', in_dwi, + ret = script_runner.run(['scil_NODDI_maps', in_dwi, in_bval, in_bvec, '--mask', mask, '--out_dir', 'noddi', '--tol', '30', '--para_diff', '0.0017', '--iso_diff', '0.003', @@ -45,7 +45,7 @@ def test_single_shell_fail(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run(['scil_NODDI_maps.py', in_dwi, + ret = script_runner.run(['scil_NODDI_maps', in_dwi, in_bval, in_bvec, '--out_dir', 'noddi', '--tol', '30', '--para_diff', '0.0017', '--iso_diff', '0.003', diff --git a/src/scilpy/cli/tests/test_NODDI_priors.py b/src/scilpy/cli/tests/test_NODDI_priors.py index 7b7ae918e..8e0e53f52 100644 --- a/src/scilpy/cli/tests/test_NODDI_priors.py +++ b/src/scilpy/cli/tests/test_NODDI_priors.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_NODDI_priors.py', '--help']) + ret = script_runner.run(['scil_NODDI_priors', '--help']) assert ret.success @@ -27,7 +27,7 @@ def test_execution_commit_amico(script_runner, monkeypatch): 'md.nii.gz') in_rd = os.path.join(SCILPY_HOME, 'processing', 'rd.nii.gz') - ret = script_runner.run(['scil_NODDI_priors.py', in_fa, in_ad, in_rd, in_md, + ret = script_runner.run(['scil_NODDI_priors', in_fa, in_ad, in_rd, in_md, '--out_txt_1fiber_para', '1fiber_para.txt', '--out_txt_1fiber_perp', '1fiber_perp.txt', '--out_mask_1fiber', '1fiber.nii.gz', diff --git a/src/scilpy/cli/tests/test_aodf_metrics.py b/src/scilpy/cli/tests/test_aodf_metrics.py index c6623ee44..02e364530 100644 --- a/src/scilpy/cli/tests/test_aodf_metrics.py +++ b/src/scilpy/cli/tests/test_aodf_metrics.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_aodf_metrics.py', '--help']) + ret = script_runner.run(['scil_aodf_metrics', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution(script_runner, monkeypatch): f"{test_data_root}/fodf_descoteaux07_sub_unified_asym.nii.gz") # Using a low resolution sphere for peak extraction reduces process time - ret = script_runner.run(['scil_aodf_metrics.py', in_fodf, + ret = script_runner.run(['scil_aodf_metrics', in_fodf, '--sphere', 'repulsion100', '--processes', '1']) assert ret.success @@ -34,7 +34,7 @@ def test_assert_not_all(script_runner, monkeypatch): in_fodf = os.path.join( f"{test_data_root}/fodf_descoteaux07_sub_unified_asym.nii.gz") - ret = script_runner.run(['scil_aodf_metrics.py', in_fodf, + ret = script_runner.run(['scil_aodf_metrics', in_fodf, '--not_all', '--processes', '1']) assert not ret.success @@ -44,7 +44,7 @@ def test_execution_not_all(script_runner, monkeypatch): in_fodf = os.path.join( f"{test_data_root}/fodf_descoteaux07_sub_unified_asym.nii.gz") - ret = script_runner.run(['scil_aodf_metrics.py', in_fodf, + ret = script_runner.run(['scil_aodf_metrics', in_fodf, '--not_all', '--asi_map', 'asi_map.nii.gz', '-f', '--processes', '1']) @@ -57,7 +57,7 @@ def test_assert_symmetric_input(script_runner, monkeypatch): f"{test_data_root}/fodf_descoteaux07_sub.nii.gz") # Using a low resolution sphere for peak extraction reduces process time - ret = script_runner.run(['scil_aodf_metrics.py', in_fodf, + ret = script_runner.run(['scil_aodf_metrics', in_fodf, '--sphere', 'repulsion100', '--processes', '1']) assert not ret.success @@ -70,7 +70,7 @@ def test_execution_symmetric_input(script_runner, monkeypatch): # Using a low resolution sphere for peak extraction reduces process time # Using multiprocessing to test this option. - ret = script_runner.run(['scil_aodf_metrics.py', in_fodf, + ret = script_runner.run(['scil_aodf_metrics', in_fodf, '--sphere', 'repulsion100', '--not_all', '--nufid', 'nufid.nii.gz', '--processes', '4']) diff --git a/src/scilpy/cli/tests/test_bids_validate.py b/src/scilpy/cli/tests/test_bids_validate.py index bffbc172d..326936213 100644 --- a/src/scilpy/cli/tests/test_bids_validate.py +++ b/src/scilpy/cli/tests/test_bids_validate.py @@ -328,7 +328,7 @@ def compare_jsons(json_output, test_dir): def test_help_option(script_runner): - ret = script_runner.run(['scil_bids_validate.py', '--help']) + ret = script_runner.run(['scil_bids_validate', '--help']) assert ret.success @@ -346,7 +346,7 @@ def test_bids_epi(tmpdir, script_runner, dwi_is_complex, json_output): complex_dwi=dwi_is_complex) ret = script_runner.run([ - 'scil_bids_validate.py', + 'scil_bids_validate', test_dir, os.path.join(test_dir, json_output), '-f', '-v']) @@ -373,7 +373,7 @@ def test_bids_sbref( complex_sbref=sbref_is_complex) ret = script_runner.run([ - 'scil_bids_validate.py', + 'scil_bids_validate', test_dir, os.path.join(test_dir, json_output), '-f', '-v']) @@ -399,7 +399,7 @@ def test_bids_rev_dwi( complex_rev_dwi=rev_is_complex) ret = script_runner.run([ - 'scil_bids_validate.py', + 'scil_bids_validate', test_dir, os.path.join(test_dir, json_output), '-f', '-v']) @@ -427,7 +427,7 @@ def test_bids_rev_dwi_sbref( complex_rev_dwi=rev_is_complex) ret = script_runner.run([ - 'scil_bids_validate.py', + 'scil_bids_validate', test_dir, os.path.join(test_dir, json_output), '-f', '-v']) diff --git a/src/scilpy/cli/tests/test_bingham_metrics.py b/src/scilpy/cli/tests/test_bingham_metrics.py index bf70502f1..f71415e9e 100644 --- a/src/scilpy/cli/tests/test_bingham_metrics.py +++ b/src/scilpy/cli/tests/test_bingham_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bingham_metrics.py', + ret = script_runner.run(['scil_bingham_metrics', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_processing(script_runner, monkeypatch): in_bingham = os.path.join(SCILPY_HOME, 'processing', 'fodf_bingham.nii.gz') - ret = script_runner.run(['scil_bingham_metrics.py', + ret = script_runner.run(['scil_bingham_metrics', in_bingham, '--nbr_integration_steps', '10', '--processes', '1']) @@ -37,7 +37,7 @@ def test_execution_processing_mask(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') - ret = script_runner.run(['scil_bingham_metrics.py', + ret = script_runner.run(['scil_bingham_metrics', in_bingham, '--nbr_integration_steps', '10', '--processes', '1', '--mask', in_mask, '-f']) @@ -49,7 +49,7 @@ def test_execution_processing_not_all(script_runner, monkeypatch): in_bingham = os.path.join(SCILPY_HOME, 'processing', 'fodf_bingham.nii.gz') - ret = script_runner.run(['scil_bingham_metrics.py', + ret = script_runner.run(['scil_bingham_metrics', in_bingham, '--nbr_integration_steps', '10', '--processes', '1', '--not_all', '--out_fs', 'fs.nii.gz', '-f']) diff --git a/src/scilpy/cli/tests/test_btensor_metrics.py b/src/scilpy/cli/tests/test_btensor_metrics.py index 40f22e2ad..b81ab34fa 100644 --- a/src/scilpy/cli/tests/test_btensor_metrics.py +++ b/src/scilpy/cli/tests/test_btensor_metrics.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_btensor_metrics.py', '--help']) + ret = script_runner.run(['scil_btensor_metrics', '--help']) assert ret.success @@ -33,7 +33,7 @@ def test_nb_btensors_check(script_runner, monkeypatch): fa = os.path.join(SCILPY_HOME, 'btensor', 'fa.nii.gz') - ret = script_runner.run(['scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run(['scil_btensor_metrics', '--in_dwis', in_dwi_lin, '--in_bvals', in_bval_lin, '--in_bvecs', in_bvec_lin, '--in_bdeltas', '1', '--fa', fa, '--do_weight_bvals', @@ -41,7 +41,7 @@ def test_nb_btensors_check(script_runner, monkeypatch): '--processes', '1', '-f']) assert (not ret.success) - ret = script_runner.run(['scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run(['scil_btensor_metrics', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', '1', @@ -68,7 +68,7 @@ def test_inputs_check(script_runner, monkeypatch): fa = os.path.join(SCILPY_HOME, 'btensor', 'fa.nii.gz') - ret = script_runner.run(['scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run(['scil_btensor_metrics', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, '--in_bvecs', in_bvec_lin, '--in_bdeltas', '1', '--fa', fa, '--do_weight_bvals', @@ -76,7 +76,7 @@ def test_inputs_check(script_runner, monkeypatch): '--processes', '1', '-f']) assert (not ret.success) - ret = script_runner.run(['scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run(['scil_btensor_metrics', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', @@ -85,7 +85,7 @@ def test_inputs_check(script_runner, monkeypatch): '--processes', '1', '-f']) assert (not ret.success) - ret = script_runner.run(['scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run(['scil_btensor_metrics', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', @@ -118,7 +118,7 @@ def test_execution_processing(script_runner, monkeypatch): fa = os.path.join(SCILPY_HOME, 'btensor_testdata', 'fa.nii.gz') - ret = script_runner.run(['scil_btensor_metrics.py', '--in_dwis', + ret = script_runner.run(['scil_btensor_metrics', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, '--in_bvecs', in_bvec_lin, diff --git a/src/scilpy/cli/tests/test_bundle_alter_to_target_dice.py b/src/scilpy/cli/tests/test_bundle_alter_to_target_dice.py index 827d0ecb5..e4d8e4b78 100644 --- a/src/scilpy/cli/tests/test_bundle_alter_to_target_dice.py +++ b/src/scilpy/cli/tests/test_bundle_alter_to_target_dice.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_alter_to_target_dice.py', '--help']) + ret = script_runner.run(['scil_bundle_alter_to_target_dice', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_subsample(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run(['scil_bundle_alter_to_target_dice.py', + ret = script_runner.run(['scil_bundle_alter_to_target_dice', in_bundle, 'out_tractogram_subsample.trk', '--min_dice', '0.75', '--epsilon', '0.01', '--subsample', '--shuffle', '-v']) @@ -32,7 +32,7 @@ def test_execution_trim(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run(['scil_bundle_alter_to_target_dice.py', + ret = script_runner.run(['scil_bundle_alter_to_target_dice', in_bundle, 'out_tractogram_trim.trk', '--min_dice', '0.75', '--epsilon', '0.01', '--trim', '-v']) @@ -43,7 +43,7 @@ def test_execution_cut(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run(['scil_bundle_alter_to_target_dice.py', + ret = script_runner.run(['scil_bundle_alter_to_target_dice', in_bundle, 'out_tractogram_cut.trk', '--min_dice', '0.75', '--epsilon', '0.01', '--cut', '-v', 'DEBUG']) @@ -54,7 +54,7 @@ def test_execution_replace(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run(['scil_bundle_alter_to_target_dice.py', + ret = script_runner.run(['scil_bundle_alter_to_target_dice', in_bundle, 'out_tractogram_replace.trk', '--min_dice', '0.75', '--epsilon', '0.01', '--replace', '-v']) @@ -65,7 +65,7 @@ def test_execution_transform(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run(['scil_bundle_alter_to_target_dice.py', + ret = script_runner.run(['scil_bundle_alter_to_target_dice', in_bundle, 'out_tractogram_transform.trk', '--min_dice', '0.75', '--epsilon', '0.01', '--transform', '--save_transform', diff --git a/src/scilpy/cli/tests/test_bundle_clean_qbx_clusters.py b/src/scilpy/cli/tests/test_bundle_clean_qbx_clusters.py index 3d5440c2e..4d6895180 100644 --- a/src/scilpy/cli/tests/test_bundle_clean_qbx_clusters.py +++ b/src/scilpy/cli/tests/test_bundle_clean_qbx_clusters.py @@ -2,5 +2,5 @@ # -*- coding: utf-8 -*- def test_help_option(script_runner): - ret = script_runner.run(['scil_json_harmonize_entries.py', '--help']) + ret = script_runner.run(['scil_json_harmonize_entries', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_compute_centroid.py b/src/scilpy/cli/tests/test_bundle_compute_centroid.py index 51eed2c36..3eeb6de2b 100644 --- a/src/scilpy/cli/tests/test_bundle_compute_centroid.py +++ b/src/scilpy/cli/tests/test_bundle_compute_centroid.py @@ -13,13 +13,13 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_compute_centroid.py', '--help']) + ret = script_runner.run(['scil_bundle_compute_centroid', '--help']) assert ret.success def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run(['scil_bundle_compute_centroid.py', + ret = script_runner.run(['scil_bundle_compute_centroid', in_bundle, 'IFGWM_uni_c.trk']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_compute_endpoints_map.py b/src/scilpy/cli/tests/test_bundle_compute_endpoints_map.py index ec638613a..95cce01c4 100644 --- a/src/scilpy/cli/tests/test_bundle_compute_endpoints_map.py +++ b/src/scilpy/cli/tests/test_bundle_compute_endpoints_map.py @@ -13,14 +13,14 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_compute_endpoints_map.py', '--help']) + ret = script_runner.run(['scil_bundle_compute_endpoints_map', '--help']) assert ret.success def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run(['scil_bundle_compute_endpoints_map.py', in_bundle, + ret = script_runner.run(['scil_bundle_compute_endpoints_map', in_bundle, 'head.nii.gz', 'tail.nii.gz', '--binary', '-f']) assert ret.success @@ -29,7 +29,7 @@ def test_execution_tractometry(script_runner, monkeypatch): def test_execution_tractometry_mm_distance5(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') - ret = script_runner.run(['scil_bundle_compute_endpoints_map.py', in_bundle, + ret = script_runner.run(['scil_bundle_compute_endpoints_map', in_bundle, 'head.nii.gz', 'tail.nii.gz', '--binary', '--distance', '5', '--unit', 'mm', '-f']) diff --git a/src/scilpy/cli/tests/test_bundle_diameter.py b/src/scilpy/cli/tests/test_bundle_diameter.py index 013c2f8d2..680f82476 100644 --- a/src/scilpy/cli/tests/test_bundle_diameter.py +++ b/src/scilpy/cli/tests/test_bundle_diameter.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_diameter.py', '--help']) + ret = script_runner.run(['scil_bundle_diameter', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_tractometry(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') in_labels = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run(['scil_bundle_diameter.py', in_bundle, in_labels, + ret = script_runner.run(['scil_bundle_diameter', in_bundle, in_labels, '--wireframe', '--fitting_func', 'lin_up', '--save_rendering', tmp_dir.name]) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_explore_bundleseg.py b/src/scilpy/cli/tests/test_bundle_explore_bundleseg.py index ab82cd624..c1072f385 100644 --- a/src/scilpy/cli/tests/test_bundle_explore_bundleseg.py +++ b/src/scilpy/cli/tests/test_bundle_explore_bundleseg.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_viz_bundle_screenshot_mni', '--help']) + ret = script_runner.run(['scil_bundle_explore_bundleseg', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_filter_by_occurence.py b/src/scilpy/cli/tests/test_bundle_filter_by_occurence.py index e5163914d..92781ba6d 100644 --- a/src/scilpy/cli/tests/test_bundle_filter_by_occurence.py +++ b/src/scilpy/cli/tests/test_bundle_filter_by_occurence.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_filter_by_occurence.py', '--help']) + ret = script_runner.run(['scil_bundle_filter_by_occurence', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution(script_runner, monkeypatch): 'bundle_4_filtered_no_loops.trk') prefix = 'test_voting_' - ret = script_runner.run(['scil_bundle_filter_by_occurence.py', in_1, in_2, + ret = script_runner.run(['scil_bundle_filter_by_occurence', in_1, in_2, in_3, prefix, '--ratio_streamlines', '0.5', '--ratio_voxels', '0.5']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_fixel_analysis.py b/src/scilpy/cli/tests/test_bundle_fixel_analysis.py index d8789b20a..a879c3953 100644 --- a/src/scilpy/cli/tests/test_bundle_fixel_analysis.py +++ b/src/scilpy/cli/tests/test_bundle_fixel_analysis.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_fixel_analysis.py', '--help']) + ret = script_runner.run(['scil_bundle_fixel_analysis', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_default_parameters(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'commit_amico', 'tracking.trk') # Using multiprocessing in this test, single in following tests. - ret = script_runner.run(['scil_bundle_fixel_analysis.py', in_peaks, + ret = script_runner.run(['scil_bundle_fixel_analysis', in_peaks, '--in_bundles', in_bundle, '--processes', '4', '-f']) assert ret.success @@ -33,7 +33,7 @@ def test_all_parameters(script_runner, monkeypatch): in_peaks = os.path.join(SCILPY_HOME, 'commit_amico', 'peaks.nii.gz') in_bundle = os.path.join(SCILPY_HOME, 'commit_amico', 'tracking.trk') - ret = script_runner.run(['scil_bundle_fixel_analysis.py', in_peaks, + ret = script_runner.run(['scil_bundle_fixel_analysis', in_peaks, '--in_bundles', in_bundle, '--in_bundles_names', 'test', '--abs_thr', '5', @@ -50,7 +50,7 @@ def test_multiple_norm(script_runner, monkeypatch): in_peaks = os.path.join(SCILPY_HOME, 'commit_amico', 'peaks.nii.gz') in_bundle = os.path.join(SCILPY_HOME, 'commit_amico', 'tracking.trk') - ret = script_runner.run(['scil_bundle_fixel_analysis.py', in_peaks, + ret = script_runner.run(['scil_bundle_fixel_analysis', in_peaks, '--in_bundles', in_bundle, '--in_bundles_names', 'test', '--abs_thr', '5', diff --git a/src/scilpy/cli/tests/test_bundle_generate_priors.py b/src/scilpy/cli/tests/test_bundle_generate_priors.py index 98af75d49..64cf91dfa 100644 --- a/src/scilpy/cli/tests/test_bundle_generate_priors.py +++ b/src/scilpy/cli/tests/test_bundle_generate_priors.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_generate_priors.py', '--help']) + ret = script_runner.run(['scil_bundle_generate_priors', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_bst(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'bst', 'rpt_m_lin.trk') in_fodf = os.path.join(SCILPY_HOME, 'bst', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') - ret = script_runner.run(['scil_bundle_generate_priors.py', + ret = script_runner.run(['scil_bundle_generate_priors', in_bundle, in_fodf, in_mask, '--todi_sigma', '1', '--out_prefix', 'rpt_m', '--sh_basis', 'descoteaux07']) diff --git a/src/scilpy/cli/tests/test_bundle_label_map.py b/src/scilpy/cli/tests/test_bundle_label_map.py index 6c8fa220f..9c263c20d 100644 --- a/src/scilpy/cli/tests/test_bundle_label_map.py +++ b/src/scilpy/cli/tests/test_bundle_label_map.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_label_map.py', '--help']) + ret = script_runner.run(['scil_bundle_label_map', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_tractometry_euclidian(script_runner, monkeypatch): 'IFGWM.trk') in_centroid = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni_c_10.trk') - ret = script_runner.run(['scil_bundle_label_map.py', + ret = script_runner.run(['scil_bundle_label_map', in_bundle, in_centroid, 'results_euc/', '--colormap', 'viridis']) @@ -37,7 +37,7 @@ def test_execution_tractometry_hyperplane(script_runner, monkeypatch): 'IFGWM.trk') in_centroid = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni_c_10.trk') - ret = script_runner.run(['scil_bundle_label_map.py', + ret = script_runner.run(['scil_bundle_label_map', in_bundle, in_centroid, 'results_man/', '--colormap', 'viridis', diff --git a/src/scilpy/cli/tests/test_bundle_mean_fixel_afd.py b/src/scilpy/cli/tests/test_bundle_mean_fixel_afd.py index e09524156..c531dbfce 100644 --- a/src/scilpy/cli/tests/test_bundle_mean_fixel_afd.py +++ b/src/scilpy/cli/tests/test_bundle_mean_fixel_afd.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_mean_fixel_afd.py', '--help']) + ret = script_runner.run(['scil_bundle_mean_fixel_afd', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_processing(script_runner, monkeypatch): in_tracking = os.path.join(SCILPY_HOME, 'processing', 'tracking.trk') in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf_descoteaux07.nii.gz') - ret = script_runner.run(['scil_bundle_mean_fixel_afd.py', in_tracking, + ret = script_runner.run(['scil_bundle_mean_fixel_afd', in_tracking, in_fodf, 'afd_test.nii.gz', '--sh_basis', 'descoteaux07', '--length_weighting']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_mean_fixel_afd_from_hdf5.py b/src/scilpy/cli/tests/test_bundle_mean_fixel_afd_from_hdf5.py index e88d34ac9..c2f387049 100644 --- a/src/scilpy/cli/tests/test_bundle_mean_fixel_afd_from_hdf5.py +++ b/src/scilpy/cli/tests/test_bundle_mean_fixel_afd_from_hdf5.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_mean_fixel_afd_from_hdf5.py', + ret = script_runner.run(['scil_bundle_mean_fixel_afd_from_hdf5', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_connectivity(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_h5 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose.h5') in_fodf = os.path.join(SCILPY_HOME, 'connectivity', 'fodf.nii.gz') - ret = script_runner.run(['scil_bundle_mean_fixel_afd_from_hdf5.py', + ret = script_runner.run(['scil_bundle_mean_fixel_afd_from_hdf5', in_h5, in_fodf, 'decompose_afd.nii.gz', '--length_weighting', '--sh_basis', 'descoteaux07', '--processes', '1']) diff --git a/src/scilpy/cli/tests/test_bundle_mean_fixel_bingham_metric.py b/src/scilpy/cli/tests/test_bundle_mean_fixel_bingham_metric.py index 1dce2e9c2..c1f95ffa9 100644 --- a/src/scilpy/cli/tests/test_bundle_mean_fixel_bingham_metric.py +++ b/src/scilpy/cli/tests/test_bundle_mean_fixel_bingham_metric.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run([ - 'scil_bundle_mean_fixel_bingham_metric.py', '--help']) + 'scil_bundle_mean_fixel_bingham_metric', '--help']) assert ret.success @@ -26,7 +26,7 @@ def test_execution_processing(script_runner, monkeypatch): in_bundles = os.path.join(SCILPY_HOME, 'processing', 'tracking.trk') ret = script_runner.run([ - 'scil_bundle_mean_fixel_bingham_metric.py', + 'scil_bundle_mean_fixel_bingham_metric', in_bundles, in_bingham, in_metric, 'fixel_mean_fd.nii.gz', '--length_weighting']) diff --git a/src/scilpy/cli/tests/test_bundle_mean_fixel_mrds_metric.py b/src/scilpy/cli/tests/test_bundle_mean_fixel_mrds_metric.py index de4836e56..5013a9a07 100644 --- a/src/scilpy/cli/tests/test_bundle_mean_fixel_mrds_metric.py +++ b/src/scilpy/cli/tests/test_bundle_mean_fixel_mrds_metric.py @@ -3,6 +3,6 @@ def test_help_option(script_runner): ret = script_runner.run([ - 'scil_bundle_mean_fixel_mrds_metric.py', '--help']) + 'scil_bundle_mean_fixel_mrds_metric', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_mean_std.py b/src/scilpy/cli/tests/test_bundle_mean_std.py index 0202f66a4..4e3e11872 100644 --- a/src/scilpy/cli/tests/test_bundle_mean_std.py +++ b/src/scilpy/cli/tests/test_bundle_mean_std.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_mean_std.py', '--help']) + ret = script_runner.run(['scil_bundle_mean_std', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_tractometry_whole(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') in_ref = os.path.join(SCILPY_HOME, 'tractometry', 'mni_masked.nii.gz') - ret = script_runner.run(['scil_bundle_mean_std.py', in_bundle, in_ref, + ret = script_runner.run(['scil_bundle_mean_std', in_bundle, in_ref, '--density_weighting', '--include_dps']) assert ret.success @@ -32,7 +32,7 @@ def test_execution_tractometry_per_point(script_runner, monkeypatch): in_label = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') in_ref = os.path.join(SCILPY_HOME, 'tractometry', 'mni_masked.nii.gz') - ret = script_runner.run(['scil_bundle_mean_std.py', in_bundle, in_ref, + ret = script_runner.run(['scil_bundle_mean_std', in_bundle, in_ref, '--per_point', in_label, '--density_weighting']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_pairwise_comparison.py b/src/scilpy/cli/tests/test_bundle_pairwise_comparison.py index ddc12c865..2d36417c1 100644 --- a/src/scilpy/cli/tests/test_bundle_pairwise_comparison.py +++ b/src/scilpy/cli/tests/test_bundle_pairwise_comparison.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run([ - 'scil_bundle_pairwise_comparison.py', '--help']) + 'scil_bundle_pairwise_comparison', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_bundles(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') ret = script_runner.run([ - 'scil_bundle_pairwise_comparison.py', + 'scil_bundle_pairwise_comparison', in_1, in_2, 'AF_L_similarity.json', '--streamline_dice', '--reference', in_ref, '--processes', '1']) @@ -39,7 +39,7 @@ def test_single(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') ret = script_runner.run([ - 'scil_bundle_pairwise_comparison.py', + 'scil_bundle_pairwise_comparison', in_2, 'AF_L_similarity_single.json', '--streamline_dice', '--reference', in_ref, '--single_compare', in_1, @@ -54,7 +54,7 @@ def test_no_overlap(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') ret = script_runner.run([ - 'scil_bundle_pairwise_comparison.py', in_1, + 'scil_bundle_pairwise_comparison', in_1, in_2, 'AF_L_similarity_no_overlap.json', '--streamline_dice', '--reference', in_ref, '--ignore_zeros_in_BA', @@ -69,7 +69,7 @@ def test_ratio(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') ret = script_runner.run([ - 'scil_bundle_pairwise_comparison.py', + 'scil_bundle_pairwise_comparison', in_2, 'AF_L_similarity_ratio.json', '--streamline_dice', '--reference', in_ref, '--single_compare', in_1, @@ -88,7 +88,7 @@ def test_ratio_fail(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') ret = script_runner.run([ - 'scil_bundle_pairwise_comparison.py', + 'scil_bundle_pairwise_comparison', in_1, in_2, 'AF_L_similarity_fail.json', '--streamline_dice', '--reference', in_ref, '--processes', '1', diff --git a/src/scilpy/cli/tests/test_bundle_reject_outliers.py b/src/scilpy/cli/tests/test_bundle_reject_outliers.py index 0611d32a7..8079fa88c 100644 --- a/src/scilpy/cli/tests/test_bundle_reject_outliers.py +++ b/src/scilpy/cli/tests/test_bundle_reject_outliers.py @@ -13,14 +13,14 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_reject_outliers.py', '--help']) + ret = script_runner.run(['scil_bundle_reject_outliers', '--help']) assert ret.success def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') - ret = script_runner.run(['scil_bundle_reject_outliers.py', in_bundle, + ret = script_runner.run(['scil_bundle_reject_outliers', in_bundle, 'inliers.trk', '--alpha', '0.6', '--remaining_bundle', 'outliers.trk', '--display_counts', '--indent', '4', diff --git a/src/scilpy/cli/tests/test_bundle_score_many_bundles_one_tractogram.py b/src/scilpy/cli/tests/test_bundle_score_many_bundles_one_tractogram.py index 2aed03209..49419f594 100644 --- a/src/scilpy/cli/tests/test_bundle_score_many_bundles_one_tractogram.py +++ b/src/scilpy/cli/tests/test_bundle_score_many_bundles_one_tractogram.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_score_many_bundles_one_tractogram.py', + ret = script_runner.run(['scil_bundle_score_many_bundles_one_tractogram', '--help']) assert ret.success @@ -42,7 +42,7 @@ def test_score_bundles(script_runner, monkeypatch): with open(os.path.join("config_file.json"), "w") as f: json.dump(json_contents, f) - ret = script_runner.run(['scil_bundle_score_many_bundles_one_tractogram.py', + ret = script_runner.run(['scil_bundle_score_many_bundles_one_tractogram', "config_file.json", "./", '--no_bbox_check']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_score_same_bundle_many_segmentations.py b/src/scilpy/cli/tests/test_bundle_score_same_bundle_many_segmentations.py index fe3ab96df..17e96a162 100644 --- a/src/scilpy/cli/tests/test_bundle_score_same_bundle_many_segmentations.py +++ b/src/scilpy/cli/tests/test_bundle_score_same_bundle_many_segmentations.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run([ - 'scil_bundle_score_same_bundle_many_segmentations.py', '--help']) + 'scil_bundle_score_same_bundle_many_segmentations', '--help']) assert ret.success @@ -28,7 +28,7 @@ def test_execution_bundles(script_runner, monkeypatch): in_model = os.path.join(SCILPY_HOME, 'bundles', 'fibercup_atlas', 'subj_1', 'bundle_0.trk') ret = script_runner.run([ - 'scil_bundle_score_same_bundle_many_segmentations.py', + 'scil_bundle_score_same_bundle_many_segmentations', in_1, in_2, 'AF_L_binary.json', '--streamlines_measures', in_model, in_tractogram, '--processes', '1', '--reference', in_ref]) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_shape_measures.py b/src/scilpy/cli/tests/test_bundle_shape_measures.py index 2256d4004..b9e120fe8 100644 --- a/src/scilpy/cli/tests/test_bundle_shape_measures.py +++ b/src/scilpy/cli/tests/test_bundle_shape_measures.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_shape_measures.py', '--help']) + ret = script_runner.run(['scil_bundle_shape_measures', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_bundles(script_runner, monkeypatch): in_2 = os.path.join(SCILPY_HOME, 'bundles', 'voting_results', 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') - ret = script_runner.run(['scil_bundle_shape_measures.py', + ret = script_runner.run(['scil_bundle_shape_measures', in_1, in_2, '--out_json', 'AF_L_measures.json', '--reference', in_ref, '--processes', '1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_uniformize_endpoints.py b/src/scilpy/cli/tests/test_bundle_uniformize_endpoints.py index 4f9628610..43c757b52 100644 --- a/src/scilpy/cli/tests/test_bundle_uniformize_endpoints.py +++ b/src/scilpy/cli/tests/test_bundle_uniformize_endpoints.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_uniformize_endpoints.py', + ret = script_runner.run(['scil_bundle_uniformize_endpoints', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_help_option(script_runner): def test_execution_auto(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') - ret = script_runner.run(['scil_bundle_uniformize_endpoints.py', + ret = script_runner.run(['scil_bundle_uniformize_endpoints', in_bundle, 'IFGWM_uni.trk', '--auto']) assert ret.success @@ -30,7 +30,7 @@ def test_execution_target_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') label = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run(['scil_bundle_uniformize_endpoints.py', + ret = script_runner.run(['scil_bundle_uniformize_endpoints', in_bundle, 'IFGWM_uni2.trk', '--target_roi', label, '3', '10']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_volume_per_label.py b/src/scilpy/cli/tests/test_bundle_volume_per_label.py index f75bb2e8c..760f2188a 100644 --- a/src/scilpy/cli/tests/test_bundle_volume_per_label.py +++ b/src/scilpy/cli/tests/test_bundle_volume_per_label.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_volume_per_label.py', + ret = script_runner.run(['scil_bundle_volume_per_label', '--help']) assert ret.success @@ -22,6 +22,6 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_label_map = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run(['scil_bundle_volume_per_label.py', + ret = script_runner.run(['scil_bundle_volume_per_label', in_label_map, 'IFGWM']) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_compare_populations.py b/src/scilpy/cli/tests/test_connectivity_compare_populations.py index 7e2ac7879..938a0790d 100644 --- a/src/scilpy/cli/tests/test_connectivity_compare_populations.py +++ b/src/scilpy/cli/tests/test_connectivity_compare_populations.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_connectivity_compare_populations.py', + ret = script_runner.run(['scil_connectivity_compare_populations', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_connectivity(script_runner, monkeypatch): in_1 = os.path.join(SCILPY_HOME, 'connectivity', 'sc.npy') in_2 = os.path.join(SCILPY_HOME, 'connectivity', 'sc_norm.npy') in_mask = os.path.join(SCILPY_HOME, 'connectivity', 'mask.npy') - ret = script_runner.run(['scil_connectivity_compare_populations.py', + ret = script_runner.run(['scil_connectivity_compare_populations', 'pval.npy', '--in_g1', in_1, '--in_g2', in_2, '--filtering_mask', in_mask]) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_compute_matrices.py b/src/scilpy/cli/tests/test_connectivity_compute_matrices.py index e2e358680..961250ba6 100644 --- a/src/scilpy/cli/tests/test_connectivity_compute_matrices.py +++ b/src/scilpy/cli/tests/test_connectivity_compute_matrices.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_connectivity_compute_matrices.py', '--help']) + ret = script_runner.run(['scil_connectivity_compute_matrices', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_connectivity(script_runner, monkeypatch): 'endpoints_atlas.nii.gz') in_avg = os.path.join(SCILPY_HOME, 'connectivity', 'avg_density_maps/') in_afd = os.path.join(SCILPY_HOME, 'connectivity', 'afd_max.nii.gz') - ret = script_runner.run(['scil_connectivity_compute_matrices.py', in_h5, + ret = script_runner.run(['scil_connectivity_compute_matrices', in_h5, in_atlas, '--volume', 'vol.npy', '--streamline_count', 'sc.npy', '--length', 'len.npy', diff --git a/src/scilpy/cli/tests/test_connectivity_compute_pca.py b/src/scilpy/cli/tests/test_connectivity_compute_pca.py index ded0fb8f4..af0c3cde2 100644 --- a/src/scilpy/cli/tests/test_connectivity_compute_pca.py +++ b/src/scilpy/cli/tests/test_connectivity_compute_pca.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_connectivity_compute_pca.py', '--help']) + ret = script_runner.run(['scil_connectivity_compute_pca', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_pca(script_runner, monkeypatch): output_folder = os.path.join(SCILPY_HOME, 'stats/pca_out') ids = os.path.join(SCILPY_HOME, 'stats/pca', 'list_id.txt') ret = script_runner.run([ - 'scil_connectivity_compute_pca.py', input_folder, output_folder, + 'scil_connectivity_compute_pca', input_folder, output_folder, '--metrics', 'ad', 'fa', 'md', 'rd', 'nufo', 'afd_total', 'afd_fixel', '--list_ids', ids, '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_compute_simple_matrix.py b/src/scilpy/cli/tests/test_connectivity_compute_simple_matrix.py index 1c305cb83..2e96436e5 100644 --- a/src/scilpy/cli/tests/test_connectivity_compute_simple_matrix.py +++ b/src/scilpy/cli/tests/test_connectivity_compute_simple_matrix.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run([ - 'scil_connectivity_compute_simple_matrix.py', '--help']) + 'scil_connectivity_compute_simple_matrix', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_script(script_runner, monkeypatch): in_sft = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') ret = script_runner.run([ - 'scil_connectivity_compute_simple_matrix.py', in_sft, in_labels, + 'scil_connectivity_compute_simple_matrix', in_sft, in_labels, 'out_matrix.npy', 'out_labels.txt', '--hide_labels', '10', '--percentage', '--hide_fig', '--out_fig', 'matrices.png']) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_filter.py b/src/scilpy/cli/tests/test_connectivity_filter.py index aeb235d57..2848c2298 100644 --- a/src/scilpy/cli/tests/test_connectivity_filter.py +++ b/src/scilpy/cli/tests/test_connectivity_filter.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_connectivity_filter.py', '--help']) + ret = script_runner.run(['scil_connectivity_filter', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_connectivity(script_runner, monkeypatch): 'sc.npy') in_sim = os.path.join(SCILPY_HOME, 'connectivity', 'len.npy') - ret = script_runner.run(['scil_connectivity_filter.py', 'mask.npy', + ret = script_runner.run(['scil_connectivity_filter', 'mask.npy', '--greater_than', in_sc, '5', '1', '--greater_than', in_sim, '0', '1', '--keep_condition_count']) diff --git a/src/scilpy/cli/tests/test_connectivity_graph_measures.py b/src/scilpy/cli/tests/test_connectivity_graph_measures.py index 0275d5b99..b4c044b8f 100644 --- a/src/scilpy/cli/tests/test_connectivity_graph_measures.py +++ b/src/scilpy/cli/tests/test_connectivity_graph_measures.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_connectivity_graph_measures.py', '--help']) + ret = script_runner.run(['scil_connectivity_graph_measures', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_connectivity(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(SCILPY_HOME, 'connectivity', 'sc_norm.npy') in_len = os.path.join(SCILPY_HOME, 'connectivity', 'len.npy') - ret = script_runner.run(['scil_connectivity_graph_measures.py', in_sc, + ret = script_runner.run(['scil_connectivity_graph_measures', in_sc, in_len, 'gtm.json', '--avg_node_wise', '--small_world']) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_hdf5_average_density_map.py b/src/scilpy/cli/tests/test_connectivity_hdf5_average_density_map.py index 9fe063886..575fc411d 100644 --- a/src/scilpy/cli/tests/test_connectivity_hdf5_average_density_map.py +++ b/src/scilpy/cli/tests/test_connectivity_hdf5_average_density_map.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_connectivity_hdf5_average_density_map.py', + ret = script_runner.run(['scil_connectivity_hdf5_average_density_map', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_help_option(script_runner): def test_execution_connectivity(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_h5 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose.h5') - ret = script_runner.run(['scil_connectivity_hdf5_average_density_map.py', + ret = script_runner.run(['scil_connectivity_hdf5_average_density_map', in_h5, 'avg_density_map/', '--binary', '--processes', '1']) assert ret.success @@ -31,7 +31,7 @@ def test_execution_connectivity_(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_h5_1 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose.h5') in_h5_2 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose_afd_rd.h5') - ret = script_runner.run(['scil_connectivity_hdf5_average_density_map.py', + ret = script_runner.run(['scil_connectivity_hdf5_average_density_map', in_h5_1, in_h5_2, 'avg_density_maps/', '--processes', '1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_math.py b/src/scilpy/cli/tests/test_connectivity_math.py index c1aed6d59..2d7907a71 100644 --- a/src/scilpy/cli/tests/test_connectivity_math.py +++ b/src/scilpy/cli/tests/test_connectivity_math.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_connectivity_math.py', '--help']) + ret = script_runner.run(['scil_connectivity_math', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_connectivity_div(script_runner, monkeypatch): 'sc.npy') in_vol = os.path.join(SCILPY_HOME, 'connectivity', 'vol.npy') - ret = script_runner.run(['scil_connectivity_math.py', 'division', + ret = script_runner.run(['scil_connectivity_math', 'division', in_sc, in_vol, 'sc_norm_vol.npy']) assert ret.success @@ -32,7 +32,7 @@ def test_execution_connectivity_add(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(SCILPY_HOME, 'connectivity', 'sc.npy') - ret = script_runner.run(['scil_connectivity_math.py', 'addition', + ret = script_runner.run(['scil_connectivity_math', 'addition', in_sc, '10', 'sc_add_10.npy']) assert ret.success @@ -41,6 +41,6 @@ def test_execution_connectivity_lower_threshold(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(SCILPY_HOME, 'connectivity', 'sc.npy') - ret = script_runner.run(['scil_connectivity_math.py', 'lower_threshold', + ret = script_runner.run(['scil_connectivity_math', 'lower_threshold', in_sc, '5', 'sc_lower_threshold.npy']) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_normalize.py b/src/scilpy/cli/tests/test_connectivity_normalize.py index 8c059835d..b6442db1e 100644 --- a/src/scilpy/cli/tests/test_connectivity_normalize.py +++ b/src/scilpy/cli/tests/test_connectivity_normalize.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_connectivity_normalize.py', '--help']) + ret = script_runner.run(['scil_connectivity_normalize', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_connectivity(script_runner, monkeypatch): 'endpoints_atlas.nii.gz') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run(['scil_connectivity_normalize.py', in_sc, + ret = script_runner.run(['scil_connectivity_normalize', in_sc, 'sc_norm.npy', '--length', in_len, '--parcel_volume', in_atlas, in_labels_list]) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_pairwise_agreement.py b/src/scilpy/cli/tests/test_connectivity_pairwise_agreement.py index 6f64e76a7..8f82f2dce 100644 --- a/src/scilpy/cli/tests/test_connectivity_pairwise_agreement.py +++ b/src/scilpy/cli/tests/test_connectivity_pairwise_agreement.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_connectivity_pairwise_agreement.py', + ret = script_runner.run(['scil_connectivity_pairwise_agreement', '--help']) assert ret.success @@ -22,6 +22,6 @@ def test_execution_connectivity(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(SCILPY_HOME, 'connectivity', 'sc_norm.npy') in_len = os.path.join(SCILPY_HOME, 'connectivity', 'len.npy') - ret = script_runner.run(['scil_connectivity_pairwise_agreement.py', in_sc, + ret = script_runner.run(['scil_connectivity_pairwise_agreement', in_sc, in_len, 'diff.json', '--single_compare', in_sc]) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_print_filenames.py b/src/scilpy/cli/tests/test_connectivity_print_filenames.py index 7a5680e66..1f6259e05 100644 --- a/src/scilpy/cli/tests/test_connectivity_print_filenames.py +++ b/src/scilpy/cli/tests/test_connectivity_print_filenames.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_connectivity_print_filenames.py', '--help']) + ret = script_runner.run(['scil_connectivity_print_filenames', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_connectivity(script_runner, monkeypatch): 'sc_norm.npy') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run(['scil_connectivity_print_filenames.py', in_sc, + ret = script_runner.run(['scil_connectivity_print_filenames', in_sc, in_labels_list, 'success.txt']) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_reorder_rois.py b/src/scilpy/cli/tests/test_connectivity_reorder_rois.py index 531dab258..e85876eb3 100644 --- a/src/scilpy/cli/tests/test_connectivity_reorder_rois.py +++ b/src/scilpy/cli/tests/test_connectivity_reorder_rois.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_connectivity_reorder_rois.py', '--help']) + ret = script_runner.run(['scil_connectivity_reorder_rois', '--help']) assert ret.success @@ -26,7 +26,7 @@ def test_execution_compute_OLO(script_runner, monkeypatch): 'sc_norm.npy') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run(['scil_connectivity_reorder_rois.py', in_sc, + ret = script_runner.run(['scil_connectivity_reorder_rois', in_sc, '--optimal_leaf_ordering', 'OLO.txt', '--out_dir', os.path.expanduser(tmp_dir.name), '--labels_list', in_labels_list, '-f']) @@ -39,7 +39,7 @@ def test_execution_apply_ordering(script_runner, monkeypatch): in_txt = os.path.join(SCILPY_HOME, 'connectivity', 'reorder.txt') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run(['scil_connectivity_reorder_rois.py', in_sc, + ret = script_runner.run(['scil_connectivity_reorder_rois', in_sc, '--in_ordering', in_txt, '--out_suffix', '_sc_reo', '--out_dir', os.path.expanduser(tmp_dir.name), diff --git a/src/scilpy/cli/tests/test_denoising_nlmeans.py b/src/scilpy/cli/tests/test_denoising_nlmeans.py index a1c6144c0..16b6ee323 100644 --- a/src/scilpy/cli/tests/test_denoising_nlmeans.py +++ b/src/scilpy/cli/tests/test_denoising_nlmeans.py @@ -13,14 +13,14 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_denoising_nlmeans.py', '--help']) + ret = script_runner.run(['scil_denoising_nlmeans', '--help']) assert ret.success def test_execution_user_sigma(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 't1_resample.nii.gz') - ret = script_runner.run(['scil_denoising_nlmeans.py', in_img, + ret = script_runner.run(['scil_denoising_nlmeans', in_img, 'denoised.nii.gz', '--processes', '1', '--sigma', '8', '--number_coils', 0, '--gaussian']) @@ -30,7 +30,7 @@ def test_execution_user_sigma(script_runner, monkeypatch): def test_execution_basic_3d(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 't1_resample.nii.gz') - ret = script_runner.run(['scil_denoising_nlmeans.py', in_img, + ret = script_runner.run(['scil_denoising_nlmeans', in_img, 't1_denoised.nii.gz', '--processes', '1', '--basic_sigma', '--number_coils', 0, '--gaussian']) @@ -41,7 +41,7 @@ def test_execution_basic_4d_mask(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop_1000.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'processing', 'fa_thr.nii.gz') - ret = script_runner.run(['scil_denoising_nlmeans.py', in_img, + ret = script_runner.run(['scil_denoising_nlmeans', in_img, 't1_denoised2.nii.gz', '--processes', '1', '--basic_sigma', '--number_coils', 0, '--gaussian', '--mask_sigma', in_mask]) @@ -51,7 +51,7 @@ def test_execution_basic_4d_mask(script_runner, monkeypatch): def test_execution_piesno(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'processing', 'dwi.nii.gz') - ret = script_runner.run(['scil_denoising_nlmeans.py', in_img, + ret = script_runner.run(['scil_denoising_nlmeans', in_img, 'dwi_denoised.nii.gz', '--processes', '1', '--piesno', '--number_coils', '4']) assert ret.success diff --git a/src/scilpy/cli/tests/test_dki_metrics.py b/src/scilpy/cli/tests/test_dki_metrics.py index d2dc9aad1..d9f86eaed 100644 --- a/src/scilpy/cli/tests/test_dki_metrics.py +++ b/src/scilpy/cli/tests/test_dki_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dki_metrics.py', '--help']) + ret = script_runner.run(['scil_dki_metrics', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_processing(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run(['scil_dki_metrics.py', in_dwi, + ret = script_runner.run(['scil_dki_metrics', in_dwi, in_bval, in_bvec, '--not_all', '--dki_fa', 'dki_fa.nii.gz', '--dki_md', 'dki_md.nii.gz', diff --git a/src/scilpy/cli/tests/test_dti_convert_tensors.py b/src/scilpy/cli/tests/test_dti_convert_tensors.py index ad5e0bdc0..e8094e7c1 100644 --- a/src/scilpy/cli/tests/test_dti_convert_tensors.py +++ b/src/scilpy/cli/tests/test_dti_convert_tensors.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dti_convert_tensors.py', '--help']) + ret = script_runner.run(['scil_dti_convert_tensors', '--help']) assert ret.success @@ -25,11 +25,11 @@ def test_execution_processing(script_runner, monkeypatch): in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop_1000.nii.gz') in_bval = os.path.join(SCILPY_HOME, 'processing', '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - script_runner.run(['scil_dti_metrics.py', in_dwi, + script_runner.run(['scil_dti_metrics', in_dwi, in_bval, in_bvec, '--not_all', '--tensor', 'tensors.nii.gz', '--tensor_format', 'fsl']) - ret = script_runner.run(['scil_dti_convert_tensors.py', 'tensors.nii.gz', + ret = script_runner.run(['scil_dti_convert_tensors', 'tensors.nii.gz', 'converted_tensors.nii.gz', 'fsl', 'mrtrix']) assert ret.success diff --git a/src/scilpy/cli/tests/test_dti_metrics.py b/src/scilpy/cli/tests/test_dti_metrics.py index fd9ae2f2d..de004ad08 100644 --- a/src/scilpy/cli/tests/test_dti_metrics.py +++ b/src/scilpy/cli/tests/test_dti_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dti_metrics.py', '--help']) + ret = script_runner.run(['scil_dti_metrics', '--help']) assert ret.success @@ -26,10 +26,10 @@ def test_execution_processing_diff_metrics(script_runner, monkeypatch): # No mask fitting with this data? Creating our own. mask = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') mask_uint8 = os.path.join('mask_uint8.nii.gz') - script_runner.run(['scil_volume_math.py', 'convert', + script_runner.run(['scil_volume_math', 'convert', mask, mask_uint8, '--data_type', 'uint8']) - ret = script_runner.run(['scil_dti_metrics.py', in_dwi, + ret = script_runner.run(['scil_dti_metrics', in_dwi, in_bval, in_bvec, '--not_all', '--fa', 'fa.nii.gz', '--md', 'md.nii.gz', @@ -49,10 +49,10 @@ def test_execution_processing_b0_threshold(script_runner, monkeypatch): # No mask fitting with this data? Creating our own. mask = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') mask_uint8 = os.path.join('mask_uint8.nii.gz') - script_runner.run(['scil_volume_math.py', 'convert', + script_runner.run(['scil_volume_math', 'convert', mask, mask_uint8, '--data_type', 'uint8']) - ret = script_runner.run(['scil_dti_metrics.py', in_dwi, + ret = script_runner.run(['scil_dti_metrics', in_dwi, in_bval, in_bvec, '--not_all', '--fa', 'fa.nii.gz', '--b0_threshold', '1', '-f']) assert not ret.success @@ -67,10 +67,10 @@ def test_execution_processing_rgb(script_runner, monkeypatch): # No mask fitting with this data? Creating our own. mask = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') mask_uint8 = os.path.join('mask_uint8.nii.gz') - script_runner.run(['scil_volume_math.py', 'convert', + script_runner.run(['scil_volume_math', 'convert', mask, mask_uint8, '--data_type', 'uint8']) - ret = script_runner.run(['scil_dti_metrics.py', in_dwi, + ret = script_runner.run(['scil_dti_metrics', in_dwi, in_bval, in_bvec, '--not_all', '--rgb', 'rgb.nii.gz', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_dwi_apply_bias_field.py b/src/scilpy/cli/tests/test_dwi_apply_bias_field.py index 765b28a3d..e0e922384 100644 --- a/src/scilpy/cli/tests/test_dwi_apply_bias_field.py +++ b/src/scilpy/cli/tests/test_dwi_apply_bias_field.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dwi_apply_bias_field.py', '--help']) + ret = script_runner.run(['scil_dwi_apply_bias_field', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_processing(script_runner, monkeypatch): 'dwi_crop.nii.gz') in_bias = os.path.join(SCILPY_HOME, 'processing', 'bias_field_b0.nii.gz') - ret = script_runner.run(['scil_dwi_apply_bias_field.py', in_dwi, + ret = script_runner.run(['scil_dwi_apply_bias_field', in_dwi, in_bias, 'dwi_crop_n4.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_dwi_compute_snr.py b/src/scilpy/cli/tests/test_dwi_compute_snr.py index 7b1799f08..aab8a1ea9 100644 --- a/src/scilpy/cli/tests/test_dwi_compute_snr.py +++ b/src/scilpy/cli/tests/test_dwi_compute_snr.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dwi_compute_snr.py', '--help']) + ret = script_runner.run(['scil_dwi_compute_snr', '--help']) assert ret.success @@ -29,7 +29,7 @@ def test_snr(script_runner, monkeypatch): noise_mask = os.path.join(SCILPY_HOME, 'processing', 'small_roi_gm_mask.nii.gz') - ret = script_runner.run(['scil_dwi_compute_snr.py', in_dwi, + ret = script_runner.run(['scil_dwi_compute_snr', in_dwi, in_bval, in_bvec, in_mask, '--noise_mask', noise_mask, '--b0_thr', '10']) diff --git a/src/scilpy/cli/tests/test_dwi_concatenate.py b/src/scilpy/cli/tests/test_dwi_concatenate.py index ebc536ff1..3e912dfc2 100644 --- a/src/scilpy/cli/tests/test_dwi_concatenate.py +++ b/src/scilpy/cli/tests/test_dwi_concatenate.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dwi_concatenate.py', '--help']) + ret = script_runner.run(['scil_dwi_concatenate', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_processing_concatenate(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run(['scil_dwi_concatenate.py', 'dwi_concat.nii.gz', + ret = script_runner.run(['scil_dwi_concatenate', 'dwi_concat.nii.gz', 'concat.bval', 'concat.bvec', '--in_dwi', in_dwi, in_dwi, '--in_bvals', in_bval, in_bval, diff --git a/src/scilpy/cli/tests/test_dwi_convert_FDF.py b/src/scilpy/cli/tests/test_dwi_convert_FDF.py index 105ed8436..303da46a0 100644 --- a/src/scilpy/cli/tests/test_dwi_convert_FDF.py +++ b/src/scilpy/cli/tests/test_dwi_convert_FDF.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_viz_dti_screenshot.py', '--help']) + ret = script_runner.run(['scil_viz_dti_screenshot', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_dwi_detect_volume_outliers.py b/src/scilpy/cli/tests/test_dwi_detect_volume_outliers.py index c023db4b4..7b2904442 100644 --- a/src/scilpy/cli/tests/test_dwi_detect_volume_outliers.py +++ b/src/scilpy/cli/tests/test_dwi_detect_volume_outliers.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dwi_detect_volume_outliers.py', '--help']) + ret = script_runner.run(['scil_dwi_detect_volume_outliers', '--help']) assert ret.success @@ -25,11 +25,11 @@ def test_execution(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run(['scil_dwi_detect_volume_outliers.py', in_dwi, + ret = script_runner.run(['scil_dwi_detect_volume_outliers', in_dwi, in_bval, in_bvec, '-v']) assert ret.success # Test wrong b0. Current minimal b-value is 5. - ret = script_runner.run(['scil_dwi_detect_volume_outliers.py', in_dwi, + ret = script_runner.run(['scil_dwi_detect_volume_outliers', in_dwi, in_bval, in_bvec, '--b0_threshold', '1']) assert not ret.success diff --git a/src/scilpy/cli/tests/test_dwi_extract_b0.py b/src/scilpy/cli/tests/test_dwi_extract_b0.py index 682982454..79402b90c 100644 --- a/src/scilpy/cli/tests/test_dwi_extract_b0.py +++ b/src/scilpy/cli/tests/test_dwi_extract_b0.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dwi_extract_b0.py', '--help']) + ret = script_runner.run(['scil_dwi_extract_b0', '--help']) assert ret.success @@ -25,11 +25,11 @@ def test_execution_processing(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run(['scil_dwi_extract_b0.py', in_dwi, in_bval, in_bvec, + ret = script_runner.run(['scil_dwi_extract_b0', in_dwi, in_bval, in_bvec, 'b0_mean.nii.gz', '--mean', '--b0', '20']) assert ret.success # Test wrong b0. Current minimal b-value is 5. - ret = script_runner.run(['scil_dwi_extract_b0.py', in_dwi, in_bval, in_bvec, + ret = script_runner.run(['scil_dwi_extract_b0', in_dwi, in_bval, in_bvec, 'b0_mean.nii.gz', '--mean', '--b0', '1', '-f']) assert not ret.success diff --git a/src/scilpy/cli/tests/test_dwi_extract_shell.py b/src/scilpy/cli/tests/test_dwi_extract_shell.py index 5e38add8e..7f21c9db3 100644 --- a/src/scilpy/cli/tests/test_dwi_extract_shell.py +++ b/src/scilpy/cli/tests/test_dwi_extract_shell.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dwi_extract_shell.py', '--help']) + ret = script_runner.run(['scil_dwi_extract_shell', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_processing_1000(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run(['scil_dwi_extract_shell.py', in_dwi, + ret = script_runner.run(['scil_dwi_extract_shell', in_dwi, in_bval, in_bvec, '0', '1000', 'dwi_crop_1000.nii.gz', '1000.bval', '1000.bvec', '-t', '30']) @@ -40,7 +40,7 @@ def test_execution_out_indices(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run(['scil_dwi_extract_shell.py', in_dwi, + ret = script_runner.run(['scil_dwi_extract_shell', in_dwi, in_bval, in_bvec, '0', '1000', 'dwi_crop_1000__1.nii.gz', '1000__1.bval', '1000__1.bvec', '-t', '30', '--out_indices', @@ -56,7 +56,7 @@ def test_execution_processing_3000(script_runner, monkeypatch): 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run(['scil_dwi_extract_shell.py', in_dwi, + ret = script_runner.run(['scil_dwi_extract_shell', in_dwi, in_bval, in_bvec, '0', '3000', 'dwi_crop_3000.nii.gz', '3000.bval', '3000.bvec', '-t', '30']) diff --git a/src/scilpy/cli/tests/test_dwi_powder_average.py b/src/scilpy/cli/tests/test_dwi_powder_average.py index 8269167c7..d3fc81337 100644 --- a/src/scilpy/cli/tests/test_dwi_powder_average.py +++ b/src/scilpy/cli/tests/test_dwi_powder_average.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dwi_powder_average.py', '--help']) + ret = script_runner.run(['scil_dwi_powder_average', '--help']) assert ret.success @@ -25,6 +25,6 @@ def test_execution_processing(script_runner, monkeypatch): in_bval = os.path.join(SCILPY_HOME, 'processing', '1000.bval') - ret = script_runner.run(['scil_dwi_powder_average.py', in_dwi, + ret = script_runner.run(['scil_dwi_powder_average', in_dwi, in_bval, 'out_pwd_avg.nii.gz', '--shells', '1000']) assert ret.success diff --git a/src/scilpy/cli/tests/test_dwi_prepare_eddy_command.py b/src/scilpy/cli/tests/test_dwi_prepare_eddy_command.py index 32c4415d1..6af858542 100644 --- a/src/scilpy/cli/tests/test_dwi_prepare_eddy_command.py +++ b/src/scilpy/cli/tests/test_dwi_prepare_eddy_command.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_prepare_eddy_command', '--help') + ret = script_runner.run(['scil_dwi_prepare_eddy_command', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_dwi_prepare_topup_command.py b/src/scilpy/cli/tests/test_dwi_prepare_topup_command.py index 6e317f242..335e8b8c0 100644 --- a/src/scilpy/cli/tests/test_dwi_prepare_topup_command.py +++ b/src/scilpy/cli/tests/test_dwi_prepare_topup_command.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_dwi_prepare_topup_command', '--help') + ret = script_runner.run(['scil_dwi_prepare_topup_command', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_dwi_reorder_philips.py b/src/scilpy/cli/tests/test_dwi_reorder_philips.py index 42fd732c9..52e2f8fe5 100644 --- a/src/scilpy/cli/tests/test_dwi_reorder_philips.py +++ b/src/scilpy/cli/tests/test_dwi_reorder_philips.py @@ -17,7 +17,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dwi_reorder_philips.py', '--help']) + ret = script_runner.run(['scil_dwi_reorder_philips', '--help']) assert ret.success @@ -35,7 +35,7 @@ def test_reorder(script_runner, monkeypatch): table[30] = tmp in_table = os.path.expanduser(tmp_dir.name) + "/in_table.txt" np.savetxt(in_table, table, header="Test") - ret = script_runner.run(['scil_dwi_reorder_philips.py', in_dwi, in_bval, + ret = script_runner.run(['scil_dwi_reorder_philips', in_dwi, in_bval, in_bvec, in_table, 'out1', '-f']) assert ret.success @@ -58,7 +58,7 @@ def test_reorder_w_json_old_version(script_runner, monkeypatch): info = {'SoftwareVersions': '5.5'} with open(in_json, 'w') as f: json.dump(info, f) - ret = script_runner.run(['scil_dwi_reorder_philips.py', in_dwi, in_bval, + ret = script_runner.run(['scil_dwi_reorder_philips', in_dwi, in_bval, in_bvec, in_table, 'out2', '--json', in_json]) assert ret.success @@ -81,6 +81,6 @@ def test_reorder_w_json_new_version(script_runner, monkeypatch): info = {'SoftwareVersions': '5.6'} with open(in_json, 'w') as f: json.dump(info, f) - ret = script_runner.run(['scil_dwi_reorder_philips.py', in_dwi, in_bval, + ret = script_runner.run(['scil_dwi_reorder_philips', in_dwi, in_bval, in_bvec, in_table, 'out3', '--json', in_json]) assert not ret.success diff --git a/src/scilpy/cli/tests/test_dwi_split_by_indices.py b/src/scilpy/cli/tests/test_dwi_split_by_indices.py index 980ed54e3..da25b4e9a 100644 --- a/src/scilpy/cli/tests/test_dwi_split_by_indices.py +++ b/src/scilpy/cli/tests/test_dwi_split_by_indices.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dwi_split_by_indices.py', '--help']) + ret = script_runner.run(['scil_dwi_split_by_indices', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_processing(script_runner, monkeypatch): in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop.nii.gz') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run(['scil_dwi_split_by_indices.py', in_dwi, + ret = script_runner.run(['scil_dwi_split_by_indices', in_dwi, in_bval, in_bvec, 'dwi', '5', '15', '25']) assert ret.success @@ -32,9 +32,9 @@ def test_execution_processing_wrong_indices_given(script_runner, monkeypatch): in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop.nii.gz') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') - ret = script_runner.run(['scil_dwi_split_by_indices.py', in_dwi, + ret = script_runner.run(['scil_dwi_split_by_indices', in_dwi, in_bval, in_bvec, 'dwi', '0', '15', '25']) assert (not ret.success) - ret = script_runner.run(['scil_dwi_split_by_indices.py', in_dwi, + ret = script_runner.run(['scil_dwi_split_by_indices', in_dwi, in_bval, in_bvec, 'dwi', '5', '15', '200']) assert (not ret.success) diff --git a/src/scilpy/cli/tests/test_dwi_to_sh.py b/src/scilpy/cli/tests/test_dwi_to_sh.py index 53f7301c3..1b8d81bba 100644 --- a/src/scilpy/cli/tests/test_dwi_to_sh.py +++ b/src/scilpy/cli/tests/test_dwi_to_sh.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dwi_to_sh.py', '--help']) + ret = script_runner.run(['scil_dwi_to_sh', '--help']) assert ret.success @@ -25,12 +25,12 @@ def test_execution_processing(script_runner, monkeypatch): '3000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '3000.bvec') - ret = script_runner.run(['scil_dwi_to_sh.py', in_dwi, in_bval, + ret = script_runner.run(['scil_dwi_to_sh', in_dwi, in_bval, in_bvec, 'sh_1000.nii.gz']) assert ret.success # Test wrong b0. Current minimal b-value is 5. - ret = script_runner.run(['scil_dwi_to_sh.py', in_dwi, in_bval, + ret = script_runner.run(['scil_dwi_to_sh', in_dwi, in_bval, in_bvec, 'sh_1000.nii.gz', '--b0_threshold', '1', '-f']) assert not ret.success diff --git a/src/scilpy/cli/tests/test_fibertube_compute_density.py b/src/scilpy/cli/tests/test_fibertube_compute_density.py index 68f724bb8..146bae727 100644 --- a/src/scilpy/cli/tests/test_fibertube_compute_density.py +++ b/src/scilpy/cli/tests/test_fibertube_compute_density.py @@ -38,14 +38,14 @@ def init_data(): def test_help_option(script_runner): - ret = script_runner.run(['scil_fibertube_compute_density.py', '--help']) + ret = script_runner.run(['scil_fibertube_compute_density', '--help']) assert ret.success def test_execution_density(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_compute_density.py', + ret = script_runner.run(['scil_fibertube_compute_density', 'fibertubes.trk', '--out_density_map', 'density_map.nii.gz', '--out_density_measures', @@ -57,7 +57,7 @@ def test_execution_density(script_runner, monkeypatch): def test_execution_collisions(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_compute_density.py', + ret = script_runner.run(['scil_fibertube_compute_density', 'fibertubes.trk', '--out_collision_map', 'collision_map.nii.gz', '--out_collision_measures', diff --git a/src/scilpy/cli/tests/test_fibertube_score_tractogram.py b/src/scilpy/cli/tests/test_fibertube_score_tractogram.py index 3145ea48c..a6b2ea0f2 100644 --- a/src/scilpy/cli/tests/test_fibertube_score_tractogram.py +++ b/src/scilpy/cli/tests/test_fibertube_score_tractogram.py @@ -57,14 +57,14 @@ def init_data(): def test_help_option(script_runner): - ret = script_runner.run(['scil_fibertube_score_tractogram.py', '--help']) + ret = script_runner.run(['scil_fibertube_score_tractogram', '--help']) assert ret.success def test_execution(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_score_tractogram.py', + ret = script_runner.run(['scil_fibertube_score_tractogram', 'fibertubes.trk', 'tracking.trk', 'config.json', 'metrics.json', '--save_error_tractogram', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_fibertube_tracking.py b/src/scilpy/cli/tests/test_fibertube_tracking.py index 389b892b6..47b204a76 100644 --- a/src/scilpy/cli/tests/test_fibertube_tracking.py +++ b/src/scilpy/cli/tests/test_fibertube_tracking.py @@ -38,14 +38,14 @@ def init_data(): def test_help_option(script_runner): - ret = script_runner.run(['scil_fibertube_tracking.py', '--help']) + ret = script_runner.run(['scil_fibertube_tracking', '--help']) assert ret.success def test_execution(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--min_length', '0', '-f']) assert ret.success @@ -54,7 +54,7 @@ def test_execution(script_runner, monkeypatch): def test_execution_rk(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--rk_order', '2', '--min_length', '0', '-f']) assert ret.success @@ -63,7 +63,7 @@ def test_execution_rk(script_runner, monkeypatch): def test_execution_config(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--blur_radius', '0.3', '--step_size', '0.1', @@ -75,7 +75,7 @@ def test_execution_config(script_runner, monkeypatch): def test_execution_seeding(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--nb_fibertubes', '1', '--nb_seeds_per_fibertube', '3', '--skip', '3', @@ -87,7 +87,7 @@ def test_execution_seeding(script_runner, monkeypatch): def test_execution_FTODF(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--min_length', '0', '-f']) assert ret.success @@ -96,7 +96,7 @@ def test_execution_FTODF(script_runner, monkeypatch): def test_execution_FTODF_rk(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--rk_order', '2', '--min_length', '0', '-f']) assert ret.success @@ -105,7 +105,7 @@ def test_execution_FTODF_rk(script_runner, monkeypatch): def test_execution_FTODF_config(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--blur_radius', '0.3', '--step_size', '0.1', @@ -117,7 +117,7 @@ def test_execution_FTODF_config(script_runner, monkeypatch): def test_execution_FTODF_seeding(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--nb_fibertubes', '1', '--nb_seeds_per_fibertube', '3', '--skip', '3', @@ -129,7 +129,7 @@ def test_execution_FTODF_seeding(script_runner, monkeypatch): def test_execution_FTODF_sphere(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--sh_order', '4', '--sphere', 'symmetric362', @@ -144,7 +144,7 @@ def test_execution_FTODF_sphere(script_runner, monkeypatch): def test_execution_FTODF_det(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() - ret = script_runner.run(['scil_fibertube_tracking.py', + ret = script_runner.run(['scil_fibertube_tracking', 'tractogram.trk', 'tracking.trk', '--use_ftODF', '--algo', 'det', '--min_length', '0', '-f']) diff --git a/src/scilpy/cli/tests/test_fodf_bundleparc.py b/src/scilpy/cli/tests/test_fodf_bundleparc.py index 4f2e1d08a..3023ab24a 100644 --- a/src/scilpy/cli/tests/test_fodf_bundleparc.py +++ b/src/scilpy/cli/tests/test_fodf_bundleparc.py @@ -12,7 +12,7 @@ @pytest.mark.ml def test_help_option(script_runner, monkeypatch): - ret = script_runner.run(['scil_fodf_bundleparc.py', '--help']) + ret = script_runner.run(['scil_fodf_bundleparc', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_help_option(script_runner, monkeypatch): def test_execution(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run(['scil_fodf_bundleparc.py', in_fodf, '-f', + ret = script_runner.run(['scil_fodf_bundleparc', in_fodf, '-f', '--bundles', 'FX_left']) assert ret.success @@ -30,7 +30,7 @@ def test_execution(script_runner, monkeypatch): def test_execution_100_labels(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run(['scil_fodf_bundleparc.py', in_fodf, + ret = script_runner.run(['scil_fodf_bundleparc', in_fodf, '--nb_pts', '100', '-f', '--bundles', 'IFO_right']) assert ret.success @@ -40,7 +40,7 @@ def test_execution_100_labels(script_runner, monkeypatch): def test_execution_keep_biggest_blob(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run(['scil_fodf_bundleparc.py', in_fodf, + ret = script_runner.run(['scil_fodf_bundleparc', in_fodf, '--keep_biggest_blob', '-f', '--bundles', 'CA']) assert ret.success @@ -50,6 +50,6 @@ def test_execution_keep_biggest_blob(script_runner, monkeypatch): def test_execution_invalid_bundle(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') - ret = script_runner.run(['scil_fodf_bundleparc.py', in_fodf, + ret = script_runner.run(['scil_fodf_bundleparc', in_fodf, '-f', '--bundles', 'CC']) assert not ret.success diff --git a/src/scilpy/cli/tests/test_fodf_max_in_ventricles.py b/src/scilpy/cli/tests/test_fodf_max_in_ventricles.py index 819af4592..51d69019f 100644 --- a/src/scilpy/cli/tests/test_fodf_max_in_ventricles.py +++ b/src/scilpy/cli/tests/test_fodf_max_in_ventricles.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_fodf_max_in_ventricles.py', '--help']) + ret = script_runner.run(['scil_fodf_max_in_ventricles', '--help']) assert ret.success @@ -25,6 +25,6 @@ def test_execution_processing(script_runner, monkeypatch): 'fa.nii.gz') in_md = os.path.join(SCILPY_HOME, 'processing', 'md.nii.gz') - ret = script_runner.run(['scil_fodf_max_in_ventricles.py', in_fodf, + ret = script_runner.run(['scil_fodf_max_in_ventricles', in_fodf, in_fa, in_md, '--sh_basis', 'tournier07']) assert ret.success diff --git a/src/scilpy/cli/tests/test_fodf_memsmt.py b/src/scilpy/cli/tests/test_fodf_memsmt.py index 64130108d..78d2b076f 100644 --- a/src/scilpy/cli/tests/test_fodf_memsmt.py +++ b/src/scilpy/cli/tests/test_fodf_memsmt.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_fodf_memsmt.py', '--help']) + ret = script_runner.run(['scil_fodf_memsmt', '--help']) assert ret.success @@ -37,7 +37,7 @@ def test_inputs_check(script_runner, monkeypatch): in_csf_frf = os.path.join(SCILPY_HOME, 'btensor_testdata', 'csf_frf.txt') - ret = script_runner.run(['scil_fodf_memsmt.py', in_wm_frf, + ret = script_runner.run(['scil_fodf_memsmt', in_wm_frf, in_gm_frf, in_csf_frf, '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, '--in_bvecs', in_bvec_lin, @@ -49,7 +49,7 @@ def test_inputs_check(script_runner, monkeypatch): 'tournier07', '--processes', '1', '-f']) assert (not ret.success) - ret = script_runner.run(['scil_fodf_memsmt.py', in_wm_frf, + ret = script_runner.run(['scil_fodf_memsmt', in_wm_frf, in_gm_frf, in_csf_frf, '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', @@ -84,7 +84,7 @@ def test_execution_processing(script_runner, monkeypatch): in_csf_frf = os.path.join(SCILPY_HOME, 'btensor_testdata', 'csf_frf.txt') - ret = script_runner.run(['scil_fodf_memsmt.py', in_wm_frf, + ret = script_runner.run(['scil_fodf_memsmt', in_wm_frf, in_gm_frf, in_csf_frf, '--in_dwis', in_dwi_lin, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_sph, diff --git a/src/scilpy/cli/tests/test_fodf_metrics.py b/src/scilpy/cli/tests/test_fodf_metrics.py index 75116b952..7bbbf5fe4 100644 --- a/src/scilpy/cli/tests/test_fodf_metrics.py +++ b/src/scilpy/cli/tests/test_fodf_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_fodf_metrics.py', '--help']) + ret = script_runner.run(['scil_fodf_metrics', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf_descoteaux07.nii.gz') - ret = script_runner.run(['scil_fodf_metrics.py', in_fodf, '--not_al', + ret = script_runner.run(['scil_fodf_metrics', in_fodf, '--not_al', '--peaks', 'peaks.nii.gz', '--afd_max', 'afd_max.nii.gz', '--afd_total', 'afd_tot.nii.gz', diff --git a/src/scilpy/cli/tests/test_fodf_msmt.py b/src/scilpy/cli/tests/test_fodf_msmt.py index 185479caa..f0a42127d 100644 --- a/src/scilpy/cli/tests/test_fodf_msmt.py +++ b/src/scilpy/cli/tests/test_fodf_msmt.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_fodf_msmt.py', '--help']) + ret = script_runner.run(['scil_fodf_msmt', '--help']) assert ret.success @@ -26,7 +26,7 @@ def test_execution_processing(script_runner, monkeypatch): in_csf_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'csf_frf.txt') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run(['scil_fodf_msmt.py', in_dwi, in_bval, + ret = script_runner.run(['scil_fodf_msmt', in_dwi, in_bval, in_bvec, in_wm_frf, in_gm_frf, in_csf_frf, '--mask', mask, '--wm_out_fODF', 'wm_fodf.nii.gz', diff --git a/src/scilpy/cli/tests/test_fodf_ssst.py b/src/scilpy/cli/tests/test_fodf_ssst.py index d2ba8caf7..e60773487 100644 --- a/src/scilpy/cli/tests/test_fodf_ssst.py +++ b/src/scilpy/cli/tests/test_fodf_ssst.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_fodf_ssst.py', '--help']) + ret = script_runner.run(['scil_fodf_ssst', '--help']) assert ret.success @@ -27,13 +27,13 @@ def test_execution_processing(script_runner, monkeypatch): '3000.bvec') in_frf = os.path.join(SCILPY_HOME, 'processing', 'frf.txt') - ret = script_runner.run(['scil_fodf_ssst.py', in_dwi, in_bval, + ret = script_runner.run(['scil_fodf_ssst', in_dwi, in_bval, in_bvec, in_frf, 'fodf.nii.gz', '--sh_order', '4', '--sh_basis', 'tournier07', '--processes', '1']) assert ret.success # Test wrong b0. Current minimal b-value is 5. - ret = script_runner.run(['scil_fodf_ssst.py', in_dwi, in_bval, + ret = script_runner.run(['scil_fodf_ssst', in_dwi, in_bval, in_bvec, in_frf, 'fodf.nii.gz', '--sh_order', '4', '--sh_basis', 'tournier07', '--processes', '1', '--b0_threshold', '1', '-f']) diff --git a/src/scilpy/cli/tests/test_fodf_to_bingham.py b/src/scilpy/cli/tests/test_fodf_to_bingham.py index 4eef7f86f..d1c7c3388 100644 --- a/src/scilpy/cli/tests/test_fodf_to_bingham.py +++ b/src/scilpy/cli/tests/test_fodf_to_bingham.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_fodf_to_bingham.py', + ret = script_runner.run(['scil_fodf_to_bingham', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf_descoteaux07.nii.gz') - ret = script_runner.run(['scil_fodf_to_bingham.py', + ret = script_runner.run(['scil_fodf_to_bingham', in_fodf, 'bingham.nii.gz', '--max_lobes', '1', '--at', '0.0', @@ -39,7 +39,7 @@ def test_execution_processing_mask(script_runner, monkeypatch): 'fodf_descoteaux07.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') - ret = script_runner.run(['scil_fodf_to_bingham.py', + ret = script_runner.run(['scil_fodf_to_bingham', in_fodf, 'bingham.nii.gz', '--max_lobes', '1', '--at', '0.0', diff --git a/src/scilpy/cli/tests/test_freewater_maps.py b/src/scilpy/cli/tests/test_freewater_maps.py index c765acc3a..d6cc0dcdf 100644 --- a/src/scilpy/cli/tests/test_freewater_maps.py +++ b/src/scilpy/cli/tests/test_freewater_maps.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_freewater_maps.py', '--help']) + ret = script_runner.run(['scil_freewater_maps', '--help']) assert ret.success @@ -27,7 +27,7 @@ def test_execution_commit_amico(script_runner, monkeypatch): 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run(['scil_freewater_maps.py', in_dwi, + ret = script_runner.run(['scil_freewater_maps', in_dwi, in_bval, in_bvec, '--mask', mask, '--out_dir', 'freewater', '--b_thr', '30', '--para_diff', '0.0015', diff --git a/src/scilpy/cli/tests/test_freewater_priors.py b/src/scilpy/cli/tests/test_freewater_priors.py index 9ed2aac80..1a056ea72 100644 --- a/src/scilpy/cli/tests/test_freewater_priors.py +++ b/src/scilpy/cli/tests/test_freewater_priors.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_freewater_priors.py', '--help']) + ret = script_runner.run(['scil_freewater_priors', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_frf_mean.py b/src/scilpy/cli/tests/test_frf_mean.py index 8221c2042..e6ec7a8f2 100644 --- a/src/scilpy/cli/tests/test_frf_mean.py +++ b/src/scilpy/cli/tests/test_frf_mean.py @@ -14,28 +14,28 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_frf_mean.py', '--help']) + ret = script_runner.run(['scil_frf_mean', '--help']) assert ret.success def test_execution_processing_ssst(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'processing', 'frf.txt') - ret = script_runner.run(['scil_frf_mean.py', in_frf, in_frf, 'mfrf1.txt']) + ret = script_runner.run(['scil_frf_mean', in_frf, in_frf, 'mfrf1.txt']) assert ret.success def test_execution_processing_msmt(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run(['scil_frf_mean.py', in_frf, in_frf, 'mfrf2.txt']) + ret = script_runner.run(['scil_frf_mean', in_frf, in_frf, 'mfrf2.txt']) assert ret.success def test_outputs_precision(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run(['scil_frf_mean.py', in_frf, in_frf, 'mfrfp.txt', + ret = script_runner.run(['scil_frf_mean', in_frf, in_frf, 'mfrfp.txt', '--precision', '4']) assert ret.success @@ -53,5 +53,5 @@ def test_execution_processing_bad_input(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_wm_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') in_frf = os.path.join(SCILPY_HOME, 'processing', 'frf.txt') - ret = script_runner.run(['scil_frf_mean.py', in_wm_frf, in_frf, 'mfrf3.txt']) + ret = script_runner.run(['scil_frf_mean', in_wm_frf, in_frf, 'mfrf3.txt']) assert not ret.success diff --git a/src/scilpy/cli/tests/test_frf_memsmt.py b/src/scilpy/cli/tests/test_frf_memsmt.py index aeeed01d1..07f7b6a8e 100644 --- a/src/scilpy/cli/tests/test_frf_memsmt.py +++ b/src/scilpy/cli/tests/test_frf_memsmt.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_frf_memsmt.py', '--help']) + ret = script_runner.run(['scil_frf_memsmt', '--help']) assert ret.success @@ -37,7 +37,7 @@ def test_roi_center_shape_parameter(script_runner, monkeypatch): in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') - ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, @@ -68,7 +68,7 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): 'spherical.bvals') in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') - ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, @@ -77,7 +77,7 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): '--roi_radii', '37', '--min_nvox', '1', '-f']) assert ret.success - ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, @@ -87,7 +87,7 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): '--min_nvox', '1', '-f']) assert ret.success - ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, @@ -114,14 +114,14 @@ def test_inputs_check(script_runner, monkeypatch): in_bvec_plan = os.path.join(SCILPY_HOME, 'btensor_testdata', 'planar.bvecs') - ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, '--in_bvecs', in_bvec_lin, '--in_bdeltas', '1', '--min_nvox', '1', '-f']) assert (not ret.success) - ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, in_bval_plan, '--in_bvecs', @@ -150,7 +150,7 @@ def test_outputs_precision(script_runner, monkeypatch): 'spherical.bvals') in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') - ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, @@ -186,7 +186,7 @@ def test_execution_processing(script_runner, monkeypatch): 'spherical.bvals') in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') - ret = script_runner.run(['scil_frf_memsmt.py', 'wm_frf.txt', + ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', in_bval_lin, in_bval_plan, in_bval_sph, diff --git a/src/scilpy/cli/tests/test_frf_msmt.py b/src/scilpy/cli/tests/test_frf_msmt.py index 65b7e41d2..65dc25a87 100644 --- a/src/scilpy/cli/tests/test_frf_msmt.py +++ b/src/scilpy/cli/tests/test_frf_msmt.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_frf_msmt.py', '--help']) + ret = script_runner.run(['scil_frf_msmt', '--help']) assert ret.success @@ -25,20 +25,20 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run(['scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_center', '15', '15', '15', '-f']) assert ret.success # Test wrong tolerance, leading to no b0. Current minimal b-val is 5. - ret = script_runner.run(['scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_center', '15', '15', '15', '-f', '--tol', '1']) assert not ret.success - ret = script_runner.run(['scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_center', '15', '-f']) @@ -55,19 +55,19 @@ def test_roi_radii_shape_parameter2(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run(['scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_radii', '37', '-f']) assert ret.success - ret = script_runner.run(['scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_radii', '37', '37', '37', '-f']) assert ret.success - ret = script_runner.run(['scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--roi_radii', '37', '37', '37', '37', '37', '-f']) @@ -84,7 +84,7 @@ def test_outputs_precision(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run(['scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--min_nvox', '20', '--precision', '4', '-f']) @@ -105,7 +105,7 @@ def test_execution_processing(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') - ret = script_runner.run(['scil_frf_msmt.py', in_dwi, + ret = script_runner.run(['scil_frf_msmt', in_dwi, in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt', '--mask', mask, '--min_nvox', '20', '-f']) diff --git a/src/scilpy/cli/tests/test_frf_set_diffusivities.py b/src/scilpy/cli/tests/test_frf_set_diffusivities.py index 2b0c9141e..7a2e8e959 100644 --- a/src/scilpy/cli/tests/test_frf_set_diffusivities.py +++ b/src/scilpy/cli/tests/test_frf_set_diffusivities.py @@ -15,14 +15,14 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_frf_set_diffusivities.py', '--help']) + ret = script_runner.run(['scil_frf_set_diffusivities', '--help']) assert ret.success def test_execution_processing_ssst(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'processing', 'frf.txt') - ret = script_runner.run(['scil_frf_set_diffusivities.py', in_frf, + ret = script_runner.run(['scil_frf_set_diffusivities', in_frf, '15,4,4', 'new_frf.txt', '-f']) assert ret.success @@ -30,7 +30,7 @@ def test_execution_processing_ssst(script_runner, monkeypatch): def test_execution_processing_msmt(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run(['scil_frf_set_diffusivities.py', in_frf, + ret = script_runner.run(['scil_frf_set_diffusivities', in_frf, '15,4,4,13,4,4,12,5,5', 'new_frf.txt', '-f']) assert ret.success @@ -38,7 +38,7 @@ def test_execution_processing_msmt(script_runner, monkeypatch): def test_outputs_precision(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run(['scil_frf_set_diffusivities.py', in_frf, + ret = script_runner.run(['scil_frf_set_diffusivities', in_frf, '15,4,4,13,4,4,12,5,5', 'new_frf.txt', '--precision', '4', '-f']) assert ret.success @@ -56,6 +56,6 @@ def test_outputs_precision(script_runner, monkeypatch): def test_execution_processing__wrong_input(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') - ret = script_runner.run(['scil_frf_set_diffusivities.py', in_frf, + ret = script_runner.run(['scil_frf_set_diffusivities', in_frf, '15,4,4,13,4,4', 'new_frf.txt', '-f']) assert not ret.success diff --git a/src/scilpy/cli/tests/test_frf_ssst.py b/src/scilpy/cli/tests/test_frf_ssst.py index 1bee70d6a..482518312 100644 --- a/src/scilpy/cli/tests/test_frf_ssst.py +++ b/src/scilpy/cli/tests/test_frf_ssst.py @@ -16,25 +16,25 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_frf_ssst.py', '--help']) + ret = script_runner.run(['scil_frf_ssst', '--help']) assert ret.success def test_roi_center_parameter(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_center', '15', '15', '15', '-f']) assert ret.success - ret = script_runner.run(['scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_center', '15', '-f']) assert (not ret.success) # Test wrong b0 threshold. Current minimal b-value is 5. - ret = script_runner.run(['scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_center', '15', '15', '15', '-f', '--b0_threshold', '1']) @@ -43,17 +43,17 @@ def test_roi_center_parameter(script_runner, monkeypatch): def test_roi_radii_shape_parameter(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_radii', '37', '-f']) assert ret.success - ret = script_runner.run(['scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_radii', '37', '37', '37', '-f']) assert ret.success - ret = script_runner.run(['scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--roi_radii', '37', '37', '37', '37', '37', '-f']) @@ -62,7 +62,7 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): def test_outputs_precision(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '--precision', '4', '-f']) assert ret.success @@ -74,6 +74,6 @@ def test_outputs_precision(script_runner, monkeypatch): def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_frf_ssst.py', in_dwi, + ret = script_runner.run(['scil_frf_ssst', in_dwi, in_bval, in_bvec, 'frf.txt', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_gradients_apply_transform.py b/src/scilpy/cli/tests/test_gradients_apply_transform.py index 806c65d16..74f315866 100644 --- a/src/scilpy/cli/tests/test_gradients_apply_transform.py +++ b/src/scilpy/cli/tests/test_gradients_apply_transform.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_gradients_apply_transform.py', '--help']) + ret = script_runner.run(['scil_gradients_apply_transform', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_bst(script_runner, monkeypatch): 'dwi.bvec') in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') - ret = script_runner.run(['scil_gradients_apply_transform.py', + ret = script_runner.run(['scil_gradients_apply_transform', in_bvecs, in_aff, 'bvecs_transformed.bvec', '--inverse']) assert ret.success diff --git a/src/scilpy/cli/tests/test_gradients_convert.py b/src/scilpy/cli/tests/test_gradients_convert.py index 4f302390c..1f3f1f821 100644 --- a/src/scilpy/cli/tests/test_gradients_convert.py +++ b/src/scilpy/cli/tests/test_gradients_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_gradients_convert.py', + ret = script_runner.run(['scil_gradients_convert', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_processing_fsl(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run(['scil_gradients_convert.py', + ret = script_runner.run(['scil_gradients_convert', '--input_fsl', in_bval, in_bvec, '1000']) assert ret.success @@ -34,7 +34,7 @@ def test_execution_processing_mrtrix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run(['scil_gradients_convert.py', + ret = script_runner.run(['scil_gradients_convert', '--input_mrtrix', in_encoding, '1000']) assert ret.success @@ -46,7 +46,7 @@ def test_name_validation_mrtrix(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run(['scil_gradients_convert.py', + ret = script_runner.run(['scil_gradients_convert', '--input_fsl', in_bval, in_bvec, '1000_test.b']) assert ret.success @@ -62,7 +62,7 @@ def test_name_validation_fsl_bval(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run(['scil_gradients_convert.py', + ret = script_runner.run(['scil_gradients_convert', '--input_mrtrix', in_encoding, '1000_test.bval']) assert ret.success @@ -82,7 +82,7 @@ def test_name_validation_fsl_bvec(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run(['scil_gradients_convert.py', + ret = script_runner.run(['scil_gradients_convert', '--input_mrtrix', in_encoding, '1000_test.bvec']) assert ret.success diff --git a/src/scilpy/cli/tests/test_gradients_generate_sampling.py b/src/scilpy/cli/tests/test_gradients_generate_sampling.py index 5bbdeb18a..9d51418c2 100644 --- a/src/scilpy/cli/tests/test_gradients_generate_sampling.py +++ b/src/scilpy/cli/tests/test_gradients_generate_sampling.py @@ -13,13 +13,13 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_gradients_generate_sampling.py', '--help']) + ret = script_runner.run(['scil_gradients_generate_sampling', '--help']) assert ret.success def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_gradients_generate_sampling.py', + ret = script_runner.run(['scil_gradients_generate_sampling', '6', '6', 'encoding.b', '--mrtrix', '--eddy', '--duty', '--b0_every', '25', '--b0_end', '--bvals', '800', '1200']) diff --git a/src/scilpy/cli/tests/test_gradients_modify_axes.py b/src/scilpy/cli/tests/test_gradients_modify_axes.py index 51562186c..5f66f3bdd 100644 --- a/src/scilpy/cli/tests/test_gradients_modify_axes.py +++ b/src/scilpy/cli/tests/test_gradients_modify_axes.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_gradients_modify_axes.py', '--help']) + ret = script_runner.run(['scil_gradients_modify_axes', '--help']) assert ret.success @@ -22,12 +22,12 @@ def test_execution_processing(script_runner, monkeypatch): # mrtrix in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run(['scil_gradients_modify_axes.py', in_encoding, + ret = script_runner.run(['scil_gradients_modify_axes', in_encoding, '1000_flip.b', '-1', '3', '2']) assert ret.success # FSL in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run(['scil_gradients_modify_axes.py', in_encoding, + ret = script_runner.run(['scil_gradients_modify_axes', in_encoding, '1000_flip.bvec', '1', '-3', '2']) assert ret.success diff --git a/src/scilpy/cli/tests/test_gradients_normalize_bvecs.py b/src/scilpy/cli/tests/test_gradients_normalize_bvecs.py index ec3998956..d8ad1b1bf 100644 --- a/src/scilpy/cli/tests/test_gradients_normalize_bvecs.py +++ b/src/scilpy/cli/tests/test_gradients_normalize_bvecs.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_gradients_normalize_bvecs.py', + ret = script_runner.run(['scil_gradients_normalize_bvecs', '--help']) assert ret.success @@ -22,6 +22,6 @@ def test_execution_processing_fsl(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run(['scil_gradients_normalize_bvecs.py', + ret = script_runner.run(['scil_gradients_normalize_bvecs', in_bvec, '1000_norm.bvec']) assert ret.success diff --git a/src/scilpy/cli/tests/test_gradients_round_bvals.py b/src/scilpy/cli/tests/test_gradients_round_bvals.py index 173035392..978d8d21c 100644 --- a/src/scilpy/cli/tests/test_gradients_round_bvals.py +++ b/src/scilpy/cli/tests/test_gradients_round_bvals.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_gradients_round_bvals.py', + ret = script_runner.run(['scil_gradients_round_bvals', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_help_option(script_runner): def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bval = os.path.join(SCILPY_HOME, 'processing', '1000.bval') - ret = script_runner.run(['scil_gradients_round_bvals.py', + ret = script_runner.run(['scil_gradients_round_bvals', in_bval, '0', '1000', '1000_resample.b', "20", "-v"]) assert ret.success diff --git a/src/scilpy/cli/tests/test_gradients_validate_correct.py b/src/scilpy/cli/tests/test_gradients_validate_correct.py index 968e6ad20..092da83ce 100644 --- a/src/scilpy/cli/tests/test_gradients_validate_correct.py +++ b/src/scilpy/cli/tests/test_gradients_validate_correct.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_gradients_validate_correct.py', '--help']) + ret = script_runner.run(['scil_gradients_validate_correct', '--help']) assert ret.success @@ -27,11 +27,11 @@ def test_execution_processing_dti_peaks(script_runner, monkeypatch): '1000.bvec') # generate the peaks file and fa map we'll use to test our script - script_runner.run(['scil_dti_metrics.py', in_dwi, in_bval, in_bvec, + script_runner.run(['scil_dti_metrics', in_dwi, in_bval, in_bvec, '--not_all', '--fa', 'fa.nii.gz', '--evecs', 'evecs.nii.gz']) # test the actual script - ret = script_runner.run(['scil_gradients_validate_correct.py', in_bvec, + ret = script_runner.run(['scil_gradients_validate_correct', in_bvec, 'evecs_v1.nii.gz', 'fa.nii.gz', 'bvec_corr', '-v']) assert ret.success @@ -46,6 +46,6 @@ def test_execution_processing_fodf_peaks(script_runner, monkeypatch): 'fa.nii.gz') # test the actual script - ret = script_runner.run(['scil_gradients_validate_correct.py', in_bvec, + ret = script_runner.run(['scil_gradients_validate_correct', in_bvec, in_peaks, in_fa, 'bvec_corr_fodf', '-v']) assert ret.success diff --git a/src/scilpy/cli/tests/test_gradients_validate_correct_eddy.py b/src/scilpy/cli/tests/test_gradients_validate_correct_eddy.py index 4de4884a8..4af4e582e 100644 --- a/src/scilpy/cli/tests/test_gradients_validate_correct_eddy.py +++ b/src/scilpy/cli/tests/test_gradients_validate_correct_eddy.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_gradients_validate_correct_eddy.py', + ret = script_runner.run(['scil_gradients_validate_correct_eddy', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_extract_half(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') - ret = script_runner.run(['scil_gradients_validate_correct_eddy.py', + ret = script_runner.run(['scil_gradients_validate_correct_eddy', in_bvec, in_bval, "32", 'out.bvec', 'out.bval', @@ -33,7 +33,7 @@ def test_execution_extract_total(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') - ret = script_runner.run(['scil_gradients_validate_correct_eddy.py', + ret = script_runner.run(['scil_gradients_validate_correct_eddy', in_bvec, in_bval, "64", 'out.bvec', 'out.bval', diff --git a/src/scilpy/cli/tests/test_gradients_validate_sampling.py b/src/scilpy/cli/tests/test_gradients_validate_sampling.py index cda011375..b8505cf56 100644 --- a/src/scilpy/cli/tests/test_gradients_validate_sampling.py +++ b/src/scilpy/cli/tests/test_gradients_validate_sampling.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_gradients_validate_sampling.py', '--help']) + ret = script_runner.run(['scil_gradients_validate_sampling', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_normal(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run(['scil_gradients_validate_sampling.py', in_bval, + ret = script_runner.run(['scil_gradients_validate_sampling', in_bval, in_bvec]) assert ret.success @@ -34,5 +34,5 @@ def test_execution_mrtrix(script_runner, monkeypatch): in_b = os.path.join(SCILPY_HOME, 'processing', '1000.b') - ret = script_runner.run(['scil_gradients_validate_sampling.py', in_b]) + ret = script_runner.run(['scil_gradients_validate_sampling', in_b]) assert ret.success diff --git a/src/scilpy/cli/tests/test_header_print_info.py b/src/scilpy/cli/tests/test_header_print_info.py index ad4743a01..3aa31f5aa 100644 --- a/src/scilpy/cli/tests/test_header_print_info.py +++ b/src/scilpy/cli/tests/test_header_print_info.py @@ -13,19 +13,19 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_header_print_info.py', '--help']) + ret = script_runner.run(['scil_header_print_info', '--help']) assert ret.success def test_execution_img(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'fa.nii.gz') - ret = script_runner.run(['scil_header_print_info.py', in_img]) + ret = script_runner.run(['scil_header_print_info', in_img]) assert ret.success def test_execution_tractogram(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'others', 'IFGWM.trk') - ret = script_runner.run(['scil_header_print_info.py', in_tracto]) + ret = script_runner.run(['scil_header_print_info', in_tracto]) assert ret.success diff --git a/src/scilpy/cli/tests/test_header_validate_compatibility.py b/src/scilpy/cli/tests/test_header_validate_compatibility.py index 768f1db3f..be4f7921a 100644 --- a/src/scilpy/cli/tests/test_header_validate_compatibility.py +++ b/src/scilpy/cli/tests/test_header_validate_compatibility.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_header_validate_compatibility.py', '--help']) + ret = script_runner.run(['scil_header_validate_compatibility', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') in_roi = os.path.join(SCILPY_HOME, 'filtering', 'mask.nii.gz') - ret = script_runner.run(['scil_header_validate_compatibility.py', + ret = script_runner.run(['scil_header_validate_compatibility', in_bundle, in_roi]) assert ret.success diff --git a/src/scilpy/cli/tests/test_json_convert_entries_to_xlsx.py b/src/scilpy/cli/tests/test_json_convert_entries_to_xlsx.py index cdd1a94a2..dc7353dec 100644 --- a/src/scilpy/cli/tests/test_json_convert_entries_to_xlsx.py +++ b/src/scilpy/cli/tests/test_json_convert_entries_to_xlsx.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_json_convert_entries_to_xlsx.py', '--help']) + ret = script_runner.run(['scil_json_convert_entries_to_xlsx', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_json = os.path.join(SCILPY_HOME, 'tractometry', 'length_stats_1.json') - ret = script_runner.run(['scil_json_convert_entries_to_xlsx.py', in_json, + ret = script_runner.run(['scil_json_convert_entries_to_xlsx', in_json, 'length_stats.xlsx']) assert ret.success diff --git a/src/scilpy/cli/tests/test_json_harmonize_entries.py b/src/scilpy/cli/tests/test_json_harmonize_entries.py index e3ed51e97..4d6895180 100644 --- a/src/scilpy/cli/tests/test_json_harmonize_entries.py +++ b/src/scilpy/cli/tests/test_json_harmonize_entries.py @@ -2,5 +2,5 @@ # -*- coding: utf-8 -*- def test_help_option(script_runner): - ret = script_runner.run('scil_json_harmonize_entries', '--help') + ret = script_runner.run(['scil_json_harmonize_entries', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_json_merge_entries.py b/src/scilpy/cli/tests/test_json_merge_entries.py index 0f7125b2e..37c30ced5 100644 --- a/src/scilpy/cli/tests/test_json_merge_entries.py +++ b/src/scilpy/cli/tests/test_json_merge_entries.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_json_merge_entries.py', '--help']) + ret = script_runner.run(['scil_json_merge_entries', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_tractometry(script_runner, monkeypatch): 'length_stats_1.json') in_json_2 = os.path.join(SCILPY_HOME, 'tractometry', 'length_stats_2.json') - ret = script_runner.run(['scil_json_merge_entries.py', in_json_1, + ret = script_runner.run(['scil_json_merge_entries', in_json_1, in_json_2, 'merge.json', '--keep_separate']) assert ret.success diff --git a/src/scilpy/cli/tests/test_labels_combine.py b/src/scilpy/cli/tests/test_labels_combine.py index fa7e17d91..92506f883 100644 --- a/src/scilpy/cli/tests/test_labels_combine.py +++ b/src/scilpy/cli/tests/test_labels_combine.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_labels_combine.py', '--help']) + ret = script_runner.run(['scil_labels_combine', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_atlas(script_runner, monkeypatch): in_atlas_1 = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') in_brainstem = os.path.join(SCILPY_HOME, 'atlas', 'brainstem.nii.gz') - ret = script_runner.run(['scil_labels_combine.py', + ret = script_runner.run(['scil_labels_combine', 'atlas_freesurfer_v2_single_brainstem.nii.gz', '--volume_ids', in_atlas_1, '8', '47', '251', '252', '253', '254', '1022', '1024', '2022', @@ -35,7 +35,7 @@ def test_execution_atlas_merge(script_runner, monkeypatch): in_atlas_1 = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') in_brainstem = os.path.join(SCILPY_HOME, 'atlas', 'brainstem.nii.gz') - ret = script_runner.run(['scil_labels_combine.py', + ret = script_runner.run(['scil_labels_combine', 'atlas_freesurfer_v2_merge_brainstem.nii.gz', '--volume_ids', in_atlas_1, '8', '47', '251', '252', '253', '254', '1022', '1024', '2022', diff --git a/src/scilpy/cli/tests/test_labels_dilate.py b/src/scilpy/cli/tests/test_labels_dilate.py index 16cdf2051..7789aa893 100644 --- a/src/scilpy/cli/tests/test_labels_dilate.py +++ b/src/scilpy/cli/tests/test_labels_dilate.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_labels_dilate.py', '--help']) + ret = script_runner.run(['scil_labels_dilate', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_single_brainstem.nii.gz') - ret = script_runner.run(['scil_labels_dilate.py', in_atlas, + ret = script_runner.run(['scil_labels_dilate', in_atlas, 'atlas_freesurfer_v2_single_brainstem_dil.nii.gz', '--processes', '1', '--distance', '2']) assert ret.success diff --git a/src/scilpy/cli/tests/test_labels_from_mask.py b/src/scilpy/cli/tests/test_labels_from_mask.py index 7b39378d2..bf11684e1 100644 --- a/src/scilpy/cli/tests/test_labels_from_mask.py +++ b/src/scilpy/cli/tests/test_labels_from_mask.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_labels_from_mask.py', '--help']) + ret = script_runner.run(['scil_labels_from_mask', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run(['scil_labels_from_mask.py', + ret = script_runner.run(['scil_labels_from_mask', in_mask, 'labels_from_mask.nii.gz', '--min_volume', '0', '-f']) assert ret.success @@ -33,7 +33,7 @@ def test_execution_labels(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run(['scil_labels_from_mask.py', + ret = script_runner.run(['scil_labels_from_mask', in_mask, 'labels_from_mask.nii.gz', '--labels', '4', '6', '-f']) assert ret.success @@ -44,7 +44,7 @@ def test_execution_background(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run(['scil_labels_from_mask.py', + ret = script_runner.run(['scil_labels_from_mask', in_mask, 'labels_from_mask.nii.gz', '--background_label', '9', '-f']) assert ret.success @@ -55,7 +55,7 @@ def test_execution_error(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run(['scil_labels_from_mask.py', + ret = script_runner.run(['scil_labels_from_mask', in_mask, 'labels_from_mask.nii.gz', '--labels', '1']) assert not ret.success @@ -66,7 +66,7 @@ def test_execution_warning(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run(['scil_labels_from_mask.py', + ret = script_runner.run(['scil_labels_from_mask', in_mask, 'labels_from_mask.nii.gz', '--labels', '1', '2', '3', '-f']) assert ret.success @@ -78,7 +78,7 @@ def test_execution_background_warning(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run(['scil_labels_from_mask.py', + ret = script_runner.run(['scil_labels_from_mask', in_mask, 'labels_from_mask.nii.gz', '--background_label', '1', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_labels_remove.py b/src/scilpy/cli/tests/test_labels_remove.py index 83e468e5a..32fdb1e43 100644 --- a/src/scilpy/cli/tests/test_labels_remove.py +++ b/src/scilpy/cli/tests/test_labels_remove.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_labels_remove.py', '--help']) + ret = script_runner.run(['scil_labels_remove', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run(['scil_labels_remove.py', in_atlas, + ret = script_runner.run(['scil_labels_remove', in_atlas, 'atlas_freesurfer_v2_no_brainstem.nii.gz', '-i', '173', '174', '175']) assert ret.success diff --git a/src/scilpy/cli/tests/test_labels_split_volume_by_ids.py b/src/scilpy/cli/tests/test_labels_split_volume_by_ids.py index 1dffb9cf4..950c69ed6 100644 --- a/src/scilpy/cli/tests/test_labels_split_volume_by_ids.py +++ b/src/scilpy/cli/tests/test_labels_split_volume_by_ids.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_labels_split_volume_by_ids.py', '--help']) + ret = script_runner.run(['scil_labels_split_volume_by_ids', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run(['scil_labels_split_volume_by_ids.py', in_atlas, + ret = script_runner.run(['scil_labels_split_volume_by_ids', in_atlas, '--out_prefix', 'brainstem', '-r', '173', '175']) assert ret.success diff --git a/src/scilpy/cli/tests/test_labels_split_volume_from_lut.py b/src/scilpy/cli/tests/test_labels_split_volume_from_lut.py index 96c5b0eea..a7c112bcd 100644 --- a/src/scilpy/cli/tests/test_labels_split_volume_from_lut.py +++ b/src/scilpy/cli/tests/test_labels_split_volume_from_lut.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_labels_split_volume_from_lut.py', '--help']) + ret = script_runner.run(['scil_labels_split_volume_from_lut', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_atlas(script_runner, monkeypatch): 'atlas_freesurfer_v2.nii.gz') in_json = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_LUT.json') - ret = script_runner.run(['scil_labels_split_volume_from_lut.py', in_atlas, + ret = script_runner.run(['scil_labels_split_volume_from_lut', in_atlas, '--out_prefix', 'brainstem', '--custom_lut', in_json]) assert ret.success diff --git a/src/scilpy/cli/tests/test_lesions_generate_nawm.py b/src/scilpy/cli/tests/test_lesions_generate_nawm.py index 2a2711db1..641a4dbed 100644 --- a/src/scilpy/cli/tests/test_lesions_generate_nawm.py +++ b/src/scilpy/cli/tests/test_lesions_generate_nawm.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_lesions_generate_nawm.py', '--help']) + ret = script_runner.run(['scil_lesions_generate_nawm', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_single_brainstem.nii.gz') - ret = script_runner.run(['scil_lesions_generate_nawm.py', in_atlas, + ret = script_runner.run(['scil_lesions_generate_nawm', in_atlas, 'nawm.nii.gz', '--nb_ring', '3', '--ring_thickness', '2']) assert ret.success diff --git a/src/scilpy/cli/tests/test_lesions_harmonize_labels.py b/src/scilpy/cli/tests/test_lesions_harmonize_labels.py index 0a6560a27..23e7016cf 100644 --- a/src/scilpy/cli/tests/test_lesions_harmonize_labels.py +++ b/src/scilpy/cli/tests/test_lesions_harmonize_labels.py @@ -13,14 +13,14 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_lesions_harmonize_labels.py', '--help']) + ret = script_runner.run(['scil_lesions_harmonize_labels', '--help']) assert ret.success def test_harmonize_label(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) t1 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T1_lesions_labels.nii.gz') t2 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T2_lesions_labels.nii.gz') - ret = script_runner.run(['scil_lesions_harmonize_labels.py', + ret = script_runner.run(['scil_lesions_harmonize_labels', t1, t2, 'test', '--max_adjacency', '5.0', '--min_voxel_overlap', '1', '-f']) assert ret.success @@ -30,7 +30,7 @@ def test_harmonize_label_incremental(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) t1 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T1_lesions_labels.nii.gz') t2 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T2_lesions_labels.nii.gz') - ret = script_runner.run(['scil_lesions_harmonize_labels.py', + ret = script_runner.run(['scil_lesions_harmonize_labels', t1, t2, 'test', '--max_adjacency', '5.0', '--min_voxel_overlap', '1', '--incremental_lesions', '-f']) diff --git a/src/scilpy/cli/tests/test_lesions_info.py b/src/scilpy/cli/tests/test_lesions_info.py index e2b0434d4..93d6e1188 100644 --- a/src/scilpy/cli/tests/test_lesions_info.py +++ b/src/scilpy/cli/tests/test_lesions_info.py @@ -2,5 +2,5 @@ # -*- coding: utf-8 -*- def test_help_option(script_runner): - ret = script_runner.run(['scil_lesions_info.py', '--help']) + ret = script_runner.run(['scil_lesions_info', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_mrds_metrics.py b/src/scilpy/cli/tests/test_mrds_metrics.py index f38e8cea2..315345eb7 100644 --- a/src/scilpy/cli/tests/test_mrds_metrics.py +++ b/src/scilpy/cli/tests/test_mrds_metrics.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_mrds_metrics.py', '--help']) + ret = script_runner.run(['scil_mrds_metrics', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_mrds_all_metrics(script_runner, monkeypatch): 'mrds', 'sub-01_MRDS_eigenvalues.nii.gz') # no option - ret = script_runner.run(['scil_mrds_metrics.py', + ret = script_runner.run(['scil_mrds_metrics', in_evals, '-f']) assert ret.success @@ -38,7 +38,7 @@ def test_execution_mrds_not_all_metrics(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'mrds', 'sub-01_mask.nii.gz') # no option - ret = script_runner.run(['scil_mrds_metrics.py', + ret = script_runner.run(['scil_mrds_metrics', in_evals, '--mask', in_mask, '--not_all', diff --git a/src/scilpy/cli/tests/test_mrds_select_number_of_tensors.py b/src/scilpy/cli/tests/test_mrds_select_number_of_tensors.py index 7fa14453b..815aaa833 100644 --- a/src/scilpy/cli/tests/test_mrds_select_number_of_tensors.py +++ b/src/scilpy/cli/tests/test_mrds_select_number_of_tensors.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_mrds_select_number_of_tensors.py', '--help']) + ret = script_runner.run(['scil_mrds_select_number_of_tensors', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_mrds(script_runner, monkeypatch): in_nufo = os.path.join(SCILPY_HOME, 'mrds', 'sub-01_nufo.nii.gz') # no option - ret = script_runner.run(['scil_mrds_select_number_of_tensors.py', + ret = script_runner.run(['scil_mrds_select_number_of_tensors', SCILPY_HOME + '/mrds/sub-01', in_nufo, '-f']) @@ -38,7 +38,7 @@ def test_execution_mrds_w_mask(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'mrds', 'sub-01_mask.nii.gz') - ret = script_runner.run(['scil_mrds_select_number_of_tensors.py', + ret = script_runner.run(['scil_mrds_select_number_of_tensors', SCILPY_HOME + '/mrds/sub-01', in_nufo, '--mask', in_mask, diff --git a/src/scilpy/cli/tests/test_mti_adjust_B1_header.py b/src/scilpy/cli/tests/test_mti_adjust_B1_header.py index 52d2abb74..872029a1c 100644 --- a/src/scilpy/cli/tests/test_mti_adjust_B1_header.py +++ b/src/scilpy/cli/tests/test_mti_adjust_B1_header.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_mti_adjust_B1_header.py', '--help']) + ret = script_runner.run(['scil_mti_adjust_B1_header', '--help']) assert ret.success @@ -26,6 +26,6 @@ def test_execution_ihMT_no_option(script_runner, monkeypatch): 'MT', 'sub-001_run-01_B1map.json') # no option - ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run(['scil_mti_adjust_B1_header', in_b1_map, tmp_dir.name, in_b1_json, '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_mti_maps_MT.py b/src/scilpy/cli/tests/test_mti_maps_MT.py index 1077e8bfa..4c3a840a6 100644 --- a/src/scilpy/cli/tests/test_mti_maps_MT.py +++ b/src/scilpy/cli/tests/test_mti_maps_MT.py @@ -58,7 +58,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_mti_maps_MT.py', '--help']) + ret = script_runner.run(['scil_mti_maps_MT', '--help']) assert ret.success @@ -66,7 +66,7 @@ def test_execution_MT_no_option(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # no option - ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -83,7 +83,7 @@ def test_execution_MT_prefix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --out_prefix - ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -101,7 +101,7 @@ def test_execution_MT_extended(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --extended - ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -119,7 +119,7 @@ def test_execution_MT_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --filtering - ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -139,11 +139,11 @@ def test_execution_MT_B1_map(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run(['scil_mti_adjust_B1_header', in_b1_map, out_b1_map, in_b1_json, '-f']) # --in_B1_map - ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -165,7 +165,7 @@ def test_execution_MT_wrong_echoes(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # Wrong number of echoes for negative - ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, @@ -184,7 +184,7 @@ def test_execution_MT_single_echoe(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # Single echoe - ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, '--in_positive', in_e1_mton, @@ -201,11 +201,11 @@ def test_execution_MT_B1_not_T1(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run(['scil_mti_adjust_B1_header', in_b1_map, out_b1_map, in_b1_json, '-f']) # B1 no T1 should raise warning. - ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, '--in_positive', in_e1_mton, @@ -223,11 +223,11 @@ def test_execution_MT_B1_no_fit(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run(['scil_mti_adjust_B1_header', in_b1_map, out_b1_map, in_b1_json, '-f']) # B1 model_based but no fit values - ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, '--in_positive', in_e1_mton, @@ -244,7 +244,7 @@ def test_execution_MT_acq_params(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # Acquisition parameters - ret = script_runner.run(['scil_mti_maps_MT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, '--mask', in_mask, '--in_mtoff_pd', in_e1_mtoff, '--in_positive', in_e1_mton, diff --git a/src/scilpy/cli/tests/test_mti_maps_ihMT.py b/src/scilpy/cli/tests/test_mti_maps_ihMT.py index 9876b2276..0029559eb 100644 --- a/src/scilpy/cli/tests/test_mti_maps_ihMT.py +++ b/src/scilpy/cli/tests/test_mti_maps_ihMT.py @@ -67,7 +67,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_mti_maps_ihMT.py', '--help']) + ret = script_runner.run(['scil_mti_maps_ihMT', '--help']) assert ret.success @@ -75,7 +75,7 @@ def test_execution_ihMT_no_option(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # no option - ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -97,7 +97,7 @@ def test_execution_ihMT_prefix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --out_prefix - ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -122,7 +122,7 @@ def test_execution_ihMT_extended(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --extended - ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -147,7 +147,7 @@ def test_execution_ihMT_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # --filtering - ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -173,10 +173,10 @@ def test_execution_ihMT_B1_map(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run(['scil_mti_adjust_B1_header', in_b1_map, out_b1_map, in_b1_json, '-f']) - ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -203,10 +203,10 @@ def test_execution_ihMT_B1_no_T1(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run(['scil_mti_adjust_B1_header', in_b1_map, out_b1_map, in_b1_json, '-f']) - ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -227,7 +227,7 @@ def test_execution_ihMT_B1_no_T1(script_runner, monkeypatch): def test_execution_ihMT_wrong_echoes(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -250,10 +250,10 @@ def test_execution_ihMT_B1_no_fit(script_runner, monkeypatch): out_b1_map = tmp_dir.name + '/B1map.nii.gz' # Temporary trick to have the B1 map with proper header. - ret = script_runner.run(['scil_mti_adjust_B1_header.py', in_b1_map, + ret = script_runner.run(['scil_mti_adjust_B1_header', in_b1_map, out_b1_map, in_b1_json, '-f']) - ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, in_e2_altnp, in_e3_altnp, @@ -277,7 +277,7 @@ def test_execution_ihMT_B1_no_fit(script_runner, monkeypatch): def test_execution_ihMT_single_echo(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, '--in_altpn', in_e1_altpn, @@ -294,7 +294,7 @@ def test_execution_ihMT_single_echo(script_runner, monkeypatch): def test_execution_ihMT_acq_params(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_mti_maps_ihMT.py', tmp_dir.name, + ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, '--mask', in_mask, '--in_altnp', in_e1_altnp, '--in_altpn', in_e1_altpn, diff --git a/src/scilpy/cli/tests/test_plot_stats_per_point.py b/src/scilpy/cli/tests/test_plot_stats_per_point.py index 9e6bc54a8..0d2516822 100644 --- a/src/scilpy/cli/tests/test_plot_stats_per_point.py +++ b/src/scilpy/cli/tests/test_plot_stats_per_point.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_plot_stats_per_point.py', '--help']) + ret = script_runner.run(['scil_plot_stats_per_point', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_json = os.path.join(SCILPY_HOME, 'tractometry', 'metric_label.json') - ret = script_runner.run(['scil_plot_stats_per_point.py', in_json, + ret = script_runner.run(['scil_plot_stats_per_point', in_json, 'out/', '--stats_over_population']) assert ret.success diff --git a/src/scilpy/cli/tests/test_qball_metrics.py b/src/scilpy/cli/tests/test_qball_metrics.py index 38da046c2..4fcc07da2 100644 --- a/src/scilpy/cli/tests/test_qball_metrics.py +++ b/src/scilpy/cli/tests/test_qball_metrics.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_qball_metrics.py', '--help']) + ret = script_runner.run(['scil_qball_metrics', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_processing(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run(['scil_qball_metrics.py', in_dwi, + ret = script_runner.run(['scil_qball_metrics', in_dwi, in_bval, in_bvec]) assert ret.success @@ -37,12 +37,12 @@ def test_execution_not_all(script_runner, monkeypatch): '1000.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') - ret = script_runner.run(['scil_qball_metrics.py', in_dwi, + ret = script_runner.run(['scil_qball_metrics', in_dwi, in_bval, in_bvec, "--not_all", "--sh", "2.nii.gz"]) assert ret.success # Test wrong b0. Current minimal b-val is 5. - ret = script_runner.run(['scil_qball_metrics.py', in_dwi, + ret = script_runner.run(['scil_qball_metrics', in_dwi, in_bval, in_bvec, "--not_all", "--sh", "2.nii.gz", '--b0_threshold', '1', '-f']) assert not ret.success diff --git a/src/scilpy/cli/tests/test_rgb_convert.py b/src/scilpy/cli/tests/test_rgb_convert.py index c85f214c0..a56afbe2d 100644 --- a/src/scilpy/cli/tests/test_rgb_convert.py +++ b/src/scilpy/cli/tests/test_rgb_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_rgb_convert.py', '--help']) + ret = script_runner.run(['scil_rgb_convert', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'rgb.nii.gz') - ret = script_runner.run(['scil_rgb_convert.py', + ret = script_runner.run(['scil_rgb_convert', in_img, 'rgb_4D.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_search_keywords.py b/src/scilpy/cli/tests/test_search_keywords.py index d9edfa778..3050e3912 100644 --- a/src/scilpy/cli/tests/test_search_keywords.py +++ b/src/scilpy/cli/tests/test_search_keywords.py @@ -3,21 +3,21 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_search_keywords.py', '--help']) + ret = script_runner.run(['scil_search_keywords', '--help']) assert ret.success def test_search_category(script_runner): - ret = script_runner.run(['scil_search_keywords.py', '--search_category', 'sh']) + ret = script_runner.run(['scil_search_keywords', '--search_category', 'sh']) assert 'Available objects:' in ret.stdout def test_no_synonyms(script_runner): - ret = script_runner.run(['scil_search_keywords.py', 'sh', '--no_synonyms']) + ret = script_runner.run(['scil_search_keywords', 'sh', '--no_synonyms']) assert ret.success def test_not_found(script_runner): - ret = script_runner.run(['scil_search_keywords.py', 'toto']) + ret = script_runner.run(['scil_search_keywords', 'toto']) assert ret.success assert 'No results found!' in ret.stdout or 'No results found!' in ret.stderr diff --git a/src/scilpy/cli/tests/test_sh_convert.py b/src/scilpy/cli/tests/test_sh_convert.py index 4fb9f4371..852b172e7 100644 --- a/src/scilpy/cli/tests/test_sh_convert.py +++ b/src/scilpy/cli/tests/test_sh_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_sh_convert.py', '--help']) + ret = script_runner.run(['scil_sh_convert', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf.nii.gz') - ret = script_runner.run(['scil_sh_convert.py', in_fodf, + ret = script_runner.run(['scil_sh_convert', in_fodf, 'fodf_descoteaux07.nii.gz', 'tournier07', 'descoteaux07_legacy', '--processes', '1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_sh_fusion.py b/src/scilpy/cli/tests/test_sh_fusion.py index 536dbfa93..b1f157245 100644 --- a/src/scilpy/cli/tests/test_sh_fusion.py +++ b/src/scilpy/cli/tests/test_sh_fusion.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_sh_fusion.py', '--help']) + ret = script_runner.run(['scil_sh_fusion', '--help']) assert ret.success @@ -23,5 +23,5 @@ def test_execution_processing(script_runner, monkeypatch): 'sh_1000.nii.gz') in_sh_2 = os.path.join(SCILPY_HOME, 'processing', 'sh_3000.nii.gz') - ret = script_runner.run(['scil_sh_fusion.py', in_sh_1, in_sh_2, 'sh.nii.gz']) + ret = script_runner.run(['scil_sh_fusion', in_sh_1, in_sh_2, 'sh.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_sh_to_aodf.py b/src/scilpy/cli/tests/test_sh_to_aodf.py index 188229961..360644c86 100644 --- a/src/scilpy/cli/tests/test_sh_to_aodf.py +++ b/src/scilpy/cli/tests/test_sh_to_aodf.py @@ -17,7 +17,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_sh_to_aodf.py', '--help']) + ret = script_runner.run(['scil_sh_to_aodf', '--help']) assert ret.success @@ -28,7 +28,7 @@ def test_help_option(script_runner): def test_asym_basis_output_gpu(script_runner, in_fodf, expected_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_sh_to_aodf.py', + ret = script_runner.run(['scil_sh_to_aodf', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', '--sigma_align', '0.8', @@ -64,7 +64,7 @@ def test_asym_basis_output_gpu(script_runner, in_fodf, expected_fodf, monkeypatc def test_asym_basis_output(script_runner, in_fodf, expected_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_sh_to_aodf.py', + ret = script_runner.run(['scil_sh_to_aodf', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', '--sigma_align', '0.8', @@ -91,7 +91,7 @@ def test_asym_basis_output(script_runner, in_fodf, expected_fodf, monkeypatch): def test_asym_input(script_runner, in_fodf, expected_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_sh_to_aodf.py', + ret = script_runner.run(['scil_sh_to_aodf', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', '--sigma_align', '0.8', @@ -117,7 +117,7 @@ def test_asym_input(script_runner, in_fodf, expected_fodf, monkeypatch): def test_cosine_method(script_runner, in_fodf, out_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_sh_to_aodf.py', + ret = script_runner.run(['scil_sh_to_aodf', in_fodf, 'out_fodf1.nii.gz', '--sphere', 'repulsion100', '--method', 'cosine', '-f', diff --git a/src/scilpy/cli/tests/test_sh_to_rish.py b/src/scilpy/cli/tests/test_sh_to_rish.py index 469a4ea74..98ebe0b0e 100644 --- a/src/scilpy/cli/tests/test_sh_to_rish.py +++ b/src/scilpy/cli/tests/test_sh_to_rish.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_sh_to_rish.py', '--help']) + ret = script_runner.run(['scil_sh_to_rish', '--help']) assert ret.success @@ -21,5 +21,5 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sh = os.path.join(SCILPY_HOME, 'processing', 'sh.nii.gz') - ret = script_runner.run(['scil_sh_to_rish.py', in_sh, 'rish.nii.gz']) + ret = script_runner.run(['scil_sh_to_rish', in_sh, 'rish.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_sh_to_sf.py b/src/scilpy/cli/tests/test_sh_to_sf.py index adeb30760..6c60bf267 100644 --- a/src/scilpy/cli/tests/test_sh_to_sf.py +++ b/src/scilpy/cli/tests/test_sh_to_sf.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_sh_to_sf.py', '--help']) + ret = script_runner.run(['scil_sh_to_sf', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_in_sphere(script_runner, monkeypatch): in_bval = os.path.join(SCILPY_HOME, 'processing', '1000.bval') # Required: either --sphere or --in_bvec. Here, --sphere - ret = script_runner.run(['scil_sh_to_sf.py', in_sh, + ret = script_runner.run(['scil_sh_to_sf', in_sh, 'sf_724.nii.gz', '--in_bval', in_bval, '--in_b0', in_b0, '--out_bval', 'sf_724.bval', '--out_bvec', 'sf_724.bvec', @@ -40,7 +40,7 @@ def test_execution_in_bvec(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') # --in_bvec: in_bval is required. - ret = script_runner.run(['scil_sh_to_sf.py', in_sh, + ret = script_runner.run(['scil_sh_to_sf', in_sh, 'sf_724.nii.gz', '--in_bval', in_bval, '--out_bval', 'sf_724.bval', '--out_bvec', 'sf_724.bvec', @@ -49,7 +49,7 @@ def test_execution_in_bvec(script_runner, monkeypatch): assert ret.success # Test that fails if no bvals is given. - ret = script_runner.run(['scil_sh_to_sf.py', in_sh, + ret = script_runner.run(['scil_sh_to_sf', in_sh, 'sf_724.nii.gz', '--out_bvec', 'sf_724.bvec', '--in_bvec', in_bvec, '--dtype', 'float32', '-f', @@ -64,7 +64,7 @@ def test_execution_no_bval(script_runner, monkeypatch): # --sphere but no --bval # Testing multiprocessing option - ret = script_runner.run(['scil_sh_to_sf.py', in_sh, + ret = script_runner.run(['scil_sh_to_sf', in_sh, 'sf_724.nii.gz', '--in_b0', in_b0, '--out_bvec', 'sf_724.bvec', '--b0_scaling', '--sphere', 'symmetric724', '--dtype', 'float32', diff --git a/src/scilpy/cli/tests/test_stats_group_comparison.py b/src/scilpy/cli/tests/test_stats_group_comparison.py index 4ccb475f9..e226e1553 100644 --- a/src/scilpy/cli/tests/test_stats_group_comparison.py +++ b/src/scilpy/cli/tests/test_stats_group_comparison.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run([ - 'scil_stats_group_comparison.py', + 'scil_stats_group_comparison', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_bundles(script_runner, monkeypatch): in_participants = os.path.join(SCILPY_HOME, 'stats/group', 'meanstd_all.json') - ret = script_runner.run(['scil_stats_group_comparison.py', + ret = script_runner.run(['scil_stats_group_comparison', in_participants, in_json, 'Group', '-b', 'AF_L', '-m', 'FIT_FW', diff --git a/src/scilpy/cli/tests/test_surface_apply_transform.py b/src/scilpy/cli/tests/test_surface_apply_transform.py index 49182c9d1..4e2c9a424 100644 --- a/src/scilpy/cli/tests/test_surface_apply_transform.py +++ b/src/scilpy/cli/tests/test_surface_apply_transform.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_surface_apply_transform.py', '--help']) + ret = script_runner.run(['scil_surface_apply_transform', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): 'lhpialt.vtk') in_aff = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'affine.txt') - ret = script_runner.run(['scil_surface_apply_transform.py', in_surf, + ret = script_runner.run(['scil_surface_apply_transform', in_surf, in_aff, 'lhpialt_lin.vtk', '--inverse']) assert ret.success diff --git a/src/scilpy/cli/tests/test_surface_convert.py b/src/scilpy/cli/tests/test_surface_convert.py index 8e2ddbcae..90ae6c252 100644 --- a/src/scilpy/cli/tests/test_surface_convert.py +++ b/src/scilpy/cli/tests/test_surface_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_surface_convert.py', '--help']) + ret = script_runner.run(['scil_surface_convert', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lhpialt.vtk') - ret = script_runner.run(['scil_surface_convert.py', in_surf, + ret = script_runner.run(['scil_surface_convert', in_surf, 'rhpialt.ply']) assert ret.success @@ -31,7 +31,7 @@ def test_execution_surface_vtk_xfrom(script_runner, monkeypatch): in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lh.pialt_xform') ref = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') - ret = script_runner.run(['scil_surface_convert.py', in_surf, + ret = script_runner.run(['scil_surface_convert', in_surf, 'lh.pialt_xform.vtk', '--reference', ref, '--flip_axes', '-1', '-1', '1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_surface_create.py b/src/scilpy/cli/tests/test_surface_create.py index 6b08168c3..532d09986 100644 --- a/src/scilpy/cli/tests/test_surface_create.py +++ b/src/scilpy/cli/tests/test_surface_create.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_surface_create.py', '--help']) + ret = script_runner.run(['scil_surface_create', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_atlas(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run(['scil_surface_create.py', + ret = script_runner.run(['scil_surface_create', '--in_labels', in_atlas, 'surface.vtk', '--list_indices', '2024:2035 1024', @@ -39,7 +39,7 @@ def test_execution_atlas_each_index(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run(['scil_surface_create.py', + ret = script_runner.run(['scil_surface_create', '--in_labels', in_atlas, 'surface.vtk', '--each_index', @@ -57,7 +57,7 @@ def test_execution_atlas_no_index(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') - ret = script_runner.run(['scil_surface_create.py', + ret = script_runner.run(['scil_surface_create', '--in_labels', in_atlas, 'surface.vtk', '--fill', @@ -73,7 +73,7 @@ def test_execution_mask(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_mask = os.path.join(SCILPY_HOME, 'atlas', 'brainstem_bin.nii.gz') - ret = script_runner.run(['scil_surface_create.py', + ret = script_runner.run(['scil_surface_create', '--in_mask', in_mask, 'surface.vtk', '-f']) assert ret.success @@ -83,7 +83,7 @@ def test_execution_volume(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_t1 = os.path.join(SCILPY_HOME, 'others', 't1.nii.gz') - ret = script_runner.run(['scil_surface_create.py', + ret = script_runner.run(['scil_surface_create', '--in_volume', in_t1, '--value', '0.2', 'surface.vtk', '-f']) diff --git a/src/scilpy/cli/tests/test_surface_flip.py b/src/scilpy/cli/tests/test_surface_flip.py index 0b8880827..760b9376a 100644 --- a/src/scilpy/cli/tests/test_surface_flip.py +++ b/src/scilpy/cli/tests/test_surface_flip.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_surface_flip.py', '--help']) + ret = script_runner.run(['scil_surface_flip', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lhpialt.vtk') - ret = script_runner.run(['scil_surface_flip.py', in_surf, 'rhpialt.vtk', + ret = script_runner.run(['scil_surface_flip', in_surf, 'rhpialt.vtk', 'x']) assert ret.success diff --git a/src/scilpy/cli/tests/test_surface_smooth.py b/src/scilpy/cli/tests/test_surface_smooth.py index 3b79d4717..7da429eb6 100644 --- a/src/scilpy/cli/tests/test_surface_smooth.py +++ b/src/scilpy/cli/tests/test_surface_smooth.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_surface_smooth.py', '--help']) + ret = script_runner.run(['scil_surface_smooth', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lhpialt.vtk') - ret = script_runner.run(['scil_surface_smooth.py', in_surf, + ret = script_runner.run(['scil_surface_smooth', in_surf, 'lhpialt_smooth.vtk', '-n', '5', '-s', '1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tracking_local.py b/src/scilpy/cli/tests/test_tracking_local.py index fafd8760d..704ce42ca 100644 --- a/src/scilpy/cli/tests/test_tracking_local.py +++ b/src/scilpy/cli/tests/test_tracking_local.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tracking_local.py', '--help']) + ret = script_runner.run(['scil_tracking_local', '--help']) assert ret.success @@ -26,7 +26,7 @@ def test_execution_tracking_fodf_prob(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'local_prob.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200']) @@ -38,7 +38,7 @@ def test_execution_tracking_fodf_det(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'local_det.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -51,7 +51,7 @@ def test_execution_tracking_ptt(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'local_ptt.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -64,7 +64,7 @@ def test_execution_sphere_subdivide(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'local_sphere.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', @@ -78,7 +78,7 @@ def test_execution_sphere_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'sphere_gpu.trk', '--use_gpu', '--sphere', 'symmetric362', '--npv', '1']) @@ -91,7 +91,7 @@ def test_sh_interp_without_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'nearest_interp.trk', '--sh_interp', 'nearest', '--nt', '100']) @@ -103,7 +103,7 @@ def test_forward_without_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'fwd_only.trk', '--forward_only', '--nt', '100']) @@ -115,7 +115,7 @@ def test_batch_size_without_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'batch.trk', '--batch_size', 100]) @@ -127,7 +127,7 @@ def test_algo_with_gpu(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'gpu_det.trk', '--algo', 'det', '--use_gpu', '--nt', '100']) @@ -139,7 +139,7 @@ def test_execution_tracking_fodf_no_compression(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'local_prob2.trk', '--nt', '100', '--sh_basis', 'descoteaux07', '--max_length', '200']) @@ -151,7 +151,7 @@ def test_execution_tracking_peaks(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_peaks = os.path.join(SCILPY_HOME, 'tracking', 'peaks.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_peaks, + ret = script_runner.run(['scil_tracking_local', in_peaks, in_mask, in_mask, 'local_eudx.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -164,7 +164,7 @@ def test_execution_tracking_fodf_prob_pmf_mapping(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'local_prob3.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -177,7 +177,7 @@ def test_execution_tracking_ptt_with_probe(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'local_ptt.trk', '--nt', '100', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -195,7 +195,7 @@ def test_execution_tracking_fodf_custom_seeds(script_runner, monkeypatch): custom_seeds = [[1., 1., 1.], [2., 2., 2.], [3., 3., 3.]] np.save(in_custom_seeds, custom_seeds) - ret = script_runner.run(['scil_tracking_local.py', in_fodf, + ret = script_runner.run(['scil_tracking_local', in_fodf, in_mask, in_mask, 'local_prob4.trk', '--in_custom_seeds', in_custom_seeds, '--compress', '0.1', '--sh_basis', 'descoteaux07', diff --git a/src/scilpy/cli/tests/test_tracking_local_dev.py b/src/scilpy/cli/tests/test_tracking_local_dev.py index 460fdd139..d955e21a3 100644 --- a/src/scilpy/cli/tests/test_tracking_local_dev.py +++ b/src/scilpy/cli/tests/test_tracking_local_dev.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tracking_local_dev.py', + ret = script_runner.run(['scil_tracking_local_dev', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_tracking_fodf(script_runner, monkeypatch): 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local_dev.py', in_fodf, + ret = script_runner.run(['scil_tracking_local_dev', in_fodf, in_mask, in_mask, 'local_prob.trk', '--nt', '10', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -44,7 +44,7 @@ def test_execution_tracking_rap(script_runner, monkeypatch): in_rap_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_local_dev.py', in_fodf, + ret = script_runner.run(['scil_tracking_local_dev', in_fodf, in_mask, in_mask, 'local_prob_rap.trk', '--nt', '10', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', '--max_length', '200', @@ -67,7 +67,7 @@ def test_execution_tracking_fodf_custom_seeds(script_runner, monkeypatch): custom_seeds = [[1., 1., 1.], [2., 2., 2.], [3., 3., 3.]] np.save(in_custom_seeds, custom_seeds) - ret = script_runner.run(['scil_tracking_local_dev.py', in_fodf, + ret = script_runner.run(['scil_tracking_local_dev', in_fodf, in_mask, in_mask, 'local_prob2.trk', '--in_custom_seeds', in_custom_seeds, '--compress', '0.1', '--sh_basis', 'descoteaux07', diff --git a/src/scilpy/cli/tests/test_tracking_pft.py b/src/scilpy/cli/tests/test_tracking_pft.py index d2e221212..0d7e4bc51 100644 --- a/src/scilpy/cli/tests/test_tracking_pft.py +++ b/src/scilpy/cli/tests/test_tracking_pft.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tracking_pft.py', + ret = script_runner.run(['scil_tracking_pft', '--help']) assert ret.success @@ -28,7 +28,7 @@ def test_execution_tracking(script_runner, monkeypatch): 'map_include.nii.gz') in_exclude = os.path.join(SCILPY_HOME, 'tracking', 'map_exclude.nii.gz') - ret = script_runner.run(['scil_tracking_pft.py', in_fodf, + ret = script_runner.run(['scil_tracking_pft', in_fodf, in_interface, in_include, in_exclude, 'pft.trk', '--nt', '1000', '--compress', '0.1', '--sh_basis', 'descoteaux07', '--min_length', '20', diff --git a/src/scilpy/cli/tests/test_tracking_pft_maps.py b/src/scilpy/cli/tests/test_tracking_pft_maps.py index 49def8ad9..8a9e840cf 100644 --- a/src/scilpy/cli/tests/test_tracking_pft_maps.py +++ b/src/scilpy/cli/tests/test_tracking_pft_maps.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tracking_pft_maps.py', + ret = script_runner.run(['scil_tracking_pft_maps', '--help']) assert ret.success @@ -26,6 +26,6 @@ def test_execution_tracking(script_runner, monkeypatch): 'map_gm.nii.gz') in_csf = os.path.join(SCILPY_HOME, 'tracking', 'map_csf.nii.gz') - ret = script_runner.run(['scil_tracking_pft_maps.py', + ret = script_runner.run(['scil_tracking_pft_maps', in_wm, in_gm, in_csf]) assert ret.success diff --git a/src/scilpy/cli/tests/test_tracking_pft_maps_edit.py b/src/scilpy/cli/tests/test_tracking_pft_maps_edit.py index c092e666c..a2ecece3f 100644 --- a/src/scilpy/cli/tests/test_tracking_pft_maps_edit.py +++ b/src/scilpy/cli/tests/test_tracking_pft_maps_edit.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tracking_pft_maps_edit.py', '--help']) + ret = script_runner.run(['scil_tracking_pft_maps_edit', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_tracking(script_runner, monkeypatch): 'map_exclude.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') - ret = script_runner.run(['scil_tracking_pft_maps_edit.py', + ret = script_runner.run(['scil_tracking_pft_maps_edit', in_include, in_exclude, in_mask, 'map_include_corr.nii.gz', 'map_exclude_corr.nii.gz']) diff --git a/src/scilpy/cli/tests/test_tractogram_apply_transform.py b/src/scilpy/cli/tests/test_tractogram_apply_transform.py index 354778587..1861169fc 100644 --- a/src/scilpy/cli/tests/test_tractogram_apply_transform.py +++ b/src/scilpy/cli/tests/test_tractogram_apply_transform.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_apply_transform.py', '--help']) + ret = script_runner.run(['scil_tractogram_apply_transform', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_inverse(script_runner, monkeypatch): in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') in_warp = os.path.join(SCILPY_HOME, 'bst', 'output1InverseWarp.nii.gz') - ret = script_runner.run(['scil_tractogram_apply_transform.py', + ret = script_runner.run(['scil_tractogram_apply_transform', in_model, in_fa, in_aff, 'rpt_m_warp.trk', '--inverse', '--in_deformation', in_warp, '--cut']) diff --git a/src/scilpy/cli/tests/test_tractogram_apply_transform_to_hdf5.py b/src/scilpy/cli/tests/test_tractogram_apply_transform_to_hdf5.py index af34790d1..f4e0e9848 100644 --- a/src/scilpy/cli/tests/test_tractogram_apply_transform_to_hdf5.py +++ b/src/scilpy/cli/tests/test_tractogram_apply_transform_to_hdf5.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_apply_transform_to_hdf5.py', + ret = script_runner.run(['scil_tractogram_apply_transform_to_hdf5', '--help']) assert ret.success @@ -28,6 +28,6 @@ def test_execution_connectivity(script_runner, monkeypatch): # toDo. Add a --in_deformation file in our test data, fitting with hdf5. # (See test_tractogram_apply_transform) # toDo. Add some dps in the hdf5's data for more line coverage. - ret = script_runner.run(['scil_tractogram_apply_transform_to_hdf5.py', + ret = script_runner.run(['scil_tractogram_apply_transform_to_hdf5', in_h5, in_target, in_transfo, 'decompose_lin.h5']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py b/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py index 96aa5215d..bb49d9af6 100644 --- a/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py +++ b/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py @@ -18,7 +18,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_assign_custom_color.py', + ret = script_runner.run(['scil_tractogram_assign_custom_color', '--help']) assert ret.success @@ -28,7 +28,7 @@ def test_execution_from_anat(script_runner, monkeypatch): in_anat = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run(['scil_tractogram_assign_custom_color.py', + ret = script_runner.run(['scil_tractogram_assign_custom_color', in_bundle, 'colored.trk', '--from_anatomy', in_anat, '--out_colorbar', 'test_colorbar.png']) assert ret.success @@ -37,7 +37,7 @@ def test_execution_from_anat(script_runner, monkeypatch): def test_execution_along_profile(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_assign_custom_color.py', + ret = script_runner.run(['scil_tractogram_assign_custom_color', in_bundle, 'colored2.trk', '--along_profile']) assert ret.success @@ -45,7 +45,7 @@ def test_execution_along_profile(script_runner, monkeypatch): def test_execution_from_angle(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_assign_custom_color.py', + ret = script_runner.run(['scil_tractogram_assign_custom_color', in_bundle, 'colored3.trk', '--local_angle']) assert ret.success @@ -53,7 +53,7 @@ def test_execution_from_angle(script_runner, monkeypatch): def test_execution_ambiant_occlusion(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_assign_custom_color.py', + ret = script_runner.run(['scil_tractogram_assign_custom_color', in_bundle, 'colored4.trk', '--local_orientation', '--ambiant_occlusion']) assert ret.success \ No newline at end of file diff --git a/src/scilpy/cli/tests/test_tractogram_assign_uniform_color.py b/src/scilpy/cli/tests/test_tractogram_assign_uniform_color.py index 172e7efc9..8a445dfab 100644 --- a/src/scilpy/cli/tests/test_tractogram_assign_uniform_color.py +++ b/src/scilpy/cli/tests/test_tractogram_assign_uniform_color.py @@ -16,7 +16,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_assign_uniform_color.py', + ret = script_runner.run(['scil_tractogram_assign_uniform_color', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_help_option(script_runner): def test_execution_fill(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_assign_uniform_color.py', + ret = script_runner.run(['scil_tractogram_assign_uniform_color', in_bundle, '--fill_color', '0x000000', '--out_tractogram', 'colored.trk', '-f']) assert ret.success @@ -39,7 +39,7 @@ def test_execution_dict(script_runner, monkeypatch): with open(json_file, "w+") as f: json.dump(my_dict, f) - ret = script_runner.run(['scil_tractogram_assign_uniform_color.py', + ret = script_runner.run(['scil_tractogram_assign_uniform_color', in_bundle, '--dict_colors', json_file, '--out_suffix', 'colored', '-f']) assert ret.success @@ -54,7 +54,7 @@ def test_execution_dict_new_color(script_runner, monkeypatch): json.dump(my_dict, f) shutil.copy2(in_bundle, 'dummy.trk') - ret = script_runner.run(['scil_tractogram_assign_uniform_color.py', + ret = script_runner.run(['scil_tractogram_assign_uniform_color', in_bundle, "dummy.trk", '--dict_colors', json_file, '--out_suffix', 'colored', '-f']) diff --git a/src/scilpy/cli/tests/test_tractogram_commit.py b/src/scilpy/cli/tests/test_tractogram_commit.py index 0c6ed2a74..6cd2e626b 100644 --- a/src/scilpy/cli/tests/test_tractogram_commit.py +++ b/src/scilpy/cli/tests/test_tractogram_commit.py @@ -20,7 +20,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_commit.py', '--help']) + ret = script_runner.run(['scil_tractogram_commit', '--help']) assert ret.success @@ -29,7 +29,7 @@ def test_execution_commit_amico(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run([ - 'scil_tractogram_commit.py', in_tracking, in_dwi, in_bval, in_bvec, + 'scil_tractogram_commit', in_tracking, in_dwi, in_bval, in_bvec, 'results_bzs/', '--tol', '30', '--nbr_dir', '500', '--nbr_iter', '500', '--in_peaks', in_peaks, '--in_tracking_mask', in_mask, @@ -45,7 +45,7 @@ def test_execution_commit2(script_runner, monkeypatch): # TODO Add a HDF5 in our test data that could be used here. ret = script_runner.run([ - 'scil_tractogram_commit.py', in_tracking, in_dwi, in_bval, in_bvec, + 'scil_tractogram_commit', in_tracking, in_dwi, in_bval, in_bvec, 'results_bzs/', '--tol', '30', '--nbr_dir', '500', '--nbr_iter', '500', '--in_peaks', in_peaks, '--in_tracking_mask', in_mask, diff --git a/src/scilpy/cli/tests/test_tractogram_compress.py b/src/scilpy/cli/tests/test_tractogram_compress.py index 771c9be36..1274a174d 100644 --- a/src/scilpy/cli/tests/test_tractogram_compress.py +++ b/src/scilpy/cli/tests/test_tractogram_compress.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_compress.py', '--help']) + ret = script_runner.run(['scil_tractogram_compress', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fib = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'gyri_fanning.trk') - ret = script_runner.run(['scil_tractogram_compress.py', in_fib, + ret = script_runner.run(['scil_tractogram_compress', in_fib, 'gyri_fanning_c.trk', '-e', '0.1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_compute_TODI.py b/src/scilpy/cli/tests/test_tractogram_compute_TODI.py index 55f371977..8f72df9b9 100644 --- a/src/scilpy/cli/tests/test_tractogram_compute_TODI.py +++ b/src/scilpy/cli/tests/test_tractogram_compute_TODI.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_compute_TODI.py', '--help']) + ret = script_runner.run(['scil_tractogram_compute_TODI', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_bst(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'bst', 'rpt_m_warp.trk') in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') - ret = script_runner.run(['scil_tractogram_compute_TODI.py', in_bundle, + ret = script_runner.run(['scil_tractogram_compute_TODI', in_bundle, '--mask', in_mask, '--out_mask', 'todi_mask.nii.gz', '--out_tdi', 'tdi.nii.gz', @@ -37,7 +37,7 @@ def test_execution_bst(script_runner, monkeypatch): def test_execution_asym(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'bst', 'rpt_m_warp.trk') - ret = script_runner.run(['scil_tractogram_compute_TODI.py', in_bundle, + ret = script_runner.run(['scil_tractogram_compute_TODI', in_bundle, '--out_todi_sh', 'atodi_sh_8.nii.gz', '--asymmetric', '--n_steps', '2']) diff --git a/src/scilpy/cli/tests/test_tractogram_compute_density_map.py b/src/scilpy/cli/tests/test_tractogram_compute_density_map.py index b871f1b1c..84938776d 100644 --- a/src/scilpy/cli/tests/test_tractogram_compute_density_map.py +++ b/src/scilpy/cli/tests/test_tractogram_compute_density_map.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_compute_density_map.py', + ret = script_runner.run(['scil_tractogram_compute_density_map', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_help_option(script_runner): def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'others', 'IFGWM.trk') - ret = script_runner.run(['scil_tractogram_compute_density_map.py', + ret = script_runner.run(['scil_tractogram_compute_density_map', in_bundle, 'binary.nii.gz', '--endpoints_only']) assert ret.success @@ -29,6 +29,6 @@ def test_execution_others(script_runner, monkeypatch): def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') - ret = script_runner.run(['scil_tractogram_compute_density_map.py', + ret = script_runner.run(['scil_tractogram_compute_density_map', in_bundle, 'IFGWM.nii.gz', '--binary']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_convert.py b/src/scilpy/cli/tests/test_tractogram_convert.py index cbeb6bb5e..6805bc535 100644 --- a/src/scilpy/cli/tests/test_tractogram_convert.py +++ b/src/scilpy/cli/tests/test_tractogram_convert.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_convert.py', '--help']) + ret = script_runner.run(['scil_tractogram_convert', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): 'gyri_fanning.fib') in_fa = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') - ret = script_runner.run(['scil_tractogram_convert.py', in_fib, + ret = script_runner.run(['scil_tractogram_convert', in_fib, 'gyri_fanning.trk', '--reference', in_fa]) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_convert_hdf5_to_trk.py b/src/scilpy/cli/tests/test_tractogram_convert_hdf5_to_trk.py index 312eb7a72..f29fb4e08 100644 --- a/src/scilpy/cli/tests/test_tractogram_convert_hdf5_to_trk.py +++ b/src/scilpy/cli/tests/test_tractogram_convert_hdf5_to_trk.py @@ -14,13 +14,13 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk.py', '--help']) + ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk', '--help']) assert ret.success def test_execution_all_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk.py', + ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk', in_h5, 'save_trk/']) assert ret.success @@ -31,7 +31,7 @@ def test_execution_all_keys(script_runner, monkeypatch): def test_execution_edge_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk.py', + ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk', in_h5, 'save_trk2/', '--edge_keys', '1_10', '1_7']) assert ret.success @@ -42,7 +42,7 @@ def test_execution_edge_keys(script_runner, monkeypatch): def test_execution_node_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk.py', + ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk', in_h5, 'save_trk3/', '--node_keys', '7']) assert ret.success @@ -58,7 +58,7 @@ def test_execution_save_empty(script_runner, monkeypatch): # connections. with open('labels_list.txt', 'w') as f: f.write('1\n10\n100') - ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk.py', + ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk', in_h5, 'save_trk4/', '--save_empty', 'labels_list.txt', '--edge_keys', '1_10', '1_100', diff --git a/src/scilpy/cli/tests/test_tractogram_convert_trk_to_hdf5.py b/src/scilpy/cli/tests/test_tractogram_convert_trk_to_hdf5.py index 9a38f2b24..9089b01d3 100644 --- a/src/scilpy/cli/tests/test_tractogram_convert_trk_to_hdf5.py +++ b/src/scilpy/cli/tests/test_tractogram_convert_trk_to_hdf5.py @@ -18,13 +18,13 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_convert_trk_to_hdf5.py', '--help']) + ret = script_runner.run(['scil_tractogram_convert_trk_to_hdf5', '--help']) assert ret.success def test_execution_edge_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk.py', + ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk', in_h5, 'save_trk/', '--edge_keys', '1_10', '1_7']) assert ret.success @@ -32,7 +32,7 @@ def test_execution_edge_keys(script_runner, monkeypatch): out_files = glob.glob('save_trk/*') assert len(out_files) == 2 - ret = script_runner.run(['scil_tractogram_convert_trk_to_hdf5.py', + ret = script_runner.run(['scil_tractogram_convert_trk_to_hdf5', 'save_trk/1_10.trk', 'save_trk/1_7.trk', 'two_edges.h5', '--stored_space', 'voxmm', diff --git a/src/scilpy/cli/tests/test_tractogram_count_streamlines.py b/src/scilpy/cli/tests/test_tractogram_count_streamlines.py index 9561ba614..65e34c204 100644 --- a/src/scilpy/cli/tests/test_tractogram_count_streamlines.py +++ b/src/scilpy/cli/tests/test_tractogram_count_streamlines.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_count_streamlines.py', '--help']) + ret = script_runner.run(['scil_tractogram_count_streamlines', '--help']) assert ret.success @@ -21,5 +21,5 @@ def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'others', 'IFGWM_sub.trk') - ret = script_runner.run(['scil_tractogram_count_streamlines.py', in_bundle]) + ret = script_runner.run(['scil_tractogram_count_streamlines', in_bundle]) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_cut_streamlines.py b/src/scilpy/cli/tests/test_tractogram_cut_streamlines.py index 349c27810..79ff265f1 100644 --- a/src/scilpy/cli/tests/test_tractogram_cut_streamlines.py +++ b/src/scilpy/cli/tests/test_tractogram_cut_streamlines.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution(script_runner, monkeypatch): in_tractogram = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') in_mask = os.path.join(SCILPY_HOME, 'filtering', 'mask.nii.gz') - ret = script_runner.run(['scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines', in_tractogram, 'out_tractogram_cut.trk', '--mask', in_mask, '--min_length', '0', '-f', '--reference', in_mask, @@ -40,7 +40,7 @@ def test_execution_two_rois(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run(['scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines', in_tractogram, '--mask', in_mask, 'out_tractogram_cut.trk', '-f', '--mask', in_mask, '--min_length', '0', @@ -57,7 +57,7 @@ def test_execution_keep_longest(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run(['scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines', in_tractogram, '--mask', in_mask, 'out_tractogram_cut.trk', '-f', '--keep_longest', '--mask', in_mask, @@ -75,7 +75,7 @@ def test_execution_trim_endpoints(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run(['scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines', in_tractogram, '--mask', in_mask, 'out_tractogram_cut.trk', '-f', '--trim_endpoints', '--mask', in_mask, @@ -91,7 +91,7 @@ def test_execution_labels(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run(['scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines', in_tractogram, '--labels', in_labels, 'out_tractogram_cut.trk', '-f', '--label_ids', '1', '10', @@ -105,7 +105,7 @@ def test_execution_labels_error_trim(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run(['scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines', in_tractogram, '--labels', in_labels, 'out_tractogram_cut2.trk', '-f', '--label_ids', '1', '10', @@ -120,7 +120,7 @@ def test_execution_labels_no_point(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run(['scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines', in_tractogram, '--labels', in_labels, 'out_tractogram_cut.trk', '-f', '--no_point_in_roi', '--label_ids', '1', '10']) @@ -133,7 +133,7 @@ def test_execution_labels_one_point(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') - ret = script_runner.run(['scil_tractogram_cut_streamlines.py', + ret = script_runner.run(['scil_tractogram_cut_streamlines', in_tractogram, '--labels', in_labels, 'out_tractogram_cut.trk', '-f', '--one_point_in_roi', '--label_ids', '1', '10']) diff --git a/src/scilpy/cli/tests/test_tractogram_detect_loops.py b/src/scilpy/cli/tests/test_tractogram_detect_loops.py index 1ab6e583a..042e41685 100644 --- a/src/scilpy/cli/tests/test_tractogram_detect_loops.py +++ b/src/scilpy/cli/tests/test_tractogram_detect_loops.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_detect_loops.py', '--help']) + ret = script_runner.run(['scil_tractogram_detect_loops', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4_filtered.trk') - ret = script_runner.run(['scil_tractogram_detect_loops.py', + ret = script_runner.run(['scil_tractogram_detect_loops', in_bundle, 'bundle_4_filtered_no_loops.trk', '--looping_tractogram', 'bundle_4_filtered_loops.trk', diff --git a/src/scilpy/cli/tests/test_tractogram_dpp_math.py b/src/scilpy/cli/tests/test_tractogram_dpp_math.py index bc2ed2ccb..a3be13000 100644 --- a/src/scilpy/cli/tests/test_tractogram_dpp_math.py +++ b/src/scilpy/cli/tests/test_tractogram_dpp_math.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_dpp_math.py', '--help']) + ret = script_runner.run(['scil_tractogram_dpp_math', '--help']) assert ret.success @@ -26,12 +26,12 @@ def test_execution_tractogram_point_math_mean_3D_defaults(script_runner, t1_on_bundle = 't1_on_streamlines.trk' # Create some dpp. Could have test data with dpp instead. - script_runner.run(['scil_tractogram_project_map_to_streamlines.py', + script_runner.run(['scil_tractogram_project_map_to_streamlines', in_bundle, t1_on_bundle, '--in_maps', in_t1, '--out_dpp_name', 't1']) # Test dps mode - ret = script_runner.run(['scil_tractogram_dpp_math.py', + ret = script_runner.run(['scil_tractogram_dpp_math', 'mean', t1_on_bundle, 't1_mean_on_streamlines.trk', '--mode', 'dps', '--in_dpp_name', 't1', '--out_keys', 't1_mean']) @@ -39,7 +39,7 @@ def test_execution_tractogram_point_math_mean_3D_defaults(script_runner, assert ret.success # Test dpp mode - ret = script_runner.run(['scil_tractogram_dpp_math.py', + ret = script_runner.run(['scil_tractogram_dpp_math', 'mean', t1_on_bundle, 't1_mean_on_streamlines2.trk', '--mode', 'dpp', '--in_dpp_name', 't1', @@ -55,12 +55,12 @@ def test_execution_tractogram_point_math_mean_4D_correlation(script_runner, in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') fodf_on_bundle = 'fodf_on_streamlines.trk' - script_runner.run(['scil_tractogram_project_map_to_streamlines.py', + script_runner.run(['scil_tractogram_project_map_to_streamlines', in_bundle, fodf_on_bundle, '--in_maps', in_fodf, in_fodf, '--out_dpp_name', 'fodf', 'fodf2']) - ret = script_runner.run(['scil_tractogram_dpp_math.py', + ret = script_runner.run(['scil_tractogram_dpp_math', 'correlation', fodf_on_bundle, 'fodf_correlation_on_streamlines.trk', '--mode', 'dps', '--endpoints_only', diff --git a/src/scilpy/cli/tests/test_tractogram_dps_math.py b/src/scilpy/cli/tests/test_tractogram_dps_math.py index abc73464f..cfd68bab5 100644 --- a/src/scilpy/cli/tests/test_tractogram_dps_math.py +++ b/src/scilpy/cli/tests/test_tractogram_dps_math.py @@ -16,7 +16,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math', '--help']) assert ret.success @@ -29,7 +29,7 @@ def test_execution_dps_math_import(script_runner, monkeypatch): filename = 'vals.npy' outname = 'out.trk' np.save(filename, np.arange(len(sft))) - ret = script_runner.run(['scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math', in_bundle, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname, @@ -43,7 +43,7 @@ def test_execution_dps_math_import_single_value(script_runner, in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') outname = 'out.trk' - ret = script_runner.run(['scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math', in_bundle, 'import', 'key', '--in_dps_single_value', '42', '--out_tractogram', outname, @@ -57,7 +57,7 @@ def test_execution_dps_math_import_single_value_array(script_runner, in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') outname = 'out.trk' - ret = script_runner.run(['scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math', in_bundle, 'import', 'key', '--in_dps_single_value', '1', '1.1', '1.2', '--out_tractogram', outname, @@ -74,7 +74,7 @@ def test_execution_dps_math_import_with_missing_vals(script_runner, filename = 'vals.npy' outname = 'out.trk' np.save(filename, np.arange(len(sft) - 10)) - ret = script_runner.run(['scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math', in_bundle, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname, @@ -92,13 +92,13 @@ def test_execution_dps_math_import_with_existing_key(script_runner, outname = 'out.trk' outname2 = 'out_2.trk' np.save(filename, np.arange(len(sft))) - ret = script_runner.run(['scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math', in_bundle, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname, '-f']) assert ret.success - ret = script_runner.run(['scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math', outname, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname2,]) @@ -113,7 +113,7 @@ def test_execution_dps_math_tck_output(script_runner, monkeypatch): filename = 'vals.npy' outname = 'out.tck' np.save(filename, np.arange(len(sft))) - ret = script_runner.run(['scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math', in_bundle, 'import', 'key', '--in_dps_file', filename, '--out_tractogram', outname, @@ -132,7 +132,7 @@ def test_execution_dps_math_delete(script_runner, monkeypatch): } save_tractogram(sft, in_bundle) outname = 'out.trk' - ret = script_runner.run(['scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math', in_bundle, 'delete', 'key', '--out_tractogram', outname, '-f']) @@ -144,7 +144,7 @@ def test_execution_dps_math_delete_no_key(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') outname = 'out.trk' - ret = script_runner.run(['scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math', in_bundle, 'delete', 'key', '--out_tractogram', outname, '-f']) @@ -162,7 +162,7 @@ def test_execution_dps_math_export(script_runner, monkeypatch): } save_tractogram(sft, in_bundle) filename = 'out.txt' - ret = script_runner.run(['scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math', in_bundle, 'export', 'key', '--out_dps_file', filename, '-f']) @@ -174,7 +174,7 @@ def test_execution_dps_math_export_no_key(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') filename = 'out.txt' - ret = script_runner.run(['scil_tractogram_dps_math.py', + ret = script_runner.run(['scil_tractogram_dps_math', in_bundle, 'export', 'key', '--out_dps_file', filename, '-f']) diff --git a/src/scilpy/cli/tests/test_tractogram_extract_ushape.py b/src/scilpy/cli/tests/test_tractogram_extract_ushape.py index 85890cf98..4ced0bd96 100644 --- a/src/scilpy/cli/tests/test_tractogram_extract_ushape.py +++ b/src/scilpy/cli/tests/test_tractogram_extract_ushape.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_extract_ushape.py', + ret = script_runner.run(['scil_tractogram_extract_ushape', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_processing(script_runner, monkeypatch): in_trk = os.path.join(SCILPY_HOME, 'tracking', 'union.trk') out_trk = 'ushape.trk' remaining_trk = 'remaining.trk' - ret = script_runner.run(['scil_tractogram_extract_ushape.py', + ret = script_runner.run(['scil_tractogram_extract_ushape', in_trk, out_trk, '--minU', '0.5', '--maxU', '1', diff --git a/src/scilpy/cli/tests/test_tractogram_filter_by_anatomy.py b/src/scilpy/cli/tests/test_tractogram_filter_by_anatomy.py index c3253df0a..aa884c163 100644 --- a/src/scilpy/cli/tests/test_tractogram_filter_by_anatomy.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_by_anatomy.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_filter_by_anatomy.py', + ret = script_runner.run(['scil_tractogram_filter_by_anatomy', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_filtering_all_options(script_runner, monkeypatch): 'tractogram_filter_ana.trk') in_wmparc = os.path.join(SCILPY_HOME, 'anatomical_filtering', 'wmparc_filter_ana.nii.gz') - ret = script_runner.run(['scil_tractogram_filter_by_anatomy.py', + ret = script_runner.run(['scil_tractogram_filter_by_anatomy', in_tractogram, in_wmparc, os.path.expanduser(tmp_dir.name), '--minL', '40', '--maxL', '200', '--angle', '300', @@ -43,7 +43,7 @@ def test_execution_filtering_rejected(script_runner, monkeypatch): 'tractogram_filter_ana.trk') in_wmparc = os.path.join(SCILPY_HOME, 'anatomical_filtering', 'wmparc_filter_ana.nii.gz') - ret = script_runner.run(['scil_tractogram_filter_by_anatomy.py', + ret = script_runner.run(['scil_tractogram_filter_by_anatomy', in_tractogram, in_wmparc, os.path.expanduser(tmp_dir.name), '--minL', '40', '--maxL', '200', '--angle', '300', @@ -61,7 +61,7 @@ def test_execution_filtering_save_intermediate(script_runner, monkeypatch): 'tractogram_filter_ana.trk') in_wmparc = os.path.join(SCILPY_HOME, 'anatomical_filtering', 'wmparc_filter_ana.nii.gz') - ret = script_runner.run(['scil_tractogram_filter_by_anatomy.py', + ret = script_runner.run(['scil_tractogram_filter_by_anatomy', in_tractogram, in_wmparc, os.path.expanduser(tmp_dir.name), '--minL', '40', '--maxL', '200', '--angle', '300', diff --git a/src/scilpy/cli/tests/test_tractogram_filter_by_length.py b/src/scilpy/cli/tests/test_tractogram_filter_by_length.py index f3659ccd5..6eacf99ae 100644 --- a/src/scilpy/cli/tests/test_tractogram_filter_by_length.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_by_length.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_filter_by_length.py', + ret = script_runner.run(['scil_tractogram_filter_by_length', '--help']) assert ret.success @@ -26,7 +26,7 @@ def test_execution_filtering(script_runner, monkeypatch): # script execution. in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') - ret = script_runner.run(['scil_tractogram_filter_by_length.py', + ret = script_runner.run(['scil_tractogram_filter_by_length', in_bundle, 'bundle_4_filtered.trk', '--minL', '125', '--maxL', '130']) @@ -40,7 +40,7 @@ def test_rejected_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') - ret = script_runner.run(['scil_tractogram_filter_by_length.py', + ret = script_runner.run(['scil_tractogram_filter_by_length', in_bundle, 'bundle_all_1mm_filtered.trk', '--minL', '125', '--maxL', '130', '--out_rejected', 'bundle_all_1mm_rejected.trk']) @@ -59,7 +59,7 @@ def test_rejected_filtering_no_rejection(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') - ret = script_runner.run(['scil_tractogram_filter_by_length.py', + ret = script_runner.run(['scil_tractogram_filter_by_length', in_bundle, 'bundle_4_filtered_no_rejection.trk', '--minL', '125', '--maxL', '130', '--out_rejected', 'bundle_4_rejected.trk']) diff --git a/src/scilpy/cli/tests/test_tractogram_filter_by_orientation.py b/src/scilpy/cli/tests/test_tractogram_filter_by_orientation.py index 95ed81247..a61f01f47 100644 --- a/src/scilpy/cli/tests/test_tractogram_filter_by_orientation.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_by_orientation.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_filter_by_orientation.py', + ret = script_runner.run(['scil_tractogram_filter_by_orientation', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') - ret = script_runner.run(['scil_tractogram_filter_by_orientation.py', + ret = script_runner.run(['scil_tractogram_filter_by_orientation', in_bundle, 'bundle_4_filtered.trk', '--min_x', '20', '--max_y', '230', '--min_z', '30', '--use_abs']) diff --git a/src/scilpy/cli/tests/test_tractogram_filter_by_roi.py b/src/scilpy/cli/tests/test_tractogram_filter_by_roi.py index 742abd341..253baec9d 100644 --- a/src/scilpy/cli/tests/test_tractogram_filter_by_roi.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_by_roi.py @@ -19,14 +19,14 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_filter_by_roi.py', '--help']) + ret = script_runner.run(['scil_tractogram_filter_by_roi', '--help']) assert ret.success def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_filter_by_roi.py', in_tractogram, + ret = script_runner.run(['scil_tractogram_filter_by_roi', in_tractogram, 'bundle_1.trk', '--display_counts', '--drawn_roi', in_roi, 'any', 'include', '--bdo', in_bdo, 'any', 'include', @@ -40,7 +40,7 @@ def test_execution_filtering(script_runner, monkeypatch): def test_execution_filtering_overwrite_distance(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_filter_by_roi.py', in_tractogram, + ret = script_runner.run(['scil_tractogram_filter_by_roi', in_tractogram, 'bundle_2.trk', '--display_counts', '--drawn_roi', in_roi, 'any', 'include', '2', '--overwrite_distance', 'any', 'include', '4']) @@ -57,7 +57,7 @@ def test_execution_filtering_list(script_runner, monkeypatch): f.write('bdo {} "any" "include"\n'.format(in_bdo)) f.write("bdo {} 'any' include".format(in_bdo)) - ret = script_runner.run(['scil_tractogram_filter_by_roi.py', in_tractogram, + ret = script_runner.run(['scil_tractogram_filter_by_roi', in_tractogram, 'bundle_3.trk', '--display_counts', '--filtering_list', filelist]) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_filter_collisions.py b/src/scilpy/cli/tests/test_tractogram_filter_collisions.py index a5004f3b9..51d17a9cd 100644 --- a/src/scilpy/cli/tests/test_tractogram_filter_collisions.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_collisions.py @@ -33,7 +33,7 @@ def init_data(): def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_filter_collisions.py', '--help']) + ret = script_runner.run(['scil_tractogram_filter_collisions', '--help']) assert ret.success @@ -44,7 +44,7 @@ def test_execution_filtering(script_runner, monkeypatch): diameters = [5, 1] np.savetxt('diameters.txt', diameters) - ret = script_runner.run(['scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '-f']) assert ret.success @@ -57,7 +57,7 @@ def test_execution_filtering_out_colliding_prefix(script_runner, monkeypatch): diameters = [5, 1] np.savetxt('diameters.txt', diameters) - ret = script_runner.run(['scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '--out_colliding_prefix', 'tractogram', '-f']) assert ret.success @@ -70,7 +70,7 @@ def test_execution_filtering_single_diameter(script_runner, monkeypatch): diameters = [5] np.savetxt('diameters.txt', diameters) - ret = script_runner.run(['scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '-f']) assert ret.success @@ -83,7 +83,7 @@ def test_execution_filtering_no_shuffle(script_runner, monkeypatch): diameters = [5, 1] np.savetxt('diameters.txt', diameters) - ret = script_runner.run(['scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '--disable_shuffling', '-f']) assert ret.success @@ -96,7 +96,7 @@ def test_execution_filtering_min_distance(script_runner, monkeypatch): diameters = [0.001, 0.001] np.savetxt('diameters.txt', diameters) - ret = script_runner.run(['scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '--min_distance', '5', '-f']) assert ret.success @@ -110,7 +110,7 @@ def test_execution_filtering_metrics(script_runner, monkeypatch): diameters = [0.001, 0.001] np.savetxt('diameters.txt', diameters) - ret = script_runner.run(['scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '--out_metrics', 'metrics.json', '-f']) assert ret.success @@ -124,7 +124,7 @@ def test_execution_rotation_matrix(script_runner, monkeypatch): diameters = [0.001, 0.001] np.savetxt('diameters.txt', diameters) - ret = script_runner.run(['scil_tractogram_filter_collisions.py', + ret = script_runner.run(['scil_tractogram_filter_collisions', 'tractogram.trk', 'diameters.txt', 'clean.trk', '--out_rotation_matrix', 'rotation.mat', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_flip.py b/src/scilpy/cli/tests/test_tractogram_flip.py index f994a5df5..0bd9da27f 100644 --- a/src/scilpy/cli/tests/test_tractogram_flip.py +++ b/src/scilpy/cli/tests/test_tractogram_flip.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_flip.py', '--help']) + ret = script_runner.run(['scil_tractogram_flip', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): 'gyri_fanning.fib') in_fa = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') - ret = script_runner.run(['scil_tractogram_flip.py', in_fib, + ret = script_runner.run(['scil_tractogram_flip', in_fib, 'gyri_fanning.tck', 'x', '--reference', in_fa]) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_math.py b/src/scilpy/cli/tests/test_tractogram_math.py index 3f41771c8..c53138dd1 100644 --- a/src/scilpy/cli/tests/test_tractogram_math.py +++ b/src/scilpy/cli/tests/test_tractogram_math.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_math.py', '--help']) + ret = script_runner.run(['scil_tractogram_math', '--help']) assert ret.success @@ -22,7 +22,7 @@ def test_execution_lazy_concatenate_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'lazy_concatenate', + ret = script_runner.run(['scil_tractogram_math', 'lazy_concatenate', in_tracto_1, in_tracto_2, 'lazy_concatenate.trk']) assert ret.success @@ -32,7 +32,7 @@ def test_execution_lazy_concatenate_mix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'lazy_concatenate', + ret = script_runner.run(['scil_tractogram_math', 'lazy_concatenate', in_tracto_1, in_tracto_2, 'lazy_concatenate_mix.trk']) assert ret.success @@ -42,7 +42,7 @@ def test_execution_union_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'union', + ret = script_runner.run(['scil_tractogram_math', 'union', in_tracto_1, in_tracto_2, 'union.trk']) assert ret.success @@ -51,7 +51,7 @@ def test_execution_intersection_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'intersection', + ret = script_runner.run(['scil_tractogram_math', 'intersection', in_tracto_1, in_tracto_2, 'intersection.trk']) assert ret.success @@ -60,7 +60,7 @@ def test_execution_difference_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'difference', + ret = script_runner.run(['scil_tractogram_math', 'difference', in_tracto_1, in_tracto_2, 'difference.trk']) assert ret.success @@ -69,7 +69,7 @@ def test_execution_concatenate_no_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'concatenate', + ret = script_runner.run(['scil_tractogram_math', 'concatenate', in_tracto_1, in_tracto_2, 'concatenate.trk']) assert ret.success @@ -78,7 +78,7 @@ def test_execution_union_no_color_robust(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'union', + ret = script_runner.run(['scil_tractogram_math', 'union', in_tracto_1, in_tracto_2, 'union_r.trk', '--robust']) assert ret.success @@ -88,7 +88,7 @@ def test_execution_intersection_no_color_robust(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'intersection', + ret = script_runner.run(['scil_tractogram_math', 'intersection', in_tracto_1, in_tracto_2, 'intersection_r.trk', '--robust']) assert ret.success @@ -98,7 +98,7 @@ def test_execution_difference_no_color_robust(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'difference', + ret = script_runner.run(['scil_tractogram_math', 'difference', in_tracto_1, in_tracto_2, 'difference_r.trk', '--robust']) assert ret.success @@ -108,7 +108,7 @@ def test_execution_union_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'union', + ret = script_runner.run(['scil_tractogram_math', 'union', in_tracto_1, in_tracto_2, 'union_color.trk']) assert ret.success @@ -117,7 +117,7 @@ def test_execution_intersection_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'intersection', + ret = script_runner.run(['scil_tractogram_math', 'intersection', in_tracto_1, in_tracto_2, 'intersection_color.trk']) assert ret.success @@ -126,7 +126,7 @@ def test_execution_difference_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'difference', + ret = script_runner.run(['scil_tractogram_math', 'difference', in_tracto_1, in_tracto_2, 'difference_color.trk']) assert ret.success @@ -135,7 +135,7 @@ def test_execution_concatenate_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'concatenate', + ret = script_runner.run(['scil_tractogram_math', 'concatenate', in_tracto_1, in_tracto_2, 'concatenate_color.trk']) assert ret.success @@ -145,7 +145,7 @@ def test_execution_union_mix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'union', + ret = script_runner.run(['scil_tractogram_math', 'union', in_tracto_1, in_tracto_2, 'union_mix.trk']) assert not ret.success @@ -154,7 +154,7 @@ def test_execution_intersection_mix_fake(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'intersection', + ret = script_runner.run(['scil_tractogram_math', 'intersection', in_tracto_1, in_tracto_2, 'intersection_mix.trk', '--fake_metadata']) assert ret.success @@ -164,7 +164,7 @@ def test_execution_difference_empty_result(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundle_0.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'difference', + ret = script_runner.run(['scil_tractogram_math', 'difference', in_tracto_1, in_tracto_2, 'difference_empty_results.trk', '--no_metadata']) assert ret.success @@ -174,7 +174,7 @@ def test_execution_difference_empty_input_1(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'empty.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'difference', + ret = script_runner.run(['scil_tractogram_math', 'difference', in_tracto_1, in_tracto_2, 'difference_empty_1.trk', '--no_metadata']) assert ret.success @@ -184,7 +184,7 @@ def test_execution_difference_empty_input_2(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto_1 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') in_tracto_2 = os.path.join(trk_path, 'empty.trk') - ret = script_runner.run(['scil_tractogram_math.py', 'difference', + ret = script_runner.run(['scil_tractogram_math', 'difference', in_tracto_1, in_tracto_2, 'difference_empty_2.trk', '--no_metadata']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_pairwise_comparison.py b/src/scilpy/cli/tests/test_tractogram_pairwise_comparison.py index 7367be292..10e8c02e8 100644 --- a/src/scilpy/cli/tests/test_tractogram_pairwise_comparison.py +++ b/src/scilpy/cli/tests/test_tractogram_pairwise_comparison.py @@ -17,13 +17,13 @@ def test_help_option(script_runner): ret = script_runner.run([ - 'scil_tractogram_pairwise_comparison.py', '--help']) + 'scil_tractogram_pairwise_comparison', '--help']) assert ret.success def test_execution_bundles_skip(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_pairwise_comparison.py', + ret = script_runner.run(['scil_tractogram_pairwise_comparison', in_1, in_2, '--out_dir', tmp_dir.name, '--reference', in_ref, '--skip_streamlines_distance']) @@ -32,7 +32,7 @@ def test_execution_bundles_skip(script_runner, monkeypatch): def test_execution_bundles(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_pairwise_comparison.py', + ret = script_runner.run(['scil_tractogram_pairwise_comparison', in_1, in_2, '--out_dir', tmp_dir.name, '--reference', in_ref, '-f', '--skip_streamlines_distance']) diff --git a/src/scilpy/cli/tests/test_tractogram_print_info.py b/src/scilpy/cli/tests/test_tractogram_print_info.py index 02d7a0c59..248fcb509 100644 --- a/src/scilpy/cli/tests/test_tractogram_print_info.py +++ b/src/scilpy/cli/tests/test_tractogram_print_info.py @@ -13,12 +13,12 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_print_info.py', '--help']) + ret = script_runner.run(['scil_tractogram_print_info', '--help']) assert ret.success def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') - ret = script_runner.run(['scil_tractogram_print_info.py', in_bundle]) + ret = script_runner.run(['scil_tractogram_print_info', in_bundle]) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_project_map_to_streamlines.py b/src/scilpy/cli/tests/test_tractogram_project_map_to_streamlines.py index dcc67cac5..df8099291 100644 --- a/src/scilpy/cli/tests/test_tractogram_project_map_to_streamlines.py +++ b/src/scilpy/cli/tests/test_tractogram_project_map_to_streamlines.py @@ -18,14 +18,14 @@ def test_help_option(script_runner): ret = script_runner.run([ - 'scil_tractogram_project_map_to_streamlines.py', '--help']) + 'scil_tractogram_project_map_to_streamlines', '--help']) assert ret.success def test_execution_3D_map(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run(['scil_tractogram_project_map_to_streamlines', in_tracto_1, 't1_on_streamlines.trk', '--in_maps', in_3d_map, '--out_dpp_name', 't1']) @@ -35,7 +35,7 @@ def test_execution_3D_map(script_runner, monkeypatch): def test_execution_4D_map(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run(['scil_tractogram_project_map_to_streamlines', in_tracto_1, 'rgb_on_streamlines.trk', '--in_maps', in_4d_map, '--out_dpp_name', 'rgb']) @@ -45,7 +45,7 @@ def test_execution_4D_map(script_runner, monkeypatch): def test_execution_3D_map_endpoints_only(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run(['scil_tractogram_project_map_to_streamlines', in_tracto_1, 't1_on_streamlines_endpoints.trk', '--in_maps', in_3d_map, @@ -57,7 +57,7 @@ def test_execution_3D_map_endpoints_only(script_runner, monkeypatch): def test_execution_4D_map_endpoints_only(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run(['scil_tractogram_project_map_to_streamlines', in_tracto_1, 'rgb_on_streamlines_endpoints.trk', '--in_maps', in_4d_map, @@ -69,7 +69,7 @@ def test_execution_4D_map_endpoints_only(script_runner, monkeypatch): def test_execution_3D_map_trilinear(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_project_map_to_streamlines.py', + ret = script_runner.run(['scil_tractogram_project_map_to_streamlines', in_tracto_1, 't1_on_streamlines_trilinear.trk', '--in_maps', in_3d_map, diff --git a/src/scilpy/cli/tests/test_tractogram_project_streamlines_to_map.py b/src/scilpy/cli/tests/test_tractogram_project_streamlines_to_map.py index 8c1b484f5..0f7269733 100644 --- a/src/scilpy/cli/tests/test_tractogram_project_streamlines_to_map.py +++ b/src/scilpy/cli/tests/test_tractogram_project_streamlines_to_map.py @@ -16,7 +16,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run(['scil_tractogram_project_streamlines_to_map', '--help']) assert ret.success @@ -29,24 +29,24 @@ def test_execution_dpp(script_runner, monkeypatch): # Create our test data with dpp: add metrics as dpp. # Or get a tractogram that already as some dpp in the test data. - script_runner.run(['scil_tractogram_project_map_to_streamlines.py', + script_runner.run(['scil_tractogram_project_map_to_streamlines', in_bundle, in_bundle_with_dpp, '-f', '--in_maps', in_mni, '--out_dpp_name', 'some_metric']) # Tests with dpp. - ret = script_runner.run(['scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run(['scil_tractogram_project_streamlines_to_map', in_bundle_with_dpp, 'project_dpp_', '--use_dpp', 'some_metric', '--point_by_point', '--to_endpoints']) assert ret.success - ret = script_runner.run(['scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run(['scil_tractogram_project_streamlines_to_map', in_bundle_with_dpp, 'project_mean_to_endpoints_', '--use_dpp', 'some_metric', '--mean_streamline', '--to_endpoints']) assert ret.success - ret = script_runner.run(['scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run(['scil_tractogram_project_streamlines_to_map', in_bundle_with_dpp, 'project_end_to_wm', '--use_dpp', 'some_metric', '--mean_endpoints', '--to_wm']) @@ -62,16 +62,16 @@ def test_execution_dps(script_runner, monkeypatch): # Create our test data with dps: add metrics as dps. # Or get a tractogram that already as some dps in the test data. - script_runner.run(['scil_tractogram_project_map_to_streamlines.py', + script_runner.run(['scil_tractogram_project_map_to_streamlines', in_bundle, in_bundle_with_dpp, '-f', '--in_maps', in_mni, '--out_dpp_name', 'some_metric']) - script_runner.run(['scil_tractogram_dpp_math.py', 'min', in_bundle_with_dpp, + script_runner.run(['scil_tractogram_dpp_math', 'min', in_bundle_with_dpp, in_bundle_with_dps, '--in_dpp_name', 'some_metric', '--out_keys', 'some_metric_dps', '--mode', 'dps', '--keep_all']) # Tests with dps. - ret = script_runner.run(['scil_tractogram_project_streamlines_to_map.py', + ret = script_runner.run(['scil_tractogram_project_streamlines_to_map', in_bundle_with_dps, 'project_dps_', '--use_dps', 'some_metric_dps', '--point_by_point', '--to_wm']) diff --git a/src/scilpy/cli/tests/test_tractogram_qbx.py b/src/scilpy/cli/tests/test_tractogram_qbx.py index 733bdebb2..b1e11cfc4 100644 --- a/src/scilpy/cli/tests/test_tractogram_qbx.py +++ b/src/scilpy/cli/tests/test_tractogram_qbx.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_qbx.py', '--help']) + ret = script_runner.run(['scil_tractogram_qbx', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') - ret = script_runner.run(['scil_tractogram_qbx.py', in_bundle, '12', + ret = script_runner.run(['scil_tractogram_qbx', in_bundle, '12', 'clusters/', '--out_centroids', 'centroids.trk']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_register.py b/src/scilpy/cli/tests/test_tractogram_register.py index 66fd86928..46fd8d47e 100644 --- a/src/scilpy/cli/tests/test_tractogram_register.py +++ b/src/scilpy/cli/tests/test_tractogram_register.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_register.py', '--help']) + ret = script_runner.run(['scil_tractogram_register', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_bundles(script_runner, monkeypatch): 'bundle_0.trk') in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') - ret = script_runner.run(['scil_tractogram_register.py', in_moving, + ret = script_runner.run(['scil_tractogram_register', in_moving, in_static, '--only_rigid', '--moving_tractogram_ref', in_ref]) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_remove_invalid.py b/src/scilpy/cli/tests/test_tractogram_remove_invalid.py index c6ba32c38..40e293740 100644 --- a/src/scilpy/cli/tests/test_tractogram_remove_invalid.py +++ b/src/scilpy/cli/tests/test_tractogram_remove_invalid.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_remove_invalid.py', '--help']) + ret = script_runner.run(['scil_tractogram_remove_invalid', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_bundles(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tractogram = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.trk') - ret = script_runner.run(['scil_tractogram_remove_invalid.py', + ret = script_runner.run(['scil_tractogram_remove_invalid', in_tractogram, 'bundle_all_1mm.trk', '--cut', '--remove_overlapping', '--remove_single', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_resample.py b/src/scilpy/cli/tests/test_tractogram_resample.py index 55b8c338f..72b2691ad 100644 --- a/src/scilpy/cli/tests/test_tractogram_resample.py +++ b/src/scilpy/cli/tests/test_tractogram_resample.py @@ -16,18 +16,18 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_resample.py', '--help']) + ret = script_runner.run(['scil_tractogram_resample', '--help']) assert ret.success def test_execution_downsample(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_tractogram_resample.py', in_tracto, + ret = script_runner.run(['scil_tractogram_resample', in_tracto, '500', 'union_shuffle_sub_downsampled.trk']) assert ret.success - ret = script_runner.run(['scil_tractogram_resample.py', in_tracto, + ret = script_runner.run(['scil_tractogram_resample', in_tracto, '200', 'union_shuffle_sub_downsampled.trk', '-f', '--downsample_per_cluster']) assert ret.success @@ -37,7 +37,7 @@ def test_execution_upsample_noise(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # point-wise only - ret = script_runner.run(['scil_tractogram_resample.py', in_tracto, + ret = script_runner.run(['scil_tractogram_resample', in_tracto, '2000', 'union_shuffle_sub_upsampled.trk', '-f', '--point_wise_std', '0.5']) assert ret.success @@ -47,13 +47,13 @@ def test_execution_upsample_ptt(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) # ptt only - ret = script_runner.run(['scil_tractogram_resample.py', in_tracto, + ret = script_runner.run(['scil_tractogram_resample', in_tracto, '500', 'union_shuffle_sub_upsampled.trk', '-f', '--tube_radius', '5']) assert ret.success # both upsampling methods - ret = script_runner.run(['scil_tractogram_resample.py', in_tracto, + ret = script_runner.run(['scil_tractogram_resample', in_tracto, '500', 'union_shuffle_sub_upsampled.trk', '-f', '--point_wise_std', '10', '--tube_radius', '5']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_resample_nb_points.py b/src/scilpy/cli/tests/test_tractogram_resample_nb_points.py index 6d92c4907..cf9b04655 100644 --- a/src/scilpy/cli/tests/test_tractogram_resample_nb_points.py +++ b/src/scilpy/cli/tests/test_tractogram_resample_nb_points.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_resample_nb_points.py', '--help']) + ret = script_runner.run(['scil_tractogram_resample_nb_points', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni_c.trk') - ret = script_runner.run(['scil_tractogram_resample_nb_points.py', + ret = script_runner.run(['scil_tractogram_resample_nb_points', in_bundle, 'IFGWM_uni_c_10.trk', '--nb_pts_per_streamline', '10']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_seed_density_map.py b/src/scilpy/cli/tests/test_tractogram_seed_density_map.py index f6aa993e2..da49a4ec1 100644 --- a/src/scilpy/cli/tests/test_tractogram_seed_density_map.py +++ b/src/scilpy/cli/tests/test_tractogram_seed_density_map.py @@ -13,13 +13,13 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_seed_density_map.py', '--help']) + ret = script_runner.run(['scil_tractogram_seed_density_map', '--help']) assert ret.success def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracking = os.path.join(SCILPY_HOME, 'processing', 'tracking.trk') - ret = script_runner.run(['scil_tractogram_seed_density_map.py', in_tracking, + ret = script_runner.run(['scil_tractogram_seed_density_map', in_tracking, 'seeds_density.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_segment_connections_from_labels.py b/src/scilpy/cli/tests/test_tractogram_segment_connections_from_labels.py index e618204e9..d4a3e21e0 100644 --- a/src/scilpy/cli/tests/test_tractogram_segment_connections_from_labels.py +++ b/src/scilpy/cli/tests/test_tractogram_segment_connections_from_labels.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run([ - 'scil_tractogram_segment_connections_from_labels.py', '--help']) + 'scil_tractogram_segment_connections_from_labels', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_connectivity(script_runner, monkeypatch): in_atlas = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') ret = script_runner.run([ - 'scil_tractogram_segment_connections_from_labels.py', in_bundle, + 'scil_tractogram_segment_connections_from_labels', in_bundle, in_atlas, 'decompose.h5', '--min_length', '20', '--max_length', '200', '--outlier_threshold', '0.5', '--loop_max_angle', '330', '--curv_qb_distance', '10', '--processes', '1', '-v', 'DEBUG', diff --git a/src/scilpy/cli/tests/test_tractogram_segment_with_ROI_and_score.py b/src/scilpy/cli/tests/test_tractogram_segment_with_ROI_and_score.py index ad5136487..10884e79d 100644 --- a/src/scilpy/cli/tests/test_tractogram_segment_with_ROI_and_score.py +++ b/src/scilpy/cli/tests/test_tractogram_segment_with_ROI_and_score.py @@ -11,7 +11,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_segment_with_ROI_and_score.py', + ret = script_runner.run(['scil_tractogram_segment_with_ROI_and_score', '--help']) assert ret.success @@ -35,7 +35,7 @@ def test_score_bundles(script_runner, monkeypatch): with open(os.path.join("config_file.json"), "w") as f: json.dump(json_contents, f) - ret = script_runner.run(['scil_tractogram_segment_with_ROI_and_score.py', + ret = script_runner.run(['scil_tractogram_segment_with_ROI_and_score', in_tractogram, "config_file.json", 'scoring_tractogram/', '--no_empty', '--use_gt_masks_as_all_masks']) diff --git a/src/scilpy/cli/tests/test_tractogram_segment_with_bundleseg.py b/src/scilpy/cli/tests/test_tractogram_segment_with_bundleseg.py index ade3c1edd..b9a166ff6 100644 --- a/src/scilpy/cli/tests/test_tractogram_segment_with_bundleseg.py +++ b/src/scilpy/cli/tests/test_tractogram_segment_with_bundleseg.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_segment_with_bundleseg.py', + ret = script_runner.run(['scil_tractogram_segment_with_bundleseg', '--help']) assert ret.success @@ -34,7 +34,7 @@ def test_execution_bundles(script_runner, monkeypatch): with open('config.json', 'w') as outfile: json.dump(tmp_config, outfile) - ret = script_runner.run(['scil_tractogram_segment_with_bundleseg.py', + ret = script_runner.run(['scil_tractogram_segment_with_bundleseg', in_tractogram, 'config.json', in_models, in_aff, '--inverse', diff --git a/src/scilpy/cli/tests/test_tractogram_segment_with_recobundles.py b/src/scilpy/cli/tests/test_tractogram_segment_with_recobundles.py index 7e1469ca9..0906bd313 100644 --- a/src/scilpy/cli/tests/test_tractogram_segment_with_recobundles.py +++ b/src/scilpy/cli/tests/test_tractogram_segment_with_recobundles.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_segment_with_recobundles.py', + ret = script_runner.run(['scil_tractogram_segment_with_recobundles', '--help']) assert ret.success @@ -24,7 +24,7 @@ def test_execution_bundles(script_runner, monkeypatch): in_model = os.path.join(SCILPY_HOME, 'bundles', 'fibercup_atlas', 'subj_1', 'bundle_0.trk') in_aff = os.path.join(SCILPY_HOME, 'bundles', 'affine.txt') - ret = script_runner.run(['scil_tractogram_segment_with_recobundles.py', + ret = script_runner.run(['scil_tractogram_segment_with_recobundles', in_tractogram, in_model, in_aff, 'bundle_0_reco.tck', '--inverse', '--tractogram_clustering_thr', '12', diff --git a/src/scilpy/cli/tests/test_tractogram_shuffle.py b/src/scilpy/cli/tests/test_tractogram_shuffle.py index 5c3bfe6f8..eb9b9b760 100644 --- a/src/scilpy/cli/tests/test_tractogram_shuffle.py +++ b/src/scilpy/cli/tests/test_tractogram_shuffle.py @@ -13,13 +13,13 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_shuffle.py', '--help']) + ret = script_runner.run(['scil_tractogram_shuffle', '--help']) assert ret.success def test_execution_tracking(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'tracking', 'union.trk') - ret = script_runner.run(['scil_tractogram_shuffle.py', in_tracto, + ret = script_runner.run(['scil_tractogram_shuffle', in_tracto, 'union_shuffle.trk']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_smooth.py b/src/scilpy/cli/tests/test_tractogram_smooth.py index b6af3e944..88f2e4029 100644 --- a/src/scilpy/cli/tests/test_tractogram_smooth.py +++ b/src/scilpy/cli/tests/test_tractogram_smooth.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_smooth.py', '--help']) + ret = script_runner.run(['scil_tractogram_smooth', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_tracking(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'tracking', 'union_shuffle_sub.trk') - ret = script_runner.run(['scil_tractogram_smooth.py', in_tracto, + ret = script_runner.run(['scil_tractogram_smooth', in_tracto, 'union_shuffle_sub_smooth.trk', '--gaussian', '10', '--compress', '0.05']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_split.py b/src/scilpy/cli/tests/test_tractogram_split.py index 83953161c..4c056f076 100644 --- a/src/scilpy/cli/tests/test_tractogram_split.py +++ b/src/scilpy/cli/tests/test_tractogram_split.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_tractogram_split.py', '--help']) + ret = script_runner.run(['scil_tractogram_split', '--help']) assert ret.success @@ -21,16 +21,16 @@ def test_execution_tracking(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'tracking', 'local.trk') - ret = script_runner.run(['scil_tractogram_split.py', in_tracto, + ret = script_runner.run(['scil_tractogram_split', in_tracto, 'local_split', '--nb_chunks', '3', '-f']) assert ret.success - ret = script_runner.run(['scil_tractogram_split.py', in_tracto, + ret = script_runner.run(['scil_tractogram_split', in_tracto, 'local_split', '--nb_chunks', '3', '-f', '--split_per_cluster']) assert ret.success - ret = script_runner.run(['scil_tractogram_split.py', in_tracto, + ret = script_runner.run(['scil_tractogram_split', in_tracto, 'local_split', '--nb_chunks', '3', '-f', '--do_not_randomize']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_bingham_fit.py b/src/scilpy/cli/tests/test_viz_bingham_fit.py index 5725b3251..82453d9be 100644 --- a/src/scilpy/cli/tests/test_viz_bingham_fit.py +++ b/src/scilpy/cli/tests/test_viz_bingham_fit.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_viz_bingham_fit.py', '--help']) + ret = script_runner.run(['scil_viz_bingham_fit', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_silent_without_output(script_runner, monkeypatch): in_dummy = os.path.join(SCILPY_HOME, 'processing', 'fodf_bingham.nii.gz') out = os.path.join(tmp_dir.name, 'test_bingham.png') - ret = script_runner.run(['scil_viz_bingham_fit.py', in_dummy, + ret = script_runner.run(['scil_viz_bingham_fit', in_dummy, '--silent', '--output', out]) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_bundle.py b/src/scilpy/cli/tests/test_viz_bundle.py index eb6e789e6..333fdb666 100644 --- a/src/scilpy/cli/tests/test_viz_bundle.py +++ b/src/scilpy/cli/tests/test_viz_bundle.py @@ -8,7 +8,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_viz_bundle.py', '--help']) + ret = script_runner.run(['scil_viz_bundle', '--help']) assert ret.success # Tests including VTK do not work on a server without a display @@ -20,6 +20,6 @@ def test_help_option(script_runner): # in_bundle = os.path.join( # SCILPY_HOME, 'bundles', 'fibercup_atlas', 'subj_1', 'bundle_0.trk') -# ret = script_runner.run(['scil_viz_bundle.py', +# ret = script_runner.run(['scil_viz_bundle', # in_vol, in_bundle, 'out.png']) # assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_bundle_screenshot_mni.py b/src/scilpy/cli/tests/test_viz_bundle_screenshot_mni.py index 60277863b..ab82cd624 100644 --- a/src/scilpy/cli/tests/test_viz_bundle_screenshot_mni.py +++ b/src/scilpy/cli/tests/test_viz_bundle_screenshot_mni.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_bundle_screenshot_mni', '--help') + ret = script_runner.run(['scil_viz_bundle_screenshot_mni', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_bundle_screenshot_mosaic.py b/src/scilpy/cli/tests/test_viz_bundle_screenshot_mosaic.py index 770d187d8..9db86f203 100644 --- a/src/scilpy/cli/tests/test_viz_bundle_screenshot_mosaic.py +++ b/src/scilpy/cli/tests/test_viz_bundle_screenshot_mosaic.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_bundle_clean_qbx_clusters.py', '--help']) + ret = script_runner.run(['scil_bundle_clean_qbx_clusters', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_connectivity.py b/src/scilpy/cli/tests/test_viz_connectivity.py index 36a8fc85d..5ede27a5d 100644 --- a/src/scilpy/cli/tests/test_viz_connectivity.py +++ b/src/scilpy/cli/tests/test_viz_connectivity.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_viz_connectivity.py', '--help']) + ret = script_runner.run(['scil_viz_connectivity', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_connectivity(script_runner, monkeypatch): 'sc_norm.npy') in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') - ret = script_runner.run(['scil_viz_connectivity.py', in_sc, + ret = script_runner.run(['scil_viz_connectivity', in_sc, 'sc_norm.png', '--log', '--display_legend', '--labels_list', in_labels_list, '--histogram', 'hist.png', '--nb_bins', '50', diff --git a/src/scilpy/cli/tests/test_viz_dti_screenshot.py b/src/scilpy/cli/tests/test_viz_dti_screenshot.py index 6355966f4..fa8cd2fe0 100644 --- a/src/scilpy/cli/tests/test_viz_dti_screenshot.py +++ b/src/scilpy/cli/tests/test_viz_dti_screenshot.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_dwi_convert_FDF.py', '--help']) + ret = script_runner.run(['scil_dwi_convert_FDF', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_fodf.py b/src/scilpy/cli/tests/test_viz_fodf.py index 172111d15..0e16cb6ff 100644 --- a/src/scilpy/cli/tests/test_viz_fodf.py +++ b/src/scilpy/cli/tests/test_viz_fodf.py @@ -12,7 +12,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_viz_fodf.py', '--help']) + ret = script_runner.run(['scil_viz_fodf', '--help']) assert ret.success @@ -20,7 +20,7 @@ def test_silent_without_output(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf.nii.gz') - ret = script_runner.run(['scil_viz_fodf.py', in_fodf, '--silent']) + ret = script_runner.run(['scil_viz_fodf', in_fodf, '--silent']) # Should say that requires an output with --silent mode assert (not ret.success) @@ -33,7 +33,7 @@ def test_run(script_runner, monkeypatch): # No variance file in our test data, but faking it with the fodf file. in_variance = os.path.join(SCILPY_HOME, 'processing', 'fodf.nii.gz') out_name = os.path.join(tmp_dir.name, 'out.png') - ret = script_runner.run(['scil_viz_fodf.py', in_fodf, '--silent', + ret = script_runner.run(['scil_viz_fodf', in_fodf, '--silent', '--in_transparency_mask', in_mask, '--mask', in_mask, '--variance', in_variance, @@ -49,7 +49,7 @@ def test_run_sphsubdivide(script_runner, monkeypatch): # Note. Cannot add --sph_subdivide to the test above, causes a memory # crash. Without the variance, lighter. - ret = script_runner.run(['scil_viz_fodf.py', in_fodf, '--silent', + ret = script_runner.run(['scil_viz_fodf', in_fodf, '--silent', '--mask', in_mask, '--sph_subdivide', '2', '--sphere', 'repulsion100', diff --git a/src/scilpy/cli/tests/test_viz_gradients_screenshot.py b/src/scilpy/cli/tests/test_viz_gradients_screenshot.py index 45fec0b60..f255277b8 100644 --- a/src/scilpy/cli/tests/test_viz_gradients_screenshot.py +++ b/src/scilpy/cli/tests/test_viz_gradients_screenshot.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_gradients_screenshot', '--help') + ret = script_runner.run(['scil_viz_gradients_screenshot', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_tractogram_collisions.py b/src/scilpy/cli/tests/test_viz_tractogram_collisions.py index 1e62fb39f..e89efdb71 100644 --- a/src/scilpy/cli/tests/test_viz_tractogram_collisions.py +++ b/src/scilpy/cli/tests/test_viz_tractogram_collisions.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_tractogram_collisions', '--help') + ret = script_runner.run(['scil_viz_tractogram_collisions', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_tractogram_seeds.py b/src/scilpy/cli/tests/test_viz_tractogram_seeds.py index f665833b7..e735dc09e 100644 --- a/src/scilpy/cli/tests/test_viz_tractogram_seeds.py +++ b/src/scilpy/cli/tests/test_viz_tractogram_seeds.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_viz_tractogram_seeds', '--help') + ret = script_runner.run(['scil_viz_tractogram_seeds', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_tractogram_seeds_3d.py b/src/scilpy/cli/tests/test_viz_tractogram_seeds_3d.py index 33453e46e..e735dc09e 100644 --- a/src/scilpy/cli/tests/test_viz_tractogram_seeds_3d.py +++ b/src/scilpy/cli/tests/test_viz_tractogram_seeds_3d.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_viz_tractogram_seeds.py', '--help']) + ret = script_runner.run(['scil_viz_tractogram_seeds', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_volume_histogram.py b/src/scilpy/cli/tests/test_viz_volume_histogram.py index 18f166c0e..7e7a4ee09 100644 --- a/src/scilpy/cli/tests/test_viz_volume_histogram.py +++ b/src/scilpy/cli/tests/test_viz_volume_histogram.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_viz_volume_histogram.py', '--help']) + ret = script_runner.run(['scil_viz_volume_histogram', '--help']) assert ret.success @@ -23,6 +23,6 @@ def test_execution_processing(script_runner, monkeypatch): 'fa.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') - ret = script_runner.run(['scil_viz_volume_histogram.py', in_fa, in_mask, + ret = script_runner.run(['scil_viz_volume_histogram', in_fa, in_mask, '20', 'histogram.png']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_volume_scatterplot.py b/src/scilpy/cli/tests/test_viz_volume_scatterplot.py index ba698ab24..8952b2b9d 100644 --- a/src/scilpy/cli/tests/test_viz_volume_scatterplot.py +++ b/src/scilpy/cli/tests/test_viz_volume_scatterplot.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_viz_volume_scatterplot.py', '--help']) + ret = script_runner.run(['scil_viz_volume_scatterplot', '--help']) assert ret.success @@ -23,7 +23,7 @@ def test_execution_processing(script_runner, monkeypatch): 'fa.nii.gz') in_y = os.path.join(SCILPY_HOME, 'plot', 'ad.nii.gz') - ret = script_runner.run(['scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run(['scil_viz_volume_scatterplot', in_x, in_y, 'scatter_plot.png']) assert ret.success @@ -36,7 +36,7 @@ def test_execution_processing_bin_mask(script_runner, monkeypatch): 'ad.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'plot', 'mask_wm.nii.gz') - ret = script_runner.run(['scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run(['scil_viz_volume_scatterplot', in_x, in_y, 'scatter_plot_m.png', '--in_bin_mask', in_mask]) assert ret.success @@ -51,7 +51,7 @@ def test_execution_processing_prob_map(script_runner, monkeypatch): 'map_wm.nii.gz') in_prob_2 = os.path.join(SCILPY_HOME, 'plot', 'map_gm.nii.gz') - ret = script_runner.run(['scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run(['scil_viz_volume_scatterplot', in_x, in_y, 'scatter_plot_prob.png', '--in_prob_maps', in_prob_1, in_prob_2]) assert ret.success @@ -67,7 +67,7 @@ def test_execution_processing_atlas(script_runner, monkeypatch): 'atlas_brainnetome.nii.gz') atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') - ret = script_runner.run(['scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run(['scil_viz_volume_scatterplot', in_x, in_y, 'scatter_plot', '--in_atlas', in_atlas, '--atlas_lut', atlas_lut]) assert ret.success @@ -83,7 +83,7 @@ def test_execution_processing_atlas_folder(script_runner, monkeypatch): 'atlas_brainnetome.nii.gz') atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') - ret = script_runner.run(['scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run(['scil_viz_volume_scatterplot', in_x, in_y, 'scatter_plot', '--in_atlas', in_atlas, '--atlas_lut', atlas_lut, '--in_folder']) @@ -101,7 +101,7 @@ def test_execution_processing_atlas_folder_specific_label(script_runner, 'atlas_brainnetome.nii.gz') atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') - ret = script_runner.run(['scil_viz_volume_scatterplot.py', in_x, in_y, + ret = script_runner.run(['scil_viz_volume_scatterplot', in_x, in_y, 'scatter_plot', '--in_atlas', in_atlas, '--atlas_lut', atlas_lut, '--specific_label', '2', '5', '7', diff --git a/src/scilpy/cli/tests/test_viz_volume_screenshot.py b/src/scilpy/cli/tests/test_viz_volume_screenshot.py index 3aa9d5bba..75865f5bf 100644 --- a/src/scilpy/cli/tests/test_viz_volume_screenshot.py +++ b/src/scilpy/cli/tests/test_viz_volume_screenshot.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(["scil_viz_volume_screenshot.py", "--help"]) + ret = script_runner.run(["scil_viz_volume_screenshot", "--help"]) assert ret.success @@ -21,7 +21,7 @@ def test_screenshot(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fa = os.path.join(SCILPY_HOME, 'bst', 'fa.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') - ret = script_runner.run(["scil_viz_volume_screenshot.py", in_fa, 'fa.png', + ret = script_runner.run(["scil_viz_volume_screenshot", in_fa, 'fa.png', '--slices', '50', '--display_slice_number', '--display_lr', '--overlays', in_mask, diff --git a/src/scilpy/cli/tests/test_viz_volume_screenshot_mosaic.py b/src/scilpy/cli/tests/test_viz_volume_screenshot_mosaic.py index 0ffdca08b..ab82cd624 100644 --- a/src/scilpy/cli/tests/test_viz_volume_screenshot_mosaic.py +++ b/src/scilpy/cli/tests/test_viz_volume_screenshot_mosaic.py @@ -3,5 +3,5 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_viz_bundle_screenshot_mni.py', '--help']) + ret = script_runner.run(['scil_viz_bundle_screenshot_mni', '--help']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_apply_transform.py b/src/scilpy/cli/tests/test_volume_apply_transform.py index ba3a65897..99d298acd 100644 --- a/src/scilpy/cli/tests/test_volume_apply_transform.py +++ b/src/scilpy/cli/tests/test_volume_apply_transform.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_apply_transform.py', '--help']) + ret = script_runner.run(['scil_volume_apply_transform', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_bst(script_runner, monkeypatch): 'fa.nii.gz') in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') - ret = script_runner.run(['scil_volume_apply_transform.py', + ret = script_runner.run(['scil_volume_apply_transform', in_model, in_fa, in_aff, 'template_lin.nii.gz', '--inverse', '-f']) @@ -40,7 +40,7 @@ def test_execution_interp_nearest(script_runner, monkeypatch): 'fa.nii.gz') in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') - ret = script_runner.run(['scil_volume_apply_transform.py', + ret = script_runner.run(['scil_volume_apply_transform', in_model, in_fa, in_aff, 'template_lin.nii.gz', '--inverse', '--interp', 'nearest', '-f']) @@ -55,7 +55,7 @@ def test_execution_interp_lin(script_runner, monkeypatch): 'fa.nii.gz') in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') - ret = script_runner.run(['scil_volume_apply_transform.py', + ret = script_runner.run(['scil_volume_apply_transform', in_model, in_fa, in_aff, 'template_lin.nii.gz', '--inverse', '--interp', 'linear', '-f']) diff --git a/src/scilpy/cli/tests/test_volume_b0_synthesis.py b/src/scilpy/cli/tests/test_volume_b0_synthesis.py index 40d912439..587c1472b 100644 --- a/src/scilpy/cli/tests/test_volume_b0_synthesis.py +++ b/src/scilpy/cli/tests/test_volume_b0_synthesis.py @@ -24,7 +24,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_b0_synthesis.py', '--help']) + ret = script_runner.run(['scil_volume_b0_synthesis', '--help']) assert ret.success @@ -45,7 +45,7 @@ def test_synthesis(script_runner, monkeypatch): nib.save(nib.Nifti1Image(b0_data.astype(np.uint8), b0_img.affine), 'b0_mask.nii.gz') - ret = script_runner.run(['scil_volume_b0_synthesis.py', + ret = script_runner.run(['scil_volume_b0_synthesis', in_t1, 't1_mask.nii.gz', in_b0, 'b0_mask.nii.gz', 'b0_synthesized.nii.gz', '-v']) diff --git a/src/scilpy/cli/tests/test_volume_count_non_zero_voxels.py b/src/scilpy/cli/tests/test_volume_count_non_zero_voxels.py index e77f7b62d..57c17914b 100644 --- a/src/scilpy/cli/tests/test_volume_count_non_zero_voxels.py +++ b/src/scilpy/cli/tests/test_volume_count_non_zero_voxels.py @@ -13,25 +13,25 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_count_non_zero_voxels.py', '--help']) + ret = script_runner.run(['scil_volume_count_non_zero_voxels', '--help']) assert ret.success def test_execution_simple_print(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'rgb.nii.gz') - ret = script_runner.run(['scil_volume_count_non_zero_voxels.py', in_img]) + ret = script_runner.run(['scil_volume_count_non_zero_voxels', in_img]) assert ret.success def test_execution_save_in_file(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'rgb.nii.gz') - ret = script_runner.run(['scil_volume_count_non_zero_voxels.py', in_img, + ret = script_runner.run(['scil_volume_count_non_zero_voxels', in_img, '--out', 'printed.txt']) assert ret.success # Then re-use the same out file with --stats - ret = script_runner.run(['scil_volume_count_non_zero_voxels.py', in_img, + ret = script_runner.run(['scil_volume_count_non_zero_voxels', in_img, '--out', 'printed.txt', '--stats']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_crop.py b/src/scilpy/cli/tests/test_volume_crop.py index 1637e4e85..ed5ea72ba 100644 --- a/src/scilpy/cli/tests/test_volume_crop.py +++ b/src/scilpy/cli/tests/test_volume_crop.py @@ -13,18 +13,18 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_crop.py', '--help']) + ret = script_runner.run(['scil_volume_crop', '--help']) assert ret.success def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi.nii.gz') - ret = script_runner.run(['scil_volume_crop.py', in_dwi, 'dwi_crop.nii.gz', + ret = script_runner.run(['scil_volume_crop', in_dwi, 'dwi_crop.nii.gz', '--output_bbox', 'bbox.json']) assert ret.success # Then try to load back the same box - ret = script_runner.run(['scil_volume_crop.py', in_dwi, 'dwi_crop2.nii.gz', + ret = script_runner.run(['scil_volume_crop', in_dwi, 'dwi_crop2.nii.gz', '--input_bbox', 'bbox.json']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_distance_map.py b/src/scilpy/cli/tests/test_volume_distance_map.py index 338005aca..cb04cbdb9 100644 --- a/src/scilpy/cli/tests/test_volume_distance_map.py +++ b/src/scilpy/cli/tests/test_volume_distance_map.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_distance_map.py', '--help']) + ret = script_runner.run(['scil_volume_distance_map', '--help']) assert ret.success @@ -27,7 +27,7 @@ def test_execution(script_runner, monkeypatch): in_mask_2 = os.path.join(SCILPY_HOME, 'tractograms', 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') - ret = script_runner.run(['scil_volume_distance_map.py', + ret = script_runner.run(['scil_volume_distance_map', in_mask_1, in_mask_2, 'distance_map.nii.gz']) diff --git a/src/scilpy/cli/tests/test_volume_flip.py b/src/scilpy/cli/tests/test_volume_flip.py index 1adf5662b..f3b1e0efb 100644 --- a/src/scilpy/cli/tests/test_volume_flip.py +++ b/src/scilpy/cli/tests/test_volume_flip.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_flip.py', '--help']) + ret = script_runner.run(['scil_volume_flip', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_fa = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') - ret = script_runner.run(['scil_volume_flip.py', in_fa, 'fa_flip.nii.gz', + ret = script_runner.run(['scil_volume_flip', in_fa, 'fa_flip.nii.gz', 'x']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_math.py b/src/scilpy/cli/tests/test_volume_math.py index 41b72636d..edfed09e9 100644 --- a/src/scilpy/cli/tests/test_volume_math.py +++ b/src/scilpy/cli/tests/test_volume_math.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_math.py', '--help']) + ret = script_runner.run(['scil_volume_math', '--help']) assert ret.success @@ -25,7 +25,7 @@ def test_execution_add(script_runner, monkeypatch): 'brainstem_174.nii.gz') in_img_3 = os.path.join(SCILPY_HOME, 'atlas', 'brainstem_175.nii.gz') - ret = script_runner.run(['scil_volume_math.py', 'addition', + ret = script_runner.run(['scil_volume_math', 'addition', in_img_1, in_img_2, in_img_3, 'brainstem.nii.gz']) assert ret.success @@ -33,7 +33,7 @@ def test_execution_add(script_runner, monkeypatch): def test_execution_low_thresh(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'atlas', 'brainstem.nii.gz') - ret = script_runner.run(['scil_volume_math.py', 'lower_threshold', + ret = script_runner.run(['scil_volume_math', 'lower_threshold', in_img, '1', 'brainstem_bin.nii.gz']) assert ret.success @@ -41,7 +41,7 @@ def test_execution_low_thresh(script_runner, monkeypatch): def test_execution_low_mult(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'atlas', 'brainstem_bin.nii.gz') - ret = script_runner.run(['scil_volume_math.py', 'multiplication', + ret = script_runner.run(['scil_volume_math', 'multiplication', in_img, '16', 'brainstem_unified.nii.gz']) assert ret.success @@ -54,7 +54,7 @@ def test_execution_concatenate(script_runner, monkeypatch): in_img_4 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '13.nii.gz') in_img_5 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '17.nii.gz') in_img_6 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '18.nii.gz') - ret = script_runner.run(['scil_volume_math.py', 'concatenate', + ret = script_runner.run(['scil_volume_math', 'concatenate', in_img_1, in_img_2, in_img_3, in_img_4, in_img_5, in_img_6, 'concat_ids.nii.gz']) assert ret.success @@ -66,7 +66,7 @@ def test_execution_concatenate_4D(script_runner, monkeypatch): in_img_2 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '8_10.nii.gz') in_img_3 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '12.nii.gz') in_img_4 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '8_10.nii.gz') - ret = script_runner.run(['scil_volume_math.py', 'concatenate', + ret = script_runner.run(['scil_volume_math', 'concatenate', in_img_1, in_img_2, in_img_3, in_img_4, 'concat_ids_4d.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_pairwise_comparison.py b/src/scilpy/cli/tests/test_volume_pairwise_comparison.py index d3babfd6d..47596c155 100644 --- a/src/scilpy/cli/tests/test_volume_pairwise_comparison.py +++ b/src/scilpy/cli/tests/test_volume_pairwise_comparison.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_pairwise_comparison.py', '--help']) + ret = script_runner.run(['scil_volume_pairwise_comparison', '--help']) assert ret.success @@ -26,7 +26,7 @@ def test_label_comparison(script_runner, monkeypatch): in_atlas_dilated = os.path.join( SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_single_brainstem_dil.nii.gz') - ret = script_runner.run(['scil_volume_pairwise_comparison.py', + ret = script_runner.run(['scil_volume_pairwise_comparison', in_atlas, in_atlas_dilated, 'atlas.json']) assert ret.success @@ -40,7 +40,7 @@ def test_binary_comparison(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') - ret = script_runner.run(['scil_volume_pairwise_comparison.py', + ret = script_runner.run(['scil_volume_pairwise_comparison', in_bin_1, in_bin_2, 'binary.json']) assert ret.success @@ -58,7 +58,7 @@ def test_multiple_compare(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') - ret = script_runner.run(['scil_volume_pairwise_comparison.py', + ret = script_runner.run(['scil_volume_pairwise_comparison', in_bin_1, in_bin_2, in_bin_3, 'multiple.json']) assert ret.success @@ -76,7 +76,7 @@ def test_single_compare(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') - ret = script_runner.run(['scil_volume_pairwise_comparison.py', + ret = script_runner.run(['scil_volume_pairwise_comparison', in_bin_1, in_bin_2, 'single.json', '--single_compare', in_bin_3]) assert ret.success @@ -95,7 +95,7 @@ def test_ratio_compare(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') - ret = script_runner.run(['scil_volume_pairwise_comparison.py', + ret = script_runner.run(['scil_volume_pairwise_comparison', in_bin_1, in_bin_2, 'ratio.json', '--single_compare', in_bin_3, '--ratio']) @@ -109,7 +109,7 @@ def test_labels_to_mask_compare(script_runner, monkeypatch): in_mask = os.path.join( SCILPY_HOME, 'atlas', 'brainstem_bin.nii.gz') - ret = script_runner.run(['scil_volume_pairwise_comparison.py', + ret = script_runner.run(['scil_volume_pairwise_comparison', in_atlas, 'labels_to_maskjson', '--single_compare', in_mask, '--labels_to_mask']) diff --git a/src/scilpy/cli/tests/test_volume_remove_outliers_ransac.py b/src/scilpy/cli/tests/test_volume_remove_outliers_ransac.py index 44526a324..f6b139046 100644 --- a/src/scilpy/cli/tests/test_volume_remove_outliers_ransac.py +++ b/src/scilpy/cli/tests/test_volume_remove_outliers_ransac.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_remove_outliers_ransac.py', '--help']) + ret = script_runner.run(['scil_volume_remove_outliers_ransac', '--help']) assert ret.success @@ -21,6 +21,6 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_ad = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') - ret = script_runner.run(['scil_volume_remove_outliers_ransac.py', in_ad, + ret = script_runner.run(['scil_volume_remove_outliers_ransac', in_ad, 'ad_ransanc.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_resample.py b/src/scilpy/cli/tests/test_volume_resample.py index 948ef5239..5657a0425 100644 --- a/src/scilpy/cli/tests/test_volume_resample.py +++ b/src/scilpy/cli/tests/test_volume_resample.py @@ -14,20 +14,20 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_resample.py', '--help']) + ret = script_runner.run(['scil_volume_resample', '--help']) assert ret.success def test_execution_given_size(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_volume_resample.py', in_img, + ret = script_runner.run(['scil_volume_resample', in_img, 'fa_resample_2.nii.gz', '--voxel_size', '2']) assert ret.success def test_execution_force_voxel(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_volume_resample.py', in_img, + ret = script_runner.run(['scil_volume_resample', in_img, 'fa_resample_4.nii.gz', '--voxel_size', '4', '--enforce_voxel_size']) assert ret.success @@ -36,7 +36,7 @@ def test_execution_force_voxel(script_runner, monkeypatch): def test_execution_ref(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ref = os.path.join(SCILPY_HOME, 'others', 'fa_resample.nii.gz') - ret = script_runner.run(['scil_volume_resample.py', in_img, + ret = script_runner.run(['scil_volume_resample', in_img, 'fa_resample2.nii.gz', '--ref', ref]) assert ret.success @@ -44,7 +44,7 @@ def test_execution_ref(script_runner, monkeypatch): def test_execution_ref_force(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ref = os.path.join(SCILPY_HOME, 'others', 'fa_resample.nii.gz') - ret = script_runner.run(['scil_volume_resample.py', in_img, + ret = script_runner.run(['scil_volume_resample', in_img, 'fa_resample_ref.nii.gz', '--ref', ref, '--enforce_dimensions']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_reshape.py b/src/scilpy/cli/tests/test_volume_reshape.py index bbe0f4dec..c9f8479d9 100644 --- a/src/scilpy/cli/tests/test_volume_reshape.py +++ b/src/scilpy/cli/tests/test_volume_reshape.py @@ -15,13 +15,13 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_reshape.py', '--help']) + ret = script_runner.run(['scil_volume_reshape', '--help']) assert ret.success def test_execution_crop(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_volume_reshape.py', in_img, + ret = script_runner.run(['scil_volume_reshape', in_img, 'fa_reshape.nii.gz', '--volume_size', '90', '-f']) assert ret.success @@ -29,7 +29,7 @@ def test_execution_crop(script_runner, monkeypatch): def test_execution_pad(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_volume_reshape.py', in_img, + ret = script_runner.run(['scil_volume_reshape', in_img, 'fa_reshape.nii.gz', '--volume_size', '150', '-f']) assert ret.success @@ -37,7 +37,7 @@ def test_execution_pad(script_runner, monkeypatch): def test_execution_full_size(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_volume_reshape.py', in_img, + ret = script_runner.run(['scil_volume_reshape', in_img, 'fa_reshape.nii.gz', '--volume_size', '164', '164', '164', '-f']) assert ret.success @@ -45,7 +45,7 @@ def test_execution_full_size(script_runner, monkeypatch): def test_execution_dtype(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) - ret = script_runner.run(['scil_volume_reshape.py', in_img, + ret = script_runner.run(['scil_volume_reshape', in_img, 'fa_reshape.nii.gz', '--volume_size', '111', '133', '109', '--data_type', 'uint8', '-f']) @@ -55,6 +55,6 @@ def test_execution_dtype(script_runner, monkeypatch): def test_execution_ref(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ref = os.path.join(SCILPY_HOME, 'others', 'fa_resample.nii.gz') - ret = script_runner.run(['scil_volume_reshape.py', in_img, + ret = script_runner.run(['scil_volume_reshape', in_img, 'fa_reshape.nii.gz', '--ref', ref, '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_reslice_to_reference.py b/src/scilpy/cli/tests/test_volume_reslice_to_reference.py index 39564f46c..553de88f0 100644 --- a/src/scilpy/cli/tests/test_volume_reslice_to_reference.py +++ b/src/scilpy/cli/tests/test_volume_reslice_to_reference.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_reslice_to_reference.py', '--help']) + ret = script_runner.run(['scil_volume_reslice_to_reference', '--help']) assert ret.success @@ -21,7 +21,7 @@ def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 't1_crop.nii.gz') in_ref = os.path.join(SCILPY_HOME, 'others', 't1.nii.gz') - ret = script_runner.run(['scil_volume_reslice_to_reference.py', in_img, + ret = script_runner.run(['scil_volume_reslice_to_reference', in_img, in_ref, 't1_reslice.nii.gz', '--interpolation', 'nearest']) assert ret.success @@ -31,7 +31,7 @@ def test_execution_4D(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.nii.gz') in_ref = os.path.join(SCILPY_HOME, 'others', 't1.nii.gz') - ret = script_runner.run(['scil_volume_reslice_to_reference.py', in_img, + ret = script_runner.run(['scil_volume_reslice_to_reference', in_img, in_ref, 'dwi_reslice.nii.gz', '--interpolation', 'nearest']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_stats_in_ROI.py b/src/scilpy/cli/tests/test_volume_stats_in_ROI.py index beb6c7c6f..96450f4e6 100644 --- a/src/scilpy/cli/tests/test_volume_stats_in_ROI.py +++ b/src/scilpy/cli/tests/test_volume_stats_in_ROI.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_stats_in_ROI.py', '--help']) + ret = script_runner.run(['scil_volume_stats_in_ROI', '--help']) assert ret.success @@ -25,28 +25,28 @@ def test_execution_tractometry(script_runner, monkeypatch): 'mni_masked.nii.gz') # Test with a single ROI input - ret = script_runner.run(['scil_volume_stats_in_ROI.py', + ret = script_runner.run(['scil_volume_stats_in_ROI', in_roi, '--metrics', in_ref]) assert ret.success # Test with multiple ROIs input - ret = script_runner.run(['scil_volume_stats_in_ROI.py', + ret = script_runner.run(['scil_volume_stats_in_ROI', in_roi, in_roi, in_roi, '--metrics', in_ref]) assert ret.success # Test with multiple metric input - ret = script_runner.run(['scil_volume_stats_in_ROI.py', + ret = script_runner.run(['scil_volume_stats_in_ROI', in_roi, '--metrics', in_ref, in_ref, in_ref]) assert ret.success # Test with multiple metric and ROIs input - ret = script_runner.run(['scil_volume_stats_in_ROI.py', + ret = script_runner.run(['scil_volume_stats_in_ROI', in_roi, in_roi, '--metrics', in_ref, in_ref]) assert ret.success # Test with a metric folder metrics_dir = os.path.join(SCILPY_HOME, 'plot') in_roi = os.path.join(SCILPY_HOME, 'plot', 'mask_wm.nii.gz') - ret = script_runner.run(['scil_volume_stats_in_ROI.py', + ret = script_runner.run(['scil_volume_stats_in_ROI', in_roi, '--metrics_dir', metrics_dir]) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_stats_in_labels.py b/src/scilpy/cli/tests/test_volume_stats_in_labels.py index a05c39913..79d58ae1e 100644 --- a/src/scilpy/cli/tests/test_volume_stats_in_labels.py +++ b/src/scilpy/cli/tests/test_volume_stats_in_labels.py @@ -11,7 +11,7 @@ def test_help_option(script_runner): - ret = script_runner.run(['scil_volume_stats_in_labels.py', '--help']) + ret = script_runner.run(['scil_volume_stats_in_labels', '--help']) assert ret.success @@ -22,19 +22,19 @@ def test_execution(script_runner, monkeypatch): atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') # Test with a single metric - ret = script_runner.run(['scil_volume_stats_in_labels.py', + ret = script_runner.run(['scil_volume_stats_in_labels', in_atlas, atlas_lut, "--metrics", in_metric]) assert ret.success # Test with multiple metrics - ret = script_runner.run(['scil_volume_stats_in_labels.py', + ret = script_runner.run(['scil_volume_stats_in_labels', in_atlas, atlas_lut, "--metrics", in_metric, in_metric, in_metric]) assert ret.success # Test with a metric folder metrics_dir = os.path.join(SCILPY_HOME, 'plot') - ret = script_runner.run(['scil_volume_stats_in_labels.py', + ret = script_runner.run(['scil_volume_stats_in_labels', in_atlas, atlas_lut, "--metrics_dir", metrics_dir]) assert ret.success From 7a7e990530c26152ea77170b216d87029de31e46 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 1 Aug 2025 22:37:31 -0400 Subject: [PATCH 70/90] add pytest-xdist --- .github/workflows/test.yml | 1 + pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 13dd0f188..9443b876c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,6 +65,7 @@ jobs: # https://discourse.vtk.org/t/status-update-runtime-opengl-render-window-selection-in-vtk/14583 VTK_VERSION=$(cat pyproject.toml | grep 'vtk==' | sed 's/vtk==//g' | sed 's/\"//g' ) uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==$VTK_VERSION + uv pip install pytest-xdist pytest-cov - name: Run tests run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH diff --git a/pyproject.toml b/pyproject.toml index acdcecf29..460c792d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ version = "2.2.0" description = "Scilpy: diffusion MRI tools and utilities" authors = [{ name = "SCIL Team" }] readme = "README.md" -requires-python = ">=3.10, < 3.13" +requires-python = ">=3.10, <3.13" license-files = ["LICENSE"] classifiers = [ "Development Status :: 3 - Alpha", @@ -57,6 +57,7 @@ dependencies = [ "pyparsing==3.2.*", "PySocks==1.7.*", "pytest==8.3.*", +"pytest-xdist==3.8.*", "pytest-console-scripts==1.4.*", "pytest-cov==6.0.*", "pytest-html==4.1.*", From b4611688f1e79cd434b156a40585e06b0beccbcc Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 1 Aug 2025 23:45:31 -0400 Subject: [PATCH 71/90] add extra step github workflow - download data before running tests --- .github/workflows/test.yml | 1 + pyproject.toml | 1 + src/scilpy/cli/scil_data_download.py | 45 ++++++++++++++++++++++++++++ src/scilpy/io/fetcher.py | 7 +++-- 4 files changed, 51 insertions(+), 3 deletions(-) create mode 100755 src/scilpy/cli/scil_data_download.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9443b876c..7d5cc9a4c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,6 +70,7 @@ jobs: run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH source ~/.venvs/scilpy/bin/activate + scil_data_download uv run --active pytest --cov-report term-missing:skip-covered - name: Save test results and coverage diff --git a/pyproject.toml b/pyproject.toml index 460c792d0..17194255d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -124,6 +124,7 @@ scil_connectivity_normalize = "scilpy.cli.scil_connectivity_normalize:main" scil_connectivity_pairwise_agreement = "scilpy.cli.scil_connectivity_pairwise_agreement:main" scil_connectivity_print_filenames = "scilpy.cli.scil_connectivity_print_filenames:main" scil_connectivity_reorder_rois = "scilpy.cli.scil_connectivity_reorder_rois:main" +scil_data_download = "scilpy.cli.scil_data_download:main" scil_denoising_nlmeans = "scilpy.cli.scil_denoising_nlmeans:main" scil_dki_metrics = "scilpy.cli.scil_dki_metrics:main" scil_dti_convert_tensors = "scilpy.cli.scil_dti_convert_tensors:main" diff --git a/src/scilpy/cli/scil_data_download.py b/src/scilpy/cli/scil_data_download.py new file mode 100755 index 000000000..9ab0a91fe --- /dev/null +++ b/src/scilpy/cli/scil_data_download.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +Download data for tests +""" +import tqdm + +from scilpy.io.dvc import pull_test_case_package +from scilpy.io.fetcher import fetch_data, get_testing_files_dict + +LIST_ZIP_FILES = ["anatomical_filtering", + "atlas", + "bids_json", + "bst", + "btensor_testdata", + "bundles", + "commit_amico", + "connectivity", + "filtering", + "ihMT", + "lesions", + "mrds", + "MT", + "others", + "plot", + "processing", + "stats", + "surface_vtk_fib", + "tracking", + "tractograms", + "tractometry"] + +def main(): + + tqdm_bar = tqdm.tqdm(total=len(LIST_ZIP_FILES)+2, desc="Download data test") + for zip_file in LIST_ZIP_FILES: + fetch_data(get_testing_files_dict(), keys=[zip_file+'.zip'], verbose=False) + tqdm_bar.update(1) + + test_data_root = pull_test_case_package("aodf") + tqdm_bar.update(1) + +if __name__ == "__main__": + main() diff --git a/src/scilpy/io/fetcher.py b/src/scilpy/io/fetcher.py index d2a920e80..adcb02ba2 100644 --- a/src/scilpy/io/fetcher.py +++ b/src/scilpy/io/fetcher.py @@ -64,7 +64,7 @@ def get_testing_files_dict(): } -def fetch_data(files_dict, keys=None): +def fetch_data(files_dict, keys=None, verbose=True): """ Fetch data. Typical use would be with gdown. But with too many data accesses, downloaded become denied. @@ -86,8 +86,9 @@ def fetch_data(files_dict, keys=None): CURR_URL = DVC_URL + "/" + url_md5[:2] + "/" + url_md5[2:] if not os.path.isdir(full_path_no_ext): if ext == '.zip' and not os.path.isdir(full_path_no_ext): - logging.warning('Downloading and extracting {} from url {} to ' - '{}'.format(f, CURR_URL, SCILPY_HOME)) + if verbose: + logging.warning('Downloading and extracting {} from url {} to ' + '{}'.format(f, CURR_URL, SCILPY_HOME)) # Robust method to Virus/Size check from GDrive download_file_from_google_drive(CURR_URL, full_path) From 5f7b3c739c85757f1c8b7d21d9fff48a0714e6aa Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Fri, 1 Aug 2025 23:57:07 -0400 Subject: [PATCH 72/90] add download nltk in scil_data_download --- src/scilpy/cli/scil_data_download.py | 15 ++++++++++++--- src/scilpy/utils/scilpy_bot.py | 11 ++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/scilpy/cli/scil_data_download.py b/src/scilpy/cli/scil_data_download.py index 9ab0a91fe..24447dbd4 100755 --- a/src/scilpy/cli/scil_data_download.py +++ b/src/scilpy/cli/scil_data_download.py @@ -6,6 +6,8 @@ """ import tqdm +import nltk + from scilpy.io.dvc import pull_test_case_package from scilpy.io.fetcher import fetch_data, get_testing_files_dict @@ -31,15 +33,22 @@ "tractograms", "tractometry"] + def main(): - tqdm_bar = tqdm.tqdm(total=len(LIST_ZIP_FILES)+2, desc="Download data test") + tqdm_bar = tqdm.tqdm(total=len(LIST_ZIP_FILES)+2, + desc="Download data test") for zip_file in LIST_ZIP_FILES: - fetch_data(get_testing_files_dict(), keys=[zip_file+'.zip'], verbose=False) + fetch_data(get_testing_files_dict(), + keys=[zip_file+'.zip'], verbose=False) tqdm_bar.update(1) - test_data_root = pull_test_case_package("aodf") + _ = pull_test_case_package("aodf") tqdm_bar.update(1) + nltk.download('punkt', quiet=True) + nltk.download('wordnet', quiet=True) + + if __name__ == "__main__": main() diff --git a/src/scilpy/utils/scilpy_bot.py b/src/scilpy/utils/scilpy_bot.py index 83d054985..e7a2f1e98 100644 --- a/src/scilpy/utils/scilpy_bot.py +++ b/src/scilpy/utils/scilpy_bot.py @@ -6,21 +6,14 @@ import re import subprocess - from tqdm import tqdm +import nltk +from nltk.stem import PorterStemmer from scilpy import SCILPY_HOME SPACING_LEN = 80 -try: - import nltk - from nltk.stem import PorterStemmer - nltk.download('punkt', quiet=True) - nltk.download('wordnet', quiet=True) -except ImportError: - raise ImportError("You must install the 'nltk' package to use this script." - "Please run 'pip install nltk'.") stemmer = PorterStemmer() # Path to the JSON file containing script information and keywords From e074c98ad1b16ea876ae871790c6b4ff9abc4e1a Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Sat, 2 Aug 2025 00:43:20 -0400 Subject: [PATCH 73/90] more fixes --- .coveragerc | 16 +++++++--------- pyproject.toml | 1 + 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.coveragerc b/.coveragerc index 7b98ae4cf..03a6151a7 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,17 +2,15 @@ branch = True concurrency = multiprocessing data_file = .coverage -source_pkgs = - scilpy - scripts +source = src relative_files = True omit = - scripts/tests/*.py - scilpy/tests/**/*.py - scilpy/**/tests/*.py - scilpy/**/tests/**/*.py - scripts/tests/*.py - scripts/tests/**/*.py + src/scilpy/tests/**/*.py + src/scilpy/**/tests/*.py + src/scilpy/**/tests/**/*.py + src/scilpy/cli/tests/*.py + src/scilpy/cli/tests/**/*.py + src/scilpy/cli/scil_data_download.py [report] skip_empty = True diff --git a/pyproject.toml b/pyproject.toml index 17194255d..3d2d174ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -181,6 +181,7 @@ scil_labels_remove = "scilpy.cli.scil_labels_remove:main" scil_labels_split_volume_by_ids = "scilpy.cli.scil_labels_split_volume_by_ids:main" scil_labels_split_volume_from_lut = "scilpy.cli.scil_labels_split_volume_from_lut:main" scil_lesions_generate_nawm = "scilpy.cli.scil_lesions_generate_nawm:main" +scil_lesions_harmonize_labels = "scilpy.cli.scil_lesions_harmonize_labels:main" scil_lesions_info = "scilpy.cli.scil_lesions_info:main" scil_mrds_metrics = "scilpy.cli.scil_mrds_metrics:main" scil_mrds_select_number_of_tensors = "scilpy.cli.scil_mrds_select_number_of_tensors:main" From e53639a7ff31a71d0e0552c371cc11e9a8b36d5d Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Sat, 2 Aug 2025 07:54:16 -0400 Subject: [PATCH 74/90] fix test scilpy bot --- src/scilpy/utils/tests/test_scilpy_bot.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/scilpy/utils/tests/test_scilpy_bot.py b/src/scilpy/utils/tests/test_scilpy_bot.py index 1b77d182e..7177084ba 100644 --- a/src/scilpy/utils/tests/test_scilpy_bot.py +++ b/src/scilpy/utils/tests/test_scilpy_bot.py @@ -7,15 +7,7 @@ _extract_keywords_and_phrases, _calculate_score ) -try: - import nltk - nltk.download('punkt_tab', quiet=True) - nltk.download('wordnet', quiet=True) - have_nltk = True -except ImportError: - have_nltk = False - - +have_nltk = True @pytest.mark.skipif(not have_nltk, reason="Requires NLTK") From 8cd2c06738b308549ab5ca36a34f6c1a41b05015 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Sat, 2 Aug 2025 08:24:38 -0400 Subject: [PATCH 75/90] fix aodf tests + add nltk punkt_tab --- src/scilpy/cli/scil_data_download.py | 1 + src/scilpy/cli/tests/test_aodf_metrics.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/scilpy/cli/scil_data_download.py b/src/scilpy/cli/scil_data_download.py index 24447dbd4..0a08f0a03 100755 --- a/src/scilpy/cli/scil_data_download.py +++ b/src/scilpy/cli/scil_data_download.py @@ -47,6 +47,7 @@ def main(): tqdm_bar.update(1) nltk.download('punkt', quiet=True) + nltk.download('punkt_tab', quiet=True) nltk.download('wordnet', quiet=True) diff --git a/src/scilpy/cli/tests/test_aodf_metrics.py b/src/scilpy/cli/tests/test_aodf_metrics.py index 02e364530..63ba83076 100644 --- a/src/scilpy/cli/tests/test_aodf_metrics.py +++ b/src/scilpy/cli/tests/test_aodf_metrics.py @@ -45,9 +45,9 @@ def test_execution_not_all(script_runner, monkeypatch): f"{test_data_root}/fodf_descoteaux07_sub_unified_asym.nii.gz") ret = script_runner.run(['scil_aodf_metrics', in_fodf, - '--not_all', '--asi_map', - 'asi_map.nii.gz', '-f', - '--processes', '1']) + '--not_all', '--asi_map', + 'asi_map.nii.gz', '-f', + '--processes', '1']) assert ret.success @@ -58,8 +58,8 @@ def test_assert_symmetric_input(script_runner, monkeypatch): # Using a low resolution sphere for peak extraction reduces process time ret = script_runner.run(['scil_aodf_metrics', in_fodf, - '--sphere', 'repulsion100', - '--processes', '1']) + '--sphere', 'repulsion100', + '--processes', '1']) assert not ret.success @@ -71,7 +71,7 @@ def test_execution_symmetric_input(script_runner, monkeypatch): # Using a low resolution sphere for peak extraction reduces process time # Using multiprocessing to test this option. ret = script_runner.run(['scil_aodf_metrics', in_fodf, - '--sphere', 'repulsion100', '--not_all', - '--nufid', 'nufid.nii.gz', - '--processes', '4']) - assert not ret.success + '--sphere', 'repulsion100', '--not_all', + '--nufid', 'nufid.nii.gz', + '--processes', '4']) + assert ret.success From 2ee85ff640d24e3c12354b0fa63cb0baaef1863c Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Sat, 2 Aug 2025 09:24:13 -0400 Subject: [PATCH 76/90] install uv for coverage step --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d5cc9a4c..dc9c69b6f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -100,7 +100,9 @@ jobs: cache: 'pip' - name: Install pycoverage - run: uv pip install coverage + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + uv pip install coverage - name: Download test results and coverage uses: actions/download-artifact@v4 From 2023ee249185d868ff34c1ef0a65e1980f6c94c8 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Sat, 2 Aug 2025 10:18:49 -0400 Subject: [PATCH 77/90] add system to uv installation --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc9c69b6f..bfc0fd6cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -102,7 +102,7 @@ jobs: - name: Install pycoverage run: | curl -LsSf https://astral.sh/uv/install.sh | sh - uv pip install coverage + uv pip install --system coverage - name: Download test results and coverage uses: actions/download-artifact@v4 From b441f760bbf20ce71bb971cd7de8be8e6e1d7c11 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Sat, 2 Aug 2025 11:52:20 -0400 Subject: [PATCH 78/90] restore coverage install --- .github/workflows/test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bfc0fd6cc..b5c20fd11 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -100,9 +100,7 @@ jobs: cache: 'pip' - name: Install pycoverage - run: | - curl -LsSf https://astral.sh/uv/install.sh | sh - uv pip install --system coverage + run: pip install coverage - name: Download test results and coverage uses: actions/download-artifact@v4 From f954d7135ab08450c27bbb8165acd2f4188bfbc4 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Thu, 12 Dec 2024 14:35:31 -0500 Subject: [PATCH 79/90] Test triu_connectivity from endpoints --- scilpy/connectivity/connectivity.py | 6 ++-- .../connectivity/tests/test_connectivity.py | 34 +++++++++++++++++++ ...ectivity_tools.py => test_matrix_tools.py} | 4 --- 3 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 scilpy/connectivity/tests/test_connectivity.py rename scilpy/connectivity/tests/{test_connectivity_tools.py => test_matrix_tools.py} (88%) diff --git a/scilpy/connectivity/connectivity.py b/scilpy/connectivity/connectivity.py index 11ed51a39..8406565bb 100644 --- a/scilpy/connectivity/connectivity.py +++ b/scilpy/connectivity/connectivity.py @@ -117,7 +117,7 @@ def compute_triu_connectivity_from_labels(tractogram, data_labels, return matrix, ordered_labels, start_labels, end_labels -def load_node_nifti(directory, in_label, out_label, ref_img): +def _load_node_nifti(directory, in_label, out_label, ref_img): in_filename = os.path.join(directory, '{}_{}.nii.gz'.format(in_label, out_label)) @@ -252,8 +252,8 @@ def compute_connectivity_matrices_from_hdf5( measures_to_return['streamline_count'] = len(streamlines) if similarity_directory is not None: - density_sim = load_node_nifti(similarity_directory, - in_label, out_label, labels_img) + density_sim = _load_node_nifti(similarity_directory, + in_label, out_label, labels_img) if density_sim is None: ba_vox = 0 else: diff --git a/scilpy/connectivity/tests/test_connectivity.py b/scilpy/connectivity/tests/test_connectivity.py new file mode 100644 index 000000000..0931162a1 --- /dev/null +++ b/scilpy/connectivity/tests/test_connectivity.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +import numpy as np + +from scilpy.connectivity.connectivity import \ + compute_triu_connectivity_from_labels + + +def test_compute_triu_connectivity_from_labels(): + labels = np.asarray([[3, 4, 5, 6], + [7, 8, 9, 10]]) + + # streamline 1 starts at label 4, ends at label 6 + # streamline 2 starts at label 9, ends at label 7 + # streamline 3 too, but not in the center (vox, corner) + tractogram = [np.asarray([[0, 1], + [5, 6], + [0, 3]]), + np.asarray([[1, 2], + [1, 0]]), + np.asarray([[1.1, 2.2], + [1.9, 0.5]])] + output, _, _, _ = compute_triu_connectivity_from_labels( + tractogram, labels) + assert np.array_equal(output.shape, [8, 8]) + expected_out = np.zeros((8, 8)) + expected_out[1, 3] = 1 + expected_out[4, 6] = 2 + assert np.array_equal(output, expected_out) + + +def test_compute_connectivity_matrices_from_hdf5(): + pass + + diff --git a/scilpy/connectivity/tests/test_connectivity_tools.py b/scilpy/connectivity/tests/test_matrix_tools.py similarity index 88% rename from scilpy/connectivity/tests/test_connectivity_tools.py rename to scilpy/connectivity/tests/test_matrix_tools.py index d89ad462e..d3b0595d2 100644 --- a/scilpy/connectivity/tests/test_connectivity_tools.py +++ b/scilpy/connectivity/tests/test_matrix_tools.py @@ -9,10 +9,6 @@ def test_apply_olo(): pass -def test_parse_ordering(): - pass - - def test_apply_reordering(): pass From 5443da25cb49b695b790299a2374da7214b1c8ef Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Thu, 12 Dec 2024 14:44:11 -0500 Subject: [PATCH 80/90] First test matrix_tool --- scilpy/connectivity/matrix_tools.py | 3 ++- .../connectivity/tests/test_connectivity.py | 4 ++-- .../connectivity/tests/test_matrix_tools.py | 23 +++++++++++++++++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/scilpy/connectivity/matrix_tools.py b/scilpy/connectivity/matrix_tools.py index 11a962a40..a33c9c099 100644 --- a/scilpy/connectivity/matrix_tools.py +++ b/scilpy/connectivity/matrix_tools.py @@ -105,7 +105,8 @@ def evaluate_graph_measures(conn_matrix, len_matrix, avg_node_wise, Parameters ---------- - conn_matrix: np.ndarray of shape ?? + conn_matrix: np.ndarray + 2D matrix of connectivity weights. len_matrix: np.ndarray of shape ?? avg_node_wise: bool If true, return a single value for node-wise measures. diff --git a/scilpy/connectivity/tests/test_connectivity.py b/scilpy/connectivity/tests/test_connectivity.py index 0931162a1..384084e7d 100644 --- a/scilpy/connectivity/tests/test_connectivity.py +++ b/scilpy/connectivity/tests/test_connectivity.py @@ -23,8 +23,8 @@ def test_compute_triu_connectivity_from_labels(): tractogram, labels) assert np.array_equal(output.shape, [8, 8]) expected_out = np.zeros((8, 8)) - expected_out[1, 3] = 1 - expected_out[4, 6] = 2 + expected_out[1, 3] = 1 # This is labels (4, 6) + expected_out[4, 6] = 2 # This is labels (7, 9) assert np.array_equal(output, expected_out) diff --git a/scilpy/connectivity/tests/test_matrix_tools.py b/scilpy/connectivity/tests/test_matrix_tools.py index d3b0595d2..02b6b265d 100644 --- a/scilpy/connectivity/tests/test_matrix_tools.py +++ b/scilpy/connectivity/tests/test_matrix_tools.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +import numpy as np + +from scilpy.connectivity.matrix_tools import apply_reordering def test_compute_olo(): @@ -10,8 +13,24 @@ def test_apply_olo(): def test_apply_reordering(): - pass - + conn_matrix = np.asarray([[1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + [13, 14, 15, 16]]) + output = apply_reordering(conn_matrix, [[0, 1, 3, 2], + [1, 2, 3, 0]]) + # First changing rows 2 and 3 + expected_out = np.asarray([[1, 2, 3, 4], + [5, 6, 7, 8], + [13, 14, 15, 16], + [9, 10, 11, 12]]) + # Permuting columns + expected_out = np.asarray([[2, 3, 4, 1], + [6, 7, 8, 5], + [14, 15, 16, 13], + [10, 11, 12, 9]]) + assert np.array_equal(output, expected_out) + def test_evaluate_graph_measures(): pass From 14d65efbdab33ac07200faba8022d7cff5548e1d Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Mon, 3 Feb 2025 10:56:08 -0500 Subject: [PATCH 81/90] apply_olo not used anywhere. Deleting --- scilpy/connectivity/matrix_tools.py | 28 ++----------------- .../connectivity/tests/test_connectivity.py | 1 + .../connectivity/tests/test_matrix_tools.py | 5 +--- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/scilpy/connectivity/matrix_tools.py b/scilpy/connectivity/matrix_tools.py index a33c9c099..1c7de862b 100644 --- a/scilpy/connectivity/matrix_tools.py +++ b/scilpy/connectivity/matrix_tools.py @@ -43,27 +43,6 @@ def compute_olo(array): return perm -def apply_olo(array, perm): - """ - Apply the permutation from compute_RCM. - - Parameters - ---------- - array: ndarray (NxN) - Sparse connectivity matrix. - perm: ndarray (N,) - Permutations for rows and columns to be applied. - - Returns - ------- - ndarray (N,N) - Reordered array. - """ - if array.ndim != 2: - raise ValueError('RCM can only be applied to 2D array.') - return array[perm].T[perm] - - def apply_reordering(array, ordering): """ Apply a non-symmetric array ordering that support non-square output. @@ -101,13 +80,12 @@ def apply_reordering(array, ordering): def evaluate_graph_measures(conn_matrix, len_matrix, avg_node_wise, small_world): """ - toDo Finish docstring - Parameters ---------- conn_matrix: np.ndarray - 2D matrix of connectivity weights. - len_matrix: np.ndarray of shape ?? + 2D matrix of connectivity weights. Typicaly a streamline count matrix. + len_matrix: np.ndarray + 2D matrix of bundle lengths. avg_node_wise: bool If true, return a single value for node-wise measures. small_world: bool diff --git a/scilpy/connectivity/tests/test_connectivity.py b/scilpy/connectivity/tests/test_connectivity.py index 384084e7d..fae95ff9e 100644 --- a/scilpy/connectivity/tests/test_connectivity.py +++ b/scilpy/connectivity/tests/test_connectivity.py @@ -29,6 +29,7 @@ def test_compute_triu_connectivity_from_labels(): def test_compute_connectivity_matrices_from_hdf5(): + # ToDo. We will have to create a test hdf5. pass diff --git a/scilpy/connectivity/tests/test_matrix_tools.py b/scilpy/connectivity/tests/test_matrix_tools.py index 02b6b265d..20602afa2 100644 --- a/scilpy/connectivity/tests/test_matrix_tools.py +++ b/scilpy/connectivity/tests/test_matrix_tools.py @@ -5,10 +5,7 @@ def test_compute_olo(): - pass - - -def test_apply_olo(): + # Simple and basically only using hierarchy's function. Not testing. pass From 9cb23e8fed68ca307a41f43ae89b8f1cf94e1145 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Mon, 3 Feb 2025 11:13:14 -0500 Subject: [PATCH 82/90] Fix missing casting from list to ArraySequence + Fix mode (how to pad out of range) of map_coordinate --- scilpy/connectivity/connectivity.py | 21 +++++---- .../connectivity/tests/test_connectivity.py | 44 +++++++++++-------- .../connectivity/tests/test_matrix_tools.py | 10 ++--- .../streamline_and_mask_operations.py | 4 +- scripts/scil_bundle_diameter.py | 2 +- scripts/scil_bundle_label_map.py | 3 +- .../scil_tractogram_assign_custom_color.py | 3 +- 7 files changed, 49 insertions(+), 38 deletions(-) diff --git a/scilpy/connectivity/connectivity.py b/scilpy/connectivity/connectivity.py index 8406565bb..844fa10cd 100644 --- a/scilpy/connectivity/connectivity.py +++ b/scilpy/connectivity/connectivity.py @@ -5,7 +5,7 @@ from dipy.io.stateful_tractogram import StatefulTractogram from dipy.io.utils import is_header_compatible, get_reference_info -from dipy.tracking.streamlinespeed import length +from dipy.tracking.streamlinespeed import length, set_number_of_points from dipy.tracking.vox2track import _streamlines_in_mask import h5py import nibabel as nib @@ -38,7 +38,7 @@ def compute_triu_connectivity_from_labels(tractogram, data_labels, When using directly with a list of streamlines, streamlines must be in vox space, center origin. data_labels: np.ndarray - The loaded nifti image. + The loaded nifti image. Must be 3D. keep_background: Bool By default, the background (label 0) is not included in the matrix. If True, label 0 is kept. @@ -66,25 +66,30 @@ def compute_triu_connectivity_from_labels(tractogram, data_labels, streamlines = sfs_2_pts.streamlines else: - streamlines = tractogram + # Using directly on streamlines, no SFT. Usually not recommended, + # useful for dwi_ml methods. Calling directly dipy's resampling. + streamlines = nib.streamlines.ArraySequence(tractogram) + streamlines = set_number_of_points(streamlines, 2) ordered_labels = list(np.sort(np.unique(data_labels))) - assert ordered_labels[0] >= 0, "Only accepting positive labels." + assert ordered_labels[0] >= 0, "Only accepting positive labels, or 0." nb_labels = len(ordered_labels) logging.debug("Computing connectivity matrix for {} labels." .format(nb_labels)) matrix = np.zeros((nb_labels, nb_labels), dtype=int) - - labels = map_coordinates(data_labels, streamlines._data.T, order=0) + labels = map_coordinates(data_labels, streamlines._data.T, order=0, + mode='nearest') start_labels = labels[0::2] end_labels = labels[1::2] # sort each pair of labels for start to be smaller than end start_labels, end_labels = zip(*[sorted(pair) for pair in zip(start_labels, end_labels)]) - - np.add.at(matrix, (start_labels, end_labels), 1) + ordered_labels = list(ordered_labels) + start_index = [ordered_labels.index(label) for label in start_labels] + end_index = [ordered_labels.index(label) for label in end_labels] + np.add.at(matrix, (start_index, end_index), 1) assert matrix.sum() == len(streamlines) # Rejecting background diff --git a/scilpy/connectivity/tests/test_connectivity.py b/scilpy/connectivity/tests/test_connectivity.py index fae95ff9e..d8c04d283 100644 --- a/scilpy/connectivity/tests/test_connectivity.py +++ b/scilpy/connectivity/tests/test_connectivity.py @@ -7,29 +7,37 @@ def test_compute_triu_connectivity_from_labels(): labels = np.asarray([[3, 4, 5, 6], - [7, 8, 9, 10]]) - - # streamline 1 starts at label 4, ends at label 6 - # streamline 2 starts at label 9, ends at label 7 - # streamline 3 too, but not in the center (vox, corner) - tractogram = [np.asarray([[0, 1], - [5, 6], - [0, 3]]), - np.asarray([[1, 2], - [1, 0]]), - np.asarray([[1.1, 2.2], - [1.9, 0.5]])] + [7, 8, 9, 10], + [11, 12, 13, 14]]) + labels = labels[:, :, None] + labels = np.concatenate([labels, labels, labels], axis=-1) + # Data shape: (3, 4, 3) + + # vox space, center origin + # streamline 1 : Easy (middle voxel). + # starts at voxel (1, 1, 1) = label 8, + # ends at voxel (1.1, 0.8, 1.1) = label 8. + # streamline 2: Border management, center of the voxel + # starts at voxel (0, 1, 0) = label 4 + # ends at voxel (2, 0, 0) = label 11 + # streamline 3: Idem, but not in the center (vox, center) + tractogram = [np.asarray([[1.0, 1.0, 1.0], + [5.0, 6.1, 10.1], + [1.1, 0.8, 1.1]]), + np.asarray([[0.0, 1.0, 0.0], + [2.0, 0.0, 0.0]]), + np.asarray([[-0.3, 0.8, -0.2], + [2.1, 0.3, -0.2]])] output, _, _, _ = compute_triu_connectivity_from_labels( tractogram, labels) - assert np.array_equal(output.shape, [8, 8]) - expected_out = np.zeros((8, 8)) - expected_out[1, 3] = 1 # This is labels (4, 6) - expected_out[4, 6] = 2 # This is labels (7, 9) + + assert np.array_equal(output.shape, [12, 12]) # 12 labels + expected_out = np.zeros((12, 12)) + expected_out[5, 5] = 1 # One streamline with label (8, 8) => [5, 5] + expected_out[1, 8] = 2 # Two streamlines with label (4, 11) = [1, 8] assert np.array_equal(output, expected_out) def test_compute_connectivity_matrices_from_hdf5(): # ToDo. We will have to create a test hdf5. pass - - diff --git a/scilpy/connectivity/tests/test_matrix_tools.py b/scilpy/connectivity/tests/test_matrix_tools.py index 20602afa2..7a4fbdb88 100644 --- a/scilpy/connectivity/tests/test_matrix_tools.py +++ b/scilpy/connectivity/tests/test_matrix_tools.py @@ -16,18 +16,14 @@ def test_apply_reordering(): [13, 14, 15, 16]]) output = apply_reordering(conn_matrix, [[0, 1, 3, 2], [1, 2, 3, 0]]) - # First changing rows 2 and 3 - expected_out = np.asarray([[1, 2, 3, 4], - [5, 6, 7, 8], - [13, 14, 15, 16], - [9, 10, 11, 12]]) - # Permuting columns + + # Changing rows 2 and 3 + permuting columns expected_out = np.asarray([[2, 3, 4, 1], [6, 7, 8, 5], [14, 15, 16, 13], [10, 11, 12, 9]]) assert np.array_equal(output, expected_out) - + def test_evaluate_graph_measures(): pass diff --git a/scilpy/tractograms/streamline_and_mask_operations.py b/scilpy/tractograms/streamline_and_mask_operations.py index 98fcae889..93f4f0c1a 100644 --- a/scilpy/tractograms/streamline_and_mask_operations.py +++ b/scilpy/tractograms/streamline_and_mask_operations.py @@ -600,9 +600,9 @@ def _intersects_two_rois(roi_data_1, roi_data_2, strl_indices, # Find all the points of the streamline that are in the ROIs roi_data_1_intersect = map_coordinates( - roi_data_1, strl_indices.T, order=0, mode='constant', cval=0) + roi_data_1, strl_indices.T, order=0, mode='nearest') roi_data_2_intersect = map_coordinates( - roi_data_2, strl_indices.T, order=0, mode='constant', cval=0) + roi_data_2, strl_indices.T, order=0, mode='nearest') # Get the indices of the voxels intersecting with the ROIs in_strl_indices = np.argwhere(roi_data_1_intersect).squeeze(-1) diff --git a/scripts/scil_bundle_diameter.py b/scripts/scil_bundle_diameter.py index bd08ef8b8..6a59d1d85 100755 --- a/scripts/scil_bundle_diameter.py +++ b/scripts/scil_bundle_diameter.py @@ -269,7 +269,7 @@ def main(): labels_dict = {label: ([], []) for label in unique_labels} pts_labels = map_coordinates(data_labels, sft.streamlines._data.T-0.5, - order=0) + order=0, mode='nearest') # For each label, all positions and directions are needed to get # a tube estimation per label. for streamline in sft.streamlines: diff --git a/scripts/scil_bundle_label_map.py b/scripts/scil_bundle_label_map.py index 68dc36905..3f5a97d6a 100755 --- a/scripts/scil_bundle_label_map.py +++ b/scripts/scil_bundle_label_map.py @@ -357,7 +357,8 @@ def main(): if len(cut_sft): tmp_data = ndi.map_coordinates( - map, cut_sft.streamlines._data.T - 0.5, order=0) + map, cut_sft.streamlines._data.T - 0.5, order=0, + mode='nearest') if basename == 'labels': max_val = args.nb_pts diff --git a/scripts/scil_tractogram_assign_custom_color.py b/scripts/scil_tractogram_assign_custom_color.py index 430135c17..2b83abe43 100755 --- a/scripts/scil_tractogram_assign_custom_color.py +++ b/scripts/scil_tractogram_assign_custom_color.py @@ -214,7 +214,8 @@ def main(): 'but got {}'.format(expected_shape, len(data))) else: # args.from_anatomy: data = nib.load(args.from_anatomy).get_fdata() - data = map_coordinates(data, concat_points, order=0) + data = map_coordinates(data, concat_points, order=0, + mode='nearest') elif args.along_profile: data = get_streamlines_as_linspaces(sft) data = np.hstack(data) From 307362c2e4102f24d9855d3045f82ef62cd844dd Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Mon, 4 Aug 2025 12:44:56 -0400 Subject: [PATCH 83/90] answer francois comments + pep8 tests + improve time with mask --- src/scilpy/cli/tests/test_NODDI_maps.py | 20 +- src/scilpy/cli/tests/test_NODDI_priors.py | 10 +- src/scilpy/cli/tests/test_aodf_metrics.py | 2 +- src/scilpy/cli/tests/test_bids_validate.py | 3 +- src/scilpy/cli/tests/test_bingham_metrics.py | 14 +- src/scilpy/cli/tests/test_btensor_metrics.py | 72 ++--- .../tests/test_bundle_alter_to_target_dice.py | 32 +- .../cli/tests/test_bundle_compute_centroid.py | 2 +- .../test_bundle_compute_endpoints_map.py | 6 +- src/scilpy/cli/tests/test_bundle_diameter.py | 4 +- .../cli/tests/test_bundle_fixel_analysis.py | 40 +-- .../cli/tests/test_bundle_generate_priors.py | 6 +- src/scilpy/cli/tests/test_bundle_label_map.py | 14 +- .../cli/tests/test_bundle_mean_fixel_afd.py | 5 +- .../test_bundle_mean_fixel_afd_from_hdf5.py | 7 +- .../cli/tests/test_bundle_reject_outliers.py | 8 +- .../test_connectivity_compare_populations.py | 4 +- .../test_connectivity_compute_matrices.py | 14 +- .../cli/tests/test_connectivity_filter.py | 6 +- .../cli/tests/test_connectivity_normalize.py | 4 +- .../tests/test_connectivity_reorder_rois.py | 6 +- .../cli/tests/test_denoising_nlmeans.py | 25 +- src/scilpy/cli/tests/test_dki_metrics.py | 17 +- src/scilpy/cli/tests/test_dti_metrics.py | 24 +- src/scilpy/cli/tests/test_dwi_compute_snr.py | 6 +- src/scilpy/cli/tests/test_dwi_concatenate.py | 8 +- .../cli/tests/test_dwi_extract_shell.py | 20 +- .../tests/test_fibertube_compute_density.py | 21 +- .../tests/test_fibertube_score_tractogram.py | 4 +- .../cli/tests/test_fibertube_tracking.py | 78 ++--- src/scilpy/cli/tests/test_fodf_bundleparc.py | 12 +- src/scilpy/cli/tests/test_fodf_memsmt.py | 50 +-- src/scilpy/cli/tests/test_fodf_metrics.py | 10 +- src/scilpy/cli/tests/test_fodf_msmt.py | 16 +- src/scilpy/cli/tests/test_fodf_ssst.py | 6 +- src/scilpy/cli/tests/test_fodf_to_bingham.py | 30 +- src/scilpy/cli/tests/test_freewater_maps.py | 14 +- src/scilpy/cli/tests/test_frf_mean.py | 6 +- src/scilpy/cli/tests/test_frf_memsmt.py | 94 +++--- src/scilpy/cli/tests/test_frf_msmt.py | 48 +-- .../cli/tests/test_frf_set_diffusivities.py | 11 +- .../cli/tests/test_gradients_convert.py | 22 +- .../tests/test_gradients_generate_sampling.py | 6 +- .../tests/test_gradients_validate_correct.py | 9 +- .../test_gradients_validate_correct_eddy.py | 17 +- .../tests/test_gradients_validate_sampling.py | 4 +- .../test_header_validate_compatibility.py | 2 +- .../test_json_convert_entries_to_xlsx.py | 2 +- .../cli/tests/test_json_harmonize_entries.py | 21 ++ .../cli/tests/test_json_merge_entries.py | 6 +- src/scilpy/cli/tests/test_labels_combine.py | 18 +- src/scilpy/cli/tests/test_labels_dilate.py | 4 +- src/scilpy/cli/tests/test_labels_from_mask.py | 20 +- src/scilpy/cli/tests/test_labels_remove.py | 4 +- .../tests/test_labels_split_volume_by_ids.py | 2 +- .../test_labels_split_volume_from_lut.py | 4 +- .../cli/tests/test_lesions_generate_nawm.py | 4 +- .../tests/test_lesions_harmonize_labels.py | 5 +- src/scilpy/cli/tests/test_lesions_info.py | 20 ++ src/scilpy/cli/tests/test_mrds_metrics.py | 20 +- .../test_mrds_select_number_of_tensors.py | 14 +- src/scilpy/cli/tests/test_mti_maps_MT.py | 190 ++++++------ src/scilpy/cli/tests/test_mti_maps_ihMT.py | 292 +++++++++--------- src/scilpy/cli/tests/test_search_keywords.py | 3 +- src/scilpy/cli/tests/test_sh_convert.py | 4 +- src/scilpy/cli/tests/test_sh_to_aodf.py | 31 +- src/scilpy/cli/tests/test_sh_to_rish.py | 2 +- src/scilpy/cli/tests/test_sh_to_sf.py | 36 +-- .../cli/tests/test_stats_group_comparison.py | 10 +- .../cli/tests/test_surface_apply_transform.py | 2 +- src/scilpy/cli/tests/test_surface_convert.py | 6 +- src/scilpy/cli/tests/test_surface_create.py | 64 ++-- src/scilpy/cli/tests/test_surface_flip.py | 2 +- src/scilpy/cli/tests/test_surface_smooth.py | 2 +- src/scilpy/cli/tests/test_tracking_local.py | 95 +++--- .../cli/tests/test_tracking_local_dev.py | 43 +-- src/scilpy/cli/tests/test_tracking_pft.py | 9 +- .../cli/tests/test_tracking_pft_maps.py | 2 +- .../cli/tests/test_tracking_pft_maps_edit.py | 6 +- .../tests/test_tractogram_apply_transform.py | 6 +- ...test_tractogram_apply_transform_to_hdf5.py | 4 +- .../test_tractogram_assign_custom_color.py | 16 +- .../test_tractogram_assign_uniform_color.py | 17 +- .../cli/tests/test_tractogram_compress.py | 2 +- .../cli/tests/test_tractogram_compute_TODI.py | 21 +- .../test_tractogram_compute_density_map.py | 4 +- .../test_tractogram_convert_hdf5_to_trk.py | 13 +- .../test_tractogram_convert_trk_to_hdf5.py | 10 +- .../tests/test_tractogram_cut_streamlines.py | 72 ++--- .../cli/tests/test_tractogram_detect_loops.py | 10 +- .../cli/tests/test_tractogram_dpp_math.py | 34 +- .../cli/tests/test_tractogram_dps_math.py | 80 ++--- .../tests/test_tractogram_extract_ushape.py | 10 +- .../test_tractogram_filter_by_anatomy.py | 20 +- .../tests/test_tractogram_filter_by_length.py | 18 +- .../test_tractogram_filter_by_orientation.py | 9 +- .../tests/test_tractogram_filter_by_roi.py | 24 +- .../test_tractogram_filter_collisions.py | 28 +- src/scilpy/cli/tests/test_tractogram_flip.py | 2 +- src/scilpy/cli/tests/test_tractogram_math.py | 60 ++-- .../test_tractogram_pairwise_comparison.py | 12 +- ...t_tractogram_project_map_to_streamlines.py | 42 +-- ...t_tractogram_project_streamlines_to_map.py | 38 +-- src/scilpy/cli/tests/test_tractogram_qbx.py | 2 +- .../cli/tests/test_tractogram_register.py | 4 +- .../tests/test_tractogram_remove_invalid.py | 4 +- .../cli/tests/test_tractogram_resample.py | 18 +- .../test_tractogram_resample_nb_points.py | 4 +- .../tests/test_tractogram_seed_density_map.py | 2 +- ...ctogram_segment_connections_from_labels.py | 3 +- ...t_tractogram_segment_with_ROI_and_score.py | 6 +- .../test_tractogram_segment_with_bundleseg.py | 8 +- ...est_tractogram_segment_with_recobundles.py | 12 +- .../cli/tests/test_tractogram_shuffle.py | 2 +- .../cli/tests/test_tractogram_smooth.py | 5 +- src/scilpy/cli/tests/test_tractogram_split.py | 10 +- src/scilpy/cli/tests/test_viz_bingham_fit.py | 2 +- src/scilpy/cli/tests/test_viz_connectivity.py | 9 +- src/scilpy/cli/tests/test_viz_fodf.py | 18 +- .../cli/tests/test_viz_volume_histogram.py | 2 +- .../cli/tests/test_viz_volume_scatterplot.py | 26 +- .../cli/tests/test_viz_volume_screenshot.py | 10 +- .../cli/tests/test_volume_apply_transform.py | 18 +- .../cli/tests/test_volume_b0_synthesis.py | 6 +- .../test_volume_count_non_zero_voxels.py | 4 +- src/scilpy/cli/tests/test_volume_crop.py | 4 +- .../cli/tests/test_volume_distance_map.py | 4 +- src/scilpy/cli/tests/test_volume_flip.py | 2 +- src/scilpy/cli/tests/test_volume_math.py | 14 +- .../tests/test_volume_pairwise_comparison.py | 22 +- .../test_volume_remove_outliers_ransac.py | 2 +- src/scilpy/cli/tests/test_volume_resample.py | 12 +- src/scilpy/cli/tests/test_volume_reshape.py | 20 +- .../tests/test_volume_reslice_to_reference.py | 8 +- .../cli/tests/test_volume_stats_in_ROI.py | 10 +- .../cli/tests/test_volume_stats_in_labels.py | 10 +- .../tractanalysis/afd_along_streamlines.py | 4 +- 137 files changed, 1341 insertions(+), 1280 deletions(-) diff --git a/src/scilpy/cli/tests/test_NODDI_maps.py b/src/scilpy/cli/tests/test_NODDI_maps.py index 70fcf3a7e..b4dbe7ff9 100644 --- a/src/scilpy/cli/tests/test_NODDI_maps.py +++ b/src/scilpy/cli/tests/test_NODDI_maps.py @@ -29,11 +29,11 @@ def test_execution_commit_amico(script_runner, monkeypatch): mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') ret = script_runner.run(['scil_NODDI_maps', in_dwi, - in_bval, in_bvec, '--mask', mask, - '--out_dir', 'noddi', '--tol', '30', - '--para_diff', '0.0017', '--iso_diff', '0.003', - '--lambda1', '0.5', '--lambda2', '0.001', - '--processes', '1', '-f']) + in_bval, in_bvec, '--mask', mask, + '--out_dir', 'noddi', '--tol', '30', + '--para_diff', '0.0017', '--iso_diff', '0.003', + '--lambda1', '0.5', '--lambda2', '0.001', + '--processes', '1', '-f']) assert ret.success @@ -46,9 +46,9 @@ def test_single_shell_fail(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') ret = script_runner.run(['scil_NODDI_maps', in_dwi, - in_bval, in_bvec, - '--out_dir', 'noddi', '--tol', '30', - '--para_diff', '0.0017', '--iso_diff', '0.003', - '--lambda1', '0.5', '--lambda2', '0.001', - '--processes', '1', '-f']) + in_bval, in_bvec, + '--out_dir', 'noddi', '--tol', '30', + '--para_diff', '0.0017', '--iso_diff', '0.003', + '--lambda1', '0.5', '--lambda2', '0.001', + '--processes', '1', '-f']) assert not ret.success diff --git a/src/scilpy/cli/tests/test_NODDI_priors.py b/src/scilpy/cli/tests/test_NODDI_priors.py index 8e0e53f52..b3aa375a7 100644 --- a/src/scilpy/cli/tests/test_NODDI_priors.py +++ b/src/scilpy/cli/tests/test_NODDI_priors.py @@ -28,9 +28,9 @@ def test_execution_commit_amico(script_runner, monkeypatch): in_rd = os.path.join(SCILPY_HOME, 'processing', 'rd.nii.gz') ret = script_runner.run(['scil_NODDI_priors', in_fa, in_ad, in_rd, in_md, - '--out_txt_1fiber_para', '1fiber_para.txt', - '--out_txt_1fiber_perp', '1fiber_perp.txt', - '--out_mask_1fiber', '1fiber.nii.gz', - '--out_txt_ventricles', 'ventricules.txt', - '--out_mask_ventricles', 'ventricules.nii.gz']) + '--out_txt_1fiber_para', '1fiber_para.txt', + '--out_txt_1fiber_perp', '1fiber_perp.txt', + '--out_mask_1fiber', '1fiber.nii.gz', + '--out_txt_ventricles', 'ventricules.txt', + '--out_mask_ventricles', 'ventricules.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_aodf_metrics.py b/src/scilpy/cli/tests/test_aodf_metrics.py index 63ba83076..a6daa9aee 100644 --- a/src/scilpy/cli/tests/test_aodf_metrics.py +++ b/src/scilpy/cli/tests/test_aodf_metrics.py @@ -73,5 +73,5 @@ def test_execution_symmetric_input(script_runner, monkeypatch): ret = script_runner.run(['scil_aodf_metrics', in_fodf, '--sphere', 'repulsion100', '--not_all', '--nufid', 'nufid.nii.gz', - '--processes', '4']) + '--processes', '4', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bids_validate.py b/src/scilpy/cli/tests/test_bids_validate.py index 326936213..462c73e03 100644 --- a/src/scilpy/cli/tests/test_bids_validate.py +++ b/src/scilpy/cli/tests/test_bids_validate.py @@ -51,7 +51,8 @@ def generate_image_packet( metadata = generate_fake_metadata_json( intended_for, phase_dir, readout, **kwargs) if metadata: - with open(os.path.join(directory, "{}.json".format(prefix)), "w+") as f: + with open(os.path.join(directory, "{}.json".format(prefix)), + "w+") as f: json.dump(metadata, f) diff --git a/src/scilpy/cli/tests/test_bingham_metrics.py b/src/scilpy/cli/tests/test_bingham_metrics.py index f71415e9e..d6e9e72ff 100644 --- a/src/scilpy/cli/tests/test_bingham_metrics.py +++ b/src/scilpy/cli/tests/test_bingham_metrics.py @@ -24,8 +24,8 @@ def test_execution_processing(script_runner, monkeypatch): 'fodf_bingham.nii.gz') ret = script_runner.run(['scil_bingham_metrics', - in_bingham, '--nbr_integration_steps', '10', - '--processes', '1']) + in_bingham, '--nbr_integration_steps', '10', + '--processes', '1']) assert ret.success @@ -38,8 +38,8 @@ def test_execution_processing_mask(script_runner, monkeypatch): 'seed.nii.gz') ret = script_runner.run(['scil_bingham_metrics', - in_bingham, '--nbr_integration_steps', '10', - '--processes', '1', '--mask', in_mask, '-f']) + in_bingham, '--nbr_integration_steps', '10', + '--processes', '1', '--mask', in_mask, '-f']) assert ret.success @@ -50,8 +50,8 @@ def test_execution_processing_not_all(script_runner, monkeypatch): 'fodf_bingham.nii.gz') ret = script_runner.run(['scil_bingham_metrics', - in_bingham, '--nbr_integration_steps', '10', - '--processes', '1', '--not_all', '--out_fs', - 'fs.nii.gz', '-f']) + in_bingham, '--nbr_integration_steps', '10', + '--processes', '1', '--not_all', '--out_fs', + 'fs.nii.gz', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_btensor_metrics.py b/src/scilpy/cli/tests/test_btensor_metrics.py index b81ab34fa..b25e4d49c 100644 --- a/src/scilpy/cli/tests/test_btensor_metrics.py +++ b/src/scilpy/cli/tests/test_btensor_metrics.py @@ -34,20 +34,21 @@ def test_nb_btensors_check(script_runner, monkeypatch): 'fa.nii.gz') ret = script_runner.run(['scil_btensor_metrics', '--in_dwis', - in_dwi_lin, '--in_bvals', in_bval_lin, - '--in_bvecs', in_bvec_lin, '--in_bdeltas', '1', - '--fa', fa, '--do_weight_bvals', - '--do_weight_pa', '--do_multiple_s0', - '--processes', '1', '-f']) + in_dwi_lin, '--in_bvals', in_bval_lin, + '--in_bvecs', in_bvec_lin, '--in_bdeltas', '1', + '--fa', fa, '--do_weight_bvals', + '--do_weight_pa', '--do_multiple_s0', + '--processes', '1', '-f']) assert (not ret.success) ret = script_runner.run(['scil_btensor_metrics', '--in_dwis', - in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, - in_bval_plan, '--in_bvecs', in_bvec_lin, - in_bvec_plan, '--in_bdeltas', '1', '1', - '--fa', fa, '--do_weight_bvals', - '--do_weight_pa', '--do_multiple_s0', - '--processes', '1', '-f']) + in_dwi_lin, in_dwi_plan, + '--in_bvals', in_bval_lin, + in_bval_plan, '--in_bvecs', in_bvec_lin, + in_bvec_plan, '--in_bdeltas', '1', '1', + '--fa', fa, '--do_weight_bvals', + '--do_weight_pa', '--do_multiple_s0', + '--processes', '1', '-f']) assert (not ret.success) @@ -69,29 +70,30 @@ def test_inputs_check(script_runner, monkeypatch): 'fa.nii.gz') ret = script_runner.run(['scil_btensor_metrics', '--in_dwis', - in_dwi_lin, in_dwi_plan, '--in_bvals', in_bval_lin, - '--in_bvecs', in_bvec_lin, '--in_bdeltas', '1', - '--fa', fa, '--do_weight_bvals', - '--do_weight_pa', '--do_multiple_s0', - '--processes', '1', '-f']) + in_dwi_lin, in_dwi_plan, + '--in_bvals', in_bval_lin, + '--in_bvecs', in_bvec_lin, '--in_bdeltas', '1', + '--fa', fa, '--do_weight_bvals', + '--do_weight_pa', '--do_multiple_s0', + '--processes', '1', '-f']) assert (not ret.success) ret = script_runner.run(['scil_btensor_metrics', '--in_dwis', - in_dwi_lin, in_dwi_plan, '--in_bvals', - in_bval_lin, in_bval_plan, '--in_bvecs', - in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', - '-0.5', '0', '--fa', fa, '--do_weight_bvals', - '--do_weight_pa', '--do_multiple_s0', - '--processes', '1', '-f']) + in_dwi_lin, in_dwi_plan, '--in_bvals', + in_bval_lin, in_bval_plan, '--in_bvecs', + in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', + '-0.5', '0', '--fa', fa, '--do_weight_bvals', + '--do_weight_pa', '--do_multiple_s0', + '--processes', '1', '-f']) assert (not ret.success) ret = script_runner.run(['scil_btensor_metrics', '--in_dwis', - in_dwi_lin, in_dwi_plan, '--in_bvals', - in_bval_lin, in_bval_plan, '--in_bvecs', - in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', - '-0.5', '--op', fa, '--do_weight_bvals', - '--do_weight_pa', '--do_multiple_s0', - '--processes', '1', '-f']) + in_dwi_lin, in_dwi_plan, '--in_bvals', + in_bval_lin, in_bval_plan, '--in_bvecs', + in_bvec_lin, in_bvec_plan, '--in_bdeltas', '1', + '-0.5', '--op', fa, '--do_weight_bvals', + '--do_weight_pa', '--do_multiple_s0', + '--processes', '1', '-f']) assert (not ret.success) @@ -119,11 +121,11 @@ def test_execution_processing(script_runner, monkeypatch): 'fa.nii.gz') ret = script_runner.run(['scil_btensor_metrics', '--in_dwis', - in_dwi_lin, in_dwi_plan, in_dwi_sph, - '--in_bvals', in_bval_lin, in_bval_plan, - in_bval_sph, '--in_bvecs', in_bvec_lin, - in_bvec_plan, in_bvec_sph, '--in_bdeltas', - '1', '-0.5', '0', '--fa', fa, '--do_weight_bvals', - '--do_weight_pa', '--do_multiple_s0', - '--processes', '1', '-f']) + in_dwi_lin, in_dwi_plan, in_dwi_sph, + '--in_bvals', in_bval_lin, in_bval_plan, + in_bval_sph, '--in_bvecs', in_bvec_lin, + in_bvec_plan, in_bvec_sph, '--in_bdeltas', + '1', '-0.5', '0', '--fa', fa, '--do_weight_bvals', + '--do_weight_pa', '--do_multiple_s0', + '--processes', '1', '-f']) assert (ret.success) diff --git a/src/scilpy/cli/tests/test_bundle_alter_to_target_dice.py b/src/scilpy/cli/tests/test_bundle_alter_to_target_dice.py index e4d8e4b78..6f387cf4d 100644 --- a/src/scilpy/cli/tests/test_bundle_alter_to_target_dice.py +++ b/src/scilpy/cli/tests/test_bundle_alter_to_target_dice.py @@ -22,9 +22,9 @@ def test_execution_subsample(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') ret = script_runner.run(['scil_bundle_alter_to_target_dice', - in_bundle, 'out_tractogram_subsample.trk', - '--min_dice', '0.75', '--epsilon', '0.01', - '--subsample', '--shuffle', '-v']) + in_bundle, 'out_tractogram_subsample.trk', + '--min_dice', '0.75', '--epsilon', '0.01', + '--subsample', '--shuffle', '-v']) assert ret.success @@ -33,9 +33,9 @@ def test_execution_trim(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') ret = script_runner.run(['scil_bundle_alter_to_target_dice', - in_bundle, 'out_tractogram_trim.trk', - '--min_dice', '0.75', '--epsilon', '0.01', - '--trim', '-v']) + in_bundle, 'out_tractogram_trim.trk', + '--min_dice', '0.75', '--epsilon', '0.01', + '--trim', '-v']) assert ret.success @@ -44,9 +44,9 @@ def test_execution_cut(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') ret = script_runner.run(['scil_bundle_alter_to_target_dice', - in_bundle, 'out_tractogram_cut.trk', - '--min_dice', '0.75', '--epsilon', '0.01', - '--cut', '-v', 'DEBUG']) + in_bundle, 'out_tractogram_cut.trk', + '--min_dice', '0.75', '--epsilon', '0.01', + '--cut', '-v', 'DEBUG']) assert ret.success @@ -55,9 +55,9 @@ def test_execution_replace(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') ret = script_runner.run(['scil_bundle_alter_to_target_dice', - in_bundle, 'out_tractogram_replace.trk', - '--min_dice', '0.75', '--epsilon', '0.01', - '--replace', '-v']) + in_bundle, 'out_tractogram_replace.trk', + '--min_dice', '0.75', '--epsilon', '0.01', + '--replace', '-v']) assert ret.success @@ -66,9 +66,9 @@ def test_execution_transform(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') ret = script_runner.run(['scil_bundle_alter_to_target_dice', - in_bundle, 'out_tractogram_transform.trk', - '--min_dice', '0.75', '--epsilon', '0.01', - '--transform', '--save_transform', - 'transform.txt', '-v']) + in_bundle, 'out_tractogram_transform.trk', + '--min_dice', '0.75', '--epsilon', '0.01', + '--transform', '--save_transform', + 'transform.txt', '-v']) assert ret.success assert os.path.isfile('transform.txt') diff --git a/src/scilpy/cli/tests/test_bundle_compute_centroid.py b/src/scilpy/cli/tests/test_bundle_compute_centroid.py index 3eeb6de2b..703f38e52 100644 --- a/src/scilpy/cli/tests/test_bundle_compute_centroid.py +++ b/src/scilpy/cli/tests/test_bundle_compute_centroid.py @@ -21,5 +21,5 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') ret = script_runner.run(['scil_bundle_compute_centroid', - in_bundle, 'IFGWM_uni_c.trk']) + in_bundle, 'IFGWM_uni_c.trk']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_compute_endpoints_map.py b/src/scilpy/cli/tests/test_bundle_compute_endpoints_map.py index 95cce01c4..eba75e4f5 100644 --- a/src/scilpy/cli/tests/test_bundle_compute_endpoints_map.py +++ b/src/scilpy/cli/tests/test_bundle_compute_endpoints_map.py @@ -21,7 +21,7 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') ret = script_runner.run(['scil_bundle_compute_endpoints_map', in_bundle, - 'head.nii.gz', 'tail.nii.gz', '--binary', '-f']) + 'head.nii.gz', 'tail.nii.gz', '--binary', '-f']) assert ret.success @@ -30,7 +30,7 @@ def test_execution_tractometry_mm_distance5(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni.trk') ret = script_runner.run(['scil_bundle_compute_endpoints_map', in_bundle, - 'head.nii.gz', 'tail.nii.gz', '--binary', - '--distance', '5', '--unit', 'mm', '-f']) + 'head.nii.gz', 'tail.nii.gz', '--binary', + '--distance', '5', '--unit', 'mm', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_diameter.py b/src/scilpy/cli/tests/test_bundle_diameter.py index 680f82476..e82adbc66 100644 --- a/src/scilpy/cli/tests/test_bundle_diameter.py +++ b/src/scilpy/cli/tests/test_bundle_diameter.py @@ -23,6 +23,6 @@ def test_execution_tractometry(script_runner, monkeypatch): in_labels = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_labels_map.nii.gz') ret = script_runner.run(['scil_bundle_diameter', in_bundle, in_labels, - '--wireframe', '--fitting_func', 'lin_up', - '--save_rendering', tmp_dir.name]) + '--wireframe', '--fitting_func', 'lin_up', + '--save_rendering', tmp_dir.name]) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_fixel_analysis.py b/src/scilpy/cli/tests/test_bundle_fixel_analysis.py index a879c3953..7636daf04 100644 --- a/src/scilpy/cli/tests/test_bundle_fixel_analysis.py +++ b/src/scilpy/cli/tests/test_bundle_fixel_analysis.py @@ -23,8 +23,8 @@ def test_default_parameters(script_runner, monkeypatch): # Using multiprocessing in this test, single in following tests. ret = script_runner.run(['scil_bundle_fixel_analysis', in_peaks, - '--in_bundles', in_bundle, - '--processes', '4', '-f']) + '--in_bundles', in_bundle, + '--processes', '4', '-f']) assert ret.success @@ -34,14 +34,14 @@ def test_all_parameters(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'commit_amico', 'tracking.trk') ret = script_runner.run(['scil_bundle_fixel_analysis', in_peaks, - '--in_bundles', in_bundle, - '--in_bundles_names', 'test', - '--abs_thr', '5', - '--rel_thr', '0.05', - '--norm', 'fixel', - '--split_bundles', '--split_fixels', - '--single_bundle', - '--processes', '1', '-f']) + '--in_bundles', in_bundle, + '--in_bundles_names', 'test', + '--abs_thr', '5', + '--rel_thr', '0.05', + '--norm', 'fixel', + '--split_bundles', '--split_fixels', + '--single_bundle', + '--processes', '1', '-f']) assert ret.success @@ -51,15 +51,15 @@ def test_multiple_norm(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'commit_amico', 'tracking.trk') ret = script_runner.run(['scil_bundle_fixel_analysis', in_peaks, - '--in_bundles', in_bundle, - '--in_bundles_names', 'test', - '--abs_thr', '5', - '--rel_thr', '0.05', - '--norm', 'fixel', 'none', 'voxel', - '--split_bundles', '--split_fixels', - '--single_bundle', - '--out_dir', '.', - '--processes', '1', '-f']) + '--in_bundles', in_bundle, + '--in_bundles_names', 'test', + '--abs_thr', '5', + '--rel_thr', '0.05', + '--norm', 'fixel', 'none', 'voxel', + '--split_bundles', '--split_fixels', + '--single_bundle', + '--out_dir', '.', + '--processes', '1', '-f']) assert ret.success assert os.path.isfile('bundles_LUT.txt') for n in ['voxel', 'fixel', 'none']: @@ -77,7 +77,7 @@ def test_multiple_norm(script_runner, monkeypatch): 'norm_WM.nii.gz'.format(n)) assert os.path.isfile('single_bundle_mask_{}-' 'norm_test.nii.gz'.format(n)) - + assert os.path.isfile('voxel_density_maps_voxel-norm.nii.gz') assert not os.path.isfile('voxel_density_maps_fixel-norm.nii.gz') assert os.path.isfile('voxel_density_maps_none-norm.nii.gz') diff --git a/src/scilpy/cli/tests/test_bundle_generate_priors.py b/src/scilpy/cli/tests/test_bundle_generate_priors.py index 64cf91dfa..8c636346e 100644 --- a/src/scilpy/cli/tests/test_bundle_generate_priors.py +++ b/src/scilpy/cli/tests/test_bundle_generate_priors.py @@ -23,7 +23,7 @@ def test_execution_bst(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'bst', 'fodf.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') ret = script_runner.run(['scil_bundle_generate_priors', - in_bundle, in_fodf, in_mask, - '--todi_sigma', '1', '--out_prefix', 'rpt_m', - '--sh_basis', 'descoteaux07']) + in_bundle, in_fodf, in_mask, + '--todi_sigma', '1', '--out_prefix', 'rpt_m', + '--sh_basis', 'descoteaux07']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_label_map.py b/src/scilpy/cli/tests/test_bundle_label_map.py index 9c263c20d..1da506c51 100644 --- a/src/scilpy/cli/tests/test_bundle_label_map.py +++ b/src/scilpy/cli/tests/test_bundle_label_map.py @@ -25,9 +25,9 @@ def test_execution_tractometry_euclidian(script_runner, monkeypatch): in_centroid = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni_c_10.trk') ret = script_runner.run(['scil_bundle_label_map', - in_bundle, in_centroid, - 'results_euc/', - '--colormap', 'viridis']) + in_bundle, in_centroid, + 'results_euc/', + '--colormap', 'viridis']) assert ret.success @@ -38,8 +38,8 @@ def test_execution_tractometry_hyperplane(script_runner, monkeypatch): in_centroid = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni_c_10.trk') ret = script_runner.run(['scil_bundle_label_map', - in_bundle, in_centroid, - 'results_man/', - '--colormap', 'viridis', - '--hyperplane', '--use_manhattan']) + in_bundle, in_centroid, + 'results_man/', + '--colormap', 'viridis', + '--hyperplane', '--use_manhattan']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_mean_fixel_afd.py b/src/scilpy/cli/tests/test_bundle_mean_fixel_afd.py index c531dbfce..405a8903d 100644 --- a/src/scilpy/cli/tests/test_bundle_mean_fixel_afd.py +++ b/src/scilpy/cli/tests/test_bundle_mean_fixel_afd.py @@ -23,6 +23,7 @@ def test_execution_processing(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf_descoteaux07.nii.gz') ret = script_runner.run(['scil_bundle_mean_fixel_afd', in_tracking, - in_fodf, 'afd_test.nii.gz', - '--sh_basis', 'descoteaux07', '--length_weighting']) + in_fodf, 'afd_test.nii.gz', + '--sh_basis', 'descoteaux07', + '--length_weighting']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_mean_fixel_afd_from_hdf5.py b/src/scilpy/cli/tests/test_bundle_mean_fixel_afd_from_hdf5.py index c2f387049..804a10128 100644 --- a/src/scilpy/cli/tests/test_bundle_mean_fixel_afd_from_hdf5.py +++ b/src/scilpy/cli/tests/test_bundle_mean_fixel_afd_from_hdf5.py @@ -23,7 +23,8 @@ def test_execution_connectivity(script_runner, monkeypatch): in_h5 = os.path.join(SCILPY_HOME, 'connectivity', 'decompose.h5') in_fodf = os.path.join(SCILPY_HOME, 'connectivity', 'fodf.nii.gz') ret = script_runner.run(['scil_bundle_mean_fixel_afd_from_hdf5', - in_h5, in_fodf, 'decompose_afd.nii.gz', - '--length_weighting', '--sh_basis', 'descoteaux07', - '--processes', '1']) + in_h5, in_fodf, 'decompose_afd.nii.gz', + '--length_weighting', + '--sh_basis', 'descoteaux07', + '--processes', '1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_bundle_reject_outliers.py b/src/scilpy/cli/tests/test_bundle_reject_outliers.py index 8079fa88c..5d050b6ad 100644 --- a/src/scilpy/cli/tests/test_bundle_reject_outliers.py +++ b/src/scilpy/cli/tests/test_bundle_reject_outliers.py @@ -21,8 +21,8 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') ret = script_runner.run(['scil_bundle_reject_outliers', in_bundle, - 'inliers.trk', '--alpha', '0.6', - '--remaining_bundle', 'outliers.trk', - '--display_counts', '--indent', '4', - '--sort_keys']) + 'inliers.trk', '--alpha', '0.6', + '--remaining_bundle', 'outliers.trk', + '--display_counts', '--indent', '4', + '--sort_keys']) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_compare_populations.py b/src/scilpy/cli/tests/test_connectivity_compare_populations.py index 938a0790d..de92545eb 100644 --- a/src/scilpy/cli/tests/test_connectivity_compare_populations.py +++ b/src/scilpy/cli/tests/test_connectivity_compare_populations.py @@ -24,6 +24,6 @@ def test_execution_connectivity(script_runner, monkeypatch): in_2 = os.path.join(SCILPY_HOME, 'connectivity', 'sc_norm.npy') in_mask = os.path.join(SCILPY_HOME, 'connectivity', 'mask.npy') ret = script_runner.run(['scil_connectivity_compare_populations', - 'pval.npy', '--in_g1', in_1, '--in_g2', in_2, - '--filtering_mask', in_mask]) + 'pval.npy', '--in_g1', in_1, '--in_g2', in_2, + '--filtering_mask', in_mask]) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_compute_matrices.py b/src/scilpy/cli/tests/test_connectivity_compute_matrices.py index 961250ba6..019476472 100644 --- a/src/scilpy/cli/tests/test_connectivity_compute_matrices.py +++ b/src/scilpy/cli/tests/test_connectivity_compute_matrices.py @@ -25,11 +25,11 @@ def test_execution_connectivity(script_runner, monkeypatch): in_avg = os.path.join(SCILPY_HOME, 'connectivity', 'avg_density_maps/') in_afd = os.path.join(SCILPY_HOME, 'connectivity', 'afd_max.nii.gz') ret = script_runner.run(['scil_connectivity_compute_matrices', in_h5, - in_atlas, '--volume', 'vol.npy', - '--streamline_count', 'sc.npy', - '--length', 'len.npy', - '--similarity', in_avg, 'sim.npy', - '--metrics', in_afd, 'afd_max.npy', - '--density_weighting', '--no_self_connection', - '--processes', '1']) + in_atlas, '--volume', 'vol.npy', + '--streamline_count', 'sc.npy', + '--length', 'len.npy', + '--similarity', in_avg, 'sim.npy', + '--metrics', in_afd, 'afd_max.npy', + '--density_weighting', '--no_self_connection', + '--processes', '1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_filter.py b/src/scilpy/cli/tests/test_connectivity_filter.py index 2848c2298..02ee698b6 100644 --- a/src/scilpy/cli/tests/test_connectivity_filter.py +++ b/src/scilpy/cli/tests/test_connectivity_filter.py @@ -24,7 +24,7 @@ def test_execution_connectivity(script_runner, monkeypatch): in_sim = os.path.join(SCILPY_HOME, 'connectivity', 'len.npy') ret = script_runner.run(['scil_connectivity_filter', 'mask.npy', - '--greater_than', in_sc, '5', '1', - '--greater_than', in_sim, '0', '1', - '--keep_condition_count']) + '--greater_than', in_sc, '5', '1', + '--greater_than', in_sim, '0', '1', + '--keep_condition_count']) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_normalize.py b/src/scilpy/cli/tests/test_connectivity_normalize.py index b6442db1e..495077360 100644 --- a/src/scilpy/cli/tests/test_connectivity_normalize.py +++ b/src/scilpy/cli/tests/test_connectivity_normalize.py @@ -26,6 +26,6 @@ def test_execution_connectivity(script_runner, monkeypatch): in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') ret = script_runner.run(['scil_connectivity_normalize', in_sc, - 'sc_norm.npy', '--length', in_len, - '--parcel_volume', in_atlas, in_labels_list]) + 'sc_norm.npy', '--length', in_len, + '--parcel_volume', in_atlas, in_labels_list]) assert ret.success diff --git a/src/scilpy/cli/tests/test_connectivity_reorder_rois.py b/src/scilpy/cli/tests/test_connectivity_reorder_rois.py index e85876eb3..625f18b19 100644 --- a/src/scilpy/cli/tests/test_connectivity_reorder_rois.py +++ b/src/scilpy/cli/tests/test_connectivity_reorder_rois.py @@ -27,7 +27,7 @@ def test_execution_compute_OLO(script_runner, monkeypatch): in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') ret = script_runner.run(['scil_connectivity_reorder_rois', in_sc, - '--optimal_leaf_ordering', 'OLO.txt', + '--optimal_leaf_ordering', 'OLO.txt', '--out_dir', os.path.expanduser(tmp_dir.name), '--labels_list', in_labels_list, '-f']) assert ret.success @@ -40,8 +40,8 @@ def test_execution_apply_ordering(script_runner, monkeypatch): in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') ret = script_runner.run(['scil_connectivity_reorder_rois', in_sc, - '--in_ordering', in_txt, + '--in_ordering', in_txt, '--out_suffix', '_sc_reo', '--out_dir', os.path.expanduser(tmp_dir.name), - '--labels_list', in_labels_list, '-f']) + '--labels_list', in_labels_list, '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_denoising_nlmeans.py b/src/scilpy/cli/tests/test_denoising_nlmeans.py index 16b6ee323..41cc2bc9f 100644 --- a/src/scilpy/cli/tests/test_denoising_nlmeans.py +++ b/src/scilpy/cli/tests/test_denoising_nlmeans.py @@ -21,9 +21,9 @@ def test_execution_user_sigma(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 't1_resample.nii.gz') ret = script_runner.run(['scil_denoising_nlmeans', in_img, - 'denoised.nii.gz', '--processes', '1', - '--sigma', '8', '--number_coils', 0, - '--gaussian']) + 'denoised.nii.gz', '--processes', '1', + '--sigma', '8', '--number_coils', 0, + '--gaussian']) assert ret.success @@ -31,9 +31,9 @@ def test_execution_basic_3d(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 't1_resample.nii.gz') ret = script_runner.run(['scil_denoising_nlmeans', in_img, - 't1_denoised.nii.gz', '--processes', '1', - '--basic_sigma', '--number_coils', 0, - '--gaussian']) + 't1_denoised.nii.gz', '--processes', '1', + '--basic_sigma', '--number_coils', 0, + '--gaussian']) assert ret.success @@ -42,16 +42,19 @@ def test_execution_basic_4d_mask(script_runner, monkeypatch): in_img = os.path.join(SCILPY_HOME, 'processing', 'dwi_crop_1000.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'processing', 'fa_thr.nii.gz') ret = script_runner.run(['scil_denoising_nlmeans', in_img, - 't1_denoised2.nii.gz', '--processes', '1', - '--basic_sigma', '--number_coils', 0, - '--gaussian', '--mask_sigma', in_mask]) + 't1_denoised2.nii.gz', '--processes', '1', + '--basic_sigma', '--number_coils', 0, + '--gaussian', '--mask_sigma', in_mask]) assert ret.success def test_execution_piesno(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'processing', 'dwi.nii.gz') + in_mask = os.path.join(SCILPY_HOME, 'processing', + 'small_roi_gm_mask.nii.gz') ret = script_runner.run(['scil_denoising_nlmeans', in_img, - 'dwi_denoised.nii.gz', '--processes', '1', - '--piesno', '--number_coils', '4']) + 'dwi_denoised.nii.gz', '--processes', '1', + '--mask_denoise', in_mask, + '--piesno', '--number_coils', '4']) assert ret.success diff --git a/src/scilpy/cli/tests/test_dki_metrics.py b/src/scilpy/cli/tests/test_dki_metrics.py index d9f86eaed..30a0ee086 100644 --- a/src/scilpy/cli/tests/test_dki_metrics.py +++ b/src/scilpy/cli/tests/test_dki_metrics.py @@ -20,16 +20,19 @@ def test_help_option(script_runner): def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_dwi = os.path.join(SCILPY_HOME, 'processing', - 'dwi_crop.nii.gz') + 'dwi.nii.gz') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') + in_mask = os.path.join(SCILPY_HOME, 'processing', + 'small_roi_gm_mask.nii.gz') ret = script_runner.run(['scil_dki_metrics', in_dwi, - in_bval, in_bvec, '--not_all', - '--dki_fa', 'dki_fa.nii.gz', - '--dki_md', 'dki_md.nii.gz', - '--dki_rd', 'dki_rd.nii.gz', - '--dki_ad', 'dki_ad.nii.gz', - '--dki_residual', 'dki_res.nii.gz']) + in_bval, in_bvec, '--not_all', + '--dki_fa', 'dki_fa.nii.gz', + '--dki_md', 'dki_md.nii.gz', + '--dki_rd', 'dki_rd.nii.gz', + '--dki_ad', 'dki_ad.nii.gz', + '--dki_residual', 'dki_res.nii.gz', + '--mask', in_mask]) assert ret.success diff --git a/src/scilpy/cli/tests/test_dti_metrics.py b/src/scilpy/cli/tests/test_dti_metrics.py index de004ad08..0175e05ec 100644 --- a/src/scilpy/cli/tests/test_dti_metrics.py +++ b/src/scilpy/cli/tests/test_dti_metrics.py @@ -30,13 +30,13 @@ def test_execution_processing_diff_metrics(script_runner, monkeypatch): mask, mask_uint8, '--data_type', 'uint8']) ret = script_runner.run(['scil_dti_metrics', in_dwi, - in_bval, in_bvec, '--not_all', - '--fa', 'fa.nii.gz', - '--md', 'md.nii.gz', - '--ad', 'ad.nii.gz', - '--rd', 'rd.nii.gz', - '--residual', 'residual.nii.gz', - '--mask', mask_uint8]) + in_bval, in_bvec, '--not_all', + '--fa', 'fa.nii.gz', + '--md', 'md.nii.gz', + '--ad', 'ad.nii.gz', + '--rd', 'rd.nii.gz', + '--residual', 'residual.nii.gz', + '--mask', mask_uint8]) assert ret.success @@ -53,8 +53,8 @@ def test_execution_processing_b0_threshold(script_runner, monkeypatch): mask, mask_uint8, '--data_type', 'uint8']) ret = script_runner.run(['scil_dti_metrics', in_dwi, - in_bval, in_bvec, '--not_all', - '--fa', 'fa.nii.gz', '--b0_threshold', '1', '-f']) + in_bval, in_bvec, '--not_all', + '--fa', 'fa.nii.gz', '--b0_threshold', '1', '-f']) assert not ret.success @@ -68,9 +68,9 @@ def test_execution_processing_rgb(script_runner, monkeypatch): mask = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') mask_uint8 = os.path.join('mask_uint8.nii.gz') script_runner.run(['scil_volume_math', 'convert', - mask, mask_uint8, '--data_type', 'uint8']) + mask, mask_uint8, '--data_type', 'uint8']) ret = script_runner.run(['scil_dti_metrics', in_dwi, - in_bval, in_bvec, '--not_all', - '--rgb', 'rgb.nii.gz', '-f']) + in_bval, in_bvec, '--not_all', + '--rgb', 'rgb.nii.gz', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_dwi_compute_snr.py b/src/scilpy/cli/tests/test_dwi_compute_snr.py index aab8a1ea9..dd41c5028 100644 --- a/src/scilpy/cli/tests/test_dwi_compute_snr.py +++ b/src/scilpy/cli/tests/test_dwi_compute_snr.py @@ -30,7 +30,7 @@ def test_snr(script_runner, monkeypatch): 'small_roi_gm_mask.nii.gz') ret = script_runner.run(['scil_dwi_compute_snr', in_dwi, - in_bval, in_bvec, in_mask, - '--noise_mask', noise_mask, - '--b0_thr', '10']) + in_bval, in_bvec, in_mask, + '--noise_mask', noise_mask, + '--b0_thr', '10']) assert ret.success diff --git a/src/scilpy/cli/tests/test_dwi_concatenate.py b/src/scilpy/cli/tests/test_dwi_concatenate.py index 3e912dfc2..e0a8ce69d 100644 --- a/src/scilpy/cli/tests/test_dwi_concatenate.py +++ b/src/scilpy/cli/tests/test_dwi_concatenate.py @@ -26,8 +26,8 @@ def test_execution_processing_concatenate(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') ret = script_runner.run(['scil_dwi_concatenate', 'dwi_concat.nii.gz', - 'concat.bval', 'concat.bvec', - '--in_dwi', in_dwi, in_dwi, - '--in_bvals', in_bval, in_bval, - '--in_bvecs', in_bvec, in_bvec]) + 'concat.bval', 'concat.bvec', + '--in_dwi', in_dwi, in_dwi, + '--in_bvals', in_bval, in_bval, + '--in_bvecs', in_bvec, in_bvec]) assert ret.success diff --git a/src/scilpy/cli/tests/test_dwi_extract_shell.py b/src/scilpy/cli/tests/test_dwi_extract_shell.py index 7f21c9db3..6817463cc 100644 --- a/src/scilpy/cli/tests/test_dwi_extract_shell.py +++ b/src/scilpy/cli/tests/test_dwi_extract_shell.py @@ -26,9 +26,9 @@ def test_execution_processing_1000(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') ret = script_runner.run(['scil_dwi_extract_shell', in_dwi, - in_bval, in_bvec, '0', '1000', - 'dwi_crop_1000.nii.gz', '1000.bval', '1000.bvec', - '-t', '30']) + in_bval, in_bvec, '0', '1000', + 'dwi_crop_1000.nii.gz', '1000.bval', '1000.bvec', + '-t', '30']) assert ret.success @@ -41,10 +41,10 @@ def test_execution_out_indices(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') ret = script_runner.run(['scil_dwi_extract_shell', in_dwi, - in_bval, in_bvec, '0', '1000', - 'dwi_crop_1000__1.nii.gz', '1000__1.bval', - '1000__1.bvec', '-t', '30', '--out_indices', - 'out_indices.txt']) + in_bval, in_bvec, '0', '1000', + 'dwi_crop_1000__1.nii.gz', '1000__1.bval', + '1000__1.bvec', '-t', '30', '--out_indices', + 'out_indices.txt']) assert ret.success @@ -57,7 +57,7 @@ def test_execution_processing_3000(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') ret = script_runner.run(['scil_dwi_extract_shell', in_dwi, - in_bval, in_bvec, '0', '3000', - 'dwi_crop_3000.nii.gz', '3000.bval', '3000.bvec', - '-t', '30']) + in_bval, in_bvec, '0', '3000', + 'dwi_crop_3000.nii.gz', '3000.bval', '3000.bvec', + '-t', '30']) assert ret.success diff --git a/src/scilpy/cli/tests/test_fibertube_compute_density.py b/src/scilpy/cli/tests/test_fibertube_compute_density.py index 146bae727..c2953fc2a 100644 --- a/src/scilpy/cli/tests/test_fibertube_compute_density.py +++ b/src/scilpy/cli/tests/test_fibertube_compute_density.py @@ -2,7 +2,6 @@ # -*- coding: utf-8 -*- import os -import json import tempfile import numpy as np import nibabel as nib @@ -46,11 +45,11 @@ def test_execution_density(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_compute_density', - 'fibertubes.trk', - '--out_density_map', 'density_map.nii.gz', - '--out_density_measures', - 'density_measures.json', - '-f']) + 'fibertubes.trk', + '--out_density_map', 'density_map.nii.gz', + '--out_density_measures', + 'density_measures.json', + '-f']) assert ret.success @@ -58,9 +57,9 @@ def test_execution_collisions(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_compute_density', - 'fibertubes.trk', - '--out_collision_map', 'collision_map.nii.gz', - '--out_collision_measures', - 'collision_measures.json', - '-f']) + 'fibertubes.trk', + '--out_collision_map', 'collision_map.nii.gz', + '--out_collision_measures', + 'collision_measures.json', + '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_fibertube_score_tractogram.py b/src/scilpy/cli/tests/test_fibertube_score_tractogram.py index a6b2ea0f2..cdb6a533c 100644 --- a/src/scilpy/cli/tests/test_fibertube_score_tractogram.py +++ b/src/scilpy/cli/tests/test_fibertube_score_tractogram.py @@ -65,6 +65,6 @@ def test_execution(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_score_tractogram', - 'fibertubes.trk', 'tracking.trk', 'config.json', - 'metrics.json', '--save_error_tractogram', '-f']) + 'fibertubes.trk', 'tracking.trk', 'config.json', + 'metrics.json', '--save_error_tractogram', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_fibertube_tracking.py b/src/scilpy/cli/tests/test_fibertube_tracking.py index 47b204a76..d133bee7c 100644 --- a/src/scilpy/cli/tests/test_fibertube_tracking.py +++ b/src/scilpy/cli/tests/test_fibertube_tracking.py @@ -46,8 +46,8 @@ def test_execution(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_tracking', - 'tractogram.trk', 'tracking.trk', - '--min_length', '0', '-f']) + 'tractogram.trk', 'tracking.trk', + '--min_length', '0', '-f']) assert ret.success @@ -55,8 +55,8 @@ def test_execution_rk(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_tracking', - 'tractogram.trk', 'tracking.trk', - '--rk_order', '2', '--min_length', '0', '-f']) + 'tractogram.trk', 'tracking.trk', + '--rk_order', '2', '--min_length', '0', '-f']) assert ret.success @@ -64,11 +64,11 @@ def test_execution_config(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_tracking', - 'tractogram.trk', 'tracking.trk', - '--blur_radius', '0.3', - '--step_size', '0.1', - '--out_config', 'config.json', - '--min_length', '0', '-f']) + 'tractogram.trk', 'tracking.trk', + '--blur_radius', '0.3', + '--step_size', '0.1', + '--out_config', 'config.json', + '--min_length', '0', '-f']) assert ret.success @@ -76,11 +76,11 @@ def test_execution_seeding(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_tracking', - 'tractogram.trk', 'tracking.trk', - '--nb_fibertubes', '1', - '--nb_seeds_per_fibertube', '3', '--skip', '3', - '--local_seeding', 'center', - '--min_length', '0', '-f']) + 'tractogram.trk', 'tracking.trk', + '--nb_fibertubes', '1', + '--nb_seeds_per_fibertube', '3', '--skip', '3', + '--local_seeding', 'center', + '--min_length', '0', '-f']) assert ret.success @@ -88,8 +88,8 @@ def test_execution_FTODF(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_tracking', - 'tractogram.trk', 'tracking.trk', '--use_ftODF', - '--min_length', '0', '-f']) + 'tractogram.trk', 'tracking.trk', '--use_ftODF', + '--min_length', '0', '-f']) assert ret.success @@ -97,8 +97,8 @@ def test_execution_FTODF_rk(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_tracking', - 'tractogram.trk', 'tracking.trk', '--use_ftODF', - '--rk_order', '2', '--min_length', '0', '-f']) + 'tractogram.trk', 'tracking.trk', '--use_ftODF', + '--rk_order', '2', '--min_length', '0', '-f']) assert ret.success @@ -106,11 +106,11 @@ def test_execution_FTODF_config(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_tracking', - 'tractogram.trk', 'tracking.trk', '--use_ftODF', - '--blur_radius', '0.3', - '--step_size', '0.1', - '--out_config', 'config.json', - '--min_length', '0', '-f']) + 'tractogram.trk', 'tracking.trk', '--use_ftODF', + '--blur_radius', '0.3', + '--step_size', '0.1', + '--out_config', 'config.json', + '--min_length', '0', '-f']) assert ret.success @@ -118,11 +118,11 @@ def test_execution_FTODF_seeding(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_tracking', - 'tractogram.trk', 'tracking.trk', '--use_ftODF', - '--nb_fibertubes', '1', - '--nb_seeds_per_fibertube', '3', '--skip', '3', - '--local_seeding', 'center', - '--min_length', '0', '-f']) + 'tractogram.trk', 'tracking.trk', '--use_ftODF', + '--nb_fibertubes', '1', + '--nb_seeds_per_fibertube', '3', '--skip', '3', + '--local_seeding', 'center', + '--min_length', '0', '-f']) assert ret.success @@ -130,14 +130,14 @@ def test_execution_FTODF_sphere(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_tracking', - 'tractogram.trk', 'tracking.trk', '--use_ftODF', - '--sh_order', '4', - '--sphere', 'symmetric362', - '--sh_basis', 'tournier07', - '--sub_sphere', '0', - '--sfthres', '0.05', - '--sfthres_init', '0.4', - '--min_length', '0', '-f']) + 'tractogram.trk', 'tracking.trk', '--use_ftODF', + '--sh_order', '4', + '--sphere', 'symmetric362', + '--sh_basis', 'tournier07', + '--sub_sphere', '0', + '--sfthres', '0.05', + '--sfthres_init', '0.4', + '--min_length', '0', '-f']) assert ret.success @@ -145,7 +145,7 @@ def test_execution_FTODF_det(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) init_data() ret = script_runner.run(['scil_fibertube_tracking', - 'tractogram.trk', 'tracking.trk', '--use_ftODF', - '--algo', 'det', - '--min_length', '0', '-f']) + 'tractogram.trk', 'tracking.trk', '--use_ftODF', + '--algo', 'det', + '--min_length', '0', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_fodf_bundleparc.py b/src/scilpy/cli/tests/test_fodf_bundleparc.py index 3023ab24a..49ad7a59a 100644 --- a/src/scilpy/cli/tests/test_fodf_bundleparc.py +++ b/src/scilpy/cli/tests/test_fodf_bundleparc.py @@ -22,7 +22,7 @@ def test_execution(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') ret = script_runner.run(['scil_fodf_bundleparc', in_fodf, '-f', - '--bundles', 'FX_left']) + '--bundles', 'FX_left']) assert ret.success @@ -31,8 +31,8 @@ def test_execution_100_labels(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') ret = script_runner.run(['scil_fodf_bundleparc', in_fodf, - '--nb_pts', '100', '-f', '--bundles', - 'IFO_right']) + '--nb_pts', '100', '-f', '--bundles', + 'IFO_right']) assert ret.success @@ -41,8 +41,8 @@ def test_execution_keep_biggest_blob(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') ret = script_runner.run(['scil_fodf_bundleparc', in_fodf, - '--keep_biggest_blob', '-f', '--bundles', - 'CA']) + '--keep_biggest_blob', '-f', '--bundles', + 'CA']) assert ret.success @@ -51,5 +51,5 @@ def test_execution_invalid_bundle(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'tracking', 'fodf.nii.gz') ret = script_runner.run(['scil_fodf_bundleparc', in_fodf, - '-f', '--bundles', 'CC']) + '-f', '--bundles', 'CC']) assert not ret.success diff --git a/src/scilpy/cli/tests/test_fodf_memsmt.py b/src/scilpy/cli/tests/test_fodf_memsmt.py index 78d2b076f..c649acaf9 100644 --- a/src/scilpy/cli/tests/test_fodf_memsmt.py +++ b/src/scilpy/cli/tests/test_fodf_memsmt.py @@ -38,28 +38,28 @@ def test_inputs_check(script_runner, monkeypatch): 'csf_frf.txt') ret = script_runner.run(['scil_fodf_memsmt', in_wm_frf, - in_gm_frf, in_csf_frf, '--in_dwis', - in_dwi_lin, in_dwi_plan, '--in_bvals', - in_bval_lin, '--in_bvecs', in_bvec_lin, - '--in_bdeltas', '1', - '--wm_out_fODF', 'wm_fodf.nii.gz', - '--gm_out_fODF', 'gm_fodf.nii.gz', - '--csf_out_fODF', 'csf_fodf.nii.gz', '--vf', - 'vf.nii.gz', '--sh_order', '4', '--sh_basis', - 'tournier07', '--processes', '1', '-f']) + in_gm_frf, in_csf_frf, '--in_dwis', + in_dwi_lin, in_dwi_plan, '--in_bvals', + in_bval_lin, '--in_bvecs', in_bvec_lin, + '--in_bdeltas', '1', + '--wm_out_fODF', 'wm_fodf.nii.gz', + '--gm_out_fODF', 'gm_fodf.nii.gz', + '--csf_out_fODF', 'csf_fodf.nii.gz', '--vf', + 'vf.nii.gz', '--sh_order', '4', '--sh_basis', + 'tournier07', '--processes', '1', '-f']) assert (not ret.success) ret = script_runner.run(['scil_fodf_memsmt', in_wm_frf, - in_gm_frf, in_csf_frf, '--in_dwis', - in_dwi_lin, in_dwi_plan, '--in_bvals', - in_bval_lin, in_bval_plan, '--in_bvecs', - in_bvec_lin, in_bvec_plan, '--in_bdeltas', - '1', '-0.5', '0', - '--wm_out_fODF', 'wm_fodf.nii.gz', - '--gm_out_fODF', 'gm_fodf.nii.gz', - '--csf_out_fODF', 'csf_fodf.nii.gz', '--vf', - 'vf.nii.gz', '--sh_order', '4', '--sh_basis', - 'tournier07', '--processes', '1', '-f']) + in_gm_frf, in_csf_frf, '--in_dwis', + in_dwi_lin, in_dwi_plan, '--in_bvals', + in_bval_lin, in_bval_plan, '--in_bvecs', + in_bvec_lin, in_bvec_plan, '--in_bdeltas', + '1', '-0.5', '0', + '--wm_out_fODF', 'wm_fodf.nii.gz', + '--gm_out_fODF', 'gm_fodf.nii.gz', + '--csf_out_fODF', 'csf_fodf.nii.gz', '--vf', + 'vf.nii.gz', '--sh_order', '4', '--sh_basis', + 'tournier07', '--processes', '1', '-f']) assert (not ret.success) @@ -85,10 +85,10 @@ def test_execution_processing(script_runner, monkeypatch): 'csf_frf.txt') ret = script_runner.run(['scil_fodf_memsmt', in_wm_frf, - in_gm_frf, in_csf_frf, '--in_dwis', - in_dwi_lin, in_dwi_sph, '--in_bvals', - in_bval_lin, in_bval_sph, - '--in_bvecs', in_bvec_lin, - in_bvec_sph, '--in_bdeltas', '1', '0', - '--sh_order', '8', '--processes', '8', '-f']) + in_gm_frf, in_csf_frf, '--in_dwis', + in_dwi_lin, in_dwi_sph, '--in_bvals', + in_bval_lin, in_bval_sph, + '--in_bvecs', in_bvec_lin, + in_bvec_sph, '--in_bdeltas', '1', '0', + '--sh_order', '8', '--processes', '8', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_fodf_metrics.py b/src/scilpy/cli/tests/test_fodf_metrics.py index 7bbbf5fe4..48ac1e928 100644 --- a/src/scilpy/cli/tests/test_fodf_metrics.py +++ b/src/scilpy/cli/tests/test_fodf_metrics.py @@ -22,9 +22,9 @@ def test_execution_processing(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf_descoteaux07.nii.gz') ret = script_runner.run(['scil_fodf_metrics', in_fodf, '--not_al', - '--peaks', 'peaks.nii.gz', - '--afd_max', 'afd_max.nii.gz', - '--afd_total', 'afd_tot.nii.gz', - '--afd_sum', 'afd_sum.nii.gz', - '--nufo', 'nufo.nii.gz', '--processes', '1']) + '--peaks', 'peaks.nii.gz', + '--afd_max', 'afd_max.nii.gz', + '--afd_total', 'afd_tot.nii.gz', + '--afd_sum', 'afd_sum.nii.gz', + '--nufo', 'nufo.nii.gz', '--processes', '1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_fodf_msmt.py b/src/scilpy/cli/tests/test_fodf_msmt.py index f0a42127d..1cba71d7a 100644 --- a/src/scilpy/cli/tests/test_fodf_msmt.py +++ b/src/scilpy/cli/tests/test_fodf_msmt.py @@ -27,12 +27,12 @@ def test_execution_processing(script_runner, monkeypatch): mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') ret = script_runner.run(['scil_fodf_msmt', in_dwi, in_bval, - in_bvec, in_wm_frf, in_gm_frf, in_csf_frf, - '--mask', mask, - '--wm_out_fODF', 'wm_fodf.nii.gz', - '--gm_out_fODF', 'gm_fodf.nii.gz', - '--csf_out_fODF', 'csf_fodf.nii.gz', - '--vf', 'vf.nii.gz', '--sh_order', '4', - '--sh_basis', 'tournier07', - '--processes', '1', '-f']) + in_bvec, in_wm_frf, in_gm_frf, in_csf_frf, + '--mask', mask, + '--wm_out_fODF', 'wm_fodf.nii.gz', + '--gm_out_fODF', 'gm_fodf.nii.gz', + '--csf_out_fODF', 'csf_fodf.nii.gz', + '--vf', 'vf.nii.gz', '--sh_order', '4', + '--sh_basis', 'tournier07', + '--processes', '1', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_fodf_ssst.py b/src/scilpy/cli/tests/test_fodf_ssst.py index e60773487..9e8278fcb 100644 --- a/src/scilpy/cli/tests/test_fodf_ssst.py +++ b/src/scilpy/cli/tests/test_fodf_ssst.py @@ -34,7 +34,7 @@ def test_execution_processing(script_runner, monkeypatch): # Test wrong b0. Current minimal b-value is 5. ret = script_runner.run(['scil_fodf_ssst', in_dwi, in_bval, - in_bvec, in_frf, 'fodf.nii.gz', '--sh_order', '4', - '--sh_basis', 'tournier07', '--processes', '1', - '--b0_threshold', '1', '-f']) + in_bvec, in_frf, 'fodf.nii.gz', '--sh_order', '4', + '--sh_basis', 'tournier07', '--processes', '1', + '--b0_threshold', '1', '-f']) assert not ret.success diff --git a/src/scilpy/cli/tests/test_fodf_to_bingham.py b/src/scilpy/cli/tests/test_fodf_to_bingham.py index d1c7c3388..5fdbace46 100644 --- a/src/scilpy/cli/tests/test_fodf_to_bingham.py +++ b/src/scilpy/cli/tests/test_fodf_to_bingham.py @@ -23,13 +23,13 @@ def test_execution_processing(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf_descoteaux07.nii.gz') ret = script_runner.run(['scil_fodf_to_bingham', - in_fodf, 'bingham.nii.gz', - '--max_lobes', '1', - '--at', '0.0', - '--rt', '0.1', - '--min_sep_angle', '25.', - '--max_fit_angle', '15.', - '--processes', '1']) + in_fodf, 'bingham.nii.gz', + '--max_lobes', '1', + '--at', '0.0', + '--rt', '0.1', + '--min_sep_angle', '25.', + '--max_fit_angle', '15.', + '--processes', '1']) assert ret.success @@ -40,12 +40,12 @@ def test_execution_processing_mask(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') ret = script_runner.run(['scil_fodf_to_bingham', - in_fodf, 'bingham.nii.gz', - '--max_lobes', '1', - '--at', '0.0', - '--rt', '0.1', - '--min_sep_angle', '25.', - '--max_fit_angle', '15.', - '--processes', '1', - '--mask', in_mask, '-f']) + in_fodf, 'bingham.nii.gz', + '--max_lobes', '1', + '--at', '0.0', + '--rt', '0.1', + '--min_sep_angle', '25.', + '--max_fit_angle', '15.', + '--processes', '1', + '--mask', in_mask, '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_freewater_maps.py b/src/scilpy/cli/tests/test_freewater_maps.py index d6cc0dcdf..156b0adee 100644 --- a/src/scilpy/cli/tests/test_freewater_maps.py +++ b/src/scilpy/cli/tests/test_freewater_maps.py @@ -28,11 +28,11 @@ def test_execution_commit_amico(script_runner, monkeypatch): mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') ret = script_runner.run(['scil_freewater_maps', in_dwi, - in_bval, in_bvec, '--mask', mask, - '--out_dir', 'freewater', '--b_thr', '30', - '--para_diff', '0.0015', - '--perp_diff_min', '0.0001', - '--perp_diff_max', '0.0007', - '--lambda1', '0.0', '--lambda2', '0.001', - '--processes', '1']) + in_bval, in_bvec, '--mask', mask, + '--out_dir', 'freewater', '--b_thr', '30', + '--para_diff', '0.0015', + '--perp_diff_min', '0.0001', + '--perp_diff_max', '0.0007', + '--lambda1', '0.0', '--lambda2', '0.001', + '--processes', '1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_frf_mean.py b/src/scilpy/cli/tests/test_frf_mean.py index e6ec7a8f2..21ba45688 100644 --- a/src/scilpy/cli/tests/test_frf_mean.py +++ b/src/scilpy/cli/tests/test_frf_mean.py @@ -36,7 +36,7 @@ def test_outputs_precision(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') ret = script_runner.run(['scil_frf_mean', in_frf, in_frf, 'mfrfp.txt', - '--precision', '4']) + '--precision', '4']) assert ret.success expected = [ @@ -45,8 +45,8 @@ def test_outputs_precision(script_runner, monkeypatch): "0.0009 0.0003 0.0003 3076.7249" ] with open('mfrfp.txt', 'r') as result: - for i, line in enumerate(result.readlines()): - assert line.strip("\n") == expected[i] + for i, line in enumerate(result.readlines()): + assert line.strip("\n") == expected[i] def test_execution_processing_bad_input(script_runner, monkeypatch): diff --git a/src/scilpy/cli/tests/test_frf_memsmt.py b/src/scilpy/cli/tests/test_frf_memsmt.py index 07f7b6a8e..0a443f5f4 100644 --- a/src/scilpy/cli/tests/test_frf_memsmt.py +++ b/src/scilpy/cli/tests/test_frf_memsmt.py @@ -38,12 +38,12 @@ def test_roi_center_shape_parameter(script_runner, monkeypatch): 'spherical.bvecs') ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', - 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', - in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', - in_bval_lin, in_bval_plan, in_bval_sph, - '--in_bvecs', in_bvec_lin, in_bvec_plan, - in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', - '--roi_center', '1', '--min_nvox', '1', '-f']) + 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', + in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', + in_bval_lin, in_bval_plan, in_bval_sph, + '--in_bvecs', in_bvec_lin, in_bvec_plan, + in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', + '--roi_center', '1', '--min_nvox', '1', '-f']) assert (not ret.success) @@ -69,32 +69,32 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', - 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', - in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', - in_bval_lin, in_bval_plan, in_bval_sph, - '--in_bvecs', in_bvec_lin, in_bvec_plan, - in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', - '--roi_radii', '37', '--min_nvox', '1', '-f']) + 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', + in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', + in_bval_lin, in_bval_plan, in_bval_sph, + '--in_bvecs', in_bvec_lin, in_bvec_plan, + in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', + '--roi_radii', '37', '--min_nvox', '1', '-f']) assert ret.success ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', - 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', - in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', - in_bval_lin, in_bval_plan, in_bval_sph, - '--in_bvecs', in_bvec_lin, in_bvec_plan, - in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', - '--roi_radii', '37', '37', '37', - '--min_nvox', '1', '-f']) + 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', + in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', + in_bval_lin, in_bval_plan, in_bval_sph, + '--in_bvecs', in_bvec_lin, in_bvec_plan, + in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', + '--roi_radii', '37', '37', '37', + '--min_nvox', '1', '-f']) assert ret.success ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', - 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', - in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', - in_bval_lin, in_bval_plan, in_bval_sph, - '--in_bvecs', in_bvec_lin, in_bvec_plan, - in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', - '--roi_radii', '37', '37', '37', '37', '37', - '--min_nvox', '1', '-f']) + 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', + in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', + in_bval_lin, in_bval_plan, in_bval_sph, + '--in_bvecs', in_bvec_lin, in_bvec_plan, + in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', + '--roi_radii', '37', '37', '37', '37', '37', + '--min_nvox', '1', '-f']) assert (not ret.success) @@ -115,18 +115,18 @@ def test_inputs_check(script_runner, monkeypatch): 'planar.bvecs') ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', - 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', - in_dwi_lin, in_dwi_plan, '--in_bvals', - in_bval_lin, '--in_bvecs', in_bvec_lin, - '--in_bdeltas', '1', '--min_nvox', '1', '-f']) + 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', + in_dwi_lin, in_dwi_plan, '--in_bvals', + in_bval_lin, '--in_bvecs', in_bvec_lin, + '--in_bdeltas', '1', '--min_nvox', '1', '-f']) assert (not ret.success) ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', - 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', - in_dwi_lin, in_dwi_plan, '--in_bvals', - in_bval_lin, in_bval_plan, '--in_bvecs', - in_bvec_lin, in_bvec_plan, '--in_bdeltas', - '1', '-0.5', '0', '--min_nvox', '1', '-f']) + 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', + in_dwi_lin, in_dwi_plan, '--in_bvals', + in_bval_lin, in_bval_plan, '--in_bvecs', + in_bvec_lin, in_bvec_plan, '--in_bdeltas', + '1', '-0.5', '0', '--min_nvox', '1', '-f']) assert (not ret.success) @@ -151,12 +151,12 @@ def test_outputs_precision(script_runner, monkeypatch): in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', - 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', - in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', - in_bval_lin, in_bval_plan, in_bval_sph, - '--in_bvecs', in_bvec_lin, in_bvec_plan, - in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', - '--min_nvox', '1', '--precision', '4', '-f']) + 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', + in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', + in_bval_lin, in_bval_plan, in_bval_sph, + '--in_bvecs', in_bvec_lin, in_bvec_plan, + in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', + '--min_nvox', '1', '--precision', '4', '-f']) assert ret.success @@ -187,10 +187,10 @@ def test_execution_processing(script_runner, monkeypatch): in_bvec_sph = os.path.join(SCILPY_HOME, 'btensor_testdata', 'spherical.bvecs') ret = script_runner.run(['scil_frf_memsmt', 'wm_frf.txt', - 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', - in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', - in_bval_lin, in_bval_plan, in_bval_sph, - '--in_bvecs', in_bvec_lin, in_bvec_plan, - in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', - '--min_nvox', '1', '-f']) + 'gm_frf.txt', 'csf_frf.txt', '--in_dwis', + in_dwi_lin, in_dwi_plan, in_dwi_sph, '--in_bvals', + in_bval_lin, in_bval_plan, in_bval_sph, + '--in_bvecs', in_bvec_lin, in_bvec_plan, + in_bvec_sph, '--in_bdeltas', '1', '-0.5', '0', + '--min_nvox', '1', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_frf_msmt.py b/src/scilpy/cli/tests/test_frf_msmt.py index 65dc25a87..ee19db8e6 100644 --- a/src/scilpy/cli/tests/test_frf_msmt.py +++ b/src/scilpy/cli/tests/test_frf_msmt.py @@ -26,22 +26,22 @@ def test_roi_radii_shape_parameter(script_runner, monkeypatch): 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') ret = script_runner.run(['scil_frf_msmt', in_dwi, - in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', - 'csf_frf.txt', '--mask', mask, '--roi_center', - '15', '15', '15', '-f']) + in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', + 'csf_frf.txt', '--mask', mask, '--roi_center', + '15', '15', '15', '-f']) assert ret.success # Test wrong tolerance, leading to no b0. Current minimal b-val is 5. ret = script_runner.run(['scil_frf_msmt', in_dwi, - in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', - 'csf_frf.txt', '--mask', mask, '--roi_center', - '15', '15', '15', '-f', '--tol', '1']) + in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', + 'csf_frf.txt', '--mask', mask, '--roi_center', + '15', '15', '15', '-f', '--tol', '1']) assert not ret.success ret = script_runner.run(['scil_frf_msmt', in_dwi, - in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', - 'csf_frf.txt', '--mask', mask, '--roi_center', - '15', '-f']) + in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', + 'csf_frf.txt', '--mask', mask, '--roi_center', + '15', '-f']) assert (not ret.success) @@ -56,21 +56,21 @@ def test_roi_radii_shape_parameter2(script_runner, monkeypatch): 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') ret = script_runner.run(['scil_frf_msmt', in_dwi, - in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', - 'csf_frf.txt', '--mask', mask, '--roi_radii', - '37', '-f']) + in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', + 'csf_frf.txt', '--mask', mask, '--roi_radii', + '37', '-f']) assert ret.success ret = script_runner.run(['scil_frf_msmt', in_dwi, - in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', - 'csf_frf.txt', '--mask', mask, '--roi_radii', - '37', '37', '37', '-f']) + in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', + 'csf_frf.txt', '--mask', mask, '--roi_radii', + '37', '37', '37', '-f']) assert ret.success ret = script_runner.run(['scil_frf_msmt', in_dwi, - in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', - 'csf_frf.txt', '--mask', mask, '--roi_radii', - '37', '37', '37', '37', '37', '-f']) + in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', + 'csf_frf.txt', '--mask', mask, '--roi_radii', + '37', '37', '37', '37', '37', '-f']) assert (not ret.success) @@ -85,9 +85,9 @@ def test_outputs_precision(script_runner, monkeypatch): 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') ret = script_runner.run(['scil_frf_msmt', in_dwi, - in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', - 'csf_frf.txt', '--mask', mask, '--min_nvox', '20', - '--precision', '4', '-f']) + in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', + 'csf_frf.txt', '--mask', mask, '--min_nvox', '20', + '--precision', '4', '-f']) assert ret.success for frf_file in ['wm_frf.txt', 'gm_frf.txt', 'csf_frf.txt']: @@ -106,7 +106,7 @@ def test_execution_processing(script_runner, monkeypatch): 'dwi.bvec') mask = os.path.join(SCILPY_HOME, 'commit_amico', 'mask.nii.gz') ret = script_runner.run(['scil_frf_msmt', in_dwi, - in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', - 'csf_frf.txt', '--mask', mask, '--min_nvox', '20', - '-f']) + in_bval, in_bvec, 'wm_frf.txt', 'gm_frf.txt', + 'csf_frf.txt', '--mask', mask, '--min_nvox', '20', + '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_frf_set_diffusivities.py b/src/scilpy/cli/tests/test_frf_set_diffusivities.py index 7a2e8e959..3cc7b0685 100644 --- a/src/scilpy/cli/tests/test_frf_set_diffusivities.py +++ b/src/scilpy/cli/tests/test_frf_set_diffusivities.py @@ -3,7 +3,6 @@ import os import tempfile -import numpy as np from scilpy import SCILPY_HOME from scilpy.io.fetcher import fetch_data, get_testing_files_dict @@ -31,7 +30,7 @@ def test_execution_processing_msmt(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') ret = script_runner.run(['scil_frf_set_diffusivities', in_frf, - '15,4,4,13,4,4,12,5,5', 'new_frf.txt', '-f']) + '15,4,4,13,4,4,12,5,5', 'new_frf.txt', '-f']) assert ret.success @@ -39,8 +38,8 @@ def test_outputs_precision(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') ret = script_runner.run(['scil_frf_set_diffusivities', in_frf, - '15,4,4,13,4,4,12,5,5', 'new_frf.txt', - '--precision', '4', '-f']) + '15,4,4,13,4,4,12,5,5', 'new_frf.txt', + '--precision', '4', '-f']) assert ret.success expected = [ @@ -50,12 +49,12 @@ def test_outputs_precision(script_runner, monkeypatch): ] with open('new_frf.txt', 'r') as result: for i, line in enumerate(result.readlines()): - assert line.strip("\n") == expected[i] + assert line.strip("\n") == expected[i] def test_execution_processing__wrong_input(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_frf = os.path.join(SCILPY_HOME, 'commit_amico', 'wm_frf.txt') ret = script_runner.run(['scil_frf_set_diffusivities', in_frf, - '15,4,4,13,4,4', 'new_frf.txt', '-f']) + '15,4,4,13,4,4', 'new_frf.txt', '-f']) assert not ret.success diff --git a/src/scilpy/cli/tests/test_gradients_convert.py b/src/scilpy/cli/tests/test_gradients_convert.py index 1f3f1f821..879e5c22f 100644 --- a/src/scilpy/cli/tests/test_gradients_convert.py +++ b/src/scilpy/cli/tests/test_gradients_convert.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run(['scil_gradients_convert', - '--help']) + '--help']) assert ret.success @@ -25,8 +25,8 @@ def test_execution_processing_fsl(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') ret = script_runner.run(['scil_gradients_convert', - '--input_fsl', - in_bval, in_bvec, '1000']) + '--input_fsl', + in_bval, in_bvec, '1000']) assert ret.success @@ -35,8 +35,8 @@ def test_execution_processing_mrtrix(script_runner, monkeypatch): in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') ret = script_runner.run(['scil_gradients_convert', - '--input_mrtrix', - in_encoding, '1000']) + '--input_mrtrix', + in_encoding, '1000']) assert ret.success @@ -47,8 +47,8 @@ def test_name_validation_mrtrix(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', '1000.bvec') ret = script_runner.run(['scil_gradients_convert', - '--input_fsl', - in_bval, in_bvec, '1000_test.b']) + '--input_fsl', + in_bval, in_bvec, '1000_test.b']) assert ret.success wrong_path = os.path.join(tmp_dir.name, '1000_test.b.b') @@ -63,8 +63,8 @@ def test_name_validation_fsl_bval(script_runner, monkeypatch): in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') ret = script_runner.run(['scil_gradients_convert', - '--input_mrtrix', - in_encoding, '1000_test.bval']) + '--input_mrtrix', + in_encoding, '1000_test.bval']) assert ret.success wrong_path_bval = os.path.join(tmp_dir.name, '1000_test.bval.bval') @@ -83,8 +83,8 @@ def test_name_validation_fsl_bvec(script_runner, monkeypatch): in_encoding = os.path.join(SCILPY_HOME, 'processing', '1000.b') ret = script_runner.run(['scil_gradients_convert', - '--input_mrtrix', - in_encoding, '1000_test.bvec']) + '--input_mrtrix', + in_encoding, '1000_test.bvec']) assert ret.success wrong_path_bval = os.path.join(tmp_dir.name, '1000_test.bvec.bval') diff --git a/src/scilpy/cli/tests/test_gradients_generate_sampling.py b/src/scilpy/cli/tests/test_gradients_generate_sampling.py index 9d51418c2..f4d8ba619 100644 --- a/src/scilpy/cli/tests/test_gradients_generate_sampling.py +++ b/src/scilpy/cli/tests/test_gradients_generate_sampling.py @@ -20,7 +20,7 @@ def test_help_option(script_runner): def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_gradients_generate_sampling', - '6', '6', 'encoding.b', '--mrtrix', '--eddy', - '--duty', '--b0_every', '25', '--b0_end', - '--bvals', '800', '1200']) + '6', '6', 'encoding.b', '--mrtrix', '--eddy', + '--duty', '--b0_every', '25', '--b0_end', + '--bvals', '800', '1200']) assert ret.success diff --git a/src/scilpy/cli/tests/test_gradients_validate_correct.py b/src/scilpy/cli/tests/test_gradients_validate_correct.py index 092da83ce..8c79a6f41 100644 --- a/src/scilpy/cli/tests/test_gradients_validate_correct.py +++ b/src/scilpy/cli/tests/test_gradients_validate_correct.py @@ -28,11 +28,12 @@ def test_execution_processing_dti_peaks(script_runner, monkeypatch): # generate the peaks file and fa map we'll use to test our script script_runner.run(['scil_dti_metrics', in_dwi, in_bval, in_bvec, - '--not_all', '--fa', 'fa.nii.gz', - '--evecs', 'evecs.nii.gz']) + '--not_all', '--fa', 'fa.nii.gz', + '--evecs', 'evecs.nii.gz']) # test the actual script ret = script_runner.run(['scil_gradients_validate_correct', in_bvec, - 'evecs_v1.nii.gz', 'fa.nii.gz', 'bvec_corr', '-v']) + 'evecs_v1.nii.gz', 'fa.nii.gz', + 'bvec_corr', '-v']) assert ret.success @@ -47,5 +48,5 @@ def test_execution_processing_fodf_peaks(script_runner, monkeypatch): # test the actual script ret = script_runner.run(['scil_gradients_validate_correct', in_bvec, - in_peaks, in_fa, 'bvec_corr_fodf', '-v']) + in_peaks, in_fa, 'bvec_corr_fodf', '-v']) assert ret.success diff --git a/src/scilpy/cli/tests/test_gradients_validate_correct_eddy.py b/src/scilpy/cli/tests/test_gradients_validate_correct_eddy.py index 4af4e582e..e01b6a12b 100644 --- a/src/scilpy/cli/tests/test_gradients_validate_correct_eddy.py +++ b/src/scilpy/cli/tests/test_gradients_validate_correct_eddy.py @@ -23,19 +23,20 @@ def test_execution_extract_half(script_runner, monkeypatch): in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') ret = script_runner.run(['scil_gradients_validate_correct_eddy', - in_bvec, in_bval, "32", - 'out.bvec', - 'out.bval', - '-f']) + in_bvec, in_bval, "32", + 'out.bvec', + 'out.bval', + '-f']) assert ret.success + def test_execution_extract_total(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bvec = os.path.join(SCILPY_HOME, 'processing', 'dwi.bvec') in_bval = os.path.join(SCILPY_HOME, 'processing', 'dwi.bval') ret = script_runner.run(['scil_gradients_validate_correct_eddy', - in_bvec, in_bval, "64", - 'out.bvec', - 'out.bval', - '-f']) + in_bvec, in_bval, "64", + 'out.bvec', + 'out.bval', + '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_gradients_validate_sampling.py b/src/scilpy/cli/tests/test_gradients_validate_sampling.py index b8505cf56..218e92232 100644 --- a/src/scilpy/cli/tests/test_gradients_validate_sampling.py +++ b/src/scilpy/cli/tests/test_gradients_validate_sampling.py @@ -25,14 +25,14 @@ def test_execution_normal(script_runner, monkeypatch): '1000.bvec') ret = script_runner.run(['scil_gradients_validate_sampling', in_bval, - in_bvec]) + in_bvec]) assert ret.success def test_execution_mrtrix(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_b = os.path.join(SCILPY_HOME, 'processing', - '1000.b') + '1000.b') ret = script_runner.run(['scil_gradients_validate_sampling', in_b]) assert ret.success diff --git a/src/scilpy/cli/tests/test_header_validate_compatibility.py b/src/scilpy/cli/tests/test_header_validate_compatibility.py index be4f7921a..fea53f0d3 100644 --- a/src/scilpy/cli/tests/test_header_validate_compatibility.py +++ b/src/scilpy/cli/tests/test_header_validate_compatibility.py @@ -22,5 +22,5 @@ def test_execution_filtering(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') in_roi = os.path.join(SCILPY_HOME, 'filtering', 'mask.nii.gz') ret = script_runner.run(['scil_header_validate_compatibility', - in_bundle, in_roi]) + in_bundle, in_roi]) assert ret.success diff --git a/src/scilpy/cli/tests/test_json_convert_entries_to_xlsx.py b/src/scilpy/cli/tests/test_json_convert_entries_to_xlsx.py index dc7353dec..2ad7054f6 100644 --- a/src/scilpy/cli/tests/test_json_convert_entries_to_xlsx.py +++ b/src/scilpy/cli/tests/test_json_convert_entries_to_xlsx.py @@ -22,6 +22,6 @@ def test_execution_tractometry(script_runner, monkeypatch): in_json = os.path.join(SCILPY_HOME, 'tractometry', 'length_stats_1.json') ret = script_runner.run(['scil_json_convert_entries_to_xlsx', in_json, - 'length_stats.xlsx']) + 'length_stats.xlsx']) assert ret.success diff --git a/src/scilpy/cli/tests/test_json_harmonize_entries.py b/src/scilpy/cli/tests/test_json_harmonize_entries.py index 4d6895180..4b52cad7f 100644 --- a/src/scilpy/cli/tests/test_json_harmonize_entries.py +++ b/src/scilpy/cli/tests/test_json_harmonize_entries.py @@ -1,6 +1,27 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +import os +import tempfile + +from scilpy import SCILPY_HOME +from scilpy.io.fetcher import fetch_data, get_testing_files_dict + +# If they already exist, this only takes 5 seconds (check md5sum) +fetch_data(get_testing_files_dict(), keys=['tractometry.zip']) +tmp_dir = tempfile.TemporaryDirectory() + + def test_help_option(script_runner): ret = script_runner.run(['scil_json_harmonize_entries', '--help']) assert ret.success + + +def test_execution(script_runner, monkeypatch): + monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) + in_json = os.path.join(SCILPY_HOME, 'tractometry', + 'metric_label.json') + ret = script_runner.run(['scil_json_harmonize_entries', in_json, + 'tmp.json', '--indent', '3', + '--sort_keys', '-f']) + assert ret.success diff --git a/src/scilpy/cli/tests/test_json_merge_entries.py b/src/scilpy/cli/tests/test_json_merge_entries.py index 37c30ced5..f65a23361 100644 --- a/src/scilpy/cli/tests/test_json_merge_entries.py +++ b/src/scilpy/cli/tests/test_json_merge_entries.py @@ -20,10 +20,10 @@ def test_help_option(script_runner): def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_json_1 = os.path.join(SCILPY_HOME, 'tractometry', - 'length_stats_1.json') + 'length_stats_1.json') in_json_2 = os.path.join(SCILPY_HOME, 'tractometry', - 'length_stats_2.json') + 'length_stats_2.json') ret = script_runner.run(['scil_json_merge_entries', in_json_1, - in_json_2, 'merge.json', '--keep_separate']) + in_json_2, 'merge.json', '--keep_separate']) assert ret.success diff --git a/src/scilpy/cli/tests/test_labels_combine.py b/src/scilpy/cli/tests/test_labels_combine.py index 92506f883..cb15e8780 100644 --- a/src/scilpy/cli/tests/test_labels_combine.py +++ b/src/scilpy/cli/tests/test_labels_combine.py @@ -23,10 +23,10 @@ def test_execution_atlas(script_runner, monkeypatch): 'atlas_freesurfer_v2.nii.gz') in_brainstem = os.path.join(SCILPY_HOME, 'atlas', 'brainstem.nii.gz') ret = script_runner.run(['scil_labels_combine', - 'atlas_freesurfer_v2_single_brainstem.nii.gz', - '--volume_ids', in_atlas_1, '8', '47', '251', - '252', '253', '254', '1022', '1024', '2022', - '2024', '--volume_ids', in_brainstem, '16']) + 'atlas_freesurfer_v2_single_brainstem.nii.gz', + '--volume_ids', in_atlas_1, '8', '47', '251', + '252', '253', '254', '1022', '1024', '2022', + '2024', '--volume_ids', in_brainstem, '16']) assert ret.success @@ -36,9 +36,9 @@ def test_execution_atlas_merge(script_runner, monkeypatch): 'atlas_freesurfer_v2.nii.gz') in_brainstem = os.path.join(SCILPY_HOME, 'atlas', 'brainstem.nii.gz') ret = script_runner.run(['scil_labels_combine', - 'atlas_freesurfer_v2_merge_brainstem.nii.gz', - '--volume_ids', in_atlas_1, '8', '47', '251', - '252', '253', '254', '1022', '1024', '2022', - '2024', '--volume_ids', in_brainstem, '16', - '--merge_groups']) + 'atlas_freesurfer_v2_merge_brainstem.nii.gz', + '--volume_ids', in_atlas_1, '8', '47', '251', + '252', '253', '254', '1022', '1024', '2022', + '2024', '--volume_ids', in_brainstem, '16', + '--merge_groups']) assert ret.success diff --git a/src/scilpy/cli/tests/test_labels_dilate.py b/src/scilpy/cli/tests/test_labels_dilate.py index 7789aa893..0c24904a8 100644 --- a/src/scilpy/cli/tests/test_labels_dilate.py +++ b/src/scilpy/cli/tests/test_labels_dilate.py @@ -22,6 +22,6 @@ def test_execution_atlas(script_runner, monkeypatch): in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_single_brainstem.nii.gz') ret = script_runner.run(['scil_labels_dilate', in_atlas, - 'atlas_freesurfer_v2_single_brainstem_dil.nii.gz', - '--processes', '1', '--distance', '2']) + 'atlas_freesurfer_v2_single_brainstem_dil.nii.gz', + '--processes', '1', '--distance', '2']) assert ret.success diff --git a/src/scilpy/cli/tests/test_labels_from_mask.py b/src/scilpy/cli/tests/test_labels_from_mask.py index bf11684e1..fdf41e5b7 100644 --- a/src/scilpy/cli/tests/test_labels_from_mask.py +++ b/src/scilpy/cli/tests/test_labels_from_mask.py @@ -23,8 +23,8 @@ def test_execution(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') ret = script_runner.run(['scil_labels_from_mask', - in_mask, 'labels_from_mask.nii.gz', - '--min_volume', '0', '-f']) + in_mask, 'labels_from_mask.nii.gz', + '--min_volume', '0', '-f']) assert ret.success @@ -34,8 +34,8 @@ def test_execution_labels(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') ret = script_runner.run(['scil_labels_from_mask', - in_mask, 'labels_from_mask.nii.gz', - '--labels', '4', '6', '-f']) + in_mask, 'labels_from_mask.nii.gz', + '--labels', '4', '6', '-f']) assert ret.success @@ -45,8 +45,8 @@ def test_execution_background(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') ret = script_runner.run(['scil_labels_from_mask', - in_mask, 'labels_from_mask.nii.gz', - '--background_label', '9', '-f']) + in_mask, 'labels_from_mask.nii.gz', + '--background_label', '9', '-f']) assert ret.success @@ -56,8 +56,8 @@ def test_execution_error(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') ret = script_runner.run(['scil_labels_from_mask', - in_mask, 'labels_from_mask.nii.gz', - '--labels', '1']) + in_mask, 'labels_from_mask.nii.gz', + '--labels', '1']) assert not ret.success @@ -67,8 +67,8 @@ def test_execution_warning(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') ret = script_runner.run(['scil_labels_from_mask', - in_mask, 'labels_from_mask.nii.gz', - '--labels', '1', '2', '3', '-f']) + in_mask, 'labels_from_mask.nii.gz', + '--labels', '1', '2', '3', '-f']) assert ret.success assert ret.stderr # Check if there is a warning message diff --git a/src/scilpy/cli/tests/test_labels_remove.py b/src/scilpy/cli/tests/test_labels_remove.py index 32fdb1e43..5d2e975c6 100644 --- a/src/scilpy/cli/tests/test_labels_remove.py +++ b/src/scilpy/cli/tests/test_labels_remove.py @@ -22,6 +22,6 @@ def test_execution_atlas(script_runner, monkeypatch): in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') ret = script_runner.run(['scil_labels_remove', in_atlas, - 'atlas_freesurfer_v2_no_brainstem.nii.gz', - '-i', '173', '174', '175']) + 'atlas_freesurfer_v2_no_brainstem.nii.gz', + '-i', '173', '174', '175']) assert ret.success diff --git a/src/scilpy/cli/tests/test_labels_split_volume_by_ids.py b/src/scilpy/cli/tests/test_labels_split_volume_by_ids.py index 950c69ed6..3beba61db 100644 --- a/src/scilpy/cli/tests/test_labels_split_volume_by_ids.py +++ b/src/scilpy/cli/tests/test_labels_split_volume_by_ids.py @@ -22,5 +22,5 @@ def test_execution_atlas(script_runner, monkeypatch): in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') ret = script_runner.run(['scil_labels_split_volume_by_ids', in_atlas, - '--out_prefix', 'brainstem', '-r', '173', '175']) + '--out_prefix', 'brainstem', '-r', '173', '175']) assert ret.success diff --git a/src/scilpy/cli/tests/test_labels_split_volume_from_lut.py b/src/scilpy/cli/tests/test_labels_split_volume_from_lut.py index a7c112bcd..7b2e0de9d 100644 --- a/src/scilpy/cli/tests/test_labels_split_volume_from_lut.py +++ b/src/scilpy/cli/tests/test_labels_split_volume_from_lut.py @@ -24,6 +24,6 @@ def test_execution_atlas(script_runner, monkeypatch): in_json = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_LUT.json') ret = script_runner.run(['scil_labels_split_volume_from_lut', in_atlas, - '--out_prefix', 'brainstem', - '--custom_lut', in_json]) + '--out_prefix', 'brainstem', + '--custom_lut', in_json]) assert ret.success diff --git a/src/scilpy/cli/tests/test_lesions_generate_nawm.py b/src/scilpy/cli/tests/test_lesions_generate_nawm.py index 641a4dbed..2330aa75a 100644 --- a/src/scilpy/cli/tests/test_lesions_generate_nawm.py +++ b/src/scilpy/cli/tests/test_lesions_generate_nawm.py @@ -24,6 +24,6 @@ def test_execution_atlas(script_runner, monkeypatch): in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_single_brainstem.nii.gz') ret = script_runner.run(['scil_lesions_generate_nawm', in_atlas, - 'nawm.nii.gz', '--nb_ring', '3', - '--ring_thickness', '2']) + 'nawm.nii.gz', '--nb_ring', '3', + '--ring_thickness', '2']) assert ret.success diff --git a/src/scilpy/cli/tests/test_lesions_harmonize_labels.py b/src/scilpy/cli/tests/test_lesions_harmonize_labels.py index 23e7016cf..550af0328 100644 --- a/src/scilpy/cli/tests/test_lesions_harmonize_labels.py +++ b/src/scilpy/cli/tests/test_lesions_harmonize_labels.py @@ -16,6 +16,7 @@ def test_help_option(script_runner): ret = script_runner.run(['scil_lesions_harmonize_labels', '--help']) assert ret.success + def test_harmonize_label(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) t1 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T1_lesions_labels.nii.gz') @@ -33,5 +34,5 @@ def test_harmonize_label_incremental(script_runner, monkeypatch): ret = script_runner.run(['scil_lesions_harmonize_labels', t1, t2, 'test', '--max_adjacency', '5.0', '--min_voxel_overlap', '1', - '--incremental_lesions', '-f']) - assert ret.success \ No newline at end of file + '--incremental_lesions', '-f']) + assert ret.success diff --git a/src/scilpy/cli/tests/test_lesions_info.py b/src/scilpy/cli/tests/test_lesions_info.py index 93d6e1188..696838d59 100644 --- a/src/scilpy/cli/tests/test_lesions_info.py +++ b/src/scilpy/cli/tests/test_lesions_info.py @@ -1,6 +1,26 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +import os +import tempfile + +from scilpy import SCILPY_HOME +from scilpy.io.fetcher import fetch_data, get_testing_files_dict + +# If they already exist, this only takes 5 seconds (check md5sum) +fetch_data(get_testing_files_dict(), keys=['lesions.zip']) +tmp_dir = tempfile.TemporaryDirectory() + + def test_help_option(script_runner): ret = script_runner.run(['scil_lesions_info', '--help']) assert ret.success + + +def test_execution_lesion(script_runner, monkeypatch): + monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) + t1 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T1_lesions_labels.nii.gz') + t2 = os.path.join(SCILPY_HOME, 'lesions', 'S001_T2_lesions_labels.nii.gz') + ret = script_runner.run(['scil_lesions_info', t1, + '--bundle_labels_map', t2, 'out.json']) + assert ret.success diff --git a/src/scilpy/cli/tests/test_mrds_metrics.py b/src/scilpy/cli/tests/test_mrds_metrics.py index 315345eb7..3e54473c8 100644 --- a/src/scilpy/cli/tests/test_mrds_metrics.py +++ b/src/scilpy/cli/tests/test_mrds_metrics.py @@ -24,9 +24,7 @@ def test_execution_mrds_all_metrics(script_runner, monkeypatch): 'mrds', 'sub-01_MRDS_eigenvalues.nii.gz') # no option - ret = script_runner.run(['scil_mrds_metrics', - in_evals, - '-f']) + ret = script_runner.run(['scil_mrds_metrics', in_evals, '-f']) assert ret.success @@ -39,12 +37,12 @@ def test_execution_mrds_not_all_metrics(script_runner, monkeypatch): 'mrds', 'sub-01_mask.nii.gz') # no option ret = script_runner.run(['scil_mrds_metrics', - in_evals, - '--mask', in_mask, - '--not_all', - '--fa', 'sub-01_MRDS_FA.nii.gz', - '--ad', 'sub-01_MRDS_AD.nii.gz', - '--rd', 'sub-01_MRDS_RD.nii.gz', - '--md', 'sub-01_MRDS_MD.nii.gz', - '-f']) + in_evals, + '--mask', in_mask, + '--not_all', + '--fa', 'sub-01_MRDS_FA.nii.gz', + '--ad', 'sub-01_MRDS_AD.nii.gz', + '--rd', 'sub-01_MRDS_RD.nii.gz', + '--md', 'sub-01_MRDS_MD.nii.gz', + '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_mrds_select_number_of_tensors.py b/src/scilpy/cli/tests/test_mrds_select_number_of_tensors.py index 815aaa833..a5ccc9504 100644 --- a/src/scilpy/cli/tests/test_mrds_select_number_of_tensors.py +++ b/src/scilpy/cli/tests/test_mrds_select_number_of_tensors.py @@ -24,9 +24,9 @@ def test_execution_mrds(script_runner, monkeypatch): 'mrds', 'sub-01_nufo.nii.gz') # no option ret = script_runner.run(['scil_mrds_select_number_of_tensors', - SCILPY_HOME + '/mrds/sub-01', - in_nufo, - '-f']) + SCILPY_HOME + '/mrds/sub-01', + in_nufo, + '-f']) assert ret.success @@ -39,8 +39,8 @@ def test_execution_mrds_w_mask(script_runner, monkeypatch): 'sub-01_mask.nii.gz') ret = script_runner.run(['scil_mrds_select_number_of_tensors', - SCILPY_HOME + '/mrds/sub-01', - in_nufo, - '--mask', in_mask, - '-f']) + SCILPY_HOME + '/mrds/sub-01', + in_nufo, + '--mask', in_mask, + '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_mti_maps_MT.py b/src/scilpy/cli/tests/test_mti_maps_MT.py index 4c3a840a6..33e4252c2 100644 --- a/src/scilpy/cli/tests/test_mti_maps_MT.py +++ b/src/scilpy/cli/tests/test_mti_maps_MT.py @@ -67,15 +67,15 @@ def test_execution_MT_no_option(script_runner, monkeypatch): # no option ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, - '--mask', in_mask, - '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, - in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, - '--in_positive', in_e1_mton, in_e2_mton, - in_e3_mton, in_e4_mton, in_e5_mton, - '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, - in_e4_t1w, in_e5_t1w, - '--in_jsons', in_mtoff_json, in_t1w_json, - '-f']) + '--mask', in_mask, + '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, + in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, + '--in_positive', in_e1_mton, in_e2_mton, + in_e3_mton, in_e4_mton, in_e5_mton, + '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, + in_e4_t1w, in_e5_t1w, + '--in_jsons', in_mtoff_json, in_t1w_json, + '-f']) assert ret.success @@ -84,16 +84,16 @@ def test_execution_MT_prefix(script_runner, monkeypatch): # --out_prefix ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, - '--mask', in_mask, - '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, - in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, - '--in_positive', in_e1_mton, in_e2_mton, - in_e3_mton, in_e4_mton, in_e5_mton, - '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, - in_e4_t1w, in_e5_t1w, - '--in_jsons', in_mtoff_json, in_t1w_json, - '--out_prefix', 'sub_01', - '-f']) + '--mask', in_mask, + '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, + in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, + '--in_positive', in_e1_mton, in_e2_mton, + in_e3_mton, in_e4_mton, in_e5_mton, + '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, + in_e4_t1w, in_e5_t1w, + '--in_jsons', in_mtoff_json, in_t1w_json, + '--out_prefix', 'sub_01', + '-f']) assert ret.success @@ -102,16 +102,16 @@ def test_execution_MT_extended(script_runner, monkeypatch): # --extended ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, - '--mask', in_mask, - '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, - in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, - '--in_positive', in_e1_mton, in_e2_mton, - in_e3_mton, in_e4_mton, in_e5_mton, - '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, - in_e4_t1w, in_e5_t1w, - '--in_jsons', in_mtoff_json, in_t1w_json, - '--extended', - '-f']) + '--mask', in_mask, + '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, + in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, + '--in_positive', in_e1_mton, in_e2_mton, + in_e3_mton, in_e4_mton, in_e5_mton, + '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, + in_e4_t1w, in_e5_t1w, + '--in_jsons', in_mtoff_json, in_t1w_json, + '--extended', + '-f']) assert ret.success @@ -120,16 +120,16 @@ def test_execution_MT_filtering(script_runner, monkeypatch): # --filtering ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, - '--mask', in_mask, - '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, - in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, - '--in_positive', in_e1_mton, in_e2_mton, - in_e3_mton, in_e4_mton, in_e5_mton, - '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, - in_e4_t1w, in_e5_t1w, - '--in_jsons', in_mtoff_json, in_t1w_json, - '--filtering', - '-f']) + '--mask', in_mask, + '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, + in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, + '--in_positive', in_e1_mton, in_e2_mton, + in_e3_mton, in_e4_mton, in_e5_mton, + '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, + in_e4_t1w, in_e5_t1w, + '--in_jsons', in_mtoff_json, in_t1w_json, + '--filtering', + '-f']) assert ret.success @@ -144,20 +144,20 @@ def test_execution_MT_B1_map(script_runner, monkeypatch): # --in_B1_map ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, - '--mask', in_mask, - '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, - in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, - '--in_positive', in_e1_mton, in_e2_mton, - in_e3_mton, in_e4_mton, in_e5_mton, - '--in_negative', in_e1_mton, in_e2_mton, - in_e3_mton, in_e4_mton, in_e5_mton, - '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, - in_e4_t1w, in_e5_t1w, - '--in_jsons', in_mtoff_json, in_t1w_json, - '--in_B1_map', out_b1_map, - '--B1_correction_method', 'empiric', - '--out_prefix', 'sub-01', - '-f']) + '--mask', in_mask, + '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, + in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, + '--in_positive', in_e1_mton, in_e2_mton, + in_e3_mton, in_e4_mton, in_e5_mton, + '--in_negative', in_e1_mton, in_e2_mton, + in_e3_mton, in_e4_mton, in_e5_mton, + '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, + in_e4_t1w, in_e5_t1w, + '--in_jsons', in_mtoff_json, in_t1w_json, + '--in_B1_map', out_b1_map, + '--B1_correction_method', 'empiric', + '--out_prefix', 'sub-01', + '-f']) assert ret.success @@ -166,17 +166,17 @@ def test_execution_MT_wrong_echoes(script_runner, monkeypatch): # Wrong number of echoes for negative ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, - '--mask', in_mask, - '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, - in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, - '--in_positive', in_e1_mton, in_e2_mton, - in_e3_mton, in_e4_mton, in_e5_mton, - '--in_negative', in_e1_mton, in_e2_mton, - in_e3_mton, in_e4_mton, - '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, - in_e4_t1w, in_e5_t1w, - '--in_jsons', in_mtoff_json, in_t1w_json, - '-f']) + '--mask', in_mask, + '--in_mtoff_pd', in_e1_mtoff, in_e2_mtoff, + in_e3_mtoff, in_e4_mtoff, in_e5_mtoff, + '--in_positive', in_e1_mton, in_e2_mton, + in_e3_mton, in_e4_mton, in_e5_mton, + '--in_negative', in_e1_mton, in_e2_mton, + in_e3_mton, in_e4_mton, + '--in_mtoff_t1', in_e1_t1w, in_e2_t1w, in_e3_t1w, + in_e4_t1w, in_e5_t1w, + '--in_jsons', in_mtoff_json, in_t1w_json, + '-f']) assert (not ret.success) @@ -185,13 +185,13 @@ def test_execution_MT_single_echoe(script_runner, monkeypatch): # Single echoe ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, - '--mask', in_mask, - '--in_mtoff_pd', in_e1_mtoff, - '--in_positive', in_e1_mton, - '--in_negative', in_e1_mton, - '--in_mtoff_t1', in_e1_t1w, - '--in_jsons', in_mtoff_json, in_t1w_json, - '-f']) + '--mask', in_mask, + '--in_mtoff_pd', in_e1_mtoff, + '--in_positive', in_e1_mton, + '--in_negative', in_e1_mton, + '--in_mtoff_t1', in_e1_t1w, + '--in_jsons', in_mtoff_json, in_t1w_json, + '-f']) assert ret.success @@ -206,14 +206,14 @@ def test_execution_MT_B1_not_T1(script_runner, monkeypatch): # B1 no T1 should raise warning. ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, - '--mask', in_mask, - '--in_mtoff_pd', in_e1_mtoff, - '--in_positive', in_e1_mton, - '--in_negative', in_e1_mton, - '--in_jsons', in_mtoff_json, in_t1w_json, - '--in_B1_map', out_b1_map, - '--B1_correction_method', 'empiric', - '-f']) + '--mask', in_mask, + '--in_mtoff_pd', in_e1_mtoff, + '--in_positive', in_e1_mton, + '--in_negative', in_e1_mton, + '--in_jsons', in_mtoff_json, in_t1w_json, + '--in_B1_map', out_b1_map, + '--B1_correction_method', 'empiric', + '-f']) assert ret.success @@ -228,15 +228,15 @@ def test_execution_MT_B1_no_fit(script_runner, monkeypatch): # B1 model_based but no fit values ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, - '--mask', in_mask, - '--in_mtoff_pd', in_e1_mtoff, - '--in_positive', in_e1_mton, - '--in_negative', in_e1_mton, - '--in_mtoff_t1', in_e1_t1w, - '--in_jsons', in_mtoff_json, in_t1w_json, - '--in_B1_map', out_b1_map, - '--B1_correction_method', 'model_based', - '-f']) + '--mask', in_mask, + '--in_mtoff_pd', in_e1_mtoff, + '--in_positive', in_e1_mton, + '--in_negative', in_e1_mton, + '--in_mtoff_t1', in_e1_t1w, + '--in_jsons', in_mtoff_json, in_t1w_json, + '--in_B1_map', out_b1_map, + '--B1_correction_method', 'model_based', + '-f']) assert (not ret.success) @@ -245,11 +245,11 @@ def test_execution_MT_acq_params(script_runner, monkeypatch): # Acquisition parameters ret = script_runner.run(['scil_mti_maps_MT', tmp_dir.name, - '--mask', in_mask, - '--in_mtoff_pd', in_e1_mtoff, - '--in_positive', in_e1_mton, - '--in_negative', in_e1_mton, - '--in_mtoff_t1', in_e1_t1w, - '--in_acq_parameters', "15", "15", "0.1", "0.1", - '-f']) + '--mask', in_mask, + '--in_mtoff_pd', in_e1_mtoff, + '--in_positive', in_e1_mton, + '--in_negative', in_e1_mton, + '--in_mtoff_t1', in_e1_t1w, + '--in_acq_parameters', "15", "15", "0.1", "0.1", + '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_mti_maps_ihMT.py b/src/scilpy/cli/tests/test_mti_maps_ihMT.py index 0029559eb..4246448d1 100644 --- a/src/scilpy/cli/tests/test_mti_maps_ihMT.py +++ b/src/scilpy/cli/tests/test_mti_maps_ihMT.py @@ -76,20 +76,20 @@ def test_execution_ihMT_no_option(script_runner, monkeypatch): # no option ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, - '--mask', in_mask, - '--in_altnp', in_e1_altnp, in_e2_altnp, - in_e3_altnp, - '--in_altpn', in_e1_altpn, in_e2_altpn, - in_e3_altpn, - '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, - in_e3_mtoff_pd, - '--in_negative', in_e1_neg, in_e2_neg, in_e3_neg, - '--in_positive', in_e1_pos, in_e2_pos, in_e3_pos, - '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, - in_e3_mtoff_t1, - '--in_jsons', in_mtoff_pd_json, - in_mtoff_t1_json, - '-f']) + '--mask', in_mask, + '--in_altnp', in_e1_altnp, in_e2_altnp, + in_e3_altnp, + '--in_altpn', in_e1_altpn, in_e2_altpn, + in_e3_altpn, + '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, + in_e3_mtoff_pd, + '--in_negative', in_e1_neg, in_e2_neg, in_e3_neg, + '--in_positive', in_e1_pos, in_e2_pos, in_e3_pos, + '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, + in_e3_mtoff_t1, + '--in_jsons', in_mtoff_pd_json, + in_mtoff_t1_json, + '-f']) assert ret.success @@ -98,23 +98,23 @@ def test_execution_ihMT_prefix(script_runner, monkeypatch): # --out_prefix ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, - '--mask', in_mask, - '--in_altnp', in_e1_altnp, in_e2_altnp, - in_e3_altnp, - '--in_altpn', in_e1_altpn, in_e2_altpn, - in_e3_altpn, - '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, - in_e3_mtoff_pd, - '--in_negative', in_e1_neg, in_e2_neg, - in_e3_neg, - '--in_positive', in_e1_pos, in_e2_pos, - in_e3_pos, - '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, - in_e3_mtoff_t1, - '--in_jsons', in_mtoff_pd_json, - in_mtoff_t1_json, - '--out_prefix', 'sub_01', - '-f']) + '--mask', in_mask, + '--in_altnp', in_e1_altnp, in_e2_altnp, + in_e3_altnp, + '--in_altpn', in_e1_altpn, in_e2_altpn, + in_e3_altpn, + '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, + in_e3_mtoff_pd, + '--in_negative', in_e1_neg, in_e2_neg, + in_e3_neg, + '--in_positive', in_e1_pos, in_e2_pos, + in_e3_pos, + '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, + in_e3_mtoff_t1, + '--in_jsons', in_mtoff_pd_json, + in_mtoff_t1_json, + '--out_prefix', 'sub_01', + '-f']) assert ret.success @@ -123,23 +123,23 @@ def test_execution_ihMT_extended(script_runner, monkeypatch): # --extended ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, - '--mask', in_mask, - '--in_altnp', in_e1_altnp, in_e2_altnp, - in_e3_altnp, - '--in_altpn', in_e1_altpn, in_e2_altpn, - in_e3_altpn, - '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, - in_e3_mtoff_pd, - '--in_negative', in_e1_neg, in_e2_neg, - in_e3_neg, - '--in_positive', in_e1_pos, in_e2_pos, - in_e3_pos, - '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, - in_e3_mtoff_t1, - '--in_jsons', in_mtoff_pd_json, - in_mtoff_t1_json, - '--extended', - '-f']) + '--mask', in_mask, + '--in_altnp', in_e1_altnp, in_e2_altnp, + in_e3_altnp, + '--in_altpn', in_e1_altpn, in_e2_altpn, + in_e3_altpn, + '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, + in_e3_mtoff_pd, + '--in_negative', in_e1_neg, in_e2_neg, + in_e3_neg, + '--in_positive', in_e1_pos, in_e2_pos, + in_e3_pos, + '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, + in_e3_mtoff_t1, + '--in_jsons', in_mtoff_pd_json, + in_mtoff_t1_json, + '--extended', + '-f']) assert ret.success @@ -148,22 +148,22 @@ def test_execution_ihMT_filtering(script_runner, monkeypatch): # --filtering ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, - '--mask', in_mask, - '--in_altnp', in_e1_altnp, in_e2_altnp, - in_e3_altnp, - '--in_altpn', in_e1_altpn, in_e2_altpn, - in_e3_altpn, - '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, - in_e3_mtoff_pd, - '--in_negative', in_e1_neg, in_e2_neg, in_e3_neg, - '--in_positive', in_e1_pos, in_e2_pos, in_e3_pos, - '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, - in_e3_mtoff_t1, - '--in_jsons', in_mtoff_pd_json, - in_mtoff_t1_json, - '--out_prefix', 'sub-01', - '--filtering', - '-f']) + '--mask', in_mask, + '--in_altnp', in_e1_altnp, in_e2_altnp, + in_e3_altnp, + '--in_altpn', in_e1_altpn, in_e2_altpn, + in_e3_altpn, + '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, + in_e3_mtoff_pd, + '--in_negative', in_e1_neg, in_e2_neg, in_e3_neg, + '--in_positive', in_e1_pos, in_e2_pos, in_e3_pos, + '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, + in_e3_mtoff_t1, + '--in_jsons', in_mtoff_pd_json, + in_mtoff_t1_json, + '--out_prefix', 'sub-01', + '--filtering', + '-f']) assert ret.success @@ -177,23 +177,23 @@ def test_execution_ihMT_B1_map(script_runner, monkeypatch): out_b1_map, in_b1_json, '-f']) ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, - '--mask', in_mask, - '--in_altnp', in_e1_altnp, in_e2_altnp, - in_e3_altnp, - '--in_altpn', in_e1_altpn, in_e2_altpn, - in_e3_altpn, - '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, - in_e3_mtoff_pd, - '--in_negative', in_e1_neg, in_e2_neg, in_e3_neg, - '--in_positive', in_e1_pos, in_e2_pos, in_e3_pos, - '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, - in_e3_mtoff_t1, - '--out_prefix', 'sub-01', - '--in_B1_map', out_b1_map, - '--B1_correction_method', 'empiric', - '--in_jsons', in_mtoff_pd_json, - in_mtoff_t1_json, - '-f']) + '--mask', in_mask, + '--in_altnp', in_e1_altnp, in_e2_altnp, + in_e3_altnp, + '--in_altpn', in_e1_altpn, in_e2_altpn, + in_e3_altpn, + '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, + in_e3_mtoff_pd, + '--in_negative', in_e1_neg, in_e2_neg, in_e3_neg, + '--in_positive', in_e1_pos, in_e2_pos, in_e3_pos, + '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, + in_e3_mtoff_t1, + '--out_prefix', 'sub-01', + '--in_B1_map', out_b1_map, + '--B1_correction_method', 'empiric', + '--in_jsons', in_mtoff_pd_json, + in_mtoff_t1_json, + '-f']) assert ret.success @@ -204,23 +204,23 @@ def test_execution_ihMT_B1_no_T1(script_runner, monkeypatch): # Temporary trick to have the B1 map with proper header. ret = script_runner.run(['scil_mti_adjust_B1_header', in_b1_map, - out_b1_map, in_b1_json, '-f']) + out_b1_map, in_b1_json, '-f']) ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, - '--mask', in_mask, - '--in_altnp', in_e1_altnp, in_e2_altnp, - in_e3_altnp, - '--in_altpn', in_e1_altpn, in_e2_altpn, - in_e3_altpn, - '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, - in_e3_mtoff_pd, - '--in_negative', in_e1_neg, in_e2_neg, in_e3_neg, - '--in_positive', in_e1_pos, in_e2_pos, in_e3_pos, - '--in_B1_map', out_b1_map, - '--B1_correction_method', 'empiric', - '--in_jsons', in_mtoff_pd_json, - in_mtoff_t1_json, - '-f']) + '--mask', in_mask, + '--in_altnp', in_e1_altnp, in_e2_altnp, + in_e3_altnp, + '--in_altpn', in_e1_altpn, in_e2_altpn, + in_e3_altpn, + '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, + in_e3_mtoff_pd, + '--in_negative', in_e1_neg, in_e2_neg, in_e3_neg, + '--in_positive', in_e1_pos, in_e2_pos, in_e3_pos, + '--in_B1_map', out_b1_map, + '--B1_correction_method', 'empiric', + '--in_jsons', in_mtoff_pd_json, + in_mtoff_t1_json, + '-f']) assert ret.success @@ -228,19 +228,19 @@ def test_execution_ihMT_wrong_echoes(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, - '--mask', in_mask, - '--in_altnp', in_e1_altnp, in_e2_altnp, - in_e3_altnp, - '--in_altpn', in_e1_altpn, in_e2_altpn, - in_e3_altpn, - '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, - in_e3_mtoff_pd, - '--in_negative', in_e1_neg, in_e2_neg, in_e3_neg, - '--in_positive', in_e1_pos, in_e2_pos, in_e3_pos, - '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, - '--in_jsons', in_mtoff_pd_json, - in_mtoff_t1_json, - '-f']) + '--mask', in_mask, + '--in_altnp', in_e1_altnp, in_e2_altnp, + in_e3_altnp, + '--in_altpn', in_e1_altpn, in_e2_altpn, + in_e3_altpn, + '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, + in_e3_mtoff_pd, + '--in_negative', in_e1_neg, in_e2_neg, in_e3_neg, + '--in_positive', in_e1_pos, in_e2_pos, in_e3_pos, + '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, + '--in_jsons', in_mtoff_pd_json, + in_mtoff_t1_json, + '-f']) assert (not ret.success) @@ -254,23 +254,23 @@ def test_execution_ihMT_B1_no_fit(script_runner, monkeypatch): out_b1_map, in_b1_json, '-f']) ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, - '--mask', in_mask, - '--in_altnp', in_e1_altnp, in_e2_altnp, - in_e3_altnp, - '--in_altpn', in_e1_altpn, in_e2_altpn, - in_e3_altpn, - '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, - in_e3_mtoff_pd, - '--in_negative', in_e1_neg, in_e2_neg, in_e3_neg, - '--in_positive', in_e1_pos, in_e2_pos, in_e3_pos, - '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, - in_e3_mtoff_t1, - '--out_prefix', 'sub-01', - '--in_B1_map', out_b1_map, - '--B1_correction_method', 'model_based', - '--in_jsons', in_mtoff_pd_json, - in_mtoff_t1_json, - '-f']) + '--mask', in_mask, + '--in_altnp', in_e1_altnp, in_e2_altnp, + in_e3_altnp, + '--in_altpn', in_e1_altpn, in_e2_altpn, + in_e3_altpn, + '--in_mtoff_pd', in_e1_mtoff_pd, in_e2_mtoff_pd, + in_e3_mtoff_pd, + '--in_negative', in_e1_neg, in_e2_neg, in_e3_neg, + '--in_positive', in_e1_pos, in_e2_pos, in_e3_pos, + '--in_mtoff_t1', in_e1_mtoff_t1, in_e2_mtoff_t1, + in_e3_mtoff_t1, + '--out_prefix', 'sub-01', + '--in_B1_map', out_b1_map, + '--B1_correction_method', 'model_based', + '--in_jsons', in_mtoff_pd_json, + in_mtoff_t1_json, + '-f']) assert (not ret.success) @@ -278,16 +278,16 @@ def test_execution_ihMT_single_echo(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, - '--mask', in_mask, - '--in_altnp', in_e1_altnp, - '--in_altpn', in_e1_altpn, - '--in_mtoff_pd', in_e1_mtoff_pd, - '--in_negative', in_e1_neg, - '--in_positive', in_e1_pos, - '--in_mtoff_t1', in_e1_mtoff_t1, - '--out_prefix', 'sub_01', - '--in_jsons', in_mtoff_pd_json, - in_mtoff_t1_json, '-f']) + '--mask', in_mask, + '--in_altnp', in_e1_altnp, + '--in_altpn', in_e1_altpn, + '--in_mtoff_pd', in_e1_mtoff_pd, + '--in_negative', in_e1_neg, + '--in_positive', in_e1_pos, + '--in_mtoff_t1', in_e1_mtoff_t1, + '--out_prefix', 'sub_01', + '--in_jsons', in_mtoff_pd_json, + in_mtoff_t1_json, '-f']) assert ret.success @@ -295,14 +295,14 @@ def test_execution_ihMT_acq_params(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_mti_maps_ihMT', tmp_dir.name, - '--mask', in_mask, - '--in_altnp', in_e1_altnp, - '--in_altpn', in_e1_altpn, - '--in_mtoff_pd', in_e1_mtoff_pd, - '--in_negative', in_e1_neg, - '--in_positive', in_e1_pos, - '--in_mtoff_t1', in_e1_mtoff_t1, - '--out_prefix', 'sub_01', - '--in_acq_parameters', '15', '15', '0.1', '0.1', - '-f']) + '--mask', in_mask, + '--in_altnp', in_e1_altnp, + '--in_altpn', in_e1_altpn, + '--in_mtoff_pd', in_e1_mtoff_pd, + '--in_negative', in_e1_neg, + '--in_positive', in_e1_pos, + '--in_mtoff_t1', in_e1_mtoff_t1, + '--out_prefix', 'sub_01', + '--in_acq_parameters', '15', '15', '0.1', '0.1', + '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_search_keywords.py b/src/scilpy/cli/tests/test_search_keywords.py index 3050e3912..95ee786f8 100644 --- a/src/scilpy/cli/tests/test_search_keywords.py +++ b/src/scilpy/cli/tests/test_search_keywords.py @@ -8,7 +8,8 @@ def test_help_option(script_runner): def test_search_category(script_runner): - ret = script_runner.run(['scil_search_keywords', '--search_category', 'sh']) + ret = script_runner.run(['scil_search_keywords', + '--search_category', 'sh']) assert 'Available objects:' in ret.stdout diff --git a/src/scilpy/cli/tests/test_sh_convert.py b/src/scilpy/cli/tests/test_sh_convert.py index 852b172e7..8d2ed3eac 100644 --- a/src/scilpy/cli/tests/test_sh_convert.py +++ b/src/scilpy/cli/tests/test_sh_convert.py @@ -22,6 +22,6 @@ def test_execution_processing(script_runner, monkeypatch): in_fodf = os.path.join(SCILPY_HOME, 'processing', 'fodf.nii.gz') ret = script_runner.run(['scil_sh_convert', in_fodf, - 'fodf_descoteaux07.nii.gz', 'tournier07', - 'descoteaux07_legacy', '--processes', '1']) + 'fodf_descoteaux07.nii.gz', 'tournier07', + 'descoteaux07_legacy', '--processes', '1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_sh_to_aodf.py b/src/scilpy/cli/tests/test_sh_to_aodf.py index 360644c86..6d0c198e7 100644 --- a/src/scilpy/cli/tests/test_sh_to_aodf.py +++ b/src/scilpy/cli/tests/test_sh_to_aodf.py @@ -25,12 +25,13 @@ def test_help_option(script_runner): [os.path.join(test_data_root, "fodf_descoteaux07_sub.nii.gz"), os.path.join(test_data_root, "fodf_descoteaux07_sub_unified_asym.nii.gz")]]) -def test_asym_basis_output_gpu(script_runner, in_fodf, expected_fodf, monkeypatch): +def test_asym_basis_output_gpu(script_runner, in_fodf, + expected_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_sh_to_aodf', - in_fodf, 'out_fodf1.nii.gz', - '--sphere', 'repulsion100', + in_fodf, 'out_fodf1.nii.gz', + '--sphere', 'repulsion100', '--sigma_align', '0.8', '--sigma_spatial', '1.0', '--sigma_range', '0.2', @@ -38,8 +39,7 @@ def test_asym_basis_output_gpu(script_runner, in_fodf, expected_fodf, monkeypatc '--use_opencl', '--device', 'gpu', '--sh_basis', 'descoteaux07_legacy', '-f', - '--include_center'], - print_result=True, shell=True) + '--include_center']) if have_opencl: # if we have opencl the script should not raise an error @@ -65,16 +65,15 @@ def test_asym_basis_output(script_runner, in_fodf, expected_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_sh_to_aodf', - in_fodf, 'out_fodf1.nii.gz', - '--sphere', 'repulsion100', + in_fodf, 'out_fodf1.nii.gz', + '--sphere', 'repulsion100', '--sigma_align', '0.8', '--sigma_spatial', '1.0', '--sigma_range', '0.2', '--sigma_angle', '0.06', '--device', 'cpu', '--sh_basis', 'descoteaux07_legacy', '-f', - '--include_center'], - print_result=True, shell=True) + '--include_center']) assert ret.success @@ -92,16 +91,15 @@ def test_asym_input(script_runner, in_fodf, expected_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_sh_to_aodf', - in_fodf, 'out_fodf1.nii.gz', - '--sphere', 'repulsion100', + in_fodf, 'out_fodf1.nii.gz', + '--sphere', 'repulsion100', '--sigma_align', '0.8', '--sigma_spatial', '1.0', '--sigma_range', '0.2', '--sigma_angle', '0.06', '--device', 'cpu', '--sh_basis', 'descoteaux07_legacy', '-f', - '--include_center'], - print_result=True, shell=True) + '--include_center']) assert ret.success @@ -118,11 +116,10 @@ def test_cosine_method(script_runner, in_fodf, out_fodf, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_sh_to_aodf', - in_fodf, 'out_fodf1.nii.gz', - '--sphere', 'repulsion100', + in_fodf, 'out_fodf1.nii.gz', + '--sphere', 'repulsion100', '--method', 'cosine', '-f', - '--sh_basis', 'descoteaux07_legacy'], - print_result=True, shell=True) + '--sh_basis', 'descoteaux07_legacy']) assert ret.success diff --git a/src/scilpy/cli/tests/test_sh_to_rish.py b/src/scilpy/cli/tests/test_sh_to_rish.py index 98ebe0b0e..d84e63536 100644 --- a/src/scilpy/cli/tests/test_sh_to_rish.py +++ b/src/scilpy/cli/tests/test_sh_to_rish.py @@ -20,6 +20,6 @@ def test_help_option(script_runner): def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_sh = os.path.join(SCILPY_HOME, 'processing', - 'sh.nii.gz') + 'sh.nii.gz') ret = script_runner.run(['scil_sh_to_rish', in_sh, 'rish.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_sh_to_sf.py b/src/scilpy/cli/tests/test_sh_to_sf.py index 6c60bf267..41156a8d9 100644 --- a/src/scilpy/cli/tests/test_sh_to_sf.py +++ b/src/scilpy/cli/tests/test_sh_to_sf.py @@ -25,11 +25,11 @@ def test_execution_in_sphere(script_runner, monkeypatch): # Required: either --sphere or --in_bvec. Here, --sphere ret = script_runner.run(['scil_sh_to_sf', in_sh, - 'sf_724.nii.gz', '--in_bval', - in_bval, '--in_b0', in_b0, '--out_bval', - 'sf_724.bval', '--out_bvec', 'sf_724.bvec', - '--sphere', 'symmetric724', '--dtype', 'float32', - '--processes', '1']) + 'sf_724.nii.gz', '--in_bval', + in_bval, '--in_b0', in_b0, '--out_bval', + 'sf_724.bval', '--out_bvec', 'sf_724.bvec', + '--sphere', 'symmetric724', '--dtype', 'float32', + '--processes', '1']) assert ret.success @@ -41,19 +41,19 @@ def test_execution_in_bvec(script_runner, monkeypatch): # --in_bvec: in_bval is required. ret = script_runner.run(['scil_sh_to_sf', in_sh, - 'sf_724.nii.gz', '--in_bval', in_bval, - '--out_bval', 'sf_724.bval', - '--out_bvec', 'sf_724.bvec', - '--in_bvec', in_bvec, '--dtype', 'float32', '-f', - '--processes', '1']) + 'sf_724.nii.gz', '--in_bval', in_bval, + '--out_bval', 'sf_724.bval', + '--out_bvec', 'sf_724.bvec', + '--in_bvec', in_bvec, '--dtype', 'float32', '-f', + '--processes', '1']) assert ret.success # Test that fails if no bvals is given. ret = script_runner.run(['scil_sh_to_sf', in_sh, - 'sf_724.nii.gz', - '--out_bvec', 'sf_724.bvec', - '--in_bvec', in_bvec, '--dtype', 'float32', '-f', - '--processes', '1']) + 'sf_724.nii.gz', + '--out_bvec', 'sf_724.bvec', + '--in_bvec', in_bvec, '--dtype', 'float32', '-f', + '--processes', '1']) assert not ret.success @@ -65,8 +65,8 @@ def test_execution_no_bval(script_runner, monkeypatch): # --sphere but no --bval # Testing multiprocessing option ret = script_runner.run(['scil_sh_to_sf', in_sh, - 'sf_724.nii.gz', '--in_b0', in_b0, - '--out_bvec', 'sf_724.bvec', '--b0_scaling', - '--sphere', 'symmetric724', '--dtype', 'float32', - '-f', '--processes', '4']) + 'sf_724.nii.gz', '--in_b0', in_b0, + '--out_bvec', 'sf_724.bvec', '--b0_scaling', + '--sphere', 'symmetric724', '--dtype', 'float32', + '-f', '--processes', '4']) assert ret.success diff --git a/src/scilpy/cli/tests/test_stats_group_comparison.py b/src/scilpy/cli/tests/test_stats_group_comparison.py index e226e1553..cf2ca8929 100644 --- a/src/scilpy/cli/tests/test_stats_group_comparison.py +++ b/src/scilpy/cli/tests/test_stats_group_comparison.py @@ -26,10 +26,10 @@ def test_execution_bundles(script_runner, monkeypatch): 'meanstd_all.json') ret = script_runner.run(['scil_stats_group_comparison', - in_participants, in_json, 'Group', - '-b', 'AF_L', - '-m', 'FIT_FW', - '--va', 'mean', - '--gg']) + in_participants, in_json, 'Group', + '-b', 'AF_L', + '-m', 'FIT_FW', + '--va', 'mean', + '--gg']) assert ret.success diff --git a/src/scilpy/cli/tests/test_surface_apply_transform.py b/src/scilpy/cli/tests/test_surface_apply_transform.py index 4e2c9a424..0bb0694ba 100644 --- a/src/scilpy/cli/tests/test_surface_apply_transform.py +++ b/src/scilpy/cli/tests/test_surface_apply_transform.py @@ -24,5 +24,5 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): in_aff = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'affine.txt') ret = script_runner.run(['scil_surface_apply_transform', in_surf, - in_aff, 'lhpialt_lin.vtk', '--inverse']) + in_aff, 'lhpialt_lin.vtk', '--inverse']) assert ret.success diff --git a/src/scilpy/cli/tests/test_surface_convert.py b/src/scilpy/cli/tests/test_surface_convert.py index 90ae6c252..202ce5e25 100644 --- a/src/scilpy/cli/tests/test_surface_convert.py +++ b/src/scilpy/cli/tests/test_surface_convert.py @@ -22,7 +22,7 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lhpialt.vtk') ret = script_runner.run(['scil_surface_convert', in_surf, - 'rhpialt.ply']) + 'rhpialt.ply']) assert ret.success @@ -32,6 +32,6 @@ def test_execution_surface_vtk_xfrom(script_runner, monkeypatch): 'lh.pialt_xform') ref = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') ret = script_runner.run(['scil_surface_convert', in_surf, - 'lh.pialt_xform.vtk', '--reference', ref, - '--flip_axes', '-1', '-1', '1']) + 'lh.pialt_xform.vtk', '--reference', ref, + '--flip_axes', '-1', '-1', '1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_surface_create.py b/src/scilpy/cli/tests/test_surface_create.py index 532d09986..9430a93f8 100644 --- a/src/scilpy/cli/tests/test_surface_create.py +++ b/src/scilpy/cli/tests/test_surface_create.py @@ -23,15 +23,15 @@ def test_execution_atlas(script_runner, monkeypatch): in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') ret = script_runner.run(['scil_surface_create', - '--in_labels', in_atlas, - 'surface.vtk', - '--list_indices', '2024:2035 1024', - '--fill', - '--smooth', '1', - '--erosion', '1', - '--dilation', '1', - '--opening', '1', - '--closing', '1', '-f']) + '--in_labels', in_atlas, + 'surface.vtk', + '--list_indices', '2024:2035 1024', + '--fill', + '--smooth', '1', + '--erosion', '1', + '--dilation', '1', + '--opening', '1', + '--closing', '1', '-f']) assert ret.success @@ -40,16 +40,16 @@ def test_execution_atlas_each_index(script_runner, monkeypatch): in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') ret = script_runner.run(['scil_surface_create', - '--in_labels', in_atlas, - 'surface.vtk', - '--each_index', - '--fill', - '--smooth', '1', - '--erosion', '1', - '--dilation', '1', - '--opening', '1', - '--closing', '1', - '--vtk2vox', '-f']) + '--in_labels', in_atlas, + 'surface.vtk', + '--each_index', + '--fill', + '--smooth', '1', + '--erosion', '1', + '--dilation', '1', + '--opening', '1', + '--closing', '1', + '--vtk2vox', '-f']) assert ret.success @@ -58,14 +58,14 @@ def test_execution_atlas_no_index(script_runner, monkeypatch): in_atlas = os.path.join(SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2.nii.gz') ret = script_runner.run(['scil_surface_create', - '--in_labels', in_atlas, - 'surface.vtk', - '--fill', - '--smooth', '1', - '--erosion', '1', - '--dilation', '1', - '--opening', '1', - '--closing', '1', '-f']) + '--in_labels', in_atlas, + 'surface.vtk', + '--fill', + '--smooth', '1', + '--erosion', '1', + '--dilation', '1', + '--opening', '1', + '--closing', '1', '-f']) assert ret.success @@ -74,8 +74,8 @@ def test_execution_mask(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'atlas', 'brainstem_bin.nii.gz') ret = script_runner.run(['scil_surface_create', - '--in_mask', in_mask, - 'surface.vtk', '-f']) + '--in_mask', in_mask, + 'surface.vtk', '-f']) assert ret.success @@ -84,7 +84,7 @@ def test_execution_volume(script_runner, monkeypatch): in_t1 = os.path.join(SCILPY_HOME, 'others', 't1.nii.gz') ret = script_runner.run(['scil_surface_create', - '--in_volume', in_t1, - '--value', '0.2', - 'surface.vtk', '-f']) + '--in_volume', in_t1, + '--value', '0.2', + 'surface.vtk', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_surface_flip.py b/src/scilpy/cli/tests/test_surface_flip.py index 760b9376a..006fb0964 100644 --- a/src/scilpy/cli/tests/test_surface_flip.py +++ b/src/scilpy/cli/tests/test_surface_flip.py @@ -24,5 +24,5 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lhpialt.vtk') ret = script_runner.run(['scil_surface_flip', in_surf, 'rhpialt.vtk', - 'x']) + 'x']) assert ret.success diff --git a/src/scilpy/cli/tests/test_surface_smooth.py b/src/scilpy/cli/tests/test_surface_smooth.py index 7da429eb6..7e20b3efc 100644 --- a/src/scilpy/cli/tests/test_surface_smooth.py +++ b/src/scilpy/cli/tests/test_surface_smooth.py @@ -22,5 +22,5 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): in_surf = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'lhpialt.vtk') ret = script_runner.run(['scil_surface_smooth', in_surf, - 'lhpialt_smooth.vtk', '-n', '5', '-s', '1']) + 'lhpialt_smooth.vtk', '-n', '5', '-s', '1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tracking_local.py b/src/scilpy/cli/tests/test_tracking_local.py index 704ce42ca..2a06a9294 100644 --- a/src/scilpy/cli/tests/test_tracking_local.py +++ b/src/scilpy/cli/tests/test_tracking_local.py @@ -27,9 +27,9 @@ def test_execution_tracking_fodf_prob(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'local_prob.trk', '--nt', '100', - '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200']) + in_mask, in_mask, 'local_prob.trk', '--nt', '100', + '--compress', '0.1', '--sh_basis', 'descoteaux07', + '--min_length', '20', '--max_length', '200']) assert ret.success @@ -39,10 +39,10 @@ def test_execution_tracking_fodf_det(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'local_det.trk', '--nt', '100', - '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200', - '--algo', 'det']) + in_mask, in_mask, 'local_det.trk', '--nt', '100', + '--compress', '0.1', '--sh_basis', 'descoteaux07', + '--min_length', '20', '--max_length', '200', + '--algo', 'det']) assert ret.success @@ -52,10 +52,10 @@ def test_execution_tracking_ptt(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'local_ptt.trk', '--nt', '100', - '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200', - '--algo', 'ptt', '-f']) + in_mask, in_mask, 'local_ptt.trk', '--nt', '100', + '--compress', '0.1', '--sh_basis', 'descoteaux07', + '--min_length', '20', '--max_length', '200', + '--algo', 'ptt', '-f']) assert ret.success @@ -65,11 +65,11 @@ def test_execution_sphere_subdivide(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'local_sphere.trk', - '--nt', '100', - '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200', - '--sub_sphere', '2']) + in_mask, in_mask, 'local_sphere.trk', + '--nt', '100', + '--compress', '0.1', '--sh_basis', 'descoteaux07', + '--min_length', '20', '--max_length', '200', + '--sub_sphere', '2']) assert ret.success @@ -79,9 +79,9 @@ def test_execution_sphere_gpu(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'sphere_gpu.trk', - '--use_gpu', '--sphere', 'symmetric362', - '--npv', '1']) + in_mask, in_mask, 'sphere_gpu.trk', + '--use_gpu', '--sphere', 'symmetric362', + '--npv', '1']) assert not ret.success @@ -92,8 +92,8 @@ def test_sh_interp_without_gpu(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'nearest_interp.trk', - '--sh_interp', 'nearest', '--nt', '100']) + in_mask, in_mask, 'nearest_interp.trk', + '--sh_interp', 'nearest', '--nt', '100']) assert not ret.success @@ -104,8 +104,8 @@ def test_forward_without_gpu(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'fwd_only.trk', - '--forward_only', '--nt', '100']) + in_mask, in_mask, 'fwd_only.trk', + '--forward_only', '--nt', '100']) assert not ret.success @@ -116,8 +116,8 @@ def test_batch_size_without_gpu(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'batch.trk', - '--batch_size', 100]) + in_mask, in_mask, 'batch.trk', + '--batch_size', 100]) assert not ret.success @@ -128,8 +128,8 @@ def test_algo_with_gpu(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'gpu_det.trk', '--algo', - 'det', '--use_gpu', '--nt', '100']) + in_mask, in_mask, 'gpu_det.trk', '--algo', + 'det', '--use_gpu', '--nt', '100']) assert not ret.success @@ -140,9 +140,9 @@ def test_execution_tracking_fodf_no_compression(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'local_prob2.trk', - '--nt', '100', '--sh_basis', 'descoteaux07', - '--max_length', '200']) + in_mask, in_mask, 'local_prob2.trk', + '--nt', '100', '--sh_basis', 'descoteaux07', + '--max_length', '200']) assert ret.success @@ -152,10 +152,10 @@ def test_execution_tracking_peaks(script_runner, monkeypatch): in_peaks = os.path.join(SCILPY_HOME, 'tracking', 'peaks.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_peaks, - in_mask, in_mask, 'local_eudx.trk', '--nt', '100', - '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200', - '--algo', 'eudx']) + in_mask, in_mask, 'local_eudx.trk', '--nt', '100', + '--compress', '0.1', '--sh_basis', 'descoteaux07', + '--min_length', '20', '--max_length', '200', + '--algo', 'eudx']) assert ret.success @@ -165,10 +165,11 @@ def test_execution_tracking_fodf_prob_pmf_mapping(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'local_prob3.trk', '--nt', '100', - '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200', - '--sh_to_pmf', '-v']) + in_mask, in_mask, 'local_prob3.trk', + '--nt', '100', + '--compress', '0.1', '--sh_basis', 'descoteaux07', + '--min_length', '20', '--max_length', '200', + '--sh_to_pmf', '-v']) assert ret.success @@ -178,11 +179,11 @@ def test_execution_tracking_ptt_with_probe(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'local_ptt.trk', '--nt', '100', - '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200', - '--sh_to_pmf', '-v', '--probe_length', '2', - '--probe_quality', '5', '--algo', 'ptt', '-f']) + in_mask, in_mask, 'local_ptt.trk', '--nt', '100', + '--compress', '0.1', '--sh_basis', 'descoteaux07', + '--min_length', '20', '--max_length', '200', + '--sh_to_pmf', '-v', '--probe_length', '2', + '--probe_quality', '5', '--algo', 'ptt', '-f']) assert ret.success @@ -196,8 +197,8 @@ def test_execution_tracking_fodf_custom_seeds(script_runner, monkeypatch): np.save(in_custom_seeds, custom_seeds) ret = script_runner.run(['scil_tracking_local', in_fodf, - in_mask, in_mask, 'local_prob4.trk', - '--in_custom_seeds', in_custom_seeds, - '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200']) + in_mask, in_mask, 'local_prob4.trk', + '--in_custom_seeds', in_custom_seeds, + '--compress', '0.1', '--sh_basis', 'descoteaux07', + '--min_length', '20', '--max_length', '200']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tracking_local_dev.py b/src/scilpy/cli/tests/test_tracking_local_dev.py index d955e21a3..b7d95bdee 100644 --- a/src/scilpy/cli/tests/test_tracking_local_dev.py +++ b/src/scilpy/cli/tests/test_tracking_local_dev.py @@ -26,12 +26,12 @@ def test_execution_tracking_fodf(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local_dev', in_fodf, - in_mask, in_mask, 'local_prob.trk', '--nt', '10', - '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200', - '--save_seeds', '--rng_seed', '0', - '--sub_sphere', '2', - '--rk_order', '4']) + in_mask, in_mask, 'local_prob.trk', '--nt', '10', + '--compress', '0.1', '--sh_basis', 'descoteaux07', + '--min_length', '20', '--max_length', '200', + '--save_seeds', '--rng_seed', '0', + '--sub_sphere', '2', + '--rk_order', '4']) assert ret.success @@ -45,14 +45,15 @@ def test_execution_tracking_rap(script_runner, monkeypatch): in_rap_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_local_dev', in_fodf, - in_mask, in_mask, 'local_prob_rap.trk', '--nt', '10', - '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200', - '--save_seeds', '--rng_seed', '0', - '--sub_sphere', '2', - '--rk_order', '1', - '--rap_mask', in_rap_mask, - '--rap_method', "continue"]) + in_mask, in_mask, 'local_prob_rap.trk', + '--nt', '10', + '--compress', '0.1', '--sh_basis', 'descoteaux07', + '--min_length', '20', '--max_length', '200', + '--save_seeds', '--rng_seed', '0', + '--sub_sphere', '2', + '--rk_order', '1', + '--rap_mask', in_rap_mask, + '--rap_method', "continue"]) assert ret.success @@ -68,11 +69,11 @@ def test_execution_tracking_fodf_custom_seeds(script_runner, monkeypatch): np.save(in_custom_seeds, custom_seeds) ret = script_runner.run(['scil_tracking_local_dev', in_fodf, - in_mask, in_mask, 'local_prob2.trk', - '--in_custom_seeds', in_custom_seeds, - '--compress', '0.1', '--sh_basis', 'descoteaux07', - '--min_length', '20', '--max_length', '200', - '--save_seeds', '--rng_seed', '0', - '--sub_sphere', '2', - '--rk_order', '4']) + in_mask, in_mask, 'local_prob2.trk', + '--in_custom_seeds', in_custom_seeds, + '--compress', '0.1', '--sh_basis', 'descoteaux07', + '--min_length', '20', '--max_length', '200', + '--save_seeds', '--rng_seed', '0', + '--sub_sphere', '2', + '--rk_order', '4']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tracking_pft.py b/src/scilpy/cli/tests/test_tracking_pft.py index 0d7e4bc51..f7af92d18 100644 --- a/src/scilpy/cli/tests/test_tracking_pft.py +++ b/src/scilpy/cli/tests/test_tracking_pft.py @@ -29,8 +29,9 @@ def test_execution_tracking(script_runner, monkeypatch): in_exclude = os.path.join(SCILPY_HOME, 'tracking', 'map_exclude.nii.gz') ret = script_runner.run(['scil_tracking_pft', in_fodf, - in_interface, in_include, in_exclude, - 'pft.trk', '--nt', '1000', '--compress', '0.1', - '--sh_basis', 'descoteaux07', '--min_length', '20', - '--max_length', '200']) + in_interface, in_include, in_exclude, + 'pft.trk', '--nt', '1000', '--compress', '0.1', + '--sh_basis', 'descoteaux07', + '--min_length', '20', + '--max_length', '200']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tracking_pft_maps.py b/src/scilpy/cli/tests/test_tracking_pft_maps.py index 8a9e840cf..2acd74a53 100644 --- a/src/scilpy/cli/tests/test_tracking_pft_maps.py +++ b/src/scilpy/cli/tests/test_tracking_pft_maps.py @@ -27,5 +27,5 @@ def test_execution_tracking(script_runner, monkeypatch): in_csf = os.path.join(SCILPY_HOME, 'tracking', 'map_csf.nii.gz') ret = script_runner.run(['scil_tracking_pft_maps', - in_wm, in_gm, in_csf]) + in_wm, in_gm, in_csf]) assert ret.success diff --git a/src/scilpy/cli/tests/test_tracking_pft_maps_edit.py b/src/scilpy/cli/tests/test_tracking_pft_maps_edit.py index a2ecece3f..eebb0f681 100644 --- a/src/scilpy/cli/tests/test_tracking_pft_maps_edit.py +++ b/src/scilpy/cli/tests/test_tracking_pft_maps_edit.py @@ -26,7 +26,7 @@ def test_execution_tracking(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'tracking', 'seeding_mask.nii.gz') ret = script_runner.run(['scil_tracking_pft_maps_edit', - in_include, in_exclude, in_mask, - 'map_include_corr.nii.gz', - 'map_exclude_corr.nii.gz']) + in_include, in_exclude, in_mask, + 'map_include_corr.nii.gz', + 'map_exclude_corr.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_apply_transform.py b/src/scilpy/cli/tests/test_tractogram_apply_transform.py index 1861169fc..03850c8f7 100644 --- a/src/scilpy/cli/tests/test_tractogram_apply_transform.py +++ b/src/scilpy/cli/tests/test_tractogram_apply_transform.py @@ -25,7 +25,7 @@ def test_execution_inverse(script_runner, monkeypatch): in_warp = os.path.join(SCILPY_HOME, 'bst', 'output1InverseWarp.nii.gz') ret = script_runner.run(['scil_tractogram_apply_transform', - in_model, in_fa, in_aff, 'rpt_m_warp.trk', - '--inverse', '--in_deformation', in_warp, - '--cut']) + in_model, in_fa, in_aff, 'rpt_m_warp.trk', + '--inverse', '--in_deformation', in_warp, + '--cut']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_apply_transform_to_hdf5.py b/src/scilpy/cli/tests/test_tractogram_apply_transform_to_hdf5.py index f4e0e9848..a03cf8305 100644 --- a/src/scilpy/cli/tests/test_tractogram_apply_transform_to_hdf5.py +++ b/src/scilpy/cli/tests/test_tractogram_apply_transform_to_hdf5.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run(['scil_tractogram_apply_transform_to_hdf5', - '--help']) + '--help']) assert ret.success @@ -29,5 +29,5 @@ def test_execution_connectivity(script_runner, monkeypatch): # (See test_tractogram_apply_transform) # toDo. Add some dps in the hdf5's data for more line coverage. ret = script_runner.run(['scil_tractogram_apply_transform_to_hdf5', - in_h5, in_target, in_transfo, 'decompose_lin.h5']) + in_h5, in_target, in_transfo, 'decompose_lin.h5']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py b/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py index bb49d9af6..66cdb82f4 100644 --- a/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py +++ b/src/scilpy/cli/tests/test_tractogram_assign_custom_color.py @@ -19,7 +19,7 @@ def test_help_option(script_runner): ret = script_runner.run(['scil_tractogram_assign_custom_color', - '--help']) + '--help']) assert ret.success @@ -29,8 +29,8 @@ def test_execution_from_anat(script_runner, monkeypatch): 'IFGWM_labels_map.nii.gz') ret = script_runner.run(['scil_tractogram_assign_custom_color', - in_bundle, 'colored.trk', '--from_anatomy', - in_anat, '--out_colorbar', 'test_colorbar.png']) + in_bundle, 'colored.trk', '--from_anatomy', + in_anat, '--out_colorbar', 'test_colorbar.png']) assert ret.success @@ -38,7 +38,7 @@ def test_execution_along_profile(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_assign_custom_color', - in_bundle, 'colored2.trk', '--along_profile']) + in_bundle, 'colored2.trk', '--along_profile']) assert ret.success @@ -46,7 +46,7 @@ def test_execution_from_angle(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_assign_custom_color', - in_bundle, 'colored3.trk', '--local_angle']) + in_bundle, 'colored3.trk', '--local_angle']) assert ret.success @@ -54,6 +54,6 @@ def test_execution_ambiant_occlusion(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_assign_custom_color', - in_bundle, 'colored4.trk', '--local_orientation', - '--ambiant_occlusion']) - assert ret.success \ No newline at end of file + in_bundle, 'colored4.trk', '--local_orientation', + '--ambiant_occlusion']) + assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_assign_uniform_color.py b/src/scilpy/cli/tests/test_tractogram_assign_uniform_color.py index 8a445dfab..7ffb2dcc5 100644 --- a/src/scilpy/cli/tests/test_tractogram_assign_uniform_color.py +++ b/src/scilpy/cli/tests/test_tractogram_assign_uniform_color.py @@ -17,7 +17,7 @@ def test_help_option(script_runner): ret = script_runner.run(['scil_tractogram_assign_uniform_color', - '--help']) + '--help']) assert ret.success @@ -25,8 +25,8 @@ def test_execution_fill(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_assign_uniform_color', - in_bundle, '--fill_color', '0x000000', - '--out_tractogram', 'colored.trk', '-f']) + in_bundle, '--fill_color', '0x000000', + '--out_tractogram', 'colored.trk', '-f']) assert ret.success @@ -40,10 +40,11 @@ def test_execution_dict(script_runner, monkeypatch): json.dump(my_dict, f) ret = script_runner.run(['scil_tractogram_assign_uniform_color', - in_bundle, '--dict_colors', json_file, - '--out_suffix', 'colored', '-f']) + in_bundle, '--dict_colors', json_file, + '--out_suffix', 'colored', '-f']) assert ret.success + def test_execution_dict_new_color(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) @@ -55,7 +56,7 @@ def test_execution_dict_new_color(script_runner, monkeypatch): shutil.copy2(in_bundle, 'dummy.trk') ret = script_runner.run(['scil_tractogram_assign_uniform_color', - in_bundle, "dummy.trk", - '--dict_colors', json_file, - '--out_suffix', 'colored', '-f']) + in_bundle, "dummy.trk", + '--dict_colors', json_file, + '--out_suffix', 'colored', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_compress.py b/src/scilpy/cli/tests/test_tractogram_compress.py index 1274a174d..7e9762f83 100644 --- a/src/scilpy/cli/tests/test_tractogram_compress.py +++ b/src/scilpy/cli/tests/test_tractogram_compress.py @@ -22,5 +22,5 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): in_fib = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'gyri_fanning.trk') ret = script_runner.run(['scil_tractogram_compress', in_fib, - 'gyri_fanning_c.trk', '-e', '0.1']) + 'gyri_fanning_c.trk', '-e', '0.1']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_compute_TODI.py b/src/scilpy/cli/tests/test_tractogram_compute_TODI.py index 8f72df9b9..6d29f1569 100644 --- a/src/scilpy/cli/tests/test_tractogram_compute_TODI.py +++ b/src/scilpy/cli/tests/test_tractogram_compute_TODI.py @@ -23,14 +23,14 @@ def test_execution_bst(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') ret = script_runner.run(['scil_tractogram_compute_TODI', in_bundle, - '--mask', in_mask, - '--out_mask', 'todi_mask.nii.gz', - '--out_tdi', 'tdi.nii.gz', - '--out_todi_sh', 'todi_sh.nii.gz', - '--out_todi_sf', 'todi_sf.nii.gz', - '--sh_order', '6', - '--normalize_per_voxel', '--smooth_todi', - '--sh_basis', 'descoteaux07']) + '--mask', in_mask, + '--out_mask', 'todi_mask.nii.gz', + '--out_tdi', 'tdi.nii.gz', + '--out_todi_sh', 'todi_sh.nii.gz', + '--out_todi_sf', 'todi_sf.nii.gz', + '--sh_order', '6', + '--normalize_per_voxel', '--smooth_todi', + '--sh_basis', 'descoteaux07']) assert ret.success @@ -38,7 +38,6 @@ def test_execution_asym(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'bst', 'rpt_m_warp.trk') ret = script_runner.run(['scil_tractogram_compute_TODI', in_bundle, - '--out_todi_sh', 'atodi_sh_8.nii.gz', - '--asymmetric', '--n_steps', '2']) - + '--out_todi_sh', 'atodi_sh_8.nii.gz', + '--asymmetric', '--n_steps', '2']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_compute_density_map.py b/src/scilpy/cli/tests/test_tractogram_compute_density_map.py index 84938776d..91cf5c57c 100644 --- a/src/scilpy/cli/tests/test_tractogram_compute_density_map.py +++ b/src/scilpy/cli/tests/test_tractogram_compute_density_map.py @@ -22,7 +22,7 @@ def test_execution_others(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'others', 'IFGWM.trk') ret = script_runner.run(['scil_tractogram_compute_density_map', - in_bundle, 'binary.nii.gz', '--endpoints_only']) + in_bundle, 'binary.nii.gz', '--endpoints_only']) assert ret.success @@ -30,5 +30,5 @@ def test_execution_tractometry(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM.trk') ret = script_runner.run(['scil_tractogram_compute_density_map', - in_bundle, 'IFGWM.nii.gz', '--binary']) + in_bundle, 'IFGWM.nii.gz', '--binary']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_convert_hdf5_to_trk.py b/src/scilpy/cli/tests/test_tractogram_convert_hdf5_to_trk.py index f29fb4e08..5bff8b8fd 100644 --- a/src/scilpy/cli/tests/test_tractogram_convert_hdf5_to_trk.py +++ b/src/scilpy/cli/tests/test_tractogram_convert_hdf5_to_trk.py @@ -32,7 +32,8 @@ def test_execution_all_keys(script_runner, monkeypatch): def test_execution_edge_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk', - in_h5, 'save_trk2/', '--edge_keys', '1_10', '1_7']) + in_h5, 'save_trk2/', + '--edge_keys', '1_10', '1_7']) assert ret.success # Out directory should have 2 files @@ -43,7 +44,7 @@ def test_execution_edge_keys(script_runner, monkeypatch): def test_execution_node_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk', - in_h5, 'save_trk3/', '--node_keys', '7']) + in_h5, 'save_trk3/', '--node_keys', '7']) assert ret.success # With current test data, out directory should have 3 files @@ -59,10 +60,10 @@ def test_execution_save_empty(script_runner, monkeypatch): with open('labels_list.txt', 'w') as f: f.write('1\n10\n100') ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk', - in_h5, 'save_trk4/', - '--save_empty', 'labels_list.txt', - '--edge_keys', '1_10', '1_100', - '-v', 'DEBUG']) + in_h5, 'save_trk4/', + '--save_empty', 'labels_list.txt', + '--edge_keys', '1_10', '1_100', + '-v', 'DEBUG']) assert ret.success # Out directory should have 2 files diff --git a/src/scilpy/cli/tests/test_tractogram_convert_trk_to_hdf5.py b/src/scilpy/cli/tests/test_tractogram_convert_trk_to_hdf5.py index 9089b01d3..f0ecaa9d6 100644 --- a/src/scilpy/cli/tests/test_tractogram_convert_trk_to_hdf5.py +++ b/src/scilpy/cli/tests/test_tractogram_convert_trk_to_hdf5.py @@ -25,7 +25,7 @@ def test_help_option(script_runner): def test_execution_edge_keys(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_convert_hdf5_to_trk', - in_h5, 'save_trk/', '--edge_keys', '1_10', '1_7']) + in_h5, 'save_trk/', '--edge_keys', '1_10', '1_7']) assert ret.success # Out directory should have 2 files @@ -33,10 +33,10 @@ def test_execution_edge_keys(script_runner, monkeypatch): assert len(out_files) == 2 ret = script_runner.run(['scil_tractogram_convert_trk_to_hdf5', - 'save_trk/1_10.trk', 'save_trk/1_7.trk', - 'two_edges.h5', - '--stored_space', 'voxmm', - '--stored_origin', 'nifti']) + 'save_trk/1_10.trk', 'save_trk/1_7.trk', + 'two_edges.h5', + '--stored_space', 'voxmm', + '--stored_origin', 'nifti']) assert ret.success with h5py.File('two_edges.h5', 'r') as hdf5_file: diff --git a/src/scilpy/cli/tests/test_tractogram_cut_streamlines.py b/src/scilpy/cli/tests/test_tractogram_cut_streamlines.py index 79ff265f1..9e447053b 100644 --- a/src/scilpy/cli/tests/test_tractogram_cut_streamlines.py +++ b/src/scilpy/cli/tests/test_tractogram_cut_streamlines.py @@ -25,10 +25,10 @@ def test_execution(script_runner, monkeypatch): 'bundle_all_1mm.trk') in_mask = os.path.join(SCILPY_HOME, 'filtering', 'mask.nii.gz') ret = script_runner.run(['scil_tractogram_cut_streamlines', - in_tractogram, 'out_tractogram_cut.trk', - '--mask', in_mask, '--min_length', '0', '-f', - '--reference', in_mask, - '--resample', '0.2', '--compress', '0.1']) + in_tractogram, 'out_tractogram_cut.trk', + '--mask', in_mask, '--min_length', '0', '-f', + '--reference', in_mask, + '--resample', '0.2', '--compress', '0.1']) assert ret.success @@ -41,11 +41,11 @@ def test_execution_two_rois(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') ret = script_runner.run(['scil_tractogram_cut_streamlines', - in_tractogram, '--mask', in_mask, - 'out_tractogram_cut.trk', '-f', - '--mask', in_mask, '--min_length', '0', - '--reference', in_mask, - '--resample', '0.2', '--compress', '0.1']) + in_tractogram, '--mask', in_mask, + 'out_tractogram_cut.trk', '-f', + '--mask', in_mask, '--min_length', '0', + '--reference', in_mask, + '--resample', '0.2', '--compress', '0.1']) assert ret.success @@ -58,12 +58,12 @@ def test_execution_keep_longest(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') ret = script_runner.run(['scil_tractogram_cut_streamlines', - in_tractogram, '--mask', in_mask, - 'out_tractogram_cut.trk', '-f', - '--keep_longest', '--mask', in_mask, - '--min_length', '0', '--resample', '0.2', - '--reference', in_mask, - '--compress', '0.1']) + in_tractogram, '--mask', in_mask, + 'out_tractogram_cut.trk', '-f', + '--keep_longest', '--mask', in_mask, + '--min_length', '0', '--resample', '0.2', + '--reference', in_mask, + '--compress', '0.1']) assert ret.success @@ -76,12 +76,12 @@ def test_execution_trim_endpoints(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_head_tail_offset.nii.gz') ret = script_runner.run(['scil_tractogram_cut_streamlines', - in_tractogram, '--mask', in_mask, - 'out_tractogram_cut.trk', '-f', - '--trim_endpoints', '--mask', in_mask, - '--min_length', '0', '--resample', '0.2', - '--reference', in_mask, - '--compress', '0.1']) + in_tractogram, '--mask', in_mask, + 'out_tractogram_cut.trk', '-f', + '--trim_endpoints', '--mask', in_mask, + '--min_length', '0', '--resample', '0.2', + '--reference', in_mask, + '--compress', '0.1']) assert ret.success @@ -92,10 +92,10 @@ def test_execution_labels(script_runner, monkeypatch): in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') ret = script_runner.run(['scil_tractogram_cut_streamlines', - in_tractogram, '--labels', in_labels, - 'out_tractogram_cut.trk', '-f', - '--label_ids', '1', '10', - '--resample', '0.2', '--compress', '0.1']) + in_tractogram, '--labels', in_labels, + 'out_tractogram_cut.trk', '-f', + '--label_ids', '1', '10', + '--resample', '0.2', '--compress', '0.1']) assert ret.success @@ -106,11 +106,11 @@ def test_execution_labels_error_trim(script_runner, monkeypatch): in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') ret = script_runner.run(['scil_tractogram_cut_streamlines', - in_tractogram, '--labels', in_labels, - 'out_tractogram_cut2.trk', '-f', - '--label_ids', '1', '10', - '--resample', '0.2', '--compress', '0.1' - '--trim_endpoints']) + in_tractogram, '--labels', in_labels, + 'out_tractogram_cut2.trk', '-f', + '--label_ids', '1', '10', + '--resample', '0.2', '--compress', '0.1' + '--trim_endpoints']) assert not ret.success @@ -121,9 +121,9 @@ def test_execution_labels_no_point(script_runner, monkeypatch): in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') ret = script_runner.run(['scil_tractogram_cut_streamlines', - in_tractogram, '--labels', in_labels, - 'out_tractogram_cut.trk', '-f', - '--no_point_in_roi', '--label_ids', '1', '10']) + in_tractogram, '--labels', in_labels, + 'out_tractogram_cut.trk', '-f', + '--no_point_in_roi', '--label_ids', '1', '10']) assert ret.success @@ -134,7 +134,7 @@ def test_execution_labels_one_point(script_runner, monkeypatch): in_labels = os.path.join(SCILPY_HOME, 'connectivity', 'endpoints_atlas.nii.gz') ret = script_runner.run(['scil_tractogram_cut_streamlines', - in_tractogram, '--labels', in_labels, - 'out_tractogram_cut.trk', '-f', - '--one_point_in_roi', '--label_ids', '1', '10']) + in_tractogram, '--labels', in_labels, + 'out_tractogram_cut.trk', '-f', + '--one_point_in_roi', '--label_ids', '1', '10']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_detect_loops.py b/src/scilpy/cli/tests/test_tractogram_detect_loops.py index 042e41685..b4941ba9e 100644 --- a/src/scilpy/cli/tests/test_tractogram_detect_loops.py +++ b/src/scilpy/cli/tests/test_tractogram_detect_loops.py @@ -22,9 +22,9 @@ def test_execution_filtering(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4_filtered.trk') ret = script_runner.run(['scil_tractogram_detect_loops', - in_bundle, 'bundle_4_filtered_no_loops.trk', - '--looping_tractogram', - 'bundle_4_filtered_loops.trk', - '--angle', '270', '--qb', '4', - '--processes', '1', '--display_counts']) + in_bundle, 'bundle_4_filtered_no_loops.trk', + '--looping_tractogram', + 'bundle_4_filtered_loops.trk', + '--angle', '270', '--qb', '4', + '--processes', '1', '--display_counts']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_dpp_math.py b/src/scilpy/cli/tests/test_tractogram_dpp_math.py index a3be13000..8f0a98000 100644 --- a/src/scilpy/cli/tests/test_tractogram_dpp_math.py +++ b/src/scilpy/cli/tests/test_tractogram_dpp_math.py @@ -32,19 +32,18 @@ def test_execution_tractogram_point_math_mean_3D_defaults(script_runner, # Test dps mode ret = script_runner.run(['scil_tractogram_dpp_math', - 'mean', t1_on_bundle, 't1_mean_on_streamlines.trk', - '--mode', 'dps', '--in_dpp_name', 't1', - '--out_keys', 't1_mean']) - + 'mean', t1_on_bundle, + 't1_mean_on_streamlines.trk', + '--mode', 'dps', '--in_dpp_name', 't1', + '--out_keys', 't1_mean']) assert ret.success # Test dpp mode ret = script_runner.run(['scil_tractogram_dpp_math', - 'mean', t1_on_bundle, - 't1_mean_on_streamlines2.trk', - '--mode', 'dpp', '--in_dpp_name', 't1', - '--out_keys', 't1_mean']) - + 'mean', t1_on_bundle, + 't1_mean_on_streamlines2.trk', + '--mode', 'dpp', '--in_dpp_name', 't1', + '--out_keys', 't1_mean']) assert ret.success @@ -56,15 +55,14 @@ def test_execution_tractogram_point_math_mean_4D_correlation(script_runner, fodf_on_bundle = 'fodf_on_streamlines.trk' script_runner.run(['scil_tractogram_project_map_to_streamlines', - in_bundle, fodf_on_bundle, - '--in_maps', in_fodf, in_fodf, - '--out_dpp_name', 'fodf', 'fodf2']) + in_bundle, fodf_on_bundle, + '--in_maps', in_fodf, in_fodf, + '--out_dpp_name', 'fodf', 'fodf2']) ret = script_runner.run(['scil_tractogram_dpp_math', - 'correlation', fodf_on_bundle, - 'fodf_correlation_on_streamlines.trk', - '--mode', 'dps', '--endpoints_only', - '--in_dpp_name', 'fodf', - '--out_keys', 'fodf_correlation']) - + 'correlation', fodf_on_bundle, + 'fodf_correlation_on_streamlines.trk', + '--mode', 'dps', '--endpoints_only', + '--in_dpp_name', 'fodf', + '--out_keys', 'fodf_correlation']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_dps_math.py b/src/scilpy/cli/tests/test_tractogram_dps_math.py index cfd68bab5..397ef6417 100644 --- a/src/scilpy/cli/tests/test_tractogram_dps_math.py +++ b/src/scilpy/cli/tests/test_tractogram_dps_math.py @@ -17,7 +17,7 @@ def test_help_option(script_runner): ret = script_runner.run(['scil_tractogram_dps_math', - '--help']) + '--help']) assert ret.success @@ -30,10 +30,10 @@ def test_execution_dps_math_import(script_runner, monkeypatch): outname = 'out.trk' np.save(filename, np.arange(len(sft))) ret = script_runner.run(['scil_tractogram_dps_math', - in_bundle, 'import', 'key', - '--in_dps_file', filename, - '--out_tractogram', outname, - '-f']) + in_bundle, 'import', 'key', + '--in_dps_file', filename, + '--out_tractogram', outname, + '-f']) assert ret.success @@ -44,10 +44,10 @@ def test_execution_dps_math_import_single_value(script_runner, 'bundle_4.trk') outname = 'out.trk' ret = script_runner.run(['scil_tractogram_dps_math', - in_bundle, 'import', 'key', - '--in_dps_single_value', '42', - '--out_tractogram', outname, - '-f']) + in_bundle, 'import', 'key', + '--in_dps_single_value', '42', + '--out_tractogram', outname, + '-f']) assert ret.success @@ -58,10 +58,10 @@ def test_execution_dps_math_import_single_value_array(script_runner, 'bundle_4.trk') outname = 'out.trk' ret = script_runner.run(['scil_tractogram_dps_math', - in_bundle, 'import', 'key', - '--in_dps_single_value', '1', '1.1', '1.2', - '--out_tractogram', outname, - '-f']) + in_bundle, 'import', 'key', + '--in_dps_single_value', '1', '1.1', '1.2', + '--out_tractogram', outname, + '-f']) assert ret.success @@ -75,10 +75,10 @@ def test_execution_dps_math_import_with_missing_vals(script_runner, outname = 'out.trk' np.save(filename, np.arange(len(sft) - 10)) ret = script_runner.run(['scil_tractogram_dps_math', - in_bundle, 'import', 'key', - '--in_dps_file', filename, - '--out_tractogram', outname, - '-f']) + in_bundle, 'import', 'key', + '--in_dps_file', filename, + '--out_tractogram', outname, + '-f']) assert ret.stderr @@ -93,15 +93,15 @@ def test_execution_dps_math_import_with_existing_key(script_runner, outname2 = 'out_2.trk' np.save(filename, np.arange(len(sft))) ret = script_runner.run(['scil_tractogram_dps_math', - in_bundle, 'import', 'key', - '--in_dps_file', filename, - '--out_tractogram', outname, - '-f']) + in_bundle, 'import', 'key', + '--in_dps_file', filename, + '--out_tractogram', outname, + '-f']) assert ret.success ret = script_runner.run(['scil_tractogram_dps_math', - outname, 'import', 'key', - '--in_dps_file', filename, - '--out_tractogram', outname2,]) + outname, 'import', 'key', + '--in_dps_file', filename, + '--out_tractogram', outname2,]) assert not ret.success @@ -114,10 +114,10 @@ def test_execution_dps_math_tck_output(script_runner, monkeypatch): outname = 'out.tck' np.save(filename, np.arange(len(sft))) ret = script_runner.run(['scil_tractogram_dps_math', - in_bundle, 'import', 'key', - '--in_dps_file', filename, - '--out_tractogram', outname, - '-f']) + in_bundle, 'import', 'key', + '--in_dps_file', filename, + '--out_tractogram', outname, + '-f']) assert not ret.success @@ -133,9 +133,9 @@ def test_execution_dps_math_delete(script_runner, monkeypatch): save_tractogram(sft, in_bundle) outname = 'out.trk' ret = script_runner.run(['scil_tractogram_dps_math', - in_bundle, 'delete', 'key', - '--out_tractogram', outname, - '-f']) + in_bundle, 'delete', 'key', + '--out_tractogram', outname, + '-f']) assert ret.success @@ -145,9 +145,9 @@ def test_execution_dps_math_delete_no_key(script_runner, monkeypatch): 'bundle_4.trk') outname = 'out.trk' ret = script_runner.run(['scil_tractogram_dps_math', - in_bundle, 'delete', 'key', - '--out_tractogram', outname, - '-f']) + in_bundle, 'delete', 'key', + '--out_tractogram', outname, + '-f']) assert not ret.success @@ -163,9 +163,9 @@ def test_execution_dps_math_export(script_runner, monkeypatch): save_tractogram(sft, in_bundle) filename = 'out.txt' ret = script_runner.run(['scil_tractogram_dps_math', - in_bundle, 'export', 'key', - '--out_dps_file', filename, - '-f']) + in_bundle, 'export', 'key', + '--out_dps_file', filename, + '-f']) assert ret.success @@ -175,7 +175,7 @@ def test_execution_dps_math_export_no_key(script_runner, monkeypatch): 'bundle_4.trk') filename = 'out.txt' ret = script_runner.run(['scil_tractogram_dps_math', - in_bundle, 'export', 'key', - '--out_dps_file', filename, - '-f']) + in_bundle, 'export', 'key', + '--out_dps_file', filename, + '-f']) assert not ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_extract_ushape.py b/src/scilpy/cli/tests/test_tractogram_extract_ushape.py index 4ced0bd96..3df91d0a3 100644 --- a/src/scilpy/cli/tests/test_tractogram_extract_ushape.py +++ b/src/scilpy/cli/tests/test_tractogram_extract_ushape.py @@ -24,9 +24,9 @@ def test_execution_processing(script_runner, monkeypatch): out_trk = 'ushape.trk' remaining_trk = 'remaining.trk' ret = script_runner.run(['scil_tractogram_extract_ushape', - in_trk, out_trk, - '--minU', '0.5', - '--maxU', '1', - '--remaining_tractogram', remaining_trk, - '--display_counts']) + in_trk, out_trk, + '--minU', '0.5', + '--maxU', '1', + '--remaining_tractogram', remaining_trk, + '--display_counts']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_filter_by_anatomy.py b/src/scilpy/cli/tests/test_tractogram_filter_by_anatomy.py index aa884c163..f603c54a1 100644 --- a/src/scilpy/cli/tests/test_tractogram_filter_by_anatomy.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_by_anatomy.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run(['scil_tractogram_filter_by_anatomy', - '--help']) + '--help']) assert ret.success @@ -25,9 +25,9 @@ def test_execution_filtering_all_options(script_runner, monkeypatch): in_wmparc = os.path.join(SCILPY_HOME, 'anatomical_filtering', 'wmparc_filter_ana.nii.gz') ret = script_runner.run(['scil_tractogram_filter_by_anatomy', - in_tractogram, in_wmparc, - os.path.expanduser(tmp_dir.name), - '--minL', '40', '--maxL', '200', '--angle', '300', + in_tractogram, in_wmparc, + os.path.expanduser(tmp_dir.name), + '--minL', '40', '--maxL', '200', '--angle', '300', '--processes', '1', '--save_volumes', '--dilate_ctx', '2', '--save_intermediate_tractograms', @@ -44,9 +44,9 @@ def test_execution_filtering_rejected(script_runner, monkeypatch): in_wmparc = os.path.join(SCILPY_HOME, 'anatomical_filtering', 'wmparc_filter_ana.nii.gz') ret = script_runner.run(['scil_tractogram_filter_by_anatomy', - in_tractogram, in_wmparc, - os.path.expanduser(tmp_dir.name), - '--minL', '40', '--maxL', '200', '--angle', '300', + in_tractogram, in_wmparc, + os.path.expanduser(tmp_dir.name), + '--minL', '40', '--maxL', '200', '--angle', '300', '--processes', '1', '--save_volumes', '--dilate_ctx', '2', '--save_counts', @@ -62,9 +62,9 @@ def test_execution_filtering_save_intermediate(script_runner, monkeypatch): in_wmparc = os.path.join(SCILPY_HOME, 'anatomical_filtering', 'wmparc_filter_ana.nii.gz') ret = script_runner.run(['scil_tractogram_filter_by_anatomy', - in_tractogram, in_wmparc, - os.path.expanduser(tmp_dir.name), - '--minL', '40', '--maxL', '200', '--angle', '300', + in_tractogram, in_wmparc, + os.path.expanduser(tmp_dir.name), + '--minL', '40', '--maxL', '200', '--angle', '300', '--processes', '1', '--save_volumes', '--dilate_ctx', '2', '--save_intermediate_tractograms', diff --git a/src/scilpy/cli/tests/test_tractogram_filter_by_length.py b/src/scilpy/cli/tests/test_tractogram_filter_by_length.py index 6eacf99ae..5aa3eef11 100644 --- a/src/scilpy/cli/tests/test_tractogram_filter_by_length.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_by_length.py @@ -15,7 +15,7 @@ def test_help_option(script_runner): ret = script_runner.run(['scil_tractogram_filter_by_length', - '--help']) + '--help']) assert ret.success @@ -27,8 +27,8 @@ def test_execution_filtering(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') ret = script_runner.run(['scil_tractogram_filter_by_length', - in_bundle, 'bundle_4_filtered.trk', - '--minL', '125', '--maxL', '130']) + in_bundle, 'bundle_4_filtered.trk', + '--minL', '125', '--maxL', '130']) sft = load_tractogram('bundle_4_filtered.trk', 'same') assert len(sft) == 52 @@ -41,9 +41,9 @@ def test_rejected_filtering(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') ret = script_runner.run(['scil_tractogram_filter_by_length', - in_bundle, 'bundle_all_1mm_filtered.trk', - '--minL', '125', '--maxL', '130', - '--out_rejected', 'bundle_all_1mm_rejected.trk']) + in_bundle, 'bundle_all_1mm_filtered.trk', + '--minL', '125', '--maxL', '130', + '--out_rejected', 'bundle_all_1mm_rejected.trk']) assert ret.success assert os.path.exists('bundle_all_1mm_rejected.trk') assert os.path.exists('bundle_all_1mm_rejected.trk') @@ -60,9 +60,9 @@ def test_rejected_filtering_no_rejection(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') ret = script_runner.run(['scil_tractogram_filter_by_length', - in_bundle, 'bundle_4_filtered_no_rejection.trk', - '--minL', '125', '--maxL', '130', - '--out_rejected', 'bundle_4_rejected.trk']) + in_bundle, 'bundle_4_filtered_no_rejection.trk', + '--minL', '125', '--maxL', '130', + '--out_rejected', 'bundle_4_rejected.trk']) assert ret.success # File should be created even though there are no rejected streamlines diff --git a/src/scilpy/cli/tests/test_tractogram_filter_by_orientation.py b/src/scilpy/cli/tests/test_tractogram_filter_by_orientation.py index a61f01f47..39648cfd2 100644 --- a/src/scilpy/cli/tests/test_tractogram_filter_by_orientation.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_by_orientation.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run(['scil_tractogram_filter_by_orientation', - '--help']) + '--help']) assert ret.success @@ -23,7 +23,8 @@ def test_execution_filtering(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_4.trk') ret = script_runner.run(['scil_tractogram_filter_by_orientation', - in_bundle, 'bundle_4_filtered.trk', - '--min_x', '20', '--max_y', '230', '--min_z', '30', - '--use_abs']) + in_bundle, 'bundle_4_filtered.trk', + '--min_x', '20', '--max_y', '230', + '--min_z', '30', + '--use_abs']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_filter_by_roi.py b/src/scilpy/cli/tests/test_tractogram_filter_by_roi.py index 253baec9d..8d56771ab 100644 --- a/src/scilpy/cli/tests/test_tractogram_filter_by_roi.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_by_roi.py @@ -27,13 +27,13 @@ def test_execution_filtering(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_filter_by_roi', in_tractogram, - 'bundle_1.trk', '--display_counts', - '--drawn_roi', in_roi, 'any', 'include', - '--bdo', in_bdo, 'any', 'include', - '--x_plane', '0', 'either_end', 'exclude', - '--y_plane', '0', 'all', 'exclude', '0', - '--z_plane', '0', 'either_end', 'exclude', '1', - '--save_rejected', 'bundle_1_rejected.trk']) + 'bundle_1.trk', '--display_counts', + '--drawn_roi', in_roi, 'any', 'include', + '--bdo', in_bdo, 'any', 'include', + '--x_plane', '0', 'either_end', 'exclude', + '--y_plane', '0', 'all', 'exclude', '0', + '--z_plane', '0', 'either_end', 'exclude', '1', + '--save_rejected', 'bundle_1_rejected.trk']) assert ret.success @@ -41,9 +41,9 @@ def test_execution_filtering_overwrite_distance(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_filter_by_roi', in_tractogram, - 'bundle_2.trk', '--display_counts', - '--drawn_roi', in_roi, 'any', 'include', '2', - '--overwrite_distance', 'any', 'include', '4']) + 'bundle_2.trk', '--display_counts', + '--drawn_roi', in_roi, 'any', 'include', '2', + '--overwrite_distance', 'any', 'include', '4']) assert ret.success @@ -58,6 +58,6 @@ def test_execution_filtering_list(script_runner, monkeypatch): f.write("bdo {} 'any' include".format(in_bdo)) ret = script_runner.run(['scil_tractogram_filter_by_roi', in_tractogram, - 'bundle_3.trk', '--display_counts', - '--filtering_list', filelist]) + 'bundle_3.trk', '--display_counts', + '--filtering_list', filelist]) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_filter_collisions.py b/src/scilpy/cli/tests/test_tractogram_filter_collisions.py index 51d17a9cd..6244415e6 100644 --- a/src/scilpy/cli/tests/test_tractogram_filter_collisions.py +++ b/src/scilpy/cli/tests/test_tractogram_filter_collisions.py @@ -45,8 +45,8 @@ def test_execution_filtering(script_runner, monkeypatch): np.savetxt('diameters.txt', diameters) ret = script_runner.run(['scil_tractogram_filter_collisions', - 'tractogram.trk', 'diameters.txt', 'clean.trk', - '-f']) + 'tractogram.trk', 'diameters.txt', 'clean.trk', + '-f']) assert ret.success @@ -58,8 +58,8 @@ def test_execution_filtering_out_colliding_prefix(script_runner, monkeypatch): np.savetxt('diameters.txt', diameters) ret = script_runner.run(['scil_tractogram_filter_collisions', - 'tractogram.trk', 'diameters.txt', 'clean.trk', - '--out_colliding_prefix', 'tractogram', '-f']) + 'tractogram.trk', 'diameters.txt', 'clean.trk', + '--out_colliding_prefix', 'tractogram', '-f']) assert ret.success @@ -71,8 +71,8 @@ def test_execution_filtering_single_diameter(script_runner, monkeypatch): np.savetxt('diameters.txt', diameters) ret = script_runner.run(['scil_tractogram_filter_collisions', - 'tractogram.trk', 'diameters.txt', 'clean.trk', - '-f']) + 'tractogram.trk', 'diameters.txt', 'clean.trk', + '-f']) assert ret.success @@ -84,8 +84,8 @@ def test_execution_filtering_no_shuffle(script_runner, monkeypatch): np.savetxt('diameters.txt', diameters) ret = script_runner.run(['scil_tractogram_filter_collisions', - 'tractogram.trk', 'diameters.txt', 'clean.trk', - '--disable_shuffling', '-f']) + 'tractogram.trk', 'diameters.txt', 'clean.trk', + '--disable_shuffling', '-f']) assert ret.success @@ -97,8 +97,8 @@ def test_execution_filtering_min_distance(script_runner, monkeypatch): np.savetxt('diameters.txt', diameters) ret = script_runner.run(['scil_tractogram_filter_collisions', - 'tractogram.trk', 'diameters.txt', 'clean.trk', - '--min_distance', '5', '-f']) + 'tractogram.trk', 'diameters.txt', 'clean.trk', + '--min_distance', '5', '-f']) assert ret.success @@ -111,8 +111,8 @@ def test_execution_filtering_metrics(script_runner, monkeypatch): np.savetxt('diameters.txt', diameters) ret = script_runner.run(['scil_tractogram_filter_collisions', - 'tractogram.trk', 'diameters.txt', 'clean.trk', - '--out_metrics', 'metrics.json', '-f']) + 'tractogram.trk', 'diameters.txt', 'clean.trk', + '--out_metrics', 'metrics.json', '-f']) assert ret.success @@ -125,6 +125,6 @@ def test_execution_rotation_matrix(script_runner, monkeypatch): np.savetxt('diameters.txt', diameters) ret = script_runner.run(['scil_tractogram_filter_collisions', - 'tractogram.trk', 'diameters.txt', 'clean.trk', - '--out_rotation_matrix', 'rotation.mat', '-f']) + 'tractogram.trk', 'diameters.txt', 'clean.trk', + '--out_rotation_matrix', 'rotation.mat', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_flip.py b/src/scilpy/cli/tests/test_tractogram_flip.py index 0bd9da27f..7fcfe7297 100644 --- a/src/scilpy/cli/tests/test_tractogram_flip.py +++ b/src/scilpy/cli/tests/test_tractogram_flip.py @@ -24,5 +24,5 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): in_fa = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') ret = script_runner.run(['scil_tractogram_flip', in_fib, - 'gyri_fanning.tck', 'x', '--reference', in_fa]) + 'gyri_fanning.tck', 'x', '--reference', in_fa]) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_math.py b/src/scilpy/cli/tests/test_tractogram_math.py index c53138dd1..285b1e123 100644 --- a/src/scilpy/cli/tests/test_tractogram_math.py +++ b/src/scilpy/cli/tests/test_tractogram_math.py @@ -23,8 +23,8 @@ def test_execution_lazy_concatenate_no_color(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') ret = script_runner.run(['scil_tractogram_math', 'lazy_concatenate', - in_tracto_1, in_tracto_2, - 'lazy_concatenate.trk']) + in_tracto_1, in_tracto_2, + 'lazy_concatenate.trk']) assert ret.success @@ -33,8 +33,8 @@ def test_execution_lazy_concatenate_mix(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') ret = script_runner.run(['scil_tractogram_math', 'lazy_concatenate', - in_tracto_1, in_tracto_2, - 'lazy_concatenate_mix.trk']) + in_tracto_1, in_tracto_2, + 'lazy_concatenate_mix.trk']) assert ret.success @@ -43,7 +43,7 @@ def test_execution_union_no_color(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') ret = script_runner.run(['scil_tractogram_math', 'union', - in_tracto_1, in_tracto_2, 'union.trk']) + in_tracto_1, in_tracto_2, 'union.trk']) assert ret.success @@ -52,7 +52,7 @@ def test_execution_intersection_no_color(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') ret = script_runner.run(['scil_tractogram_math', 'intersection', - in_tracto_1, in_tracto_2, 'intersection.trk']) + in_tracto_1, in_tracto_2, 'intersection.trk']) assert ret.success @@ -61,7 +61,7 @@ def test_execution_difference_no_color(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') ret = script_runner.run(['scil_tractogram_math', 'difference', - in_tracto_1, in_tracto_2, 'difference.trk']) + in_tracto_1, in_tracto_2, 'difference.trk']) assert ret.success @@ -70,7 +70,7 @@ def test_execution_concatenate_no_color(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') ret = script_runner.run(['scil_tractogram_math', 'concatenate', - in_tracto_1, in_tracto_2, 'concatenate.trk']) + in_tracto_1, in_tracto_2, 'concatenate.trk']) assert ret.success @@ -79,8 +79,8 @@ def test_execution_union_no_color_robust(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') ret = script_runner.run(['scil_tractogram_math', 'union', - in_tracto_1, in_tracto_2, 'union_r.trk', - '--robust']) + in_tracto_1, in_tracto_2, 'union_r.trk', + '--robust']) assert ret.success @@ -89,8 +89,8 @@ def test_execution_intersection_no_color_robust(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') ret = script_runner.run(['scil_tractogram_math', 'intersection', - in_tracto_1, in_tracto_2, 'intersection_r.trk', - '--robust']) + in_tracto_1, in_tracto_2, 'intersection_r.trk', + '--robust']) assert ret.success @@ -99,8 +99,8 @@ def test_execution_difference_no_color_robust(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') ret = script_runner.run(['scil_tractogram_math', 'difference', - in_tracto_1, in_tracto_2, 'difference_r.trk', - '--robust']) + in_tracto_1, in_tracto_2, 'difference_r.trk', + '--robust']) assert ret.success @@ -109,7 +109,7 @@ def test_execution_union_color(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') ret = script_runner.run(['scil_tractogram_math', 'union', - in_tracto_1, in_tracto_2, 'union_color.trk']) + in_tracto_1, in_tracto_2, 'union_color.trk']) assert ret.success @@ -118,7 +118,8 @@ def test_execution_intersection_color(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') ret = script_runner.run(['scil_tractogram_math', 'intersection', - in_tracto_1, in_tracto_2, 'intersection_color.trk']) + in_tracto_1, in_tracto_2, + 'intersection_color.trk']) assert ret.success @@ -127,7 +128,8 @@ def test_execution_difference_color(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') ret = script_runner.run(['scil_tractogram_math', 'difference', - in_tracto_1, in_tracto_2, 'difference_color.trk']) + in_tracto_1, in_tracto_2, + 'difference_color.trk']) assert ret.success @@ -136,7 +138,8 @@ def test_execution_concatenate_color(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') ret = script_runner.run(['scil_tractogram_math', 'concatenate', - in_tracto_1, in_tracto_2, 'concatenate_color.trk']) + in_tracto_1, in_tracto_2, + 'concatenate_color.trk']) assert ret.success @@ -146,7 +149,7 @@ def test_execution_union_mix(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') ret = script_runner.run(['scil_tractogram_math', 'union', - in_tracto_1, in_tracto_2, 'union_mix.trk']) + in_tracto_1, in_tracto_2, 'union_mix.trk']) assert not ret.success @@ -155,8 +158,8 @@ def test_execution_intersection_mix_fake(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundles_color.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0.trk') ret = script_runner.run(['scil_tractogram_math', 'intersection', - in_tracto_1, in_tracto_2, 'intersection_mix.trk', - '--fake_metadata']) + in_tracto_1, in_tracto_2, 'intersection_mix.trk', + '--fake_metadata']) assert ret.success @@ -165,8 +168,9 @@ def test_execution_difference_empty_result(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundle_0.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') ret = script_runner.run(['scil_tractogram_math', 'difference', - in_tracto_1, in_tracto_2, - 'difference_empty_results.trk', '--no_metadata']) + in_tracto_1, in_tracto_2, + 'difference_empty_results.trk', + '--no_metadata']) assert ret.success @@ -175,8 +179,9 @@ def test_execution_difference_empty_input_1(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'empty.trk') in_tracto_2 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') ret = script_runner.run(['scil_tractogram_math', 'difference', - in_tracto_1, in_tracto_2, 'difference_empty_1.trk', - '--no_metadata']) + in_tracto_1, in_tracto_2, + 'difference_empty_1.trk', + '--no_metadata']) assert ret.success @@ -185,6 +190,7 @@ def test_execution_difference_empty_input_2(script_runner, monkeypatch): in_tracto_1 = os.path.join(trk_path, 'fibercup_bundle_0_color.trk') in_tracto_2 = os.path.join(trk_path, 'empty.trk') ret = script_runner.run(['scil_tractogram_math', 'difference', - in_tracto_1, in_tracto_2, 'difference_empty_2.trk', - '--no_metadata']) + in_tracto_1, in_tracto_2, + 'difference_empty_2.trk', + '--no_metadata']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_pairwise_comparison.py b/src/scilpy/cli/tests/test_tractogram_pairwise_comparison.py index 10e8c02e8..90ba4286d 100644 --- a/src/scilpy/cli/tests/test_tractogram_pairwise_comparison.py +++ b/src/scilpy/cli/tests/test_tractogram_pairwise_comparison.py @@ -24,16 +24,16 @@ def test_help_option(script_runner): def test_execution_bundles_skip(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_pairwise_comparison', - in_1, in_2, '--out_dir', tmp_dir.name, - '--reference', in_ref, - '--skip_streamlines_distance']) + in_1, in_2, '--out_dir', tmp_dir.name, + '--reference', in_ref, + '--skip_streamlines_distance']) assert ret.success def test_execution_bundles(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_pairwise_comparison', - in_1, in_2, '--out_dir', tmp_dir.name, - '--reference', in_ref, '-f', - '--skip_streamlines_distance']) + in_1, in_2, '--out_dir', tmp_dir.name, + '--reference', in_ref, '-f', + '--skip_streamlines_distance']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_project_map_to_streamlines.py b/src/scilpy/cli/tests/test_tractogram_project_map_to_streamlines.py index df8099291..e3d239e44 100644 --- a/src/scilpy/cli/tests/test_tractogram_project_map_to_streamlines.py +++ b/src/scilpy/cli/tests/test_tractogram_project_map_to_streamlines.py @@ -26,9 +26,9 @@ def test_execution_3D_map(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_project_map_to_streamlines', - in_tracto_1, 't1_on_streamlines.trk', - '--in_maps', in_3d_map, - '--out_dpp_name', 't1']) + in_tracto_1, 't1_on_streamlines.trk', + '--in_maps', in_3d_map, + '--out_dpp_name', 't1']) assert ret.success @@ -36,9 +36,9 @@ def test_execution_4D_map(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_project_map_to_streamlines', - in_tracto_1, 'rgb_on_streamlines.trk', - '--in_maps', in_4d_map, - '--out_dpp_name', 'rgb']) + in_tracto_1, 'rgb_on_streamlines.trk', + '--in_maps', in_4d_map, + '--out_dpp_name', 'rgb']) assert ret.success @@ -46,11 +46,11 @@ def test_execution_3D_map_endpoints_only(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_project_map_to_streamlines', - in_tracto_1, - 't1_on_streamlines_endpoints.trk', - '--in_maps', in_3d_map, - '--out_dpp_name', 't1', - '--endpoints_only']) + in_tracto_1, + 't1_on_streamlines_endpoints.trk', + '--in_maps', in_3d_map, + '--out_dpp_name', 't1', + '--endpoints_only']) assert ret.success @@ -58,11 +58,11 @@ def test_execution_4D_map_endpoints_only(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_project_map_to_streamlines', - in_tracto_1, - 'rgb_on_streamlines_endpoints.trk', - '--in_maps', in_4d_map, - '--out_dpp_name', 'rgb', - '--endpoints_only']) + in_tracto_1, + 'rgb_on_streamlines_endpoints.trk', + '--in_maps', in_4d_map, + '--out_dpp_name', 'rgb', + '--endpoints_only']) assert ret.success @@ -70,9 +70,9 @@ def test_execution_3D_map_trilinear(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_project_map_to_streamlines', - in_tracto_1, - 't1_on_streamlines_trilinear.trk', - '--in_maps', in_3d_map, - '--out_dpp_name', 't1', - '--trilinear']) + in_tracto_1, + 't1_on_streamlines_trilinear.trk', + '--in_maps', in_3d_map, + '--out_dpp_name', 't1', + '--trilinear']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_project_streamlines_to_map.py b/src/scilpy/cli/tests/test_tractogram_project_streamlines_to_map.py index 0f7269733..4935d66e7 100644 --- a/src/scilpy/cli/tests/test_tractogram_project_streamlines_to_map.py +++ b/src/scilpy/cli/tests/test_tractogram_project_streamlines_to_map.py @@ -30,26 +30,26 @@ def test_execution_dpp(script_runner, monkeypatch): # Create our test data with dpp: add metrics as dpp. # Or get a tractogram that already as some dpp in the test data. script_runner.run(['scil_tractogram_project_map_to_streamlines', - in_bundle, in_bundle_with_dpp, '-f', - '--in_maps', in_mni, '--out_dpp_name', 'some_metric']) + in_bundle, in_bundle_with_dpp, '-f', + '--in_maps', in_mni, '--out_dpp_name', 'some_metric']) # Tests with dpp. ret = script_runner.run(['scil_tractogram_project_streamlines_to_map', - in_bundle_with_dpp, 'project_dpp_', - '--use_dpp', 'some_metric', '--point_by_point', - '--to_endpoints']) + in_bundle_with_dpp, 'project_dpp_', + '--use_dpp', 'some_metric', '--point_by_point', + '--to_endpoints']) assert ret.success ret = script_runner.run(['scil_tractogram_project_streamlines_to_map', - in_bundle_with_dpp, 'project_mean_to_endpoints_', - '--use_dpp', 'some_metric', '--mean_streamline', - '--to_endpoints']) + in_bundle_with_dpp, 'project_mean_to_endpoints_', + '--use_dpp', 'some_metric', '--mean_streamline', + '--to_endpoints']) assert ret.success ret = script_runner.run(['scil_tractogram_project_streamlines_to_map', - in_bundle_with_dpp, 'project_end_to_wm', - '--use_dpp', 'some_metric', '--mean_endpoints', - '--to_wm']) + in_bundle_with_dpp, 'project_end_to_wm', + '--use_dpp', 'some_metric', '--mean_endpoints', + '--to_wm']) assert ret.success @@ -63,16 +63,16 @@ def test_execution_dps(script_runner, monkeypatch): # Create our test data with dps: add metrics as dps. # Or get a tractogram that already as some dps in the test data. script_runner.run(['scil_tractogram_project_map_to_streamlines', - in_bundle, in_bundle_with_dpp, '-f', - '--in_maps', in_mni, '--out_dpp_name', 'some_metric']) + in_bundle, in_bundle_with_dpp, '-f', + '--in_maps', in_mni, '--out_dpp_name', 'some_metric']) script_runner.run(['scil_tractogram_dpp_math', 'min', in_bundle_with_dpp, - in_bundle_with_dps, '--in_dpp_name', 'some_metric', - '--out_keys', 'some_metric_dps', '--mode', 'dps', - '--keep_all']) + in_bundle_with_dps, '--in_dpp_name', 'some_metric', + '--out_keys', 'some_metric_dps', '--mode', 'dps', + '--keep_all']) # Tests with dps. ret = script_runner.run(['scil_tractogram_project_streamlines_to_map', - in_bundle_with_dps, 'project_dps_', - '--use_dps', 'some_metric_dps', '--point_by_point', - '--to_wm']) + in_bundle_with_dps, 'project_dps_', + '--use_dps', 'some_metric_dps', + '--point_by_point', '--to_wm']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_qbx.py b/src/scilpy/cli/tests/test_tractogram_qbx.py index b1e11cfc4..3b6f83eef 100644 --- a/src/scilpy/cli/tests/test_tractogram_qbx.py +++ b/src/scilpy/cli/tests/test_tractogram_qbx.py @@ -22,5 +22,5 @@ def test_execution_filtering(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'filtering', 'bundle_all_1mm.trk') ret = script_runner.run(['scil_tractogram_qbx', in_bundle, '12', - 'clusters/', '--out_centroids', 'centroids.trk']) + 'clusters/', '--out_centroids', 'centroids.trk']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_register.py b/src/scilpy/cli/tests/test_tractogram_register.py index 46fd8d47e..c0ac025d4 100644 --- a/src/scilpy/cli/tests/test_tractogram_register.py +++ b/src/scilpy/cli/tests/test_tractogram_register.py @@ -26,6 +26,6 @@ def test_execution_bundles(script_runner, monkeypatch): in_ref = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.nii.gz') ret = script_runner.run(['scil_tractogram_register', in_moving, - in_static, '--only_rigid', - '--moving_tractogram_ref', in_ref]) + in_static, '--only_rigid', + '--moving_tractogram_ref', in_ref]) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_remove_invalid.py b/src/scilpy/cli/tests/test_tractogram_remove_invalid.py index 40e293740..8a7d95d81 100644 --- a/src/scilpy/cli/tests/test_tractogram_remove_invalid.py +++ b/src/scilpy/cli/tests/test_tractogram_remove_invalid.py @@ -22,6 +22,6 @@ def test_execution_bundles(script_runner, monkeypatch): in_tractogram = os.path.join(SCILPY_HOME, 'bundles', 'bundle_all_1mm.trk') ret = script_runner.run(['scil_tractogram_remove_invalid', - in_tractogram, 'bundle_all_1mm.trk', '--cut', - '--remove_overlapping', '--remove_single', '-f']) + in_tractogram, 'bundle_all_1mm.trk', '--cut', + '--remove_overlapping', '--remove_single', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_resample.py b/src/scilpy/cli/tests/test_tractogram_resample.py index 72b2691ad..f853daf2e 100644 --- a/src/scilpy/cli/tests/test_tractogram_resample.py +++ b/src/scilpy/cli/tests/test_tractogram_resample.py @@ -24,12 +24,12 @@ def test_execution_downsample(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_tractogram_resample', in_tracto, - '500', 'union_shuffle_sub_downsampled.trk']) + '500', 'union_shuffle_sub_downsampled.trk']) assert ret.success ret = script_runner.run(['scil_tractogram_resample', in_tracto, - '200', 'union_shuffle_sub_downsampled.trk', - '-f', '--downsample_per_cluster']) + '200', 'union_shuffle_sub_downsampled.trk', + '-f', '--downsample_per_cluster']) assert ret.success @@ -38,8 +38,8 @@ def test_execution_upsample_noise(script_runner, monkeypatch): # point-wise only ret = script_runner.run(['scil_tractogram_resample', in_tracto, - '2000', 'union_shuffle_sub_upsampled.trk', '-f', - '--point_wise_std', '0.5']) + '2000', 'union_shuffle_sub_upsampled.trk', '-f', + '--point_wise_std', '0.5']) assert ret.success @@ -48,12 +48,12 @@ def test_execution_upsample_ptt(script_runner, monkeypatch): # ptt only ret = script_runner.run(['scil_tractogram_resample', in_tracto, - '500', 'union_shuffle_sub_upsampled.trk', '-f', - '--tube_radius', '5']) + '500', 'union_shuffle_sub_upsampled.trk', '-f', + '--tube_radius', '5']) assert ret.success # both upsampling methods ret = script_runner.run(['scil_tractogram_resample', in_tracto, - '500', 'union_shuffle_sub_upsampled.trk', '-f', - '--point_wise_std', '10', '--tube_radius', '5']) + '500', 'union_shuffle_sub_upsampled.trk', '-f', + '--point_wise_std', '10', '--tube_radius', '5']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_resample_nb_points.py b/src/scilpy/cli/tests/test_tractogram_resample_nb_points.py index cf9b04655..af8d8bf24 100644 --- a/src/scilpy/cli/tests/test_tractogram_resample_nb_points.py +++ b/src/scilpy/cli/tests/test_tractogram_resample_nb_points.py @@ -22,6 +22,6 @@ def test_execution_tractometry(script_runner, monkeypatch): in_bundle = os.path.join(SCILPY_HOME, 'tractometry', 'IFGWM_uni_c.trk') ret = script_runner.run(['scil_tractogram_resample_nb_points', - in_bundle, 'IFGWM_uni_c_10.trk', - '--nb_pts_per_streamline', '10']) + in_bundle, 'IFGWM_uni_c_10.trk', + '--nb_pts_per_streamline', '10']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_seed_density_map.py b/src/scilpy/cli/tests/test_tractogram_seed_density_map.py index da49a4ec1..1d3ce7b85 100644 --- a/src/scilpy/cli/tests/test_tractogram_seed_density_map.py +++ b/src/scilpy/cli/tests/test_tractogram_seed_density_map.py @@ -21,5 +21,5 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracking = os.path.join(SCILPY_HOME, 'processing', 'tracking.trk') ret = script_runner.run(['scil_tractogram_seed_density_map', in_tracking, - 'seeds_density.nii.gz']) + 'seeds_density.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_segment_connections_from_labels.py b/src/scilpy/cli/tests/test_tractogram_segment_connections_from_labels.py index d4a3e21e0..dad3c7211 100644 --- a/src/scilpy/cli/tests/test_tractogram_segment_connections_from_labels.py +++ b/src/scilpy/cli/tests/test_tractogram_segment_connections_from_labels.py @@ -28,5 +28,6 @@ def test_execution_connectivity(script_runner, monkeypatch): in_atlas, 'decompose.h5', '--min_length', '20', '--max_length', '200', '--outlier_threshold', '0.5', '--loop_max_angle', '330', '--curv_qb_distance', '10', '--processes', '1', '-v', 'DEBUG', - '--save_final', '--out_dir', os.path.join(tmp_dir.name, 'out_bundles')]) + '--save_final', '--out_dir', + os.path.join(tmp_dir.name, 'out_bundles')]) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_segment_with_ROI_and_score.py b/src/scilpy/cli/tests/test_tractogram_segment_with_ROI_and_score.py index 10884e79d..9f77d895b 100644 --- a/src/scilpy/cli/tests/test_tractogram_segment_with_ROI_and_score.py +++ b/src/scilpy/cli/tests/test_tractogram_segment_with_ROI_and_score.py @@ -36,7 +36,7 @@ def test_score_bundles(script_runner, monkeypatch): json.dump(json_contents, f) ret = script_runner.run(['scil_tractogram_segment_with_ROI_and_score', - in_tractogram, "config_file.json", - 'scoring_tractogram/', '--no_empty', - '--use_gt_masks_as_all_masks']) + in_tractogram, "config_file.json", + 'scoring_tractogram/', '--no_empty', + '--use_gt_masks_as_all_masks']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_segment_with_bundleseg.py b/src/scilpy/cli/tests/test_tractogram_segment_with_bundleseg.py index b9a166ff6..7c5cf9c62 100644 --- a/src/scilpy/cli/tests/test_tractogram_segment_with_bundleseg.py +++ b/src/scilpy/cli/tests/test_tractogram_segment_with_bundleseg.py @@ -35,8 +35,8 @@ def test_execution_bundles(script_runner, monkeypatch): json.dump(tmp_config, outfile) ret = script_runner.run(['scil_tractogram_segment_with_bundleseg', - in_tractogram, 'config.json', - in_models, - in_aff, '--inverse', - '--processes', '1', '-v', 'WARNING']) + in_tractogram, 'config.json', + in_models, + in_aff, '--inverse', + '--processes', '1', '-v', 'WARNING']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_segment_with_recobundles.py b/src/scilpy/cli/tests/test_tractogram_segment_with_recobundles.py index 0906bd313..06df353f8 100644 --- a/src/scilpy/cli/tests/test_tractogram_segment_with_recobundles.py +++ b/src/scilpy/cli/tests/test_tractogram_segment_with_recobundles.py @@ -14,7 +14,7 @@ def test_help_option(script_runner): ret = script_runner.run(['scil_tractogram_segment_with_recobundles', - '--help']) + '--help']) assert ret.success @@ -25,9 +25,9 @@ def test_execution_bundles(script_runner, monkeypatch): 'subj_1', 'bundle_0.trk') in_aff = os.path.join(SCILPY_HOME, 'bundles', 'affine.txt') ret = script_runner.run(['scil_tractogram_segment_with_recobundles', - in_tractogram, in_model, in_aff, - 'bundle_0_reco.tck', '--inverse', - '--tractogram_clustering_thr', '12', - '--slr_threads', '1', '--out_pickle', - 'clusters.pkl']) + in_tractogram, in_model, in_aff, + 'bundle_0_reco.tck', '--inverse', + '--tractogram_clustering_thr', '12', + '--slr_threads', '1', '--out_pickle', + 'clusters.pkl']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_shuffle.py b/src/scilpy/cli/tests/test_tractogram_shuffle.py index eb9b9b760..59c6a79db 100644 --- a/src/scilpy/cli/tests/test_tractogram_shuffle.py +++ b/src/scilpy/cli/tests/test_tractogram_shuffle.py @@ -21,5 +21,5 @@ def test_execution_tracking(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_tracto = os.path.join(SCILPY_HOME, 'tracking', 'union.trk') ret = script_runner.run(['scil_tractogram_shuffle', in_tracto, - 'union_shuffle.trk']) + 'union_shuffle.trk']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_smooth.py b/src/scilpy/cli/tests/test_tractogram_smooth.py index 88f2e4029..418b5539d 100644 --- a/src/scilpy/cli/tests/test_tractogram_smooth.py +++ b/src/scilpy/cli/tests/test_tractogram_smooth.py @@ -22,6 +22,7 @@ def test_execution_tracking(script_runner, monkeypatch): in_tracto = os.path.join(SCILPY_HOME, 'tracking', 'union_shuffle_sub.trk') ret = script_runner.run(['scil_tractogram_smooth', in_tracto, - 'union_shuffle_sub_smooth.trk', '--gaussian', '10', - '--compress', '0.05']) + 'union_shuffle_sub_smooth.trk', + '--gaussian', '10', + '--compress', '0.05']) assert ret.success diff --git a/src/scilpy/cli/tests/test_tractogram_split.py b/src/scilpy/cli/tests/test_tractogram_split.py index 4c056f076..7680343fa 100644 --- a/src/scilpy/cli/tests/test_tractogram_split.py +++ b/src/scilpy/cli/tests/test_tractogram_split.py @@ -22,15 +22,15 @@ def test_execution_tracking(script_runner, monkeypatch): in_tracto = os.path.join(SCILPY_HOME, 'tracking', 'local.trk') ret = script_runner.run(['scil_tractogram_split', in_tracto, - 'local_split', '--nb_chunks', '3', '-f']) + 'local_split', '--nb_chunks', '3', '-f']) assert ret.success ret = script_runner.run(['scil_tractogram_split', in_tracto, - 'local_split', '--nb_chunks', '3', '-f', - '--split_per_cluster']) + 'local_split', '--nb_chunks', '3', '-f', + '--split_per_cluster']) assert ret.success ret = script_runner.run(['scil_tractogram_split', in_tracto, - 'local_split', '--nb_chunks', '3', '-f', - '--do_not_randomize']) + 'local_split', '--nb_chunks', '3', '-f', + '--do_not_randomize']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_bingham_fit.py b/src/scilpy/cli/tests/test_viz_bingham_fit.py index 82453d9be..10f0e16eb 100644 --- a/src/scilpy/cli/tests/test_viz_bingham_fit.py +++ b/src/scilpy/cli/tests/test_viz_bingham_fit.py @@ -22,6 +22,6 @@ def test_silent_without_output(script_runner, monkeypatch): in_dummy = os.path.join(SCILPY_HOME, 'processing', 'fodf_bingham.nii.gz') out = os.path.join(tmp_dir.name, 'test_bingham.png') ret = script_runner.run(['scil_viz_bingham_fit', in_dummy, - '--silent', '--output', out]) + '--silent', '--output', out]) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_connectivity.py b/src/scilpy/cli/tests/test_viz_connectivity.py index 5ede27a5d..4a08e5394 100644 --- a/src/scilpy/cli/tests/test_viz_connectivity.py +++ b/src/scilpy/cli/tests/test_viz_connectivity.py @@ -24,8 +24,9 @@ def test_execution_connectivity(script_runner, monkeypatch): in_labels_list = os.path.join(SCILPY_HOME, 'connectivity', 'labels_list.txt') ret = script_runner.run(['scil_viz_connectivity', in_sc, - 'sc_norm.png', '--log', '--display_legend', - '--labels_list', in_labels_list, - '--histogram', 'hist.png', '--nb_bins', '50', - '--exclude_zeros', '--chord_chart', 'sc_chord.png']) + 'sc_norm.png', '--log', '--display_legend', + '--labels_list', in_labels_list, + '--histogram', 'hist.png', '--nb_bins', '50', + '--exclude_zeros', '--chord_chart', + 'sc_chord.png']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_fodf.py b/src/scilpy/cli/tests/test_viz_fodf.py index 0e16cb6ff..e3d38f8e8 100644 --- a/src/scilpy/cli/tests/test_viz_fodf.py +++ b/src/scilpy/cli/tests/test_viz_fodf.py @@ -34,10 +34,10 @@ def test_run(script_runner, monkeypatch): in_variance = os.path.join(SCILPY_HOME, 'processing', 'fodf.nii.gz') out_name = os.path.join(tmp_dir.name, 'out.png') ret = script_runner.run(['scil_viz_fodf', in_fodf, '--silent', - '--in_transparency_mask', in_mask, - '--mask', in_mask, - '--variance', in_variance, - '--output', out_name]) + '--in_transparency_mask', in_mask, + '--mask', in_mask, + '--variance', in_variance, + '--output', out_name]) assert ret.success @@ -50,9 +50,9 @@ def test_run_sphsubdivide(script_runner, monkeypatch): # Note. Cannot add --sph_subdivide to the test above, causes a memory # crash. Without the variance, lighter. ret = script_runner.run(['scil_viz_fodf', in_fodf, '--silent', - '--mask', in_mask, - '--sph_subdivide', '2', - '--sphere', 'repulsion100', - '--output', out_name]) + '--mask', in_mask, + '--sph_subdivide', '2', + '--sphere', 'repulsion100', + '--output', out_name]) - assert ret.success \ No newline at end of file + assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_volume_histogram.py b/src/scilpy/cli/tests/test_viz_volume_histogram.py index 7e7a4ee09..716082725 100644 --- a/src/scilpy/cli/tests/test_viz_volume_histogram.py +++ b/src/scilpy/cli/tests/test_viz_volume_histogram.py @@ -24,5 +24,5 @@ def test_execution_processing(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'processing', 'seed.nii.gz') ret = script_runner.run(['scil_viz_volume_histogram', in_fa, in_mask, - '20', 'histogram.png']) + '20', 'histogram.png']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_volume_scatterplot.py b/src/scilpy/cli/tests/test_viz_volume_scatterplot.py index 8952b2b9d..d9fd2ec22 100644 --- a/src/scilpy/cli/tests/test_viz_volume_scatterplot.py +++ b/src/scilpy/cli/tests/test_viz_volume_scatterplot.py @@ -24,7 +24,7 @@ def test_execution_processing(script_runner, monkeypatch): in_y = os.path.join(SCILPY_HOME, 'plot', 'ad.nii.gz') ret = script_runner.run(['scil_viz_volume_scatterplot', in_x, in_y, - 'scatter_plot.png']) + 'scatter_plot.png']) assert ret.success @@ -37,7 +37,7 @@ def test_execution_processing_bin_mask(script_runner, monkeypatch): in_mask = os.path.join(SCILPY_HOME, 'plot', 'mask_wm.nii.gz') ret = script_runner.run(['scil_viz_volume_scatterplot', in_x, in_y, - 'scatter_plot_m.png', '--in_bin_mask', in_mask]) + 'scatter_plot_m.png', '--in_bin_mask', in_mask]) assert ret.success @@ -52,8 +52,8 @@ def test_execution_processing_prob_map(script_runner, monkeypatch): in_prob_2 = os.path.join(SCILPY_HOME, 'plot', 'map_gm.nii.gz') ret = script_runner.run(['scil_viz_volume_scatterplot', in_x, in_y, - 'scatter_plot_prob.png', - '--in_prob_maps', in_prob_1, in_prob_2]) + 'scatter_plot_prob.png', + '--in_prob_maps', in_prob_1, in_prob_2]) assert ret.success @@ -68,8 +68,8 @@ def test_execution_processing_atlas(script_runner, monkeypatch): atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') ret = script_runner.run(['scil_viz_volume_scatterplot', in_x, in_y, - 'scatter_plot', '--in_atlas', in_atlas, - '--atlas_lut', atlas_lut]) + 'scatter_plot', '--in_atlas', in_atlas, + '--atlas_lut', atlas_lut]) assert ret.success @@ -84,9 +84,9 @@ def test_execution_processing_atlas_folder(script_runner, monkeypatch): atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') ret = script_runner.run(['scil_viz_volume_scatterplot', in_x, in_y, - 'scatter_plot', '--in_atlas', in_atlas, - '--atlas_lut', atlas_lut, - '--in_folder']) + 'scatter_plot', '--in_atlas', in_atlas, + '--atlas_lut', atlas_lut, + '--in_folder']) assert ret.success @@ -102,8 +102,8 @@ def test_execution_processing_atlas_folder_specific_label(script_runner, atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json') ret = script_runner.run(['scil_viz_volume_scatterplot', in_x, in_y, - 'scatter_plot', '--in_atlas', in_atlas, - '--atlas_lut', atlas_lut, - '--specific_label', '2', '5', '7', - '--in_folder']) + 'scatter_plot', '--in_atlas', in_atlas, + '--atlas_lut', atlas_lut, + '--specific_label', '2', '5', '7', + '--in_folder']) assert ret.success diff --git a/src/scilpy/cli/tests/test_viz_volume_screenshot.py b/src/scilpy/cli/tests/test_viz_volume_screenshot.py index 75865f5bf..af0944915 100644 --- a/src/scilpy/cli/tests/test_viz_volume_screenshot.py +++ b/src/scilpy/cli/tests/test_viz_volume_screenshot.py @@ -22,9 +22,9 @@ def test_screenshot(script_runner, monkeypatch): in_fa = os.path.join(SCILPY_HOME, 'bst', 'fa.nii.gz') in_mask = os.path.join(SCILPY_HOME, 'bst', 'mask.nii.gz') ret = script_runner.run(["scil_viz_volume_screenshot", in_fa, 'fa.png', - '--slices', '50', - '--display_slice_number', '--display_lr', - '--overlays', in_mask, - '--overlays_as_contours', - '--volume_cmap_name', 'viridis']) + '--slices', '50', + '--display_slice_number', '--display_lr', + '--overlays', in_mask, + '--overlays_as_contours', + '--volume_cmap_name', 'viridis']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_apply_transform.py b/src/scilpy/cli/tests/test_volume_apply_transform.py index 99d298acd..d133f2cbf 100644 --- a/src/scilpy/cli/tests/test_volume_apply_transform.py +++ b/src/scilpy/cli/tests/test_volume_apply_transform.py @@ -26,9 +26,9 @@ def test_execution_bst(script_runner, monkeypatch): in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') ret = script_runner.run(['scil_volume_apply_transform', - in_model, in_fa, in_aff, - 'template_lin.nii.gz', '--inverse', - '-f']) + in_model, in_fa, in_aff, + 'template_lin.nii.gz', '--inverse', + '-f']) assert ret.success @@ -41,9 +41,9 @@ def test_execution_interp_nearest(script_runner, monkeypatch): in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') ret = script_runner.run(['scil_volume_apply_transform', - in_model, in_fa, in_aff, - 'template_lin.nii.gz', '--inverse', - '--interp', 'nearest', '-f']) + in_model, in_fa, in_aff, + 'template_lin.nii.gz', '--inverse', + '--interp', 'nearest', '-f']) assert ret.success @@ -56,7 +56,7 @@ def test_execution_interp_lin(script_runner, monkeypatch): in_aff = os.path.join(SCILPY_HOME, 'bst', 'output0GenericAffine.mat') ret = script_runner.run(['scil_volume_apply_transform', - in_model, in_fa, in_aff, - 'template_lin.nii.gz', '--inverse', - '--interp', 'linear', '-f']) + in_model, in_fa, in_aff, + 'template_lin.nii.gz', '--inverse', + '--interp', 'linear', '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_b0_synthesis.py b/src/scilpy/cli/tests/test_volume_b0_synthesis.py index 587c1472b..216291a5d 100644 --- a/src/scilpy/cli/tests/test_volume_b0_synthesis.py +++ b/src/scilpy/cli/tests/test_volume_b0_synthesis.py @@ -46,7 +46,7 @@ def test_synthesis(script_runner, monkeypatch): 'b0_mask.nii.gz') ret = script_runner.run(['scil_volume_b0_synthesis', - in_t1, 't1_mask.nii.gz', - in_b0, 'b0_mask.nii.gz', - 'b0_synthesized.nii.gz', '-v']) + in_t1, 't1_mask.nii.gz', + in_b0, 'b0_mask.nii.gz', + 'b0_synthesized.nii.gz', '-v']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_count_non_zero_voxels.py b/src/scilpy/cli/tests/test_volume_count_non_zero_voxels.py index 57c17914b..266491db8 100644 --- a/src/scilpy/cli/tests/test_volume_count_non_zero_voxels.py +++ b/src/scilpy/cli/tests/test_volume_count_non_zero_voxels.py @@ -28,10 +28,10 @@ def test_execution_save_in_file(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'others', 'rgb.nii.gz') ret = script_runner.run(['scil_volume_count_non_zero_voxels', in_img, - '--out', 'printed.txt']) + '--out', 'printed.txt']) assert ret.success # Then re-use the same out file with --stats ret = script_runner.run(['scil_volume_count_non_zero_voxels', in_img, - '--out', 'printed.txt', '--stats']) + '--out', 'printed.txt', '--stats']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_crop.py b/src/scilpy/cli/tests/test_volume_crop.py index ed5ea72ba..a56a1c490 100644 --- a/src/scilpy/cli/tests/test_volume_crop.py +++ b/src/scilpy/cli/tests/test_volume_crop.py @@ -21,10 +21,10 @@ def test_execution_processing(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_dwi = os.path.join(SCILPY_HOME, 'processing', 'dwi.nii.gz') ret = script_runner.run(['scil_volume_crop', in_dwi, 'dwi_crop.nii.gz', - '--output_bbox', 'bbox.json']) + '--output_bbox', 'bbox.json']) assert ret.success # Then try to load back the same box ret = script_runner.run(['scil_volume_crop', in_dwi, 'dwi_crop2.nii.gz', - '--input_bbox', 'bbox.json']) + '--input_bbox', 'bbox.json']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_distance_map.py b/src/scilpy/cli/tests/test_volume_distance_map.py index cb04cbdb9..078909bec 100644 --- a/src/scilpy/cli/tests/test_volume_distance_map.py +++ b/src/scilpy/cli/tests/test_volume_distance_map.py @@ -28,8 +28,8 @@ def test_execution(script_runner, monkeypatch): 'streamline_and_mask_operations', 'bundle_4_center.nii.gz') ret = script_runner.run(['scil_volume_distance_map', - in_mask_1, in_mask_2, - 'distance_map.nii.gz']) + in_mask_1, in_mask_2, + 'distance_map.nii.gz']) img = nib.load('distance_map.nii.gz') data = img.get_fdata() diff --git a/src/scilpy/cli/tests/test_volume_flip.py b/src/scilpy/cli/tests/test_volume_flip.py index f3b1e0efb..4eb836c42 100644 --- a/src/scilpy/cli/tests/test_volume_flip.py +++ b/src/scilpy/cli/tests/test_volume_flip.py @@ -22,5 +22,5 @@ def test_execution_surface_vtk_fib(script_runner, monkeypatch): in_fa = os.path.join(SCILPY_HOME, 'surface_vtk_fib', 'fa.nii.gz') ret = script_runner.run(['scil_volume_flip', in_fa, 'fa_flip.nii.gz', - 'x']) + 'x']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_math.py b/src/scilpy/cli/tests/test_volume_math.py index edfed09e9..22efdcd98 100644 --- a/src/scilpy/cli/tests/test_volume_math.py +++ b/src/scilpy/cli/tests/test_volume_math.py @@ -26,7 +26,7 @@ def test_execution_add(script_runner, monkeypatch): in_img_3 = os.path.join(SCILPY_HOME, 'atlas', 'brainstem_175.nii.gz') ret = script_runner.run(['scil_volume_math', 'addition', - in_img_1, in_img_2, in_img_3, 'brainstem.nii.gz']) + in_img_1, in_img_2, in_img_3, 'brainstem.nii.gz']) assert ret.success @@ -34,7 +34,7 @@ def test_execution_low_thresh(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'atlas', 'brainstem.nii.gz') ret = script_runner.run(['scil_volume_math', 'lower_threshold', - in_img, '1', 'brainstem_bin.nii.gz']) + in_img, '1', 'brainstem_bin.nii.gz']) assert ret.success @@ -42,7 +42,7 @@ def test_execution_low_mult(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(SCILPY_HOME, 'atlas', 'brainstem_bin.nii.gz') ret = script_runner.run(['scil_volume_math', 'multiplication', - in_img, '16', 'brainstem_unified.nii.gz']) + in_img, '16', 'brainstem_unified.nii.gz']) assert ret.success @@ -55,8 +55,8 @@ def test_execution_concatenate(script_runner, monkeypatch): in_img_5 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '17.nii.gz') in_img_6 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '18.nii.gz') ret = script_runner.run(['scil_volume_math', 'concatenate', - in_img_1, in_img_2, in_img_3, in_img_4, in_img_5, - in_img_6, 'concat_ids.nii.gz']) + in_img_1, in_img_2, in_img_3, in_img_4, in_img_5, + in_img_6, 'concat_ids.nii.gz']) assert ret.success @@ -67,6 +67,6 @@ def test_execution_concatenate_4D(script_runner, monkeypatch): in_img_3 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '12.nii.gz') in_img_4 = os.path.join(SCILPY_HOME, 'atlas', 'ids', '8_10.nii.gz') ret = script_runner.run(['scil_volume_math', 'concatenate', - in_img_1, in_img_2, in_img_3, in_img_4, - 'concat_ids_4d.nii.gz']) + in_img_1, in_img_2, in_img_3, in_img_4, + 'concat_ids_4d.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_pairwise_comparison.py b/src/scilpy/cli/tests/test_volume_pairwise_comparison.py index 47596c155..07bcc238c 100644 --- a/src/scilpy/cli/tests/test_volume_pairwise_comparison.py +++ b/src/scilpy/cli/tests/test_volume_pairwise_comparison.py @@ -27,7 +27,7 @@ def test_label_comparison(script_runner, monkeypatch): SCILPY_HOME, 'atlas', 'atlas_freesurfer_v2_single_brainstem_dil.nii.gz') ret = script_runner.run(['scil_volume_pairwise_comparison', - in_atlas, in_atlas_dilated, 'atlas.json']) + in_atlas, in_atlas_dilated, 'atlas.json']) assert ret.success @@ -41,7 +41,7 @@ def test_binary_comparison(script_runner, monkeypatch): 'bundle_4_head_tail_offset.nii.gz') ret = script_runner.run(['scil_volume_pairwise_comparison', - in_bin_1, in_bin_2, 'binary.json']) + in_bin_1, in_bin_2, 'binary.json']) assert ret.success @@ -59,7 +59,7 @@ def test_multiple_compare(script_runner, monkeypatch): 'bundle_4_center.nii.gz') ret = script_runner.run(['scil_volume_pairwise_comparison', - in_bin_1, in_bin_2, in_bin_3, 'multiple.json']) + in_bin_1, in_bin_2, in_bin_3, 'multiple.json']) assert ret.success @@ -77,8 +77,8 @@ def test_single_compare(script_runner, monkeypatch): 'bundle_4_center.nii.gz') ret = script_runner.run(['scil_volume_pairwise_comparison', - in_bin_1, in_bin_2, 'single.json', - '--single_compare', in_bin_3]) + in_bin_1, in_bin_2, 'single.json', + '--single_compare', in_bin_3]) assert ret.success @@ -96,9 +96,9 @@ def test_ratio_compare(script_runner, monkeypatch): 'bundle_4_center.nii.gz') ret = script_runner.run(['scil_volume_pairwise_comparison', - in_bin_1, in_bin_2, 'ratio.json', - '--single_compare', in_bin_3, - '--ratio']) + in_bin_1, in_bin_2, 'ratio.json', + '--single_compare', in_bin_3, + '--ratio']) assert ret.success @@ -110,7 +110,7 @@ def test_labels_to_mask_compare(script_runner, monkeypatch): SCILPY_HOME, 'atlas', 'brainstem_bin.nii.gz') ret = script_runner.run(['scil_volume_pairwise_comparison', - in_atlas, 'labels_to_maskjson', - '--single_compare', in_mask, - '--labels_to_mask']) + in_atlas, 'labels_to_maskjson', + '--single_compare', in_mask, + '--labels_to_mask']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_remove_outliers_ransac.py b/src/scilpy/cli/tests/test_volume_remove_outliers_ransac.py index f6b139046..b91be68bd 100644 --- a/src/scilpy/cli/tests/test_volume_remove_outliers_ransac.py +++ b/src/scilpy/cli/tests/test_volume_remove_outliers_ransac.py @@ -22,5 +22,5 @@ def test_execution_processing(script_runner, monkeypatch): in_ad = os.path.join(SCILPY_HOME, 'processing', 'ad.nii.gz') ret = script_runner.run(['scil_volume_remove_outliers_ransac', in_ad, - 'ad_ransanc.nii.gz']) + 'ad_ransanc.nii.gz']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_resample.py b/src/scilpy/cli/tests/test_volume_resample.py index 5657a0425..06e978550 100644 --- a/src/scilpy/cli/tests/test_volume_resample.py +++ b/src/scilpy/cli/tests/test_volume_resample.py @@ -21,15 +21,15 @@ def test_help_option(script_runner): def test_execution_given_size(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_volume_resample', in_img, - 'fa_resample_2.nii.gz', '--voxel_size', '2']) + 'fa_resample_2.nii.gz', '--voxel_size', '2']) assert ret.success def test_execution_force_voxel(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_volume_resample', in_img, - 'fa_resample_4.nii.gz', '--voxel_size', '4', - '--enforce_voxel_size']) + 'fa_resample_4.nii.gz', '--voxel_size', '4', + '--enforce_voxel_size']) assert ret.success @@ -37,7 +37,7 @@ def test_execution_ref(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ref = os.path.join(SCILPY_HOME, 'others', 'fa_resample.nii.gz') ret = script_runner.run(['scil_volume_resample', in_img, - 'fa_resample2.nii.gz', '--ref', ref]) + 'fa_resample2.nii.gz', '--ref', ref]) assert ret.success @@ -45,6 +45,6 @@ def test_execution_ref_force(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ref = os.path.join(SCILPY_HOME, 'others', 'fa_resample.nii.gz') ret = script_runner.run(['scil_volume_resample', in_img, - 'fa_resample_ref.nii.gz', '--ref', ref, - '--enforce_dimensions']) + 'fa_resample_ref.nii.gz', '--ref', ref, + '--enforce_dimensions']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_reshape.py b/src/scilpy/cli/tests/test_volume_reshape.py index c9f8479d9..0b9bbde6e 100644 --- a/src/scilpy/cli/tests/test_volume_reshape.py +++ b/src/scilpy/cli/tests/test_volume_reshape.py @@ -22,33 +22,33 @@ def test_help_option(script_runner): def test_execution_crop(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_volume_reshape', in_img, - 'fa_reshape.nii.gz', '--volume_size', '90', - '-f']) + 'fa_reshape.nii.gz', '--volume_size', '90', + '-f']) assert ret.success def test_execution_pad(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_volume_reshape', in_img, - 'fa_reshape.nii.gz', '--volume_size', '150', - '-f']) + 'fa_reshape.nii.gz', '--volume_size', '150', + '-f']) assert ret.success def test_execution_full_size(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_volume_reshape', in_img, - 'fa_reshape.nii.gz', '--volume_size', - '164', '164', '164', '-f']) + 'fa_reshape.nii.gz', '--volume_size', + '164', '164', '164', '-f']) assert ret.success def test_execution_dtype(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ret = script_runner.run(['scil_volume_reshape', in_img, - 'fa_reshape.nii.gz', '--volume_size', - '111', '133', '109', '--data_type', - 'uint8', '-f']) + 'fa_reshape.nii.gz', '--volume_size', + '111', '133', '109', '--data_type', + 'uint8', '-f']) assert ret.success @@ -56,5 +56,5 @@ def test_execution_ref(script_runner, monkeypatch): monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) ref = os.path.join(SCILPY_HOME, 'others', 'fa_resample.nii.gz') ret = script_runner.run(['scil_volume_reshape', in_img, - 'fa_reshape.nii.gz', '--ref', ref, '-f']) + 'fa_reshape.nii.gz', '--ref', ref, '-f']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_reslice_to_reference.py b/src/scilpy/cli/tests/test_volume_reslice_to_reference.py index 553de88f0..724981600 100644 --- a/src/scilpy/cli/tests/test_volume_reslice_to_reference.py +++ b/src/scilpy/cli/tests/test_volume_reslice_to_reference.py @@ -22,8 +22,8 @@ def test_execution_others(script_runner, monkeypatch): in_img = os.path.join(SCILPY_HOME, 'others', 't1_crop.nii.gz') in_ref = os.path.join(SCILPY_HOME, 'others', 't1.nii.gz') ret = script_runner.run(['scil_volume_reslice_to_reference', in_img, - in_ref, 't1_reslice.nii.gz', - '--interpolation', 'nearest']) + in_ref, 't1_reslice.nii.gz', + '--interpolation', 'nearest']) assert ret.success @@ -32,6 +32,6 @@ def test_execution_4D(script_runner, monkeypatch): in_img = os.path.join(SCILPY_HOME, 'commit_amico', 'dwi.nii.gz') in_ref = os.path.join(SCILPY_HOME, 'others', 't1.nii.gz') ret = script_runner.run(['scil_volume_reslice_to_reference', in_img, - in_ref, 'dwi_reslice.nii.gz', - '--interpolation', 'nearest']) + in_ref, 'dwi_reslice.nii.gz', + '--interpolation', 'nearest']) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_stats_in_ROI.py b/src/scilpy/cli/tests/test_volume_stats_in_ROI.py index 96450f4e6..d4d9297fc 100644 --- a/src/scilpy/cli/tests/test_volume_stats_in_ROI.py +++ b/src/scilpy/cli/tests/test_volume_stats_in_ROI.py @@ -26,27 +26,27 @@ def test_execution_tractometry(script_runner, monkeypatch): # Test with a single ROI input ret = script_runner.run(['scil_volume_stats_in_ROI', - in_roi, '--metrics', in_ref]) + in_roi, '--metrics', in_ref]) assert ret.success # Test with multiple ROIs input ret = script_runner.run(['scil_volume_stats_in_ROI', - in_roi, in_roi, in_roi, '--metrics', in_ref]) + in_roi, in_roi, in_roi, '--metrics', in_ref]) assert ret.success # Test with multiple metric input ret = script_runner.run(['scil_volume_stats_in_ROI', - in_roi, '--metrics', in_ref, in_ref, in_ref]) + in_roi, '--metrics', in_ref, in_ref, in_ref]) assert ret.success # Test with multiple metric and ROIs input ret = script_runner.run(['scil_volume_stats_in_ROI', - in_roi, in_roi, '--metrics', in_ref, in_ref]) + in_roi, in_roi, '--metrics', in_ref, in_ref]) assert ret.success # Test with a metric folder metrics_dir = os.path.join(SCILPY_HOME, 'plot') in_roi = os.path.join(SCILPY_HOME, 'plot', 'mask_wm.nii.gz') ret = script_runner.run(['scil_volume_stats_in_ROI', - in_roi, '--metrics_dir', metrics_dir]) + in_roi, '--metrics_dir', metrics_dir]) assert ret.success diff --git a/src/scilpy/cli/tests/test_volume_stats_in_labels.py b/src/scilpy/cli/tests/test_volume_stats_in_labels.py index 79d58ae1e..415fe023d 100644 --- a/src/scilpy/cli/tests/test_volume_stats_in_labels.py +++ b/src/scilpy/cli/tests/test_volume_stats_in_labels.py @@ -23,18 +23,18 @@ def test_execution(script_runner, monkeypatch): # Test with a single metric ret = script_runner.run(['scil_volume_stats_in_labels', - in_atlas, atlas_lut, "--metrics", in_metric]) + in_atlas, atlas_lut, "--metrics", in_metric]) assert ret.success # Test with multiple metrics ret = script_runner.run(['scil_volume_stats_in_labels', - in_atlas, atlas_lut, "--metrics", - in_metric, in_metric, in_metric]) + in_atlas, atlas_lut, "--metrics", + in_metric, in_metric, in_metric]) assert ret.success # Test with a metric folder metrics_dir = os.path.join(SCILPY_HOME, 'plot') ret = script_runner.run(['scil_volume_stats_in_labels', - in_atlas, atlas_lut, "--metrics_dir", - metrics_dir]) + in_atlas, atlas_lut, "--metrics_dir", + metrics_dir]) assert ret.success diff --git a/src/scilpy/tractanalysis/afd_along_streamlines.py b/src/scilpy/tractanalysis/afd_along_streamlines.py index 436d39854..de2248443 100644 --- a/src/scilpy/tractanalysis/afd_along_streamlines.py +++ b/src/scilpy/tractanalysis/afd_along_streamlines.py @@ -3,7 +3,7 @@ from dipy.data import get_sphere from dipy.reconst.shm import sh_to_sf_matrix, sph_harm_ind_list import numpy as np -from scipy.special import lpn +from scipy.special import legendre_p_all from scilpy.reconst.utils import find_order_from_nb_coeff from scilpy.tractanalysis.voxel_boundary_intersection import\ @@ -87,7 +87,7 @@ def afd_and_rd_sums_along_streamlines(sft, fodf, fodf_basis, sphere = get_sphere(name='repulsion724') b_matrix, _ = sh_to_sf_matrix(sphere, order, fodf_basis, legacy=is_legacy) _, n = sph_harm_ind_list(order) - legendre0_at_n = lpn(order, 0)[0][n] + legendre0_at_n = legendre_p_all(order, 0)[0][n] sphere_norm = np.linalg.norm(sphere.vertices) afd_sum_map = np.zeros(shape=fodf_data.shape[:-1]) From 54749cae14a760eb989842ce3fbf6c3c0e31c1e6 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Mon, 4 Aug 2025 17:00:09 -0400 Subject: [PATCH 84/90] fix get_version test --- src/scilpy/cli/scil_get_version.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/scilpy/cli/scil_get_version.py b/src/scilpy/cli/scil_get_version.py index fbf6c332f..b6067ac26 100755 --- a/src/scilpy/cli/scil_get_version.py +++ b/src/scilpy/cli/scil_get_version.py @@ -77,11 +77,14 @@ def main(): with open(os.path.join(repo_dir, '.git', 'FETCH_HEAD')) as f: git_text = f.read().split() branch = git_text[2].replace("'", "") - origin = git_text[4] + origin = '' + if len(git_text) > 4 : + origin = git_text[4] print('Your Scilpy directory is: {}'.format(_bold(repo_dir))) - print('Your current Origin is: {}'.format(_bold(origin))) - print('Your repository is on branch: {}\n'.format(_bold(branch))) + if origin: + print('Your current origin is: {}'.format(_bold(origin))) + print('Your repository is on branch: {}\n'.format(_bold(branch))) last_commit = repo.head.commit print('The last commit hash is: {}'.format(_bold(last_commit.hexsha))) From 3466fc938c3333af278159415dcb35db9bae9e52 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Tue, 5 Aug 2025 10:13:13 -0400 Subject: [PATCH 85/90] try to force encoding while reading vocabulary file --- src/scilpy/cli/scil_search_keywords.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/scilpy/cli/scil_search_keywords.py b/src/scilpy/cli/scil_search_keywords.py index a713c35b2..176798593 100755 --- a/src/scilpy/cli/scil_search_keywords.py +++ b/src/scilpy/cli/scil_search_keywords.py @@ -107,8 +107,7 @@ def main(): # keywords are single words. Phrases are composed keywords keywords, phrases = _extract_keywords_and_phrases(args.expressions) - - with open(VOCAB_FILE_PATH, 'r') as f: + with open(VOCAB_FILE_PATH, 'r', encoding="utf-8") as f: vocab_data = json.load(f) # If synonyms are enabled, extend the search to include synonyms From 0a3836e81061ce64cf0f7f78f702ab681fed439a Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Tue, 5 Aug 2025 10:39:15 -0400 Subject: [PATCH 86/90] update setup workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b5c20fd11..568825cf0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: run: echo "python-version=$(head -1 .python-version)" >> $GITHUB_OUTPUT - name: Set up Python for Scilpy - uses: actions/setup-python@v5.0.0 + uses: actions/setup-python@v5.6.0 with: python-version: ${{ steps.python-selector.outputs.python-version }} cache: 'pip' From a8682c7d26cef5a7672459891afb420419ab31a7 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Wed, 6 Aug 2025 09:37:08 -0400 Subject: [PATCH 87/90] try to answer Alex comments --- .github/workflows/test.yml | 24 +++++------------------- codecov.yml | 2 +- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 568825cf0..b927007d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,12 +30,12 @@ jobs: id: python-selector run: echo "python-version=$(head -1 .python-version)" >> $GITHUB_OUTPUT - - name: Set up Python for Scilpy - uses: actions/setup-python@v5.6.0 + - name: Set up Python and uv for Scilpy + uses: actions/setup-uv@v6.4.6 with: python-version: ${{ steps.python-selector.outputs.python-version }} - cache: 'pip' - + activate-environment: true + enable-cache: true - name: Install non-python dependencies run: | curl -LsSf https://astral.sh/uv/install.sh | sh @@ -56,8 +56,6 @@ jobs: - name: Install Scilpy run: | - uv venv ~/.venvs/scilpy --python=${{ steps.python-selector.outputs.python-version }} - source ~/.venvs/scilpy/bin/activate uv pip install --upgrade pip wheel uv pip install --upgrade "setuptools<71.0.0" uv pip install -e . @@ -69,7 +67,6 @@ jobs: - name: Run tests run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH - source ~/.venvs/scilpy/bin/activate scil_data_download uv run --active pytest --cov-report term-missing:skip-covered @@ -93,27 +90,16 @@ jobs: - name: Checkout repository at merge uses: actions/checkout@v4 - - name: Set up Python for codecov upload - uses: actions/setup-python@v5.0.0 - with: - python-version: '3.10' - cache: 'pip' - - - name: Install pycoverage - run: pip install coverage - - name: Download test results and coverage uses: actions/download-artifact@v4 with: name: test-coverage-${{ github.run_id }} - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5.4.3 with: token: ${{ secrets.CODECOV_TOKEN }} flags: unittests name: scilpy-unittests-${{ github.run_id }}-${{ github.run_attempt }} verbose: true fail_ci_if_error: true - plugin: pycoverage - diff --git a/codecov.yml b/codecov.yml index 7416bd623..df8be643f 100644 --- a/codecov.yml +++ b/codecov.yml @@ -28,7 +28,7 @@ component_management: - component_id: scilpy_library name: Library paths: - - src/scilpy/ + - "^src/scilpy/(?!cli)/.*$" comment: layout: "condensed_header, diff, components" \ No newline at end of file From 4ddc9b2c11acb650f8696b7aa7017f26b1345d52 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Wed, 6 Aug 2025 09:40:25 -0400 Subject: [PATCH 88/90] fix typo action --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b927007d5..441732604 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: run: echo "python-version=$(head -1 .python-version)" >> $GITHUB_OUTPUT - name: Set up Python and uv for Scilpy - uses: actions/setup-uv@v6.4.6 + uses: astral-sh/setup-uv@v6.4.6 with: python-version: ${{ steps.python-selector.outputs.python-version }} activate-environment: true From 822e7e863ac8f152c005a6165fd1fe168cdc409f Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Wed, 6 Aug 2025 09:41:54 -0400 Subject: [PATCH 89/90] fix version --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 441732604..8cea4cc83 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: run: echo "python-version=$(head -1 .python-version)" >> $GITHUB_OUTPUT - name: Set up Python and uv for Scilpy - uses: astral-sh/setup-uv@v6.4.6 + uses: astral-sh/setup-uv@v6.4.3 with: python-version: ${{ steps.python-selector.outputs.python-version }} activate-environment: true From bcdc29279023d9af7b9d171bd95e7ba3fb84c364 Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Wed, 6 Aug 2025 10:03:51 -0400 Subject: [PATCH 90/90] fix workflow --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8cea4cc83..0b66ae6c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,9 +36,9 @@ jobs: python-version: ${{ steps.python-selector.outputs.python-version }} activate-environment: true enable-cache: true + - name: Install non-python dependencies run: | - curl -LsSf https://astral.sh/uv/install.sh | sh sudo apt-get update sudo apt-get install -y \ build-essential \ @@ -47,7 +47,9 @@ jobs: libblas-dev \ liblapack-dev \ libfreetype6-dev \ - libdrm-dev + libdrm-dev \ + libgl1-mesa-dev \ + libosmesa6-dev - name: stdlib checkout if: ${{ !contains(steps.python-selector.outputs.python-version, '3.12') }}