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

5 merge paired plane registration into this capsule #8

Closed

Conversation

arielleleon
Copy link
Collaborator

@jkim0731

  • Adding paired plane registration to the decrosstalk capsule
  • transform_and_save fx pulled form brain_observatory_qc and modified to cache and save paired plane movie to temporary directory (scratch)

@arielleleon arielleleon requested a review from jkim0731 November 19, 2023 19:29
@arielleleon arielleleon linked an issue Nov 19, 2023 that may be closed by this pull request
code/run_capsule.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@jkim0731 jkim0731 left a comment

Choose a reason for hiding this comment

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

Left comments

code/paired_plane_registration.py Outdated Show resolved Hide resolved
@@ -195,16 +202,18 @@ def paired_plane_cached_movie(h5_file: Path,
assert len(data_length) == len(y_shifts) == len(x_shifts)
if run_nonrigid:
assert len(data_length) == ymax1.shape[0] == xmax1.shape[0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

this line can go up after L192

code/paired_plane_registration.py Outdated Show resolved Hide resolved
f.create_dataset('data', data=r_frames)
if i == 0:
with h5py.File(temp_path, 'w') as f:
f.create_dataset('data', (data_length, 512, 512), maxshape=(chunk_size, 512, 512), chunk=(1000, 512, 512))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is better this way to fix data shape before saving the data, so that we don't need to check later.

I think the first chunk is not saved. (maybe just need to remove else: in L228?
Hardcoding 512 x 512 is not safe- let's use data shape (from registered.h5 file).
Is chunks (not chunk i guess..?) (1000, 512, 512) arbitrary, or is it because of emf? for EMF we'll access evenly distributed 1000 epochs so having 1000 chunks.shape[0] may not be efficient.

oeid_pj = list(input_dir.glob(f"{oeid}_processing.json"))[0]
with open(oeid_pj, "r") as f:
pj = json.load(f)
if "nonrigid" in pj["data_processes"][0]["parameters"]["nonrigid"]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you check if 'nonrigid' is recorded as 'nonrigid'/'rigid' or 'True'/'False'?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jkim0731 I did check and this is directly from the output parameters from suite2p

code/run_capsule.py Outdated Show resolved Hide resolved
code/run_capsule.py Outdated Show resolved Hide resolved
@arielleleon
Copy link
Collaborator Author

****Closing to merge into development branch

@arielleleon arielleleon deleted the 5-merge-paired-plane-registration-into-this-capsule branch November 21, 2023 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merge paired plane registration into this capsule
2 participants