NaviNIBS.Navigator.GUI.ViewPanels.SubjectRegistrationPanel module

Bases: MainViewPanel

SubjectRegistrationPanel

Note: need to carefully manage sequencing / interaction between fiducials and head points. Example scenario: 1. Plan fiducials 2. Sample planned fiducials 3. Align fiducials 4. Sample head points 5. Refine alignment with head points 6. Convert sampled fiducials to planned 7. Create another fiducial from pointer position (e.g. head ref) Some time later, tracker moves and we must reregister: 8. Re-sample (sampled-converted-to-planned) fiducials and head ref 9. Align fiducials 10. Don’t resample head points, but expect them to update their alignment This last point is what requires careful attention in sequencing. Head points are defined in tracker space. If the tracker moves, the old points are no longer valid (but we may want to update them for the new alignment for display purposes).

Another example scenario, not using sample->planned fiducial conversion: 1. Plan fiducials 2. Sample planned fiducials 3. Align fiducials 4. Sample head points 5. Refine alignment with head points Some time later, tracker moves and we must reregister: 8. Re-sample planned fiducials 9. Align fiducials 10. Don’t resample head points, but expect them to update their alignment(?)

But also must allow this scenario: 1. Plan fiducials 2. Sample planned fiducials 3. Align fiducials 4. Sample head points 5. Refine alignment with head points 6. Align to fiducials again to “undo” head point refinement 7. Change a refinement setting (e.g. weight) and refine again, without needing to resample head points

Less common scenario that would also be nice to support: 1. Plan fiducials 2. Sample planned fiducials 3. Align fiducials 4. Sample head points 5. Refine alignment with head points 6. Edit a planned fiducial to make it align better with reality. 7. Align fiducials. 8. Refine alignment with head points, without needing to resample.

So, if re-aligning to fiducials but sampled fiducials haven’t actually changed, we should assume that tracker position hasn’t changed, and so head points don’t need to be adjusted.

But if fiducials have changed, and then we re-align to those fiducials, then we should assume

that the tracker position did change. If we do nothing, head points will then be incorrect/nonnsensical. We must either convert head points into the new tracker space, or delete them.

To convert head points into new tracker space, can we assume that previous tracker to MRI transform was “correct”, and go through that?

TODO: maybe use fiducial history or add a “last edited” timestamp to fiducial fields and head points to not be responsible for tracking this sequencing here.

Parameters:
  • _session

  • _label

  • _iconFn

  • _key

  • _surfKey

Should return (True, None) if panel can be enabled, and (False, ‘<Reason why cannot be enabled>’) otherwise. The second output in the latter case should be a string explaining why the panel cannot be enabled, e.g. ‘Registration must be completed before navigating’

Return type:

tuple[bool, Optional[str]]