code: def test_synthesizeflash(create_files_in_directory):
      filelist, outdir = create_files_in_directory
  
      syn = freesurfer.SynthesizeFLASH()
  
      # make sure command gets called
      assert syn.cmd == "mri_synthesize"
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          syn.run()
  
      # .inputs based parameters setting
      syn.inputs.t1_image = filelist[0]
      syn.inputs.pd_image = filelist[1]
      syn.inputs.flip_angle = 30
      syn.inputs.te = 4.5
      syn.inputs.tr = 20
  
      assert syn.cmdline == (
          "mri_synthesize 20.00 30.00 4.500 %s %s %s"
          % (
              filelist[0],
              filelist[1],
              os.path.join(outdir, "synth-flash_30.mgz"),
          )
      )
  
      # constructor based parameters setting
      syn2 = freesurfer.SynthesizeFLASH(
          t1_image=filelist[0],
          pd_image=filelist[1],
          flip_angle=20,
          te=5,
          tr=25,
      )
      assert syn2.cmdline == (
          "mri_synthesize 25.00 20.00 5.000 %s %s %s"
          % (
              filelist[0],
              filelist[1],
              os.path.join(outdir, "synth-flash_20.mgz"),
          )
      )
  
file_path: nipype/nipype/interfaces/freesurfer/tests/test_preprocess.py
imports: import os
  import pytest
  from looseversion import LooseVersion
  from nipype.testing.fixtures import create_files_in_directory
  from nipype.interfaces import freesurfer
  from nipype.interfaces.freesurfer import Info
label_desc: Use image node_id 3 for calling a global function with example usage: test_synthesizeflash(create_files_in_directory) without return types