original_docstring: 
      Uses FSL FLIRT with the BBR cost function to find the transform that
      maps the EPI space into the MNI152-nonlinear-symmetric atlas.
  
      The input epi_mean is the averaged and brain-masked EPI timeseries
  
      Returns the EPI mean resampled in MNI space (for checking out registration) and
      the associated "lobe" parcellation in EPI space.
  
      .. workflow::
  
        from mriqc.workflows.functional import epi_mni_align
        wf = epi_mni_align({})
  
      
docstring: Uses FSL FLIRT with the BBR cost function to find the transform that
  maps the EPI space into the MNI152-nonlinear-symmetric atlas.
  
  The input epi_mean is the averaged and brain-masked EPI timeseries
  
  Returns the EPI mean resampled in MNI space (for checking out registration) and
  the associated "lobe" parcellation in EPI space.
  
  
  
  from mriqc.workflows.functional import epi_mni_align
  wf = epi_mni_align({})
docstring_tokens: Uses FSL FLIRT with the BBR cost function to find the transform that maps the EPI space into the MNI152 - nonlinear - symmetric atlas . The input epi_mean is the averaged and brain - masked EPI timeseries Returns the EPI mean resampled in MNI space ( for checking out registration ) and the associated " lobe " parcellation in EPI space . from mriqc . workflows . functional import epi_mni_align wf = epi_mni_align ( {} )
code: def epi_mni_align(settings, name='SpatialNormalization'):
      """
      Uses FSL FLIRT with the BBR cost function to find the transform that
      maps the EPI space into the MNI152-nonlinear-symmetric atlas.
  
      The input epi_mean is the averaged and brain-masked EPI timeseries
  
      Returns the EPI mean resampled in MNI space (for checking out registration) and
      the associated "lobe" parcellation in EPI space.
  
      .. workflow::
  
        from mriqc.workflows.functional import epi_mni_align
        wf = epi_mni_align({})
  
      """
      from niworkflows.data import get_mni_icbm152_nlin_asym_09c as get_template
      from niworkflows.interfaces.registration import (
          RobustMNINormalizationRPT as RobustMNINormalization
      )
      from pkg_resources import resource_filename as pkgrf
  
      # Get settings
      testing = settings.get('testing', False)
      n_procs = settings.get('n_procs', 1)
      ants_nthreads = settings.get('ants_nthreads', DEFAULTS['ants_nthreads'])
  
      # Init template
      mni_template = get_template()
  
      workflow = pe.Workflow(name=name)
      inputnode = pe.Node(niu.IdentityInterface(fields=['epi_mean', 'epi_mask']),
                          name='inputnode')
      outputnode = pe.Node(niu.IdentityInterface(
          fields=['epi_mni', 'epi_parc', 'report']), name='outputnode')
  
      epimask = pe.Node(fsl.ApplyMask(), name='EPIApplyMask')
  
      n4itk = pe.Node(ants.N4BiasFieldCorrection(dimension=3), name='SharpenEPI')
  
      norm = pe.Node(RobustMNINormalization(
          num_threads=ants_nthreads,
          float=settings.get('ants_float', False),
          template='mni_icbm152_nlin_asym_09c',
          reference_image=pkgrf('mriqc', 'data/mni/2mm_T2_brain.nii.gz'),
          flavor='testing' if testing else 'precise',
          moving='EPI',
          generate_report=True,),
          name='EPI2MNI',
          num_threads=n_procs,
          mem_gb=3)
  
      # Warp segmentation into EPI space
      invt = pe.Node(ants.ApplyTransforms(
          float=True,
          input_image=str(Path(mni_template) / '1mm_parc.nii.gz'),
          dimension=3, default_value=0, interpolation='NearestNeighbor'),
          name='ResampleSegmentation')
  
      workflow.connect([
          (inputnode, invt, [('epi_mean', 'reference_image')]),
          (inputnode, n4itk, [('epi_mean', 'input_image')]),
          (inputnode, epimask, [('epi_mask', 'mask_file')]),
          (n4itk, epimask, [('output_image', 'in_file')]),
          (epimask, norm, [('out_file', 'moving_image')]),
          (norm, invt, [
              ('inverse_composite_transform', 'transforms')]),
          (invt, outputnode, [('output_image', 'epi_parc')]),
          (norm, outputnode, [('warped_image', 'epi_mni'),
                              ('out_report', 'report')]),
  
      ])
      return workflow
code_tokens: def epi_mni_align ( settings , name = 'SpatialNormalization' ) : from niworkflows . data import get_mni_icbm152_nlin_asym_09c as get_template from niworkflows . interfaces . registration import ( RobustMNINormalizationRPT as RobustMNINormalization ) from pkg_resources import resource_filename as pkgrf testing = settings . get ( 'testing' , False ) n_procs = settings . get ( 'n_procs' , 1 ) ants_nthreads = settings . get ( 'ants_nthreads' , DEFAULTS [ 'ants_nthreads' ] ) mni_template = get_template ( ) workflow = pe . Workflow ( name = name ) inputnode = pe . Node ( niu . IdentityInterface ( fields = [ 'epi_mean' , 'epi_mask' ] ) , name = 'inputnode' ) outputnode = pe . Node ( niu . IdentityInterface ( fields = [ 'epi_mni' , 'epi_parc' , 'report' ] ) , name = 'outputnode' ) epimask = pe . Node ( fsl . ApplyMask ( ) , name = 'EPIApplyMask' ) n4itk = pe . Node ( ants . N4BiasFieldCorrection ( dimension = 3 ) , name = 'SharpenEPI' ) norm = pe . Node ( RobustMNINormalization ( num_threads = ants_nthreads , float = settings . get ( 'ants_float' , False ) , template = 'mni_icbm152_nlin_asym_09c' , reference_image = pkgrf ( 'mriqc' , 'data/mni/2mm_T2_brain.nii.gz' ) , flavor = 'testing' if testing else 'precise' , moving = 'EPI' , generate_report = True , ) , name = 'EPI2MNI' , num_threads = n_procs , mem_gb = 3 ) invt = pe . Node ( ants . ApplyTransforms ( float = True , input_image = str ( Path ( mni_template ) / '1mm_parc.nii.gz' ) , dimension = 3 , default_value = 0 , interpolation = 'NearestNeighbor' ) , name = 'ResampleSegmentation' ) workflow . connect ( [ ( inputnode , invt , [ ( 'epi_mean' , 'reference_image' ) ] ) , ( inputnode , n4itk , [ ( 'epi_mean' , 'input_image' ) ] ) , ( inputnode , epimask , [ ( 'epi_mask' , 'mask_file' ) ] ) , ( n4itk , epimask , [ ( 'output_image' , 'in_file' ) ] ) , ( epimask , norm , [ ( 'out_file' , 'moving_image' ) ] ) , ( norm , invt , [ ( 'inverse_composite_transform' , 'transforms' ) ] ) , ( invt , outputnode , [ ( 'output_image' , 'epi_parc' ) ] ) , ( norm , outputnode , [ ( 'warped_image' , 'epi_mni' ) , ( 'out_report' , 'report' ) ] ) , ] ) return workflow
short_docstring: Uses FSL FLIRT with the BBR cost function to find the transform that
  maps the EPI space into the MNI152-nonlinear-symmetric atlas.
short_docstring_tokens: Uses FSL FLIRT with the BBR cost function to find the transform that maps the EPI space into the MNI152 - nonlinear - symmetric atlas .
comment: """
      Uses FSL FLIRT with the BBR cost function to find the transform that
      maps the EPI space into the MNI152-nonlinear-symmetric atlas.
  
      The input epi_mean is the averaged and brain-masked EPI timeseries
  
      Returns the EPI mean resampled in MNI space (for checking out registration) and
      the associated "lobe" parcellation in EPI space.
  
      .. workflow::
  
        from mriqc.workflows.functional import epi_mni_align
        wf = epi_mni_align({})
  
      """$SEP$# Get settings$SEP$# Init template$SEP$# Warp segmentation into EPI space