dti_extractor
tit.pre.qsi.dti_extractor ¶
DTI tensor extraction for SimNIBS integration.
This module extracts DTI tensors from QSIRecon outputs and converts them to the format expected by SimNIBS for anisotropic conductivity simulations.
SimNIBS expects a 4D NIfTI file with the diffusion tensor stored as a 6-component upper triangular representation: [Dxx, Dxy, Dxz, Dyy, Dyz, Dzz].
The tensor must be coregistered to the SimNIBS T1 space.
extract_dti_tensor ¶
extract_dti_tensor(project_dir: str, subject_id: str, *, logger: Logger, source: str = 'qsirecon', skip_registration: bool = False) -> Path
Extract DTI tensor from QSIRecon output for SimNIBS.
This function finds the DTI tensor in QSIRecon outputs, converts it to SimNIBS format, and saves it to the m2m directory.
Parameters¶
project_dir : str Path to the BIDS project root directory. subject_id : str Subject identifier (without 'sub-' prefix). logger : logging.Logger Logger for status messages. source : str, optional Source of DTI tensor. Currently only 'qsirecon' is supported. Default: 'qsirecon'. skip_registration : bool, optional If True, skip registration to SimNIBS T1 space. Use this if the tensor is already in the correct space. Default: False.
Returns¶
Path Path to the extracted DTI tensor file in m2m directory.
Raises¶
PreprocessError If tensor extraction fails.
Source code in tit/pre/qsi/dti_extractor.py
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 | |
check_dti_tensor_exists ¶
Check if a DTI tensor file exists for a subject.
Parameters¶
project_dir : str Path to the project directory. subject_id : str Subject identifier.
Returns¶
bool True if the DTI tensor file exists in the m2m directory.