Filtering, selecting, and renaming data in _ChRIS_ plugins #713
Replies: 1 comment 4 replies
|
Let me rephrase this idea in a slightly different way to check whether I’m understanding it correctly. It seems like the missing CUBE abstraction is a storage-efficient “file view” or “slice” of an existing output tree. Today, if I want a subset, rename, or regrouping of files, the practical path is often to run a plugin that materializes a new output directory. That works, but it turns cheap logical operations into duplicated storage. Would one concrete version of Solution C be something like this?
Example manifest: views:
- source: some/previous/output/a.nii.gz
output: selected/a.nii.gz
- source: some/previous/output/b.nii.gz
output: selected/b.nii.gzThat seems like it could support two related use cases with one common CUBE mechanism:
So maybe the important thing is not whether the producer is ts or ds, but that CUBE has one common file-view registration mechanism. This also seems to fit an interactive/plugin-assisted UX. For example, the UI could let a user browse a parent plugin’s output tree, select files/folders, define filters or rename rules, preview the resulting view, and then click “commit.” The commit action would still create a normal child plugin instance, e.g. pl-topofileview, with the UI-generated file-view spec as input/ parameters. So the UI is just a spec builder; the committed result remains a normal plugin instance in the feed graph, preserving provenance and making the operation reproducible. This would be a QoL improvement and a storage-efficiency improvement. It also seems aligned with the seagap model, and potentially useful for ATLAS workflows where curated views/slices of larger output trees are common. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Often there is a need to filter data found in the input directory. Examples:
.nii.gzfiles (and omit unmatched files such as.jsonfiles)MRI scans. Concretely, I need to match the keywords "T2_HASTE_4 CONCAT LONG TR" in the
ProtocolNameDICOM tag..nii.gzfiles depending on what DICOM tags are specified in their BIDS sidecar12.Use case (1) can be achieved using pl-topologicalcopy, and the storage use has been optimized in #545. However it is a clumsy solution:
--filteris specified as a regex,(comma) is a special character, cannot filter on commas in filenames. Related to Add protection against files/folders with paths that contain commas #609Use case (2) can somewhat be solved. There is a convention on the clinical side that
SeriesDescriptioncontainsProtocolNameand in ChRIS, folders containing DICOM series are named afterSeriesDescription. However, relying on conventions is brittle, so use case (3) is a more correct approach.Use cases (3), (4), and (5) can be solved by writing a (ds-type) ChRIS plugin, e.g. pl-bulk-rename. However. this causes files to be copied, consuming twice the amount of storage than necessary.
The problem and its context can be summarized like this: simple operations (filter, select, rename) lead to wasteful storage consumption. Some of these use cases are solved by pl-topologicalcopy, but its usage is esoteric and limited.
Solution A: expand the capabilities of ts-type plugins to cover the use cases of filter, select, and rename. Pros: efficient solution which is continuous with current design. Cons: it's often easier for end users to write a custom ChRIS plugin than to conceptualize and apply ts-type plugins for the same purpose.
Solution B: #515. Pros: plugin-centric design emphasizes that ChRIS plugins do everything, simpler to understand and audit ChRIS pipelines. Cons: computationally expensive.
Solution C: provide a way for plugin developers to "annotate" or provide "hints" to CUBE that an output file is a copy of an input file. Pros: plugin-centric design and efficient. Cons: optimizations are unlikely to be used by novice plugin developers.
Footnotes
https://bids-specification.readthedocs.io/en/v1.4.0/05-derivatives/02-common-data-types.html ↩
https://brainvoyager.com/bv/doc/UsersGuide/GettingStarted/NIfTIAndJSONSidecarFiles.html ↩
All reactions