@groovy.util.logging.Slf4j @groovy.transform.CompileStatic class LibBidsShWrapper extends java.lang.Object
Wrapper for the libBIDS.sh bash library.
Locates the libBIDS.sh script (embedded in the plugin distribution,
checked out as a git submodule, or provided explicitly by the caller), then
invokes libBIDSsh_parse_bids_to_table to produce a TSV file that is
subsequently read by nfneuro.plugin.util.BidsCsvParser.
All user-supplied paths are validated against a shell-metacharacter deny-list before being passed to the subprocess to prevent command injection.
| Constructor and description |
|---|
LibBidsShWrapper() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.lang.String |
getLibBidsVersion(java.lang.String scriptPath)Attempt to extract the version string from a libBIDS.sh script. |
|
java.io.File |
parseBidsToTable(java.lang.String bidsDir, java.lang.String libBidsShPath, java.lang.Boolean bidsignore, java.lang.Boolean defaultIgnores)Parse BIDS directory to TSV table using libBIDS.sh |
|
boolean |
validateLibBidsScript(java.lang.String scriptPath)Verify that a libBIDS.sh script exists, is readable, and contains the
expected libBIDSsh_parse_bids_to_table function signature. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait() |
Attempt to extract the version string from a libBIDS.sh script.
Looks for a VERSION="x.y.z" assignment near the top of the file.
scriptPath - absolute path to the libBIDS.sh file"1.2.0"), or "unknown" if not found or on any errorParse BIDS directory to TSV table using libBIDS.sh Executes the bash script and captures TSV output
bidsDir - Path to BIDS datasetlibBidsShPath - Path to libBIDS.sh (optional, auto-detects if not provided) Verify that a libBIDS.sh script exists, is readable, and contains the
expected libBIDSsh_parse_bids_to_table function signature.
scriptPath - absolute path to the candidate libBIDS.sh filetrue if the script is usable; false otherwise (errors are logged)