code: def test_stats():
      with TemporaryDirectory() as out_dir:
          data_path, bval_path, bvec_path = get_fnames("small_101D")
          volume, affine = load_nifti(data_path)
          mask = np.ones_like(volume[:, :, :, 0], dtype=np.uint8)
          mask_path = join(out_dir, "tmp_mask.nii.gz")
          save_nifti(mask_path, mask, affine)
  
          snr_flow = SNRinCCFlow(force=True)
          args = [data_path, bval_path, bvec_path, mask_path]
          snr_flow.run(*args, out_dir=out_dir)
  
          assert_true(
              os.path.exists(os.path.join(out_dir, "product.json"))
          )
          assert_true(
              os.stat(os.path.join(out_dir, "product.json")).st_size
              != 0
          )
          assert_true(
              os.path.exists(os.path.join(out_dir, "cc.nii.gz"))
          )
          assert_true(
              os.stat(os.path.join(out_dir, "cc.nii.gz")).st_size != 0
          )
          assert_true(
              os.path.exists(os.path.join(out_dir, "mask_noise.nii.gz"))
          )
          assert_true(
              os.stat(
                  os.path.join(out_dir, "mask_noise.nii.gz")
              ).st_size
              != 0
          )
  
          snr_flow._force_overwrite = True
          snr_flow.run(*args, out_dir=out_dir)
          assert_true(
              os.path.exists(os.path.join(out_dir, "product.json"))
          )
          assert_true(
              os.stat(os.path.join(out_dir, "product.json")).st_size
              != 0
          )
          assert_true(
              os.path.exists(os.path.join(out_dir, "cc.nii.gz"))
          )
          assert_true(
              os.stat(os.path.join(out_dir, "cc.nii.gz")).st_size != 0
          )
          assert_true(
              os.path.exists(os.path.join(out_dir, "mask_noise.nii.gz"))
          )
          assert_true(
              os.stat(
                  os.path.join(out_dir, "mask_noise.nii.gz")
              ).st_size
              != 0
          )
  
          snr_flow._force_overwrite = True
          snr_flow.run(
              *args,
              bbox_threshold=(0.5, 1, 0, 0.15, 0, 0.2),
              out_dir=out_dir,
          )
          assert_true(
              os.path.exists(os.path.join(out_dir, "product.json"))
          )
          assert_true(
              os.stat(os.path.join(out_dir, "product.json")).st_size
              != 0
          )
          assert_true(
              os.path.exists(os.path.join(out_dir, "cc.nii.gz"))
          )
          assert_true(
              os.stat(os.path.join(out_dir, "cc.nii.gz")).st_size != 0
          )
          assert_true(
              os.path.exists(os.path.join(out_dir, "mask_noise.nii.gz"))
          )
          assert_true(
              os.stat(
                  os.path.join(out_dir, "mask_noise.nii.gz")
              ).st_size
              != 0
          )
  
imports: import os
  from os.path import join
  from tempfile import TemporaryDirectory
  import numpy
  import numpy.testing
  import pytest
  from dipy.data import get_fnames
  from dipy.io.image import save_nifti, load_nifti
  from dipy.io.stateful_tractogram import Space, StatefulTractogram
  from dipy.io.streamline import load_tractogram, save_tractogram
  from dipy.testing import assert_true
  from dipy.testing.decorators import set_random_number_generator
  from dipy.tracking.streamline import Streamlines
  from dipy.utils.optpkg import optional_package
  from dipy.workflows.stats import SNRinCCFlow
  from dipy.workflows.stats import BundleAnalysisTractometryFlow
  from dipy.workflows.stats import LinearMixedModelsFlow
  from dipy.workflows.stats import BundleShapeAnalysis
  from dipy.workflows.stats import buan_bundle_profiles
label_desc: Use image node_id 1 for calling a global function with example usage: test_stats() without return types