@groovy.transform.CompileStatic class SuffixMapper extends java.lang.Object
Resolves suffix_maps_to aliases in the bids2nf.yaml configuration.
When a configuration key (virtual suffix) differs from the actual BIDS file suffix
it selects (e.g. dwi_fullreverse → actual suffix "dwi"), this class
builds a lookup map used by the set handlers to match files to their configuration
entry.
Example configuration:
dwi_fullreverse: suffix_maps_to: "dwi" named_set: ...
| Constructor and description |
|---|
SuffixMapper() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static java.lang.String |
getOutputSuffix(java.lang.String configKey, java.util.Map configValue)Get the actual suffix that should be used in output |
|
static java.lang.String |
getTargetSuffix(java.lang.String setType, java.lang.String configKey, java.util.Map<java.lang.String, java.util.Map<java.lang.String, java.lang.String>> mapping)Get target suffix from inverted mapping for a config key |
|
static java.util.List<java.lang.String> |
resolveConfigKeys(java.lang.String setType, java.lang.String suffix, java.util.Map<java.lang.String, java.util.Map<java.lang.String, java.lang.String>> mapping)Resolve configuration key for a given file suffix |
|
static java.util.Map<java.lang.String, java.util.Map<java.lang.String, java.lang.String>> |
suffixMapping(java.util.Map config)Build suffix mapping from configuration |
| 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() |
Get the actual suffix that should be used in output For configurations with suffix_maps_to, this returns the target suffix rather than the configuration key.
configKey - Configuration key (may be like "dwi_fullreverse")configValue - Configuration value mapGet target suffix from inverted mapping for a config key
setType - Type of set (e.g., "plain_set", "named_set")configKey - Configuration keymapping - Suffix mapping from suffixMapping() (configKey -> targetSuffix)Resolve configuration key for a given file suffix Searches through the inverted suffix mapping (configKey -> targetSuffix) to find which config key(s) map to the given suffix.
setType - Type of set (e.g., "plain_set", "named_set")suffix - File suffix from BIDS filemapping - Suffix mapping from suffixMapping() (configKey -> targetSuffix)Build suffix mapping from configuration Scans all configuration entries for suffix_maps_to field and creates a mapping of config key -> file suffix (inverted for collision-free lookups)
config - Full configuration map