Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add symlink to Processing for ZDriftMetrics #5

Merged
merged 27 commits into from
Oct 6, 2023
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2130289
Add symlink to `ZDriftMetrics`
kushalbakshi Sep 26, 2023
175a7e6
Update attributes for ZDrift and Processing `make`
kushalbakshi Sep 26, 2023
14da7a5
Update attribute exceeds_threshold -> bad_frames
kushalbakshi Sep 27, 2023
a5a4e0e
Modify attribute comment
kushalbakshi Oct 2, 2023
83efb3a
Update table ProcessingParamSet -> ProcessingTask for output dir
kushalbakshi Oct 2, 2023
1b0b496
Update "params" -> "z_params"
kushalbakshi Oct 2, 2023
e63e639
Convert "output_dir" to path
kushalbakshi Oct 2, 2023
e88313c
Remove `unlink` step
kushalbakshi Oct 2, 2023
fdc7933
Use PathLike object for symlink, not list
kushalbakshi Oct 2, 2023
4fddefa
Check if symlink already exists
kushalbakshi Oct 2, 2023
9b105b0
Symlink using file not folder
kushalbakshi Oct 2, 2023
9162427
check for symlink, append links to `image_files`
kushalbakshi Oct 2, 2023
76056a8
Add `image_files` to else block
kushalbakshi Oct 2, 2023
d0e0104
Debug symlink
kushalbakshi Oct 3, 2023
225c663
Debug output_dir error
kushalbakshi Oct 3, 2023
2b51502
Debug symlink
kushalbakshi Oct 3, 2023
65623c2
Revert symlink to outbox
kushalbakshi Oct 3, 2023
472a4f4
Symlink into first directory of full path
kushalbakshi Oct 4, 2023
39a227b
Debug symlink
kushalbakshi Oct 4, 2023
b69f0e8
Specify path before saving
kushalbakshi Oct 4, 2023
7a11b00
Fix typo
kushalbakshi Oct 4, 2023
11577ec
Debug path error
kushalbakshi Oct 4, 2023
57f613a
Resolve path error in suite2p
kushalbakshi Oct 4, 2023
e126088
Add print statement for debugging
kushalbakshi Oct 4, 2023
41b1d45
Black formatting
kushalbakshi Oct 4, 2023
1aae2bb
Add error message for processing more than one set of bad frames
kushalbakshi Oct 5, 2023
3438f79
Updates from code review comments
kushalbakshi Oct 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions element_calcium_imaging/imaging_no_curation.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,13 @@ def make(self, key):
else:
raise NotImplementedError("Unknown method: {}".format(method))
elif task_mode == "trigger":
drop_frames = (ZDriftMetrics & key).fetch1("bad_frames")
if drop_frames.size > 0:
np.save(pathlib.Path(output_dir) / "bad_frames.npy", drop_frames)
drop_frames = (ZDriftMetrics & key).fetch("bad_frames")
if len(drop_frames) > 1:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simplify by doing try-catch around the fetch1() here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

raise dj.DataJointError(
"Processing more than 1 set of `bad_frames` per scan is not currently supported."
)
if drop_frames[0].size > 0:
np.save(pathlib.Path(output_dir) / "bad_frames.npy", drop_frames[0])
raw_image_files = (scan.ScanInfo.ScanFile & key).fetch("file_path")
files_to_link = [
find_full_path(get_imaging_root_data_dir(), raw_image_file)
Expand Down