Skip to content

Commit

Permalink
mpciROIs.uuids
Browse files Browse the repository at this point in the history
  • Loading branch information
k1o0 committed Oct 13, 2023
1 parent 2803838 commit 7c807b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions brainbox/behavior/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ class TrainingStatus(IntFlag):
... assert TrainingStatus[status.upper()] in ~TrainingStatus.FAILED, 'Subject untrained'
... assert TrainingStatus[status.upper()] in TrainingStatus.TRAINED ^ TrainingStatus.READY
# Get the next training status
Get the next training status
>>> next(member for member in sorted(TrainingStatus) if member > TrainingStatus[status.upper()])
<TrainingStatus.READY4RECORDING: 128>
Notes
-----
- ~TrainingStatus.TRAINED means any status but trained 1a or trained 1b.
- A subject may acheive both TRAINED_1A and TRAINED_1B within a single session, therefore it
is possible to have skipped the TRAINED_1A session status.
is possible to have skipped the TRAINED_1A session status.
"""
UNTRAINABLE = auto()
UNBIASABLE = auto()
Expand Down
6 changes: 6 additions & 0 deletions ibllib/pipes/mesoscope_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def signature(self):
('mpciROIs.stackPos.npy', 'alf/FOV*', True),
('mpciROIs.mpciROITypes.npy', 'alf/FOV*', True),
('mpciROIs.cellClassifier.npy', 'alf/FOV*', True),
('mpciROIs.uuids.csv', 'alf/FOV*', True),
('mpciROITypes.names.tsv', 'alf/FOV*', True),
('mpciROIs.masks.npy', 'alf/FOV*', True),
('mpciROIs.neuropilMasks.npy', 'alf/FOV*', True),
Expand Down Expand Up @@ -328,6 +329,11 @@ def _rename_outputs(self, suite2p_dir, frameQC_names, frameQC, rename_dict=None)
np.save(fov_dir.joinpath('mpciROIs.stackPos.npy'), np.asarray([(*s['med'], 0) for s in stat], dtype=int))
np.save(fov_dir.joinpath('mpciROIs.cellClassifier.npy'), np.asarray(iscell[:, 1], dtype=float))
np.save(fov_dir.joinpath('mpciROIs.mpciROITypes.npy'), np.asarray(iscell[:, 0], dtype=np.int16))
# clusters uuids
uuid_list = ['uuids'] + list(map(str, [uuid.uuid4() for _ in range(len(iscell))]))
with open(fov_dir.joinpath('mpciROIs.uuids.csv'), 'w+') as fid:
fid.write('\n'.join(uuid_list))

pd.DataFrame([(0, 'no cell'), (1, 'cell')], columns=['roi_values', 'roi_labels']
).to_csv(fov_dir.joinpath('mpciROITypes.names.tsv'), sep='\t', index=False)
# ROI and neuropil masks
Expand Down

0 comments on commit 7c807b6

Please sign in to comment.