Closed marcelzwiers closed 1 year ago
Implementation of <<<*>>>
makes most sense and is very easy -- all that is needed is this:
def dynamicvalue(self, value, cleanup: bool=True, runtime: bool=False):
"""
[...]
"""
# Input checks
if not value or not isinstance(value, str) or not self.path.name or ('<<<' in value and '>>>' in value):
return value
Together with adding post-dynamic value renaming code to: bids.increment_runindex(outfolder, newbidsname, sidecarname, ..)
But I'm dropping this idea after all because the sidecar value from dcm2niix ({"PhaseEncodingDirection": "j-"}
) contains BIDS-invalid +
/-
signs and therefore cannot be used in the filename *_dir-sidecarvalue_
Is your feature request related to a problem? Please describe. The DICOM header does not directly store the phase encoding direction op EPI image to populate the
dir-AP/PA
ordir-LR/RL
key-value pairs.Describe the solution you'd like Dcm2niix retrieves the dir information indirectly and stores it as
PhaseEncodingDirection: j/j-
andPhaseEncodingDirection: k/k-
respectively (for axial acquisitions at least). So BIDScoin could retrospectively use that info to dynamically updatedir: <<PhaseEncodingDirection>>
This could perhaps become a generic feature, e.g. of the form
dir: <<sidecar:PhaseEncodingDirection>>
ordir: <<<PhaseEncodingDirection>>>