Original code expected one "counts:" field in a mrtrix .tck header. This is problematic when using the mrtrix command cat_tracks to combine .tcks, which appends an additional "counts:" field to the end of the .tck header. Change is to just grab the max index and passing that through.
"Change is to just grab the max index and passing that through." to clarify this max is the total number of fibers in the file? That what we need here, right?
Original code expected one "counts:" field in a mrtrix .tck header. This is problematic when using the mrtrix command cat_tracks to combine .tcks, which appends an additional "counts:" field to the end of the .tck header. Change is to just grab the max index and passing that through.