Amplitude of Low Frequency Fluctuations(ALFF) and fractional ALFF

CPAC.alff.create_alff(wf_name='alff_workflow')[source]

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

wf_name : string
Workflow name
alff_workflow : workflow object
ALFF workflow

Source

Workflow Inputs:

hp_input.hp : list (float) 
    high pass frequencies

lp_input.lp : list (float) 
    low pass frequencies

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

Workflow Outputs:

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

Order of Commands:

  • Filter the input file rest file( slice-time, motion corrected and nuisance regressed) ::
    3dBandpass -prefix residual_filtered.nii.gz

    0.009 0.08 residual.nii.gz

  • Calculate ALFF by taking the standard deviation of the filtered file ::
    3dTstat -stdev

    -mask rest_mask.nii.gz -prefix residual_filtered_3dT.nii.gz residual_filtered.nii.gz

  • Calculate the standard deviation of the unfiltered file ::
    3dTstat -stdev

    -mask rest_mask.nii.gz -prefix residual_3dT.nii.gz residual.nii.gz

  • Calculate fALFF ::
    3dcalc -a rest_mask.nii.gz

    -b residual_filtered_3dT.nii.gz -c residual_3dT.nii.gz -expr ‘(1.0*bool(a))*((1.0*b)/(1.0*c))’ -float

  • Normalize ALFF/fALFF to Z-score across full brain

    fslstats
    ALFF.nii.gz
    -k rest_mask.nii.gz
    -m > mean_ALFF.txt ; mean=$( cat mean_ALFF.txt )
    
    fslstats
    ALFF.nii.gz
    -k rest_mask.nii.gz
    -s > std_ALFF.txt ; std=$( cat std_ALFF.txt )
    
    fslmaths
    ALFF.nii.gz
    -sub ${mean}
    -div ${std}
    -mas rest_mask.nii.gz ALFF_Z.nii.gz
    
    fslstats
    fALFF.nii.gz
    -k rest_mask.nii.gz
    -m > mean_fALFF.txt ; mean=$( cat mean_fALFF.txt )
    
    fslstats
    fALFF.nii.gz
    -k rest_mask.nii.gz 
    -s > std_fALFF.txt
    std=$( cat std_fALFF.txt )
    
    fslmaths
    fALFF.nii.gz
    -sub ${mean}
    -div ${std}
    -mas rest_mask.nii.gz
    fALFF_Z.nii.gz
    

High Level Workflow Graph:

workflows/../images/alff.dot.png

Detailed Workflow Graph:

workflows/../images/alff_detailed.dot.png
[1]Zou, Q.-H., Zhu, C.-Z., Yang, Y., Zuo, X.-N., Long, X.-Y., Cao, Q.-J., Wang, Y.-F., et al. (2008). An improved approach to detection of amplitude of low-frequency fluctuation (ALFF) for resting-state fMRI: fractional ALFF. Journal of neuroscience methods, 172(1), 137-41. doi:10.10
>>> alff_w = create_alff()
>>> alff_w.inputs.hp_input.hp = [0.01]
>>> alff_w.inputs.lp_input.lp = [0.1]
>>> alff_w.get_node('hp_input').iterables = ('hp',[0.01])
>>> alff_w.get_node('lp_input').iterables = ('lp',[0.1])
>>> alff_w.inputs.inputspec.rest_res = '/home/data/subject/func/rest_bandpassed.nii.gz'
>>> alff_w.inputs.inputspec.rest_mask= '/home/data/subject/func/rest_mask.nii.gz' 
>>> alff_w.run() 
CPAC.alff.get_img_nvols(in_files)[source]

Calculates the number of volumes in the given nifti image

in_files : string (nifti file)

out : int
number of volumes of input nifti file
CPAC.alff.get_img_tr(in_files, TRa)[source]

Computes the Temporal Resolution parameter from the image header. If TRa is not None then it compares the computed TR and the supplied if the difference is greater than 0.001 then it returns supplied TRa as the TR of the image and flashes a warning message else returns TRa

in_files : string (nifti file)

TRa : float
user supplied Temporal Resolution
out : float
TR for input file
CPAC.alff.get_N1(nvols, TR, HP)[source]

Get the low frequency point

TR : float
Temporal Resolution
nvols : int
Number of volumes
HP : float
HighPass Low Cutoff Frequency

n1 : float

Low Frequency Point

CPAC.alff.get_N2(nvols, TR, LP, HP)[source]

Get the high frequency point

TR : float
Temporal Resolution
nvols : int
Number of volumes
LP : float
LowPass High Cutoff Frequency
HP : float
HighPass Low Cutoff Frequency

n2 : float

High Frequency Point

CPAC.alff.get_operand_string(mean, std_dev)[source]

Generate the Operand String to be used in workflow nodes to supply mean and std deviation to alff workflow nodes

mean: string
mean value in string format
std_dev : string
std deviation value in string format

op_string : string

CPAC.alff.set_op_str(n2)[source]

Build the operand string used by the workflow nodes

n2 : float

strs : string

operand string
CPAC.alff.set_op1_str(nvols)[source]

Build the operand string used by the workflow nodes

nvols : int

strs : string

operand string
CPAC.alff.takemod(nvols)[source]

Determine if the input is odd or even values and return a of 0 and 1 depending on the truth value

nvols : int

decisions : int