abstract class BaseSetHandler extends java.lang.Object
| Constructor and description |
|---|
BaseSetHandler() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected java.util.List |
applyFlatOrdering(java.util.Map files) |
|
protected java.util.List |
applyFlatOrdering(java.util.List files) |
|
protected java.util.List |
applyHierarchicalOrdering(java.util.Map files) |
|
protected java.util.List |
applyHierarchicalOrdering(java.util.List files) |
|
protected java.util.Map |
applyPartsGrouping(java.util.Map nestedMap, java.util.List<java.lang.String> partsConfig, java.util.List<nfneuro.plugin.model.BidsFile> allFiles, java.lang.String datasetRoot)Apply parts grouping to a nested data map |
|
protected int |
compareSequenceValues(java.lang.String a, java.lang.String b)Compare sequence values for sorting |
|
protected int |
compareSequenceValues(java.util.List a, java.util.List b) |
|
protected java.util.Set<java.lang.String> |
consumedEntities(java.util.Map config)Collect the entities consumed internally by this set type across all configurations, normalized to their short form. |
|
protected java.util.List<nfneuro.plugin.model.BidsFile> |
filterBySuffix(java.util.List<nfneuro.plugin.model.BidsFile> files, java.lang.String suffix)Filter files by suffix |
|
protected java.util.Map |
findMatchingGrouping(nfneuro.plugin.model.BidsFile file, java.util.Map config, java.util.Map<java.lang.String, java.util.Map<java.lang.String, java.lang.String>> suffixMapping)Find matching grouping pattern for given file |
|
protected java.util.Set<java.lang.String> |
getAvailableKeys(java.util.Map subset, java.util.List<nfneuro.plugin.model.BidsFile> allFiles)Get available keys for required field validation |
|
protected java.util.Map<java.lang.String, java.util.List<java.lang.String>> |
getOrdering(nfneuro.plugin.model.BidsFile file, java.util.Map setConfig)Get sequence by entities from set config |
|
protected abstract java.util.List<java.lang.String> |
getSequenceByEntities(java.util.Map setConfig)Get sequence by entities from set config |
|
protected abstract java.util.Map |
getSetConfig(java.util.Map suffixConfig)Get set configuration from suffix config |
|
protected abstract java.util.Map |
getSetIndex(nfneuro.plugin.model.BidsFile file, java.util.Map setConfig, java.lang.String configKey)Get set index for a file based on set configuration |
|
static final java.lang.String |
getSetType(java.util.Map suffixConfig)Return the set-type key present in the suffix configuration map (one of "plain_set", "named_set", "sequential_set",
"mixed_set"), or null if none is found. |
|
protected java.util.List |
groupPathsByParts(java.util.List<java.lang.String> paths, java.util.List<java.lang.String> partsConfig, java.util.Map basenameToFile)Group a list of file paths by their part entity values |
|
protected java.util.List |
groupValueByParts(java.lang.String value, java.util.List<java.lang.String> partsConfig, java.util.Map basenameToFile) |
|
protected java.util.List |
groupValueByParts(java.util.List value, java.util.List<java.lang.String> partsConfig, java.util.Map basenameToFile) |
|
protected java.util.List<java.lang.String> |
groupingEntities(java.util.Map config, java.util.List<java.lang.String> loopOverEntities)Determine the entities used to group files for loop-over. |
|
protected java.lang.String |
logGroup() |
|
protected void |
logProcessingStats(int processedCount, int filteredCount)Log processing statistics |
|
protected abstract void |
packFileIntoSet(java.util.Map sets, java.util.Map allFiles, java.util.Map index, nfneuro.plugin.model.BidsFile file, java.util.Map ordering)Pack file into set structure |
|
groovyx.gpars.dataflow.DataflowQueue |
process(java.lang.String datasetRoot, java.util.List<nfneuro.plugin.model.BidsFile> bidsFiles, java.util.Map config, java.util.List<java.lang.String> loopOverEntities, java.util.Map<java.lang.String, java.util.Map<java.lang.String, java.lang.String>> suffixMapping) |
|
protected abstract java.util.List<nfneuro.plugin.model.BidsChannelData> |
processGroup(java.lang.String datasetRoot, java.util.Map plainSets, java.util.Map allFiles, java.util.Map config, java.util.List<java.lang.String> loopOverEntities, java.util.Map suffixMapping) |
|
protected abstract java.lang.String |
setName()Get set name |
|
protected boolean |
validateRequiredFileCount(java.util.List<nfneuro.plugin.model.BidsFile> files, java.lang.Integer requiredCount)Validate required files are present in group |
| 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() |
Apply parts grouping to a nested data map Transforms file lists/values grouped by extension to also group by BIDS 'part' entity. Parts represent subcomponents of complex MRI data (e.g., mag/phase, real/imag). Input structure examples: {nii: ["path1", "path2"]} or {nii: "path"} Output structure with parts: {nii: [{mag: "path1_mag", phase: "path1_phase"}, {mag: "path2_mag", phase: "path2_phase"}]}
nestedMap - Map of extension type to file path(s) - {nii: [...], json: [...]}partsConfig - List of part values to group by (e.g., ["mag", "phase"])allFiles - All BidsFile objects for extracting part entity valuesdatasetRoot - Root path for computing relative pathsCompare sequence values for sorting Attempts numeric comparison first by extracting numbers from entity values. For example, "echo-10" and "echo-2" will be compared as 10 and 2 (not alphabetically). Falls back to string comparison if values are not numeric.
a - First value to compareb - Second value to compareCollect the entities consumed internally by this set type across all configurations, normalized to their short form.
A consumed entity is one whose value varies across the files that are
merged into a single emitted item (for example a sequential set's
by_entity/by_entities, or a mixed set's
sequential_dimension). Such entities must be kept out of both the
grouping key and the emitted meta so files spanning that dimension collapse
into a single item and fuse with the other results instead of being split
into one item per value.
Set types without a sequenced dimension (plain and named sets) return an empty set, making this a no-op for them.
config - Full configuration mapFilter files by suffix
files - All BIDS filessuffix - Target suffixFind matching grouping pattern for given file Tries all candidate config keys for the file's suffix and returns the first one that passes all validation checks.
file - BIDS fileconfig - ConfigurationsuffixMapping - Suffix to config key mapping (inverted: configKey -> targetSuffix)Get available keys for required field validation For named sets: returns keys from subset.files (named groups like 'ap', 'pa') For sequential/plain sets: returns file types/extensions (like 'nii', 'json', 'bval') For mixed sets: returns both named groups and file types
subset - The set data structureallFiles - All files for this suffixGet sequence by entities from set config
file - BIDS filesetConfig - Set configurationGet sequence by entities from set config
setConfig - Set configurationGet set configuration from suffix config
suffixConfig - Configuration for specific suffixGet set index for a file based on set configuration
file - BIDS filesetConfig - Set configurationconfigKey - Configuration key (for suffix_maps_to support) Return the set-type key present in the suffix configuration map
(one of "plain_set", "named_set", "sequential_set",
"mixed_set"), or null if none is found.
suffixConfig - the per-suffix configuration map entrynullGroup a list of file paths by their part entity values Uses the basenameToFile lookup map to find properly parsed BidsFile objects. Groups files by their basename (excluding part entity) and creates part-grouped maps.
paths - List of relative file paths to grouppartsConfig - List of part values (e.g., ["mag", "phase"])basenameToFile - Map of basename to BidsFile objectsDetermine the entities used to group files for loop-over.
By default this is the full list of loop-over entities. Handlers whose
sets consume an entity internally (for example a mixed_set's
sequential_dimension) override this to remove those entities so that
files spanning the consumed dimension are collapsed into a single group and
fused with the other results.
config - Full configuration maploopOverEntities - Configured loop-over entitiesLog processing statistics
handlerName - Name of handlerprocessedCount - Files processedfilteredCount - Files filteredPack file into set structure
sets - Set structure to populateallFiles - Map of associated filesindex - Set index for the filefile - BIDS file to packordering - Ordering information for sequencingGet set name
Validate required files are present in group
files - File listrequiredCount - Minimum required files