Metadata Builder ================ The Metadata Builder converts a dataset's structure, filenames, existing sidecars, and readable image headers into a transparent set of metadata inventories, BIDS-oriented templates, validation summaries, and review tables. It can be used after creating a new dataset in NIM Studio or independently to inspect and curate an existing raw, derivative, or study-level dataset. The Metadata Builder does not assume that automatically inferred values are complete or scientifically correct. All generated modality templates are marked for manual review, and missing required or recommended fields remain visible before export. Overview -------- The Metadata Builder scans a selected dataset recursively and summarizes its participants, sessions, files, modalities, tasks, acquisitions, runs, suffixes, existing JSON files, NIfTI files, and readable DICOM metadata. During the scan, NIM Studio combines information from: * Folder structure * BIDS-style filenames * Existing sidecar JSON files * NIfTI headers, when ``nibabel`` is installed * DICOM headers, when ``pydicom`` is installed The resulting metadata are associated with their detected source so that users can distinguish values inferred from filenames, folder organization, existing JSON files, NIfTI headers, and DICOM headers. :contentReference[oaicite:0]{index=0} Supported Dataset Contexts -------------------------- The Metadata Builder can scan: * Raw BIDS datasets * Derivative datasets * Study-level dataset roots * Partially organized BIDS-like datasets * Existing datasets created outside NIM Studio The selected root is classified as ``raw``, ``derivative``, or ``study`` using its directory context and detected contents. For derivative datasets, the application also pre-fills the pipeline name using the selected folder name when no value has been entered. :contentReference[oaicite:1]{index=1} Dataset Description ------------------- The module provides an editable interface for constructing ``dataset_description.json``. Supported fields include: Required fields ^^^^^^^^^^^^^^^ * ``Name`` * ``BIDSVersion`` Dataset type ^^^^^^^^^^^^ * ``raw`` * ``derivative`` * ``study`` Recommended and optional fields ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * ``License`` * ``Authors`` * ``Keywords`` * ``Acknowledgements`` * ``HowToAcknowledge`` * ``Funding`` * ``EthicsApprovals`` * ``ReferencesAndLinks`` * ``DatasetDOI`` Derivative provenance fields ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ For derivative datasets, users can document: * ``GeneratedBy.Name`` * Pipeline version * Pipeline or processing description * Source dataset URL * Source dataset DOI * Source dataset version A derivative dataset cannot save a selected ``dataset_description.json`` unless ``GeneratedBy.Name`` has been provided. :contentReference[oaicite:2]{index=2} :contentReference[oaicite:3]{index=3} When a dataset has been scanned, NIM Studio may also add a structural summary containing the number of detected participants, participant-session rows, files, and datatypes. It records that the metadata templates were generated by NIM Studio and still require user verification. :contentReference[oaicite:4]{index=4} Participant Management ---------------------- The Metadata Builder creates participant-level summaries from detected ``sub-