code: def test_nlmeans_flow():
      with TemporaryDirectory() as out_dir:
          data_path, _, _ = get_fnames()
          volume, affine = load_nifti(data_path)
  
          nlmeans_flow = NLMeansFlow()
  
          nlmeans_flow.run(data_path, out_dir=out_dir)
          assert_true(
              os.path.isfile(
                  nlmeans_flow.last_generated_outputs["out_denoised"]
              )
          )
  
          nlmeans_flow._force_overwrite = True
          nlmeans_flow.run(data_path, sigma=4, out_dir=out_dir)
          denoised_path = nlmeans_flow.last_generated_outputs[
              "out_denoised"
          ]
          assert_true(os.path.isfile(denoised_path))
          denoised_data, denoised_affine = load_nifti(denoised_path)
          npt.assert_equal(denoised_data.shape, volume.shape)
          npt.assert_array_almost_equal(denoised_affine, affine)
  
file_path: dipy/dipy/workflows/tests/test_denoise.py
imports: import os
  from tempfile import TemporaryDirectory
  import pytest
  import numpy
  import numpy.testing
  from dipy.utils.optpkg import optional_package
  from dipy.data import get_fnames
  from dipy.io.image import save_nifti, load_nifti, load_nifti_data
  from dipy.testing import assert_true, assert_false, assert_greater, assert_less
  from dipy.testing.decorators import set_random_number_generator
  from dipy.workflows.denoise import NLMeansFlow, LPCAFlow, MPPCAFlow, GibbsRingingFlow, Patch2SelfFlow
label_desc: Use image node_id 1 for calling a global function with example usage: test_nlmeans_flow() without return types