From f9cead6b75563bae8df5edd5bc27ff3bb5256c39 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Mon, 22 Jan 2024 06:14:42 -0500 Subject: [PATCH] TRK voxel center: Order of matrix multiply matters --- README.md | 2 +- streamlineIO.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2a9a002..d1b1776 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ There are several important considerations regarding supporting the TRX format w The included JavaScript `bench` provides a method to evaluate performance. This benchmark is likely specific to JavaScript and so caution should be excercised in evaluating relative performance. The script will report the time to load a TRK, TCK, VTK or TRX file 10 times (it loads the tracts 11 times, and ignores the first run). -The graph below shows the time load the [left inferior fronto-occipital fasciculus (IFOF) ](https://brain.labsolver.org/hcp_trk_atlas.html) from the HCP1065 Population-Averaged Tractography Atlas (Yeh, 2022). This has with 21209 streamlines and 4915166 vertices. The different formats are generated with the [tff_convert_tractogram.py](https://github.com/tee-ar-ex/trx-python) script.The benchmark was run on a MacBook laptop with a M2 Pro CPU. The ideal format would be both fast to load (to the left on the horizontal axis) and have a small file size (toward the bottom in the right axis). However, compression typically trades load time for file size. Here all data is loaded from a local solid state drive, whereas smaller files would benefit if data was loaded using a slow internet connection. The following file formats are illustrated (except where noted, both positions and indices are stored with 32-bit precision): +The graph below shows the time load the [left inferior fronto-occipital fasciculus (IFOF) ](https://brain.labsolver.org/hcp_trk_atlas.html) from the HCP1065 Population-Averaged Tractography Atlas (Yeh, 2022). This has with 21209 streamlines and 4915166 vertices. The different formats are generated with the [tff_convert_tractogram.py](https://github.com/tee-ar-ex/trx-python) script. The benchmark was run on a MacBook laptop with a M2 Pro CPU. The ideal format would be both fast to load (to the left on the horizontal axis) and have a small file size (toward the bottom in the right axis). However, compression typically trades load time for file size. Here all data is loaded from a local solid state drive, whereas smaller files would benefit if data was loaded using a slow internet connection. The following file formats are illustrated (except where noted, both positions and indices are stored with 32-bit precision): - tt: The [DSI Studio format](https://dsi-studio.labsolver.org/doc/cli_data.html) is very compact. The vertex position is stored as 1/32nd of a voxel, so it may be slightly lossy for some data. - tt.gz: Gzip compressed DSI-Studio. diff --git a/streamlineIO.mjs b/streamlineIO.mjs index 76df16c..894311d 100644 --- a/streamlineIO.mjs +++ b/streamlineIO.mjs @@ -246,7 +246,7 @@ function readTRK(buffer) { mat4.identity(mat); } let vox2mmMat = mat4.create(); - mat4.mul(vox2mmMat, mat, zoomMat); + mat4.mul(vox2mmMat, zoomMat, mat); let i32 = null; let f32 = null; i32 = new Int32Array(buffer.slice(hdr_sz));