code: def test_tbss_skeleton(create_files_in_directory):
      skeletor = fsl.TractSkeleton()
  
      files, newdir = create_files_in_directory
  
      # Test the underlying command
      assert skeletor.cmd == "tbss_skeleton"
  
      # It shouldn't run yet
      with pytest.raises(ValueError):
          skeletor.run()
  
      # Test the most basic way to use it
      skeletor.inputs.in_file = files[0]
  
      # First by implicit argument
      skeletor.inputs.skeleton_file = True
      assert (
          skeletor.cmdline
          == "tbss_skeleton -i a.nii -o %s"
          % os.path.join(newdir, "a_skeleton.nii")
      )
  
      # Now with a specific name
      skeletor.inputs.skeleton_file = "old_boney.nii"
      assert (
          skeletor.cmdline == "tbss_skeleton -i a.nii -o old_boney.nii"
      )
  
      # Now test the more complicated usage
      bones = fsl.TractSkeleton(in_file="a.nii", project_data=True)
  
      # This should error
      with pytest.raises(ValueError):
          bones.run()
  
      # But we can set what we need
      bones.inputs.threshold = 0.2
      bones.inputs.distance_map = "b.nii"
      bones.inputs.data_file = "b.nii"  # Even though that's silly
  
      # Now we get a command line
      assert (
          bones.cmdline
          == "tbss_skeleton -i a.nii -p 0.200 b.nii {} b.nii {}".format(
              Info.standard_image("LowerCingulum_1mm.nii.gz"),
              os.path.join(newdir, "b_skeletonised.nii"),
          )
      )
  
      # Can we specify a mask?
      bones.inputs.use_cingulum_mask = Undefined
      bones.inputs.search_mask_file = "a.nii"
      assert (
          bones.cmdline
          == "tbss_skeleton -i a.nii -p 0.200 b.nii a.nii b.nii %s"
          % os.path.join(newdir, "b_skeletonised.nii")
      )
  
file_path: nipype/nipype/interfaces/fsl/tests/test_dti.py
imports: import os
  import nipype.interfaces.fsl.dti
  from nipype.interfaces.fsl import Info, no_fsl
  from nipype.interfaces.base import Undefined
  import pytest
  from nipype.testing.fixtures import create_files_in_directory
label_desc: Use image node_id 7 for calling a global function with example usage: test_tbss_skeleton(create_files_in_directory) without return types