class_docstr: Defines a trait whose value must be a known neuroimaging file.
class_docstr_tok: ["Defines","a","trait","whose","value","must","be","a","known","neuroimaging","file","."]
docstr: Create an ImageFile trait.
docstr_tok: ["Create","an","ImageFile","trait","."]
code: def __init__(
      self,
      value=NoDefaultSpecified,
      exists=False,
      resolve=False,
      types=None,
      **metadata,
  ):
      """Create an ImageFile trait."""
      extensions = None
      if types is not None:
          if isinstance(types, (bytes, str)):
              types = [types]
  
          if set(types) - set(IMG_FORMATS.keys()):
              invalid = set(types) - set(IMG_FORMATS.keys())
              raise ValueError(
                  """\
  Unknown value(s) %s for metadata type of an ImageFile input.\
  """
                  % ", ".join(['"%s"' % t for t in invalid])
              )
          extensions = [ext for t in types for ext in IMG_FORMATS[t]]
  
      super().__init__(
          value=value,
          exists=exists,
          extensions=extensions,
          resolve=resolve,
          **metadata,
      )
  
imports: from collections.abc import Sequence
  from traits import __version__
  import traits.api
  from traits.api import TraitType, Unicode
  from traits.trait_base import _Undefined
  from pathlib import Path
  from ...utils.filemanip import path_resolve
label_desc: Use image node_id 1 to create a new ImageFile object from inherited base classes: File with example: obj = ImageFile(value, exists, resolve, types)