<commit_before>import os
import sys
import commands
import nipype.pipeline.engine as pe
import nipype.algorithms.rapidart as ra
import nipype.interfaces.afni as afni
import nipype.interfaces.fsl as fsl
import nipype.interfaces.io as nio
import nipype.interfaces.utility as util
from CPAC.alff import *

def create_alff(tr):

    """
    Calculate Amplitude of low frequency oscillations(ALFF) and fractional ALFF maps

    Parameters
    ----------

    tr : (float) Temporal Resolution of the functional alff

    Returns
    -------

    alff_workflow : workflow object

        ALFF workflow

    Examples
    --------


    Notes
    -----

    `Source <https://github.com/openconnectome/C-PAC/blob/master/CPAC/alff/alff.py>`_

    Workflow Inputs: ::

        hp_input.hp : (A list of floating point numbers)
            high pass frequencies

        lp_input.lp : (A list of floating point numbers)
            low pass frequencies

        fwhm_input.fwhm : (A list of floating point numbers)
            full width half max for spatial alff_Z_to_standard_FWHMing

        inputspec.rest_res : string (an existing nifti file)
            Nuisance signal regressed functional image

        inputspec.rest_mask : string (an existing nifti file)
            A mask volume(derived by dilating the motion corrected functional volume) in native space

        inputspec.rest_mask2standard : string (an existing nifti file)
            A mask volume(derived from the functional volume) in standard in standard space
            Used in spatial alff_Z_to_standard_FWHMing the Z-transformed correlations in MNI space

        inputspec.premat : string (an existing affine transformation .mat file)
            Specifies an affine transform that should be applied to the data prior to the non-linear warping(example_func2highres.mat).

        inputspec.standard : string (an existing nifti file)
            FSL standard nifti file in user specified resolution

        inputspec.fieldcoeff_file : string (an existing nifti file)
            File with warp coefficients/fields. This typically the output given by the --cout parameter of fnirt during registration step


    Workflow Outputs: ::

        outputspec.power_spectrum_distribution : string (nifti file)
            outputs image containing the spectral power density of residual functional image

        outputspec.alff_img : string (nifti file)
            outputs image containing the sum of the amplitudes in the low frequency band

        outputspec.falff_img : string (nifti file)
            outputs image containing the sum of the amplitudes in the low frequency band divided by the amplitude of the total frequency

        outputspec.alff_Z_img : string (nifti file)
            outputs image containing Normalized ALFF Z scores across full brain in native space

        outputspec.falff_Z_img : string (nifti file)
            outputs image containing Normalized fALFF Z scores across full brain in native space

        outputspec.alff_Z_2standard_img : string (nifti file)
            outputs image containing normalized  ALFF Z scores in MNI space<commit_msg>fixed alff on documentation for workflow input parameter standardization<commit_after>import os
import sys
import commands
import nipype.pipeline.engine as pe
import nipype.algorithms.rapidart as ra
import nipype.interfaces.afni as afni
import nipype.interfaces.fsl as fsl
import nipype.interfaces.io as nio
import nipype.interfaces.utility as util
from CPAC.alff import *

def create_alff(tr):

    """
    Calculate Amplitude of low frequency oscillations(ALFF) and fractional ALFF maps

    Parameters
    ----------

    tr : (float) Temporal Resolution of the functional alff

    Returns
    -------

    alff_workflow : workflow object

        ALFF workflow

    Examples
    --------


    Notes
    -----

    `Source <https://github.com/openconnectome/C-PAC/blob/master/CPAC/alff/alff.py>`_

    Workflow Inputs: ::

        hp_input.hp : list (float) 
            high pass frequencies

        lp_input.lp : list (float) 
            low pass frequencies

        fwhm_input.fwhm : list (float)
            full width half max for spatial alff_Z_to_standard_FWHMing

        inputspec.rest_res : string (existing nifti file)
            Nuisance signal regressed functional image

        inputspec.rest_mask : string (existing nifti file)
            A mask volume(derived by dilating the motion corrected functional volume) in native space

        inputspec.rest_mask2standard : string (existing nifti file)
            A mask volume(derived from the functional volume) in standard in standard space
            Used in spatial alff_Z_to_standard_FWHMing the Z-transformed correlations in MNI space

        inputspec.premat : string (existing affine transformation .mat file)
            Specifies an affine transform that should be applied to the data prior to the non-linear warping(example_func2highres.mat).

        inputspec.standard : string (existing nifti file)
            FSL standard nifti file in user specified resolution

        inputspec.fieldcoeff_file : string (existing nifti file)
            File with warp coefficients/fields. This typically the output given by the --cout parameter of fnirt during registration step


    Workflow Outputs: ::

        outputspec.power_spectrum_distribution : string (nifti file)
            outputs image containing the spectral power density of residual functional image

        outputspec.alff_img : string (nifti file)
            outputs image containing the sum of the amplitudes in the low frequency band

        outputspec.falff_img : string (nifti file)
            outputs image containing the sum of the amplitudes in the low frequency band divided by the amplitude of the total frequency

        outputspec.alff_Z_img : string (nifti file)
            outputs image containing Normalized ALFF Z scores across full brain in native space

        outputspec.falff_Z_img : string (nifti file)
            outputs image containing Normalized fALFF Z scores across full brain in native space

        outputspec.alff_Z_2standard_img : string (nifti file)
            outputs image containing normalized  ALFF Z scores in MNI space
{'fraction_non_alphanumeric': 0.05023196288593825, 'fraction_numerical': 0.0009598464245720685, 'mean_word_length': 2.7369994022713686, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2081071', 'n_tokens_mistral': 1682, 'n_tokens_neox': 1572, 'n_words': 643}