.. _scil_volume_validate_correct_strides: scil_volume_validate_correct_strides ==================================== :: usage: __main__.py [-h] [--in_bvec IN_BVEC] [--out_bvec OUT_BVEC] [--validate_bvec] [--in_bval IN_BVAL] [--b0_threshold thr] [--skip_b0_check] [-v [{DEBUG,INFO,WARNING,ERROR}]] [-f] in_data out_data Detect when data strides are different from [1, 2, 3] and correct them. The script takes as input a nifti file and outputs a nifti file with the corrected strides if needed. Input file can be 3D or 4D. Only the first 3 dimensions are considered for the stride correction. In the case of DWI data, we recommand to also input the b-values and b-vectors files to correct the b-vectors accordingly. If the --validate_bvecs is set, the script first detects sign flips and/or axes swaps in the b-vectors from a fiber coherence index [1] and corrects the b-vectors. Then, the b-vectors are permuted and sign flipped to match the new strides. A typical pipeline could be: >>> scil_volume_validate_correct_strides t1.nii.gz t1_restride.nii.gz >>> scil_volume_validate_correct_strides dwi.nii.gz dwi_restride.nii.gz --in_bvec dwi.bvec --out_bvec dwi_restride.bvec --validate_bvec --in_bval dwi.bval ------------------------------------------------------------------------------ Reference: [1] Schilling KG, Yeh FC, Nath V, Hansen C, Williams O, Resnick S, Anderson AW, Landman BA. A fiber coherence index for quality control of B-table orientation in diffusion MRI scans. Magn Reson Imaging. 2019 May;58:82-89. doi: 10.1016/j.mri.2019.01.018. ------------------------------------------------------------------------------ positional arguments: in_data Path to input nifti file. out_data Path to output nifti file with corrected strides. options: -h, --help show this help message and exit --in_bvec IN_BVEC Path to bvec file (FSL format). If provided, the bvecs will be permuted and sign flipped to match the new strides. --out_bvec OUT_BVEC Path to output bvec file (FSL format). Must be provided if --in_bvec is used. --validate_bvec If set, the script first detects sign flips and/or axes swaps in the b-vectors from a fiber coherence index [1] and corrects the b-vectors before permuting/sign flipping them to match the new strides. If not set, the b-vectors are only permuted and sign flipped to match the new strides. --in_bval IN_BVAL Path to bval file. Must be provided if --validate_bvecs is used. --b0_threshold thr Threshold under which b-values are considered to be b0s. [Default: 20] * Note. We would expect to find at least one b-value in the range [0, b0_threshold]. To skip this check, use --skip_b0_check. --skip_b0_check By default, we supervise that at least one b0 exists in your data (i.e. b-values below the default --b0_threshold). Use this option to allow continuing even if the minimum b-value is suspiciously high. If no b-value is found below the threshold, the script will continue with your minimal b-value as new --b0_threshold. Use with care, and only if you understand your data. -v [{DEBUG,INFO,WARNING,ERROR}] Produces verbose output depending on the provided level. Default level is warning, default when using -v is info. -f Force overwriting of the output files. 2.2.2