code: def _check_images(image_file, flag_full_aroma):
      """Validate input file and ICA AROMA related file.
  
      Parameters
      ----------
      image_file : str
          Path to the functional image file.
  
      flag_full_aroma : bool
          True if the input is a full ICA-AROMA output, False otherwise.
  
      Raises
      ------
      ValueError
          If the image is not valid.
      """
      if len(image_file) == 2:  # must be gifti
          valid_img, error_message = _ext_validator(
              image_file, "func.gii"
          )
      elif flag_full_aroma:
          valid_img, error_message = _ext_validator(
              [image_file], "aroma"
          )
      else:
          ext = ".".join(image_file.split(".")[-2:])
          valid_img, error_message = _ext_validator([image_file], ext)
      if not valid_img:
          raise ValueError(error_message)
  
imports: import itertools
  import json
  import os
  import re
  import numpy
  import pandas
  from sklearn.preprocessing import scale
  from nilearn._utils.fmriprep_confounds import flag_single_gifti, is_camel_case
  from nilearn.interfaces.bids import parse_bids_filename
  from .load_confounds_scrub import extract_outlier_regressors
label_desc: Use image node_id 12 for calling a global function with example usage: _check_images(image_file, flag_full_aroma) without return types