Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the user guide for the big picture.
3.1.1. fmralign.alignment.pairwise_alignment.PairwiseAlignment¶
- class fmralign.alignment.pairwise_alignment.PairwiseAlignment(method='identity', labels=None, n_jobs=1, verbose=0)[source]¶
Performs pairwise alignment between two subjects.
This class performs source-to-target alignment of two subjects’ data. It supports various alignment methods and can process data in parallel.
- Parameters:
- methodstr or a BaseAlignment instance, default=”identity”
The alignment method to use. It can be a string representing the method name or an instance of a class derived from BaseAlignment. Available methods include: [“identity”, “procrustes”, “ot”, “sparseuot”, “ridge”].
- labelsarray-like or None, default=None
Describes each voxel label’s in the case of non-overlapping parcels. If provided, local alignments can be performed in parallel. If None, global alignment is performed across all features.
- n_jobsint, default=1
Number of parallel jobs to run. -1 means using all processors.
- verboseint, default=0
Verbosity level. Higher values provide more detailed output.
- Attributes:
- labels_array-like
Validated labels used during fitting.
- method_str
Validated alignment method used during fitting.
- fitted_estimatorBaseAlignment object
List of fitted alignment estimators, one per subject.
Examples
>>> from fmralign import PairwiseAlignment >>> X = np.random.rand(10, 5) >>> Y = np.random.rand(10, 5) >>> test_data = np.random.rand(8, 5) >>> aligner = PairwiseAlignment(method="procrustes") >>> aligner.fit(X, Y) >>> aligned_data = aligner.transform(test_data)