class_docstr: Custom error type for dimension checking.
  
  This error is used in recursive calls in check_niimg to keep track of the
  dimensionality of the data. Its final goal it to generate a user friendly
  message.
  
  Parameters
  ----------
  file_dimension : integer
      Indicates the dimensionality of the bottom-level nifti file.
  
  required_dimension : integer
      The dimension the nifti file should have.
class_docstr_tok: ["Custom","error","type","for","dimension","checking",".","This","error","is","used","in","recursive","calls","in","check_niimg","to","keep","track","of","the","dimensionality","of","the","data",".","Its","final","goal","it","to","generate","a","user","friendly","message",".","Parameters","--","--","--","--","--","file_dimension",":","integer","Indicates","the","dimensionality","of","the","bottom-level","nifti","file",".","required_dimension",":","integer","The","dimension","the","nifti","file","should","have","."]
docstr: Format error message.
docstr_tok: ["Format","error","message","."]
code: def message(self):
      """Format error message."""
      expected_dim = self.required_dimension + self.stack_counter
      total_file_dim = f" ({self.file_dimension + self.stack_counter}D)"
      return (
          "Input data has incompatible dimensionality: "
          f"Expected dimension is {expected_dim}D and you provided a "
          f"{'list of ' * self.stack_counter}{self.file_dimension}D "
          f"image{'s' * (self.stack_counter > 0)}"
          f"{total_file_dim * (self.stack_counter > 0)}. "
          "See https://nilearn.github.io/stable/manipulating_images/"
          "input_output.html."
      )
  
label_desc: Use image node_id 3 for calling the DimensionError obj's underlying member method code with example usage: obj.message() and returns: str, expected_dim, str, unknown, self, str, unknown, unknown, str