From 745b1ceac23bb9215d46c0281684b16a4340bdab Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Mon, 23 Oct 2023 14:39:41 -0400 Subject: [PATCH] Rename acquisition to gradient --- scilpy/{acquisition => gradients}/__init__.py | 0 scilpy/{acquisition => gradients}/gen_gradient_sampling.py | 2 +- .../tests/test_gen_gradient_sampling.py | 0 scilpy/{acquisition => gradients}/tests/test_utils.py | 0 scilpy/{acquisition => gradients}/utils.py | 0 scilpy/gradientsampling/optimize_gradient_sampling.py | 2 +- scilpy/preprocessing/distortion_correction.py | 2 +- scilpy/reconst/b_tensor_utils.py | 2 +- scilpy/reconst/divide_fit.py | 6 +++--- scilpy/reconst/multi_processes.py | 2 +- scripts/scil_compute_ihMT_maps.py | 2 +- scripts/scil_generate_gradient_sampling.py | 4 ++-- scripts/scil_prepare_eddy_command.py | 4 ++-- scripts/scil_prepare_topup_command.py | 2 +- scripts/scil_snr_in_roi.py | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) rename scilpy/{acquisition => gradients}/__init__.py (100%) rename scilpy/{acquisition => gradients}/gen_gradient_sampling.py (99%) rename scilpy/{acquisition => gradients}/tests/test_gen_gradient_sampling.py (100%) rename scilpy/{acquisition => gradients}/tests/test_utils.py (100%) rename scilpy/{acquisition => gradients}/utils.py (100%) diff --git a/scilpy/acquisition/__init__.py b/scilpy/gradients/__init__.py similarity index 100% rename from scilpy/acquisition/__init__.py rename to scilpy/gradients/__init__.py diff --git a/scilpy/acquisition/gen_gradient_sampling.py b/scilpy/gradients/gen_gradient_sampling.py similarity index 99% rename from scilpy/acquisition/gen_gradient_sampling.py rename to scilpy/gradients/gen_gradient_sampling.py index 68735c7b34..ba265571e7 100644 --- a/scilpy/acquisition/gen_gradient_sampling.py +++ b/scilpy/gradients/gen_gradient_sampling.py @@ -13,7 +13,7 @@ import numpy as np from scipy import optimize -from scilpy.acquisition.utils import random_uniform_on_sphere +from scilpy.gradients.utils import random_uniform_on_sphere def generate_gradient_sampling(nb_samples_per_shell, verbose=1): diff --git a/scilpy/acquisition/tests/test_gen_gradient_sampling.py b/scilpy/gradients/tests/test_gen_gradient_sampling.py similarity index 100% rename from scilpy/acquisition/tests/test_gen_gradient_sampling.py rename to scilpy/gradients/tests/test_gen_gradient_sampling.py diff --git a/scilpy/acquisition/tests/test_utils.py b/scilpy/gradients/tests/test_utils.py similarity index 100% rename from scilpy/acquisition/tests/test_utils.py rename to scilpy/gradients/tests/test_utils.py diff --git a/scilpy/acquisition/utils.py b/scilpy/gradients/utils.py similarity index 100% rename from scilpy/acquisition/utils.py rename to scilpy/gradients/utils.py diff --git a/scilpy/gradientsampling/optimize_gradient_sampling.py b/scilpy/gradientsampling/optimize_gradient_sampling.py index 2a1f7edd3a..db426553aa 100644 --- a/scilpy/gradientsampling/optimize_gradient_sampling.py +++ b/scilpy/gradientsampling/optimize_gradient_sampling.py @@ -297,7 +297,7 @@ def compute_peak_power(q_scheme, ker_size=10): Parameters ------ q_scheme: nd.array - Scheme of acquisition. + Scheme of gradients. ker_size: int Kernel size (default=10). diff --git a/scilpy/preprocessing/distortion_correction.py b/scilpy/preprocessing/distortion_correction.py index 0996c6a3fd..ab99c78993 100644 --- a/scilpy/preprocessing/distortion_correction.py +++ b/scilpy/preprocessing/distortion_correction.py @@ -59,7 +59,7 @@ def create_multi_topup_index(bvals, mean, n_rev, b0_thr=0): """ Create index of bvals for Eddy in cases where Topup ran on more than one b0 volume in both phase directions. The volumes must be - ordered such as all forward phase acquisition are followed by all + ordered such as all forward phase gradients are followed by all reverse phase ones (In the case of AP-PA, PA_1, PA_2, ..., PA_N, AP_1, AP_2, ..., AP_N). diff --git a/scilpy/reconst/b_tensor_utils.py b/scilpy/reconst/b_tensor_utils.py index 0ea5d1cb61..0c79e87108 100644 --- a/scilpy/reconst/b_tensor_utils.py +++ b/scilpy/reconst/b_tensor_utils.py @@ -55,7 +55,7 @@ def generate_btensor_input(in_dwis, in_bvals, in_bvecs, Powder-averaged diffusion data. gtab_infos : np.ndarray (if `do_pa_signals`) Contains information about the gtab, such as the unique bvals, the - encoding types, the number of directions and the acquisition index. + encoding types, the number of directions and the gradients index. """ data_full = np.empty(0) bvals_full = np.empty(0) diff --git a/scilpy/reconst/divide_fit.py b/scilpy/reconst/divide_fit.py index e4958feb35..8dad441515 100644 --- a/scilpy/reconst/divide_fit.py +++ b/scilpy/reconst/divide_fit.py @@ -36,7 +36,7 @@ def random_p0(signal, gtab_infos, lb, ub, weight, n_iter): Diffusion data of a single voxel. gtab_infos : np.ndarray Contains information about the gtab, such as the unique bvals, the - encoding types, the number of directions and the acquisition index. + encoding types, the number of directions and the gradients index. Obtained as output of the function `reconst.b_tensor_utils.generate_btensor_input`. lb : np.ndarray of floats @@ -79,7 +79,7 @@ def gamma_data2fit(signal, gtab_infos, fit_iters=1, random_iters=50, Diffusion data of a single voxel. gtab_infos : np.ndarray Contains information about the gtab, such as the unique bvals, the - encoding types, the number of directions and the acquisition index. + encoding types, the number of directions and the gradients index. Obtained as output of the function `reconst.b_tensor_utils.generate_btensor_input`. fit_iters : int, optional @@ -187,7 +187,7 @@ def gamma_fit2data(gtab_infos, params): ---------- gtab_infos : np.ndarray Contains information about the gtab, such as the unique bvals, the - encoding types, the number of directions and the acquisition index. + encoding types, the number of directions and the gradients index. Obtained as output of the function `reconst.b_tensor_utils.generate_btensor_input`. params : np.array diff --git a/scilpy/reconst/multi_processes.py b/scilpy/reconst/multi_processes.py index b22f42c5e8..1ebf49f6d3 100644 --- a/scilpy/reconst/multi_processes.py +++ b/scilpy/reconst/multi_processes.py @@ -626,7 +626,7 @@ def fit_gamma(data, gtab_infos, mask=None, fit_iters=1, random_iters=50, `reconst.b_tensor_utils.generate_powder_averaged_data`. gtab_infos : np.ndarray Contains information about the gtab, such as the unique bvals, the - encoding types, the number of directions and the acquisition index. + encoding types, the number of directions and the gradients index. Obtained as output of the function `reconst.b_tensor_utils.generate_powder_averaged_data`. mask : np.ndarray, optional diff --git a/scripts/scil_compute_ihMT_maps.py b/scripts/scil_compute_ihMT_maps.py index 87f78deeaa..d92739163d 100755 --- a/scripts/scil_compute_ihMT_maps.py +++ b/scripts/scil_compute_ihMT_maps.py @@ -12,7 +12,7 @@ myelin content in white matter of the brain. Different contrasts can be done with an off-resonance pulse prior to image -acquisition (a prepulse), saturating the protons on non-aqueous molecules, +gradients (a prepulse), saturating the protons on non-aqueous molecules, by applying different frequency irradiation. The two MT maps and two ihMT maps are obtained using five contrasts: single frequency positive or negative and dual frequency with an alternation of both positive and negative frequency diff --git a/scripts/scil_generate_gradient_sampling.py b/scripts/scil_generate_gradient_sampling.py index 26238ada9c..df10e46c9c 100755 --- a/scripts/scil_generate_gradient_sampling.py +++ b/scripts/scil_generate_gradient_sampling.py @@ -3,7 +3,7 @@ """ Generate multi-shell gradient sampling with various processing options. Helps -accelerate acquisition, optimize duty cycle and avoid artefacts. +accelerate gradients, optimize duty cycle and avoid artefacts. Multi-shell gradient sampling is generated as in [1]. The bvecs are then flipped to maximize spread for eddy current correction, b0s are interleaved at @@ -18,7 +18,7 @@ from scilpy.io.utils import ( add_overwrite_arg, add_verbose_arg, assert_outputs_exist) -from scilpy.acquisition.gen_gradient_sampling import ( +from scilpy.gradients.gen_gradient_sampling import ( generate_gradient_sampling) from scilpy.gradientsampling.optimize_gradient_sampling import ( add_b0s, add_bvalue_b0, compute_bvalue_lin_b, compute_bvalue_lin_q, diff --git a/scripts/scil_prepare_eddy_command.py b/scripts/scil_prepare_eddy_command.py index 7ec161f272..f8413324f0 100755 --- a/scripts/scil_prepare_eddy_command.py +++ b/scripts/scil_prepare_eddy_command.py @@ -30,7 +30,7 @@ def _build_arg_parser(): p.add_argument('in_dwi', help='Input DWI Nifti image. If using multiple ' - 'acquisition and/or opposite phase directions, please ' + 'gradients and/or opposite phase directions, please ' 'merge in the same order as for prepare_topup using ' 'scil_concatenate_dwi.py.') @@ -172,7 +172,7 @@ def main(): bvals, 'cluster', n_rev, b0_threshold) else: raise ValueError('Could not determine a valid index file ' - 'from the provided acquisition parameters ' + 'from the provided gradients parameters ' 'file: {}'.format(args.topup_params)) else: acqparams = create_acqparams(args.readout, args.encoding_direction, diff --git a/scripts/scil_prepare_topup_command.py b/scripts/scil_prepare_topup_command.py index 9b6138102d..2ad7dfe15f 100755 --- a/scripts/scil_prepare_topup_command.py +++ b/scripts/scil_prepare_topup_command.py @@ -51,7 +51,7 @@ def _build_arg_parser(): help='Prefix of the topup results [%(default)s].') p.add_argument('--out_params', default='acqparams.txt', - help='Filename for the acquisition ' + help='Filename for the gradients ' 'parameters file [%(default)s].') p.add_argument('--out_script', action='store_true', diff --git a/scripts/scil_snr_in_roi.py b/scripts/scil_snr_in_roi.py index 70a2fe4fde..24e4d62626 100755 --- a/scripts/scil_snr_in_roi.py +++ b/scripts/scil_snr_in_roi.py @@ -19,7 +19,7 @@ It is heavily dependent on the ROI and its quality. We highly recommend using a noise_map if you can acquire one. -See refs [1, 2] that describe the noise map acquisition. +See refs [1, 2] that describe the noise map gradients. [1] St-Jean, et al (2016). Non Local Spatial and Angular Matching... https://doi.org/10.1016/j.media.2016.02.010 [2] Reymbaut, et al (2021). Magic DIAMOND... https://doi.org/10.1016/j.media.2021.101988