class_docstr: Detects outliers in a functional imaging series
  
  Uses intensity and motion parameters to infer outliers. If `use_norm` is
  True, it computes the movement of the center of each face a cuboid centered
  around the head and returns the maximal movement across the centers. If you
  wish to use individual thresholds instead, import `Undefined` from
  `nipype.interfaces.base` and set `....inputs.use_norm = Undefined`
  
  
  Examples
  --------
  
  >>> ad = ArtifactDetect()
  >>> ad.inputs.realigned_files = 'functional.nii'
  >>> ad.inputs.realignment_parameters = 'functional.par'
  >>> ad.inputs.parameter_source = 'FSL'
  >>> ad.inputs.norm_threshold = 1
  >>> ad.inputs.use_differences = [True, False]
  >>> ad.inputs.zintensity_threshold = 3
  >>> ad.run()  # doctest: +SKIP
class_docstr_tok: ["Detects","outliers","in","a","functional","imaging","series","Uses","intensity","and","motion","parameters","to","infer","outliers",".","If","`","use_norm","`","is","True",",","it","computes","the","movement","of","the","center","of","each","face","a","cuboid","centered","around","the","head","and","returns","the","maximal","movement","across","the","centers",".","If","you","wish","to","use","individual","thresholds","instead",",","import","`","Undefined","`","from","`","nipype.interfaces.base","`","and","set","`","....","inputs.use_norm","=","Undefined","`","Examples","--","--","--","--",">",">",">","ad","=","ArtifactDetect","(",")",">",">",">","ad.inputs.realigned_files","=","'functional.nii'",">",">",">","ad.inputs.realignment_parameters","=","'functional.par'",">",">",">","ad.inputs.parameter_source","=","'FSL'",">",">",">","ad.inputs.norm_threshold","=","1",">",">",">","ad.inputs.use_differences","=","[","True",",","False","]",">",">",">","ad.inputs.zintensity_threshold","=","3",">",">",">","ad.run","(",")","#","doctest",":","+SKIP"]
docstr: Generate output files based on motion filenames
  
  Parameters
  ----------
  
  motionfile: file/string
      Filename for motion parameter file
  output_dir: string
      output directory in which the files will be generated
docstr_tok: ["Generate","output","files","based","on","motion","filenames","Parameters","--","--","--","--","--","motionfile",":","file\/string","Filename","for","motion","parameter","file","output_dir",":","string","output","directory","in","which","the","files","will","be","generated"]
code: def _get_output_filenames(self, motionfile, output_dir):
      """Generate output files based on motion filenames
  
      Parameters
      ----------
  
      motionfile: file/string
          Filename for motion parameter file
      output_dir: string
          output directory in which the files will be generated
      """
      if isinstance(motionfile, (str, bytes)):
          infile = motionfile
      elif isinstance(motionfile, list):
          infile = motionfile[0]
      else:
          raise Exception("Unknown type of file")
      _, filename, ext = split_filename(infile)
      artifactfile = os.path.join(
          output_dir, "".join(("art.", filename, "_outliers.txt"))
      )
      intensityfile = os.path.join(
          output_dir, "".join(("global_intensity.", filename, ".txt"))
      )
      statsfile = os.path.join(
          output_dir, "".join(("stats.", filename, ".txt"))
      )
      normfile = os.path.join(
          output_dir, "".join(("norm.", filename, ".txt"))
      )
      plotfile = os.path.join(
          output_dir,
          "".join(("plot.", filename, ".", self.inputs.plot_type)),
      )
      displacementfile = os.path.join(
          output_dir, "".join(("disp.", filename, ext))
      )
      maskfile = os.path.join(
          output_dir, "".join(("mask.", filename, ext))
      )
      return (
          artifactfile,
          intensityfile,
          statsfile,
          normfile,
          plotfile,
          displacementfile,
          maskfile,
      )
  
imports: import os
  from copy import deepcopy
  from nibabel import load, funcs, Nifti1Image
  import numpy
  from ..interfaces.base import BaseInterface, traits, InputMultiPath, OutputMultiPath, TraitedSpec, File, BaseInterfaceInputSpec, isdefined
  from ..utils.filemanip import ensure_list, save_json, split_filename
  from ..utils.misc import find_indices, normalize_mc_params
  from ..None import logging, config
label_desc: Use image node_id 2 for calling the ArtifactDetect obj's underlying member method code with example usage: obj._get_output_filenames(motionfile, output_dir) and returns: artifactfile,  intensityfile,  statsfile,  normfile,  plotfile,  displacementfile,  maskfile