dti_extractor
tit.pre.qsi.dti_extractor ¶
DTI tensor extraction for SimNIBS integration.
Extracts DTI tensors from QSIRecon DSI Studio GQI output, registers them
to the SimNIBS T1 grid, and pre-compensates for SimNIBS's correct_FSL
so that world-space conductivity tensors are correct.
SimNIBS expects DTI_coregT1_tensor.nii.gz — a 4D NIfTI (X, Y, Z, 6)
in FSL upper-triangular order: [Dxx, Dxy, Dxz, Dyy, Dyz, Dzz].
QSIRecon DSI Studio GQI output (BIDS-compliant): derivatives/qsirecon/derivatives/qsirecon-DSIStudio/sub-{id}/dwi/ sub-{id}_space-ACPC_model-tensor_param-{txx,...,tzz}_dwimap.nii.gz
extract_dti_tensor ¶
extract_dti_tensor(project_dir: str, subject_id: str, *, logger: Logger, skip_registration: bool = False) -> Path
Extract and register a DTI tensor from QSIRecon DSI Studio output.
Loads the six tensor components produced by DSI Studio GQI,
validates them, registers the tensor to the SimNIBS T1 grid
(with FSL-convention pre-compensation), saves
DTI_coregT1_tensor.nii.gz into the m2m directory, and
generates a QC report.
Parameters¶
project_dir : str
BIDS project root directory.
subject_id : str
Subject identifier (e.g. '070').
logger : logging.Logger
Logger instance for progress and diagnostic messages.
skip_registration : bool, optional
When True, copy the tensor as-is without resampling or
reorientation. Default is False.
Returns¶
pathlib.Path
Path to the saved DTI_coregT1_tensor.nii.gz.
Raises¶
tit.pre.utils.PreprocessError If required inputs are missing, the tensor already exists, or the tensor data is invalid.
Source code in tit/pre/qsi/dti_extractor.py
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | |
check_dti_tensor_exists ¶
Check whether a registered DTI tensor already exists for subject_id.
Parameters¶
project_dir : str BIDS project root directory. subject_id : str Subject identifier.
Returns¶
bool
True if DTI_coregT1_tensor.nii.gz is present in the m2m
directory.