HED JavaScript Library
    Preparing search index...

    Class BidsWebAccessor

    BIDS file accessor for browser environments.

    Reads file content using the browser File.text() API. Schema loading uses remote (HTTPS) fetching.

    const input = document.querySelector('input[webkitdirectory]')
    const accessor = await BidsWebAccessor.create(input.files)
    const [dataset, issues] = await BidsDataset.create(accessor, BidsWebAccessor)

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    datasetRootDirectory: string

    The root directory of the dataset.

    fileMap: Map<string, any>

    Map of relative file paths to file representations.

    organizedPaths: Map<string, Map<string, string[]>>

    Organized paths.

    schemaBuilder: (datasetDescription: BidsJsonFile) => Promise<any>

    The HED schema builder function.

    Type Declaration

      • (datasetDescription: BidsJsonFile): Promise<any>
      • Build a HED schema collection based on the defined BIDS schemas.

        Parameters

        • datasetDescription: BidsJsonFile

          The description of the BIDS dataset being validated.

        Returns Promise<any>

        A Promise with the schema collection, or null if the specification is missing.

        If the schema specification is invalid.

    SPECIAL_DIRS: string[] = ...

    BIDS special directories.

    SUFFIXES: string[] = ...

    BIDS suffixes.

    Methods

    • Read a file's content via the browser File API.

      Parameters

      • relativePath: string

        The relative path to the file within the dataset.

      Returns Promise<string | null>

      The file contents, or null if not found.