Unable to verify .tck/.tsf pair: missing timestamp

Hi experts!

Apologies if this has been answered previously in some form or another.

I’m attempting to visualize the streamlines from my tracts of interest that pass through significant fixels (per the results of my CFE analysis). I have previously generated .tsf files from all relevant .mif objects (fwe_pvalue.mif).

As part of my visualization process, I would like to colour my tracts by these scalar files, however, I am running into the following error message:

[ERROR] unable to verify .tck / .tsf pair: missing timestamp

Any help here would be greatly appreciated :slight_smile:


Hi Mervyn,

OK, we might be a bit too stringent on the checks here… Maybe these should be made warnings rather than outright failures. Can you run tckinfo and tsfinfo on your tck and tsf files respectively, and figure out which has a missing timestamp? The idea here was to ensure that tsf files can only be used with the tck files they were originally generated from. But if the tck is missing a timestamp, then these checks can’t take place. This could happen if your tck file (or the tsf file) was generated using an earlier version of the software that predates the implementation of these checks.

As to what you can do about it, I’m not sure. I know how I’d do it, but it’s fiddly and very prone to error, so I’m not sure I’d recommend it. The problem is we don’t have tools to fix the issue if you’re satisfied it should match. It would probably be simpler for us to make a failure of this nature a warning rather than a fatal error.

You can try this yourself if you have a source install (rather than a pre-compiled package). The trick is to edit the src/dwi/tractography/scalar_file.h file, and change the code around line 60 to read:

      inline void check_properties_match (const Properties& p_tck, const Properties& p_tsf, const std::string& type, bool     abort_on_fail = true)                                                                                                         
        try {                                                                                                                 
          check_timestamps (p_tck, p_tsf, type);                                                                              
        catch (Exception& e) {                                                                                                
          e.display (1);                                                                                                      
        check_counts (p_tck, p_tsf, type, abort_on_fail);                                                                     

That should still treat mismatches in the number of vertices between the two files as fatal, but only warn if it can’t verify the timestamps.

We’ll have to discuss amongst ourselves whether we want to propagate this kind of change to the main repo, or maybe modify tsfvalidate to optionally fix the timestamps, or some other way around the issue…