childmindresearch / bids2table

Efficiently index large-scale BIDS neuroimaging datasets and derivatives
https://childmindresearch.github.io/bids2table/
MIT License
13 stars 5 forks source link

[Feature request] Accept piped file paths in CLI #42

Open nx10 opened 1 month ago

nx10 commented 1 month ago

Hi,

I’d like to request a feature for bids2table that allows the CLI to accept file paths via standard input (stdin) instead of requiring a root directory. This would make it easier to work with file paths from various sources like cloud storage or environments where direct access to the entire directory is limited.

Examples:

  1. Cloud storage:

    aws s3 ls s3://my-bids-dataset/ --recursive | awk '{print $4}' | bids2table
  2. Integration with other tools:

    find /my/data -type f -name "*.nii.gz" | bids2table
  3. From a file:

    cat bids_file_paths.txt | bids2table
  4. Limited access:

    echo "/restricted_path/sub-01/anat/sub-01_T1w.nii.gz" | bids2table

    Let me know what you think!

Thanks!