def test_execution_processing(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_dwi = os.path.join(get_home(), 'processing', 'dwi_crop.nii.gz') in_bias = os.path.join(get_home(), 'processing', 'bias_field_b0.nii.gz') ret = script_runner.run('scil_apply_bias_field_on_dwi.py', in_dwi, in_bias, 'dwi_crop_n4.nii.gz') assert ret.success
def test_execution_tractometry(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_mask = os.path.join(get_home(), 'tractometry', 'IFGWM.nii.gz') in_ref = os.path.join(get_home(), 'tractometry', 'mni_masked.nii.gz') ret = script_runner.run('scil_compute_metrics_stats_in_ROI.py', in_mask, '--metrics', in_ref) assert ret.success
def test_execution_processing(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_x = os.path.join(get_home(), 'plot', 'fa.nii.gz') in_y = os.path.join(get_home(), 'plot', 'ad.nii.gz') ret = script_runner.run('scil_visualize_scatterplot.py', in_x, in_y, 'scatter_plot.png') assert ret.success
def test_execution_tractometry(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(get_home(), 'tractometry', 'IFGWM.trk') in_ref = os.path.join(get_home(), 'tractometry', 'mni_masked.nii.gz') ret = script_runner.run('scil_compute_bundle_mean_std.py', in_bundle, in_ref, '--density_weighting', '--include_dps') assert ret.success
def test_execution_surface_vtk_fib(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_surf = os.path.join(get_home(), 'surface_vtk_fib', 'lhpialt.vtk') in_aff = os.path.join(get_home(), 'surface_vtk_fib', 'affine.txt') ret = script_runner.run('scil_apply_transform_to_surface.py', in_surf, in_aff, 'lhpialt_lin.vtk') assert ret.success
def test_execution_tractometry(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(get_home(), 'tractometry', 'IFGWM.trk') in_centroid = os.path.join(get_home(), 'tractometry', 'IFGWM_uni_c_10.trk') ret = script_runner.run('scil_bundle_voxel_label_map.py', in_bundle, in_centroid, 'IFGWM_labels_map.nii.gz') assert ret.success
def test_execution_4D(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_img = os.path.join(get_home(), 'commit_amico', 'dwi.nii.gz') in_ref = os.path.join(get_home(), 'others', 't1.nii.gz') ret = script_runner.run('scil_reshape_to_reference.py', in_img, in_ref, 'dwi_reshape.nii.gz', '--interpolation', 'nearest') assert ret.success
def test_roi_radii_shape_parameter(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_dwi = os.path.join(get_home(), 'commit_amico', 'dwi.nii.gz') in_bval = os.path.join(get_home(), 'commit_amico', 'dwi.bval') in_bvec = os.path.join(get_home(), 'commit_amico', 'dwi.bvec') mask = os.path.join(get_home(), 'commit_amico', 'mask.nii.gz') ret = script_runner.run('scil_compute_msmt_frf.py', 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_compute_msmt_frf.py', 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_compute_msmt_frf.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') assert (not ret.success)
def test_execution_connectivity_div(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(get_home(), 'connectivity', 'sc.npy') in_vol = os.path.join(get_home(), 'connectivity', 'vol.npy') ret = script_runner.run('scil_connectivity_math.py', 'division', in_sc, in_vol, 'sc_norm_vol.npy') assert ret.success
def test_execution_surface_vtk_fib(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_fib = os.path.join(get_home(), 'surface_vtk_fib', 'gyri_fanning.fib') in_fa = os.path.join(get_home(), 'surface_vtk_fib', 'fa.nii.gz') ret = script_runner.run('scil_convert_tractogram.py', in_fib, 'gyri_fanning.trk', '--reference', in_fa) assert ret.success
def test_execution_processing(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_fa = os.path.join(get_home(), 'processing', 'fa.nii.gz') in_mask = os.path.join(get_home(), 'processing', 'seed.nii.gz') ret = script_runner.run('scil_visualize_histogram.py', in_fa, in_mask, '20', 'histogram.png') assert ret.success
def test_execution_processing(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_dwi = os.path.join(get_home(), 'processing', 'dwi_crop.nii.gz') in_bval = os.path.join(get_home(), 'processing', 'dwi.bval') in_bvec = os.path.join(get_home(), 'processing', 'dwi.bvec') ret = script_runner.run('scil_extract_b0.py', in_dwi, in_bval, in_bvec, 'b0_mean.nii.gz', '--mean', '--b0', '20') assert ret.success
def test_score_bundles(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_tractogram = os.path.join(get_home(), 'tracking', 'pft.trk') models = os.path.join(get_home(), 'tracking', 'seeding_mask.nii.gz') endpoints = os.path.join(get_home(), 'tracking', 'interface.nii.gz') ret = script_runner.run('scil_score_tractogram.py', in_tractogram, models, '--gt_endpoints', endpoints) assert ret.success
def test_execution_add(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_img_1 = os.path.join(get_home(), 'atlas', 'brainstem_173.nii.gz') in_img_2 = os.path.join(get_home(), 'atlas', 'brainstem_174.nii.gz') in_img_3 = os.path.join(get_home(), 'atlas', 'brainstem_175.nii.gz') ret = script_runner.run('scil_image_math.py', 'addition', in_img_1, in_img_2, in_img_3, 'brainstem.nii.gz') assert ret.success
def test_execution_processing(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_dwi = os.path.join(get_home(), 'processing', 'dwi_crop.nii.gz') in_bval = os.path.join(get_home(), 'processing', 'dwi.bval') in_bvec = os.path.join(get_home(), 'processing', 'dwi.bvec') ret = script_runner.run('scil_compute_ssst_frf.py', in_dwi, in_bval, in_bvec, 'frf.txt', '-f') assert ret.success
def test_execution_connectivity(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(get_home(), 'connectivity', 'sc_norm.npy') in_len = os.path.join(get_home(), 'connectivity', 'len.npy') ret = script_runner.run('scil_evaluate_connectivity_measures.py', in_sc, in_len, 'gtm.json', '--avg_node_wise', '--small_world') assert ret.success
def test_execution_processing(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_dwi = os.path.join(get_home(), 'processing', 'dwi_crop.nii.gz') in_bval = os.path.join(get_home(), 'processing', 'dwi.bval') in_bvec = os.path.join(get_home(), 'processing', 'dwi.bvec') ret = script_runner.run('scil_split_image.py', in_dwi, in_bval, in_bvec, 'dwi', '5', '15', '25') assert ret.success
def test_execution_connectivity(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(get_home(), 'connectivity', 'sc_norm.npy') in_len = os.path.join(get_home(), 'connectivity', 'len.npy') ret = script_runner.run( 'scil_evaluate_connectivity_pairwise_agreement_measures.py', in_sc, in_len, 'diff.json', '--single_compare', in_sc) assert ret.success
def test_execution_processing(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_dwi = os.path.join(get_home(), 'processing', 'dwi_crop_3000.nii.gz') in_bval = os.path.join(get_home(), 'processing', '3000.bval') in_bvec = os.path.join(get_home(), 'processing', '3000.bvec') ret = script_runner.run('scil_compute_sh_from_signal.py', in_dwi, in_bval, in_bvec, 'sh_1000.nii.gz') assert ret.success
def test_execution_filtering(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_tractogram = os.path.join(get_home(), 'filtering', 'bundle_all_1mm.trk') in_mask = os.path.join(get_home(), 'filtering', 'mask.nii.gz') ret = script_runner.run('scil_cut_streamlines.py', in_tractogram, in_mask, 'out_tractogram_cut.trk', '--resample', '0.2', '--compress', '0.1') assert ret.success
def test_execution_tractometry(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(get_home(), 'tractometry', 'IFGWM_uni.trk') in_ref = os.path.join(get_home(), 'tractometry', 'mni_masked.nii.gz') ret = script_runner.run('scil_endpoints_metric.py', in_bundle, in_ref, 'out/') assert ret.success
def test_execution_connectivity(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_sc = os.path.join(get_home(), 'connectivity', 'sc.npy') in_sim = os.path.join(get_home(), 'connectivity', 'len.npy') ret = script_runner.run('scil_filter_connectivity.py', 'mask.npy', '--greater_than', in_sc, '5', '1', '--greater_than', in_sim, '0', '1', '--keep_condition_count') assert ret.success
def test_execution_tractometry(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(get_home(), 'tractometry', 'IFGWM.trk') in_labels = os.path.join(get_home(), 'tractometry', 'IFGWM_labels_map.nii.gz') ret = script_runner.run('scil_estimate_bundles_diameter.py', in_bundle, in_labels, '--wireframe', '--fitting_func', 'lin_up') assert ret.success
def test_execution_connectivity(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_h5 = os.path.join(get_home(), 'connectivity', 'decompose.h5') in_fodf = os.path.join(get_home(), 'connectivity', 'fodf.nii.gz') ret = script_runner.run('scil_compute_mean_fixel_afd_from_hdf5.py', in_h5, in_fodf, 'decompose_afd.nii.gz', '--length_weighting', '--sh_basis', 'descoteaux07', '--processes', '1') assert ret.success
def test_execution_tracking(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_wm = os.path.join(get_home(), 'tracking', 'map_wm.nii.gz') in_gm = os.path.join(get_home(), 'tracking', 'map_gm.nii.gz') in_csf = os.path.join(get_home(), 'tracking', 'map_csf.nii.gz') ret = script_runner.run( 'scil_compute_maps_for_particle_filter_tracking.py', in_wm, in_gm, in_csf) assert ret.success
def test_execution_connectivity(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_1 = os.path.join(get_home(), 'connectivity', 'sc.npy') in_2 = os.path.join(get_home(), 'connectivity', 'sc_norm.npy') in_mask = os.path.join(get_home(), 'connectivity', 'mask.npy') ret = script_runner.run('scil_compare_connectivity.py', 'pval.npy', '--in_g1', in_1, '--in_g2', in_2, '--filtering_mask', in_mask) assert ret.success
def test_execution_filtering(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_1 = os.path.join(get_home(), 'filtering', 'bundle_4.trk') in_2 = os.path.join(get_home(), 'filtering', 'bundle_4_filtered.trk') in_3 = os.path.join(get_home(), 'filtering', 'bundle_4_filtered_no_loops.trk') ret = script_runner.run('scil_perform_majority_vote.py', in_1, in_2, in_3, '--ratio_streamlines', '0.5', '--same_tractogram') assert ret.success
def test_execution_processing(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_tracking = os.path.join(get_home(), 'processing', 'tracking.trk') in_fodf = os.path.join(get_home(), 'processing', 'fodf_descoteaux07.nii.gz') ret = script_runner.run('scil_compute_mean_fixel_afd_from_bundles.py', in_tracking, in_fodf, 'afd_test.nii.gz', '--sh_basis', 'descoteaux07', '--length_weighting') assert ret.success
def test_execution_processing_3000(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_dwi = os.path.join(get_home(), 'processing', 'dwi_crop.nii.gz') in_bval = os.path.join(get_home(), 'processing', 'dwi.bval') in_bvec = os.path.join(get_home(), 'processing', 'dwi.bvec') ret = script_runner.run('scil_extract_dwi_shell.py', in_dwi, in_bval, in_bvec, '0', '3000', 'dwi_crop_3000.nii.gz', '3000.bval', '3000.bvec', '-t', '30') assert ret.success
def test_execution_connectivity(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_h5 = os.path.join(get_home(), 'connectivity', 'decompose.h5') in_target = os.path.join(get_home(), 'connectivity', 'endpoints_atlas.nii.gz') in_transfo = os.path.join(get_home(), 'connectivity', 'affine.txt') ret = script_runner.run('scil_apply_transform_to_hdf5.py', in_h5, in_target, in_transfo, 'decompose_lin.h5') assert ret.success