code: def make_localizer_contrasts(design_matrix):
      """Return a dictionary of four contrasts, given the design matrix."""
      # first generate canonical contrasts
      contrast_matrix = np.eye(design_matrix.shape[1])
      contrasts = {
          column: contrast_matrix[i]
          for i, column in enumerate(design_matrix.columns)
      }
  
      contrasts["audio"] = (
          contrasts["audio_left_hand_button_press"]
          + contrasts["audio_right_hand_button_press"]
          + contrasts["audio_computation"]
          + contrasts["sentence_listening"]
      )
  
      # one contrast adding all conditions involving instructions reading
      contrasts["visual"] = (
          contrasts["visual_left_hand_button_press"]
          + contrasts["visual_right_hand_button_press"]
          + contrasts["visual_computation"]
          + contrasts["sentence_reading"]
      )
  
      # one contrast adding all conditions involving computation
      contrasts["computation"] = (
          contrasts["visual_computation"]
          + contrasts["audio_computation"]
      )
  
      # one contrast adding all conditions involving sentences
      contrasts["sentences"] = (
          contrasts["sentence_listening"]
          + contrasts["sentence_reading"]
      )
  
      # Short dictionary of more relevant contrasts
      contrasts = {
          "left - right button press": (
              contrasts["audio_left_hand_button_press"]
              - contrasts["audio_right_hand_button_press"]
              + contrasts["visual_left_hand_button_press"]
              - contrasts["visual_right_hand_button_press"]
          ),
          "audio - visual": contrasts["audio"] - contrasts["visual"],
          "computation - sentences": (
              contrasts["computation"] - contrasts["sentences"]
          ),
          "horizontal-vertical": (
              contrasts["horizontal_checkerboard"]
              - contrasts["vertical_checkerboard"]
          ),
      }
      return contrasts
  
file_path: nilearn/examples/04_glm_first_level/plot_first_level_details.py
imports: from nilearn.datasets import func
  import pandas
  from nilearn.glm.first_level import FirstLevelModel
  from nilearn.plotting import plot_design_matrix
  import matplotlib.pyplot
  import numpy
  from nilearn.plotting import plot_contrast_matrix
  from nilearn import plotting
  from nilearn.image import high_variance_confounds
  from nilearn.datasets import fetch_icbm152_brain_gm_mask
  from nilearn.plotting import plot_roi
  from nilearn.image import resample_to_img
label_desc: Use image node_id 1 for calling a global function with example usage: make_localizer_contrasts(design_matrix) and returns: contrasts