Nilearn.glm.first_level question

Hi all,

Below are pasted what are the default settings when using nilearn for first levels. I have already postprocessed brain data to have high pass filtering, intensity normalization and confounds regression completed. I am wondering about the proper specification to eliminate that in nilearn. If I do not include high_pass=# in the function, will it automatically perform high_pass=0.01? If I want it to be not done at all, should I made high_pass=0? Should I also make drift_model=None? Is there anything else I need to do?

class nilearn.glm.first_level.FirstLevelModel(t_r=None , slice_time_ref=0.0 , hrf_model=‘glover’ , drift_model=‘cosine’ , high_pass=0.01 , drift_order=1 , fir_delays=None , min_onset=-24 , mask_img=None , target_affine=None , target_shape=None , smoothing_fwhm=None , memory=None , memory_level=1 , standardize=False , signal_scaling=0 , noise_model=‘ar1’ , verbose=0 , n_jobs=1 , minimize_memory=True , subject_label=None , random_state=None )

Thanks for your help!

hey there, @mship
To address your query regarding the use of nilearn.glm.first_level.FirstLevelModel with already preprocessed brain data, here’s how you can properly specify the parameters to avoid redundant preprocessing:

  1. High-pass Filtering:

    • By default, Nilearn uses high_pass=0.01. If you want to disable high-pass filtering entirely, set high_pass=0.
  2. Drift Model:

    • The default drift model is 'cosine'. If you want to disable this, set drift_model=None.

You don’t need to adjust parameters for intensity normalization or confound regression in the FirstLevelModel, as these are not explicitly included in the default settings.

Here’s how you can set these parameters:

from nilearn.glm.first_level import FirstLevelModel

# Initialize FirstLevelModel with preprocessing steps disabled
first_level_model = FirstLevelModel(high_pass=0, drift_model=None)

This configuration will ensure that no additional high-pass filtering or drift modeling is applied, which aligns with your already preprocessed data.

Let me know if there’s anything else you need help with!

1 Like

drift_model=None is sufficient. The high_pass is a parameter that modulates the selected drift model.

Please consult the documentation at nilearn.glm.first_level.FirstLevelModel - Nilearn, which explains each parameter in detail.

1 Like