Skip to content

Commit

Permalink
ENH: Optimize metadata gathering reusing BIDSLayout db
Browse files Browse the repository at this point in the history
There's no need to index the BIDS folder repeatedly with each of these
interfaces.

Requires: nipreps/niworkflows#788.
  • Loading branch information
oesteban committed Mar 11, 2023
1 parent dba16ac commit fe6eb69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion mriqc/workflows/anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,9 @@ def compute_iqms(name="ComputeIQMs"):
)

# Extract metadata
meta = pe.Node(ReadSidecarJSON(), name="metadata")
meta = pe.Node(ReadSidecarJSON(
index_db=config.execution.bids_database_dir
), name="metadata")

# Add provenance
addprov = pe.Node(AddProvenance(), name="provenance", run_without_submitting=True)
Expand Down
4 changes: 3 additions & 1 deletion mriqc/workflows/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@ def compute_iqms(name="ComputeIQMs"):
# fmt: on

# Add metadata
meta = pe.Node(ReadSidecarJSON(), name="metadata")
meta = pe.Node(ReadSidecarJSON(
index_db=config.execution.bids_database_dir
), name="metadata")

addprov = pe.Node(
AddProvenance(modality="bold"),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies = [
"nipype ~= 1.4",
"nireports >= 23.0",
"nitransforms >= 21.0.1",
"niworkflows >= 1.7.6",
"niworkflows git+https://github.com/nipreps/niworkflows.git@fix/786-read-bids-meta",
"numpy ~=1.20",
"pandas ~=1.0",
"pybids >= 0.15.6",
Expand Down

0 comments on commit fe6eb69

Please sign in to comment.