def test_05_not_latest_alignments_agree(self): alignments = copy.deepcopy(self.alignments) trajectory = copy.deepcopy(self.trajectory) trajectory.update({'json': alignments}) traj = one.alyx.rest('trajectories', 'update', id=self.prev_traj_id, data=trajectory) assert (self.prev_traj_id == traj['id']) align_qc = AlignmentQC(self.probe_id, one=one, brain_atlas=brain_atlas, channels=False) align_qc.load_data(prev_alignments=traj['json'], xyz_picks=np.array(self.xyz_picks) / 1e6, cluster_chns=self.cluster_chns) align_qc.resolved = 0 align_qc.run(update=True, upload_alyx=True, upload_flatiron=False) insertion = one.alyx.rest('insertions', 'read', id=self.probe_id) assert (insertion['json']['qc'] == 'NOT_SET') assert (insertion['json']['extended_qc']['alignment_count'] == 4) assert (insertion['json']['extended_qc']['alignment_stored'] == '2020-06-19T10:52:36_noam.roth') assert (insertion['json']['extended_qc']['alignment_resolved'] == 1) assert ( insertion['json']['extended_qc']['alignment_resolved_by'] == 'qc') assert (insertion['json']['extended_qc']['alignment_qc'] > 0.8) assert (np.isclose(insertion['json']['extended_qc']['alignment_qc'], 0.952319)) traj = one.alyx.rest('trajectories', 'list', probe_id=self.probe_id, provenance='Ephys aligned histology track') assert (self.prev_traj_id != traj[0]['id'])
def _05_not_latest_alignments_agree(self): alignments = copy.deepcopy(self.alignments) trajectory = copy.deepcopy(self.trajectory) trajectory.update({'json': alignments}) traj = one.alyx.rest('trajectories', 'update', id=self.prev_traj_id, data=trajectory) self.assertEqual(self.prev_traj_id, traj['id']) align_qc = AlignmentQC(self.probe_id, one=one, brain_atlas=brain_atlas, channels=False) align_qc.load_data(prev_alignments=traj['json'], xyz_picks=np.array(self.xyz_picks) / 1e6, cluster_chns=self.cluster_chns, depths=SITES_COORDINATES[:, 1], chn_coords=SITES_COORDINATES) align_qc.resolved = 0 align_qc.run(update=True, upload_alyx=True, upload_flatiron=False) _verify(self, alignment_resolved='qc', alignment_qc=0.952319, alignment_count=4, alignment_stored='2020-06-19T10:52:36_noam.roth', trajectory_created=True)