Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
e34d3e1
Stage 1 Step 1: format-handler back-end framework
Lestropie Jun 11, 2026
f7cce85
Stage 1 Step 2: move Reader/Writer into formats/tck.{h,cpp}
Lestropie Jun 11, 2026
cf825a5
Stage 1 Step 3: move tck backend impl to tck.cpp via explicit instant…
Lestropie Jun 11, 2026
20b6d4d
Stage 1 Step 4: implement Tractogram accessor
Lestropie Jun 11, 2026
fb65aa3
trx: extract generic RAM write-back buffer (WriteBuffer)
Lestropie Jun 11, 2026
fc65411
trx: move the .tck RAM write buffer into WriteBuffer
Lestropie Jun 11, 2026
5b38d0d
trx: generalise WriteBuffer for cross-format reuse; reuse it in .tsf
Lestropie Jun 11, 2026
44f8040
tckconvert: route generic conversion through the Tractogram framework
Lestropie Jun 11, 2026
a4a4cf3
Stage 4: add .vtk legacy PolyData format handler (read+write, ASCII+b…
Lestropie Jun 11, 2026
2fb316d
Stage 4: remove bespoke .vtk handling from tckconvert; route via fram…
Lestropie Jun 11, 2026
7e40d17
Stage 5: Create write handler for tractography data in `.vtx format`.…
Lestropie Jun 11, 2026
921a722
Stage 5: Create read handler for tractography data in `.vtx` format. …
Lestropie Jun 11, 2026
5ba6ce6
Stage 5: De-duplicate code between the `.vtk` and `.vtx` tractography…
Lestropie Jun 11, 2026
a8144b0
Stage 6 step 1: optional Header on format-handler base class
Lestropie Jun 11, 2026
4647ee2
Stage 6 steps 2-3: interpret .tt format; write tt_parsed.md (out-of-r…
Lestropie Jun 11, 2026
593218c
Stage 7 step 2: implement DSI Studio .tt read & write handlers
Lestropie Jun 11, 2026
2038b30
Stage 7 step 3: buffer .tt track writes; add round-trip/coordinate/ne…
Lestropie Jun 11, 2026
bb0b8de
Stage 8 step 1: research Unix pipe internals for tractography pipe ha…
Lestropie Jun 11, 2026
8a839c4
Stage 8 step 2: decide pipe transport strategy (raw-binary-stream)
Lestropie Jun 11, 2026
f5226f6
Stage 9.1: Unix-pipe tractography read & write handlers
Lestropie Jun 11, 2026
37c4421
Stage 9.2: pipe error-path tests (broken pipe / premature close)
Lestropie Jun 11, 2026
9dcff93
Stage 9.3: reject random-access requests against streaming-only handlers
Lestropie Jun 11, 2026
b21185d
Stage 10 step 1: expand Streamline / introduce composite sidecar item
Lestropie Jun 11, 2026
ef569b5
Stage 10 step 2: Shared field-registry context for worker functors
Lestropie Jun 11, 2026
d25c74c
Stage 10 step 3: tckconvert carries the full TractogramItem sidecar
Lestropie Jun 11, 2026
7904868
Stage 10 step 4: pipe handler carries arbitrary sidecar data
Lestropie Jun 11, 2026
72c2fdf
Stage 11 steps 1-2: tractogram-sidecar CLI argument types
Lestropie Jun 11, 2026
44c031a
Stage 11 step 3: adopt tractogram-sidecar argument types on sidecar o…
Lestropie Jun 11, 2026
cda3281
Stage 11 step 4: parse the path::name tractogram-sidecar reference sy…
Lestropie Jun 11, 2026
427be43
Stage 11 step 5: inject standalone input-sidecar data per streamline
Lestropie Jun 11, 2026
e789f97
Stage 11 step 6: export processed sidecar data to standalone files
Lestropie Jun 11, 2026
b69a3c1
Stage 11 step 7: reject .tsf export under a random-access request
Lestropie Jun 11, 2026
20a8234
Stage 12 step 1: audit C++ commands that read/write tractography or s…
Lestropie Jun 11, 2026
20b055d
Stage 12 step 2: tckresample updates dpv to output vertices
Lestropie Jun 11, 2026
24e1d3a
Stage 12 step 3: tckedit/tcksift embedded streamline-selection dps field
Lestropie Jun 11, 2026
94710b3
Stage 12 step 4: tcksift2 opt-in embed weights via append capability
Lestropie Jun 11, 2026
4dd3d3f
Stage 12 step 5: tcktransform passes dpv and dps through unchanged
Lestropie Jun 11, 2026
571e2d9
Stage 12 step 6: connectome2tck carries dps/dpv/weights to sub-tracto…
Lestropie Jun 11, 2026
8871a8d
Stage 12 step 7: tcksample write-time per-vertex consistency check
Lestropie Jun 11, 2026
3b865bb
Stage 12 step 8: tckvalidate validates any format + dps/dpv field len…
Lestropie Jun 11, 2026
23b2780
Stage 13 (steps 1-2): VTK sidecar field mapping
Lestropie Jun 12, 2026
fe9ae17
Stage 13 (step 3): VTK write handler sidecar support
Lestropie Jun 12, 2026
d5f4ad4
Stage 13 (step 4): VTK read handler sidecar support
Lestropie Jun 12, 2026
4be42ef
Stage 14 step 2: byte-packed TrackVis .trk header struct
Lestropie Jun 12, 2026
f802c61
Stage 14 step 3: TrackVis .trk write handler
Lestropie Jun 12, 2026
f3720f2
Stage 14 step 4: TrackVis .trk read handler
Lestropie Jun 12, 2026
554e842
Stage 14 step 5: stamp COMMAND_STRING into the .trk header
Lestropie Jun 12, 2026
eacf2d4
Stage 14 step 6: .trk capability flags, registration and tests
Lestropie Jun 12, 2026
3858094
Stage 15.1: random-access RAM wrapper for streaming tractography formats
Lestropie Jun 12, 2026
2c25930
Stage 15.2: auto-select the RAM wrapper for streaming-only random access
Lestropie Jun 12, 2026
fe14728
Fix dangling field-registry reference in Tractogram open()/create()
Lestropie Jun 12, 2026
22c789d
TRX (steps 1-2): parse a TRX directory and summarise sidecar data
Lestropie Jun 12, 2026
be05f81
TRX (steps 3-5): archive sources and the initial read-only handler
Lestropie Jun 12, 2026
6ff7a94
TRX (steps 6-7): parse the JSON header and load vertex + sidecar data
Lestropie Jun 12, 2026
641328c
TRX (step 8): create_tempdir + signal-handler cleanup for compressed …
Lestropie Jun 12, 2026
ce3f966
TRX (step 9): de-duplicate user-specified external sidecar data
Lestropie Jun 12, 2026
bbfe802
TRX (step 10): write-only TRX handler sharing the read handler's util…
Lestropie Jun 12, 2026
67b8d5e
TRX (step 11): intuitive -force interaction for augmenting a TRX dataset
Lestropie Jun 12, 2026
a2102ac
TRX (step 12): consolidate read + write into a single TRX handler
Lestropie Jun 12, 2026
e6dbdbd
Stage 17 step 1: implement the Grouping streamline-grouping data stru…
Lestropie Jun 12, 2026
23b0fc1
Stage 17 steps 2-3: TRX groups/dpg read+write via the Grouping structure
Lestropie Jun 12, 2026
6f05f70
Stage 17 step 4: encode connectome grouping via Grouping; text format…
Lestropie Jun 12, 2026
e4e5f72
TCK format: read Float16 (half-precision) vertex data
Lestropie Jun 12, 2026
2527c4d
Docs: Add Float16 support to image and streamlines data
Lestropie Jun 12, 2026
6fe53e9
Add .zfib lossy streamline-compression format handler
Lestropie Jun 12, 2026
7742afd
Add qfib lossy tractography format handler
Lestropie Jun 12, 2026
1263f2c
Accept all tractography formats in type_tracks arguments
Lestropie Jun 12, 2026
5f98712
Broadcast and enforce tractography non-finite value tolerance
Lestropie Jun 13, 2026
f913372
Migrate C++ tractogram-export commands to the Tractogram class
Lestropie Jun 14, 2026
27841c1
Add DATASET::NAME sidecar export to tcksift2 and tcksample
Lestropie Jun 14, 2026
29e787c
Migrate tractography call sites from Reader<> to Tractogram
Lestropie Jun 15, 2026
c356a5a
Make usage of SIFT2 weights in refactored tractogram handling explicit
Lestropie Jun 15, 2026
46aef5f
Add arbitrary data field thresholding to tckedit
Lestropie Jun 15, 2026
f5d3e18
Migrate connectome2tck and other remaining to Tractogram
Lestropie Jun 16, 2026
7067e17
Support embedding sampled fixel values in tractogram datasets
Lestropie Jun 16, 2026
cc4fe3a
Remove classes MR::DWI::Tractography::(Reader|Writer)
Lestropie Jun 16, 2026
6924842
Refactor tractogram rendering with vertex classification and LOD buffers
Lestropie Jun 16, 2026
2694865
Refactor tractogram LOD calculation for FoV-awareness and geometry-speci
Lestropie Jun 17, 2026
6ce5d6b
Symmetrize vertex decimation gaps in tractogram LOD rendering
Lestropie Jun 17, 2026
78039f7
Expose vertex binary layout for GPU-accelerated tractography rendering
Lestropie Jun 18, 2026
afd78d7
Conform .qfib/.zfib/.tt handlers to reference-software formats
Lestropie Jun 21, 2026
d53977a
Add cmake support for external tractography format reference data
Lestropie Jun 21, 2026
0ed87b2
Add reference-data validation tests for tckconvert
Lestropie Jun 21, 2026
db506ea
Various esoteric tweaks to newly supported tractogram formats
Lestropie Jun 21, 2026
c9e9ce6
Normalize random_coord field names in gs_sidecar_trk test
Lestropie Jun 21, 2026
08400e4
Compact TRX offsets array to uint32 when vertex count permits
Lestropie Jun 21, 2026
0ec3513
tckconvert: replace explicit transform options with coordinate-space …
Lestropie Jun 21, 2026
d409282
Support naming a weight field of a piped tractogram via "::<field>"
Lestropie Jun 22, 2026
4c4dd12
Three tractography improvements outlined
Lestropie Jun 22, 2026
cddc7b7
Rename TractogramData{In,Out} argument types to TractogramSidecar{In,…
Lestropie Jun 22, 2026
34f25d9
Restrict tractogram-sidecar self-reference to the empty-DATASET form …
Lestropie Jun 22, 2026
dad558c
Reject "::<field>" sidecar self-reference unless the tractogram is un…
Lestropie Jun 22, 2026
391cd63
Auto-document the tractogram-sidecar reference syntax in command help
Lestropie Jun 22, 2026
df076f2
tckconvert: rename coordinate-space options for clarity
Lestropie Jun 22, 2026
84a6f6d
Five CLI argument renaming and validation tasks completed sequentially
Lestropie Jun 22, 2026
a79ae1a
Enable TRX directory output and add -reference_image option to tckconver
Lestropie Jun 22, 2026
7366319
Modulate mrview streamline thickness by tractogram sidecar data
Lestropie Jun 30, 2026
7cceb49
Document tractography formats and restructure data format docs
Lestropie Jul 1, 2026
0bf2c91
tckconvert: Add example usages to help page
Lestropie Sep 16, 2026
2e76746
Warn / error on tractogram / sidecar size mismatch
Lestropie Sep 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .claude

This file was deleted.

44 changes: 44 additions & 0 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,47 @@ else()
)
FetchContent_MakeAvailable(magic_enum)
endif()

# libzip — required by the TRX tractography format handler for reading and
# writing (un)compressed zip archives. A system install is mandatory: the build
# environment may be offline, so FetchContent is not used here; the system
# package (which itself pulls in zlib for the deflate codec) is located through
# its CMake config package where available.
#
# Some distributions ship a libzip CMake config package whose imported-target
# existence checks reference the libzip command-line tools (zipcmp/zipmerge/
# ziptool); when only the runtime library + headers are installed those checks
# raise a fatal error on include(). We therefore probe the config package only
# when the user opts in (MRTRIX_USE_SYSTEM_LIBZIP_CONFIG) and otherwise locate
# the shared library and headers directly (optionally via pkg-config),
# synthesising the libzip::zip target ourselves.
option(MRTRIX_USE_SYSTEM_LIBZIP_CONFIG "Use the system libzip CMake config package" OFF)
if(MRTRIX_USE_SYSTEM_LIBZIP_CONFIG)
find_package(libzip CONFIG REQUIRED)
endif()
if(NOT TARGET libzip::zip)
find_package(PkgConfig QUIET)
if(PkgConfig_FOUND)
pkg_check_modules(PC_LIBZIP QUIET libzip)
endif()
find_path(LIBZIP_INCLUDE_DIR
NAMES zip.h
HINTS ${PC_LIBZIP_INCLUDEDIR} ${PC_LIBZIP_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include
)
find_library(LIBZIP_LIBRARY
NAMES zip
HINTS ${PC_LIBZIP_LIBDIR} ${PC_LIBZIP_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /usr/lib/x86_64-linux-gnu
)
if(NOT LIBZIP_INCLUDE_DIR OR NOT LIBZIP_LIBRARY)
message(FATAL_ERROR
"Could not find libzip. Install the libzip development package "
"(headers + shared library) or its CMake config package.")
endif()
add_library(libzip::zip UNKNOWN IMPORTED)
set_target_properties(libzip::zip PROPERTIES
IMPORTED_LOCATION "${LIBZIP_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBZIP_INCLUDE_DIR}"
)
endif()
39 changes: 39 additions & 0 deletions cmake/DownloadFiles.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Script-mode helper that downloads a fixed subset of files from a common base URL.
#
# Intended to be invoked via "cmake -P" as the DOWNLOAD_COMMAND of an
# ExternalProject so that the files are fetched at build time (only when tests
# are built) rather than at configure time. Required variables, passed on the
# command line with -D:
# BASE_URL : URL prefix shared by every file (no trailing slash)
# FILES : "|"-separated list of file names to append to BASE_URL
# DEST_DIR : directory into which the files are written (created if absent)
#
# Each file is fetched only when not already present, so a partially-completed
# download step resumes cheaply on the next build without re-fetching whole files.

if(NOT DEFINED BASE_URL OR NOT DEFINED FILES OR NOT DEFINED DEST_DIR)
message(FATAL_ERROR "DownloadFiles.cmake requires BASE_URL, FILES and DEST_DIR")
endif()

file(MAKE_DIRECTORY ${DEST_DIR})

# FILES is delimited with "|" rather than the CMake list separator ";" so that it
# survives transit as a single command-line argument.
string(REPLACE "|" ";" file_list "${FILES}")

foreach(file_name IN LISTS file_list)
set(target "${DEST_DIR}/${file_name}")
if(EXISTS ${target})
continue()
endif()
set(url "${BASE_URL}/${file_name}")
message(STATUS "Downloading ${url}")
file(DOWNLOAD ${url} ${target} STATUS download_status)
list(GET download_status 0 download_code)
if(NOT download_code EQUAL 0)
list(GET download_status 1 download_message)
# Remove the truncated artefact so a re-run does not treat it as complete.
file(REMOVE ${target})
message(FATAL_ERROR "Failed to download ${url}: ${download_message}")
endif()
endforeach()
4 changes: 2 additions & 2 deletions cpp/cmd/afdconnectivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#include "command.h"
#include "dwi/fmls.h"
#include "dwi/tractography/SIFT/model_base.h"
#include "dwi/tractography/file.h"
#include "dwi/tractography/mapping/loader.h"
#include "dwi/tractography/mapping/mapper.h"
#include "dwi/tractography/mapping/mapping.h"
#include "dwi/tractography/properties.h"
#include "dwi/tractography/tractogram.h"
#include "memory.h"
#include "mrtrix_version.h"

Expand Down Expand Up @@ -166,7 +166,7 @@ class AFDConnectivity : public DWI::Tractography::SIFT::ModelBase<AFDConnFixel>
value_type AFDConnectivity::get(const std::filesystem::path &path) {

Tractography::Properties properties;
Tractography::Reader<value_type> reader(path, properties);
auto reader = Tractography::Tractogram<float>::open(path, properties);
const size_t track_count = (properties.find("count") == properties.end() ? 0 : to<size_t>(properties["count"]));
DWI::Tractography::Mapping::TrackLoader loader(reader, track_count, "summing apparent fibre density within track");

Expand Down
Loading