Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ENH Tractography::Writer: Add tractogram timestamp to weights file #1849
If a matrix / vector text file can contain arbitrary key-value entries in comment lines at the head of the file, there's no reason why the timestamp of the corresponding track file can't be written, and then on read compared to the open track file just as is done for TSFs. This has the chance of catching instances where the track file and weights file don't actually correspond to one another.
If there's no timestamp present it'd obviously need to be no higher than warning-level. Even mismatched timestamps are less consequential here: with TSF the requirements for exact per-vertex matching is much more strict so we reject anything that can't be verified, whereas here when it's only the number of streamlines that should ideally be matched the consequences are not so great.
I think it'd need to be no higher than warning-level even on an actual mismatch in this case, since e.g. you could run something like
Since the weights file is now loaded fully immediately using
As far as TSFs, we could downgrade from exception to warning in the absence of a timestamp if you'd prefer.