Open dchristiaens opened 8 years ago
Good point. One possibility, although not perfect, is to use cat values.txt | tr ' ' '\n' > values_as_column.txt
to force all the values out as a single column vector, which can then be used with testing_diff_matrix
. You can also check that the number of lines & words in the output matches with cat values.txt | wc -l -w
. If anything breaks, the chances of it not affecting these tests should be pretty low...
Other option of course, is to modify testing_diff_matrix
to actually allow non-matching row sizes, in which case it's not really testing matrices of course... This would require slightly different handling, as we couldn't rely on the MRtrix matrix loading functionality.
Smart to put them all in one vector. I thought about iterating through all lines of both files and running testing_diff_matrix
on each of them, but it's a bit tricky to get in on a single line for the test script to recognise it.
Modifying the testing_diff_matrix
is neat. We could include an option -check_dims
to enforce a separate check on the dimensions when providing a matrix. (Or perhaps the other way around to make matrices the default).
I'm thinking modifying testing_diff_matrix
is probably the simplest and cleanest option. We don't need to add a check for dimensions, since the test would trivially fail if the ground truth file is itself a matrix...
I'm looking for a way to compare tcksample outputs. Unix
diff
for text files can't deal with small numeric errors. Our owntesting_diff_matrix
requires matching row lengths, and therefore won't work either...