NaviNIBS.Navigator.Model.SubjectRegistration module¶
- class NaviNIBS.Navigator.Model.SubjectRegistration.Fiducial(key, plannedCoord=None, sampledCoords=None, sampledCoord=None, alignmentWeight=1.0)[source]¶
Bases:
GenericCollectionDictItem
[str
]- Parameters:
_key
_plannedCoord – Note that these (planned) coordinates are in MRI space.
_sampledCoords – Note that these (sampled) coordinates are in tracker space, not in MRI space. This is to not require modification when using other methods besides fiducials for defining tracker->MRI coordinate transform. Is of size Nx3, where N is the number of repeated samples of the same coordinate.
_sampledCoord – Is of size (3,). Can be used without sampledCoords to specify single sampled coordinate. Or can be used with sampledCoords to override the default sampledCoords->sampledCoord aggregation (a simple mean) with some other result (e.g. a trimmed mean) while still preserving all original samples. Note that this is cleared whenever sampledCoords is set, to avoid persisting an out-of-date aggregated sample.
_alignmentWeight – Can be used to specify a relative positive weight for how this fiducial will be incorporated into registration. For example, if the NAS fiducial is given weight 100, and the LPA and RPA fiducials have default weights of 1, then alignment will always very closely match measured NAS to planned NAS location, and allow larger deviations for LPA and RPA for the sake of closely matching NAS.
- _plannedCoord: tp.Optional[np.ndarray]¶
Note that these (planned) coordinates are in MRI space.
- _sampledCoords: tp.Optional[np.ndarray]¶
Note that these (sampled) coordinates are in tracker space, not in MRI space. This is to not require modification when using other methods besides fiducials for defining tracker->MRI coordinate transform.
Is of size Nx3, where N is the number of repeated samples of the same coordinate.
- _sampledCoord: tp.Optional[np.ndarray]¶
Is of size (3,).
Can be used without sampledCoords to specify single sampled coordinate. Or can be used with sampledCoords to override the default sampledCoords->sampledCoord aggregation (a simple mean) with some other result (e.g. a trimmed mean) while still preserving all original samples.
Note that this is cleared whenever sampledCoords is set, to avoid persisting an out-of-date aggregated sample.
- _alignmentWeight: float¶
Can be used to specify a relative positive weight for how this fiducial will be incorporated into registration.
For example, if the NAS fiducial is given weight 100, and the LPA and RPA fiducials have default weights of 1, then alignment will always very closely match measured NAS to planned NAS location, and allow larger deviations for LPA and RPA for the sake of closely matching NAS.
- property plannedCoord¶
- property sampledCoord¶
Always returns single vector coordinate of size (3,), or None if the fiducial has not been sampled. If multiple repeats of the same fiducial are sampled (in sampledCoords), and no separate sampledCoord has been set, this returns an average of the samples.
- property sampledCoords¶
- property alignmentWeight¶
- class NaviNIBS.Navigator.Model.SubjectRegistration.Fiducials(items=NOTHING)[source]¶
Bases:
GenericCollection
[str
,Fiducial
]- Parameters:
_items
- property plannedFiducials: dict[str, ndarray | None]¶
- Return type:
dict
[str
,Optional
[ndarray
]]
- property sampledFiducials: dict[str, ndarray | None]¶
Note that this returns a dict where each value is a sampledCoord (always None or shape (3,)), even if multiple samples exist for a given fiducial. For full access, use allSampledFiducials instead.
- Return type:
dict
[str
,Optional
[ndarray
]]
- property allSampledFiducials: dict[str, ndarray | None]¶
- Return type:
dict
[str
,Optional
[ndarray
]]
- property alignmentWeights: ndarray¶
- Return type:
ndarray
- class NaviNIBS.Navigator.Model.SubjectRegistration.HeadPoints(headPoints=NOTHING, alignmentWeights=None)[source]¶
Bases:
object
- Parameters:
_headPoints – Note that these are coordinates are in tracker space, not in MRI space.
_alignmentWeights – Optional weights used for headpoint-based registration refinement, in format expected by simpleicp’s rbp_observation_weights argument (i.e. rot_x, rot_y, rot_z, t_x, t_y, t_z). Can alternatively specify as a single scalar to apply the same weight to all terms, or as two scalars to apply the first weight to all rotation term, the second weights to all translation terms. Note that values will be inverted (weightArg = 1 / weight) so that higher input values correspond to greater weighting of head points, rather than greater weighting of fiducials. Note that these weights are different in definition and usage than Fiducial.alignmentWeight.
- _headPoints: list[ndarray]¶
Note that these are coordinates are in tracker space, not in MRI space.
- _alignmentWeights: ndarray | None¶
Optional weights used for headpoint-based registration refinement, in format expected by simpleicp’s rbp_observation_weights argument (i.e. rot_x, rot_y, rot_z, t_x, t_y, t_z). Can alternatively specify as a single scalar to apply the same weight to all terms, or as two scalars to apply the first weight to all rotation term, the second weights to all translation terms.
Note that values will be inverted (weightArg = 1 / weight) so that higher input values correspond to greater weighting of head points, rather than greater weighting of fiducials.
Note that these weights are different in definition and usage than Fiducial.alignmentWeight.
- sigHeadpointsAboutToChange: Signal¶
This signal includes list of indices of headpoints about to change.
- sigHeadpointsChanged: Signal¶
” This signal includes list of indices of headpoints that changed.
- sigAttribsAboutToChange: Signal¶
This signal includes keys and incoming values of attributes (besides main headPoints list) about to change.
- sigAttribsChanged: Signal¶
This signal includes keys of attributes (besides main headPoints list) that changed.
- property alignmentWeights¶
- class NaviNIBS.Navigator.Model.SubjectRegistration.SubjectRegistration(fiducials=NOTHING, sampledHeadPoints=NOTHING, trackerToMRITransf=None, fiducialsHistory=NOTHING, trackerToMRITransfHistory=NOTHING)[source]¶
Bases:
object
- Parameters:
_fiducials
_sampledHeadPoints
_trackerToMRITransf
_fiducialsHistory
_trackerToMRITransfHistory
- _sampledHeadPoints: HeadPoints¶
- _trackerToMRITransf: ndarray | None¶
- _trackerToMRITransfHistory: Dict[str, ndarray | None]¶
- sigTrackerToMRITransfAboutToChange: Signal¶
- sigTrackerToMRITransfChanged: Signal¶
- property fiducials¶
- property fiducialsHistory¶
Result should not be modified
- property hasMinimumPlannedFiducials: bool¶
- Return type:
bool
- property hasMinimumSampledFiducials: bool¶
- Return type:
bool
- property sampledHeadPoints: HeadPoints¶
- Return type:
- property trackerToMRITransf¶
- property trackerToMRITransfHistory¶
Result should not be modified
- property isRegistered¶
- property approxHeadCenter: ndarray | None¶
- Return type:
Optional
[ndarray
]