Skip to content

Commit

Permalink
Edited extraction.py
Browse files Browse the repository at this point in the history
  • Loading branch information
arielleleon committed Oct 24, 2024
1 parent 3921e22 commit 19156c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ def contour_video(
ops_path = str(next(Path(args.tmp_dir).rglob("ops.npy")))
# write output files
with (
h5py.File(output_dir / "extraction.h5", "w") as f
h5py.File(output_dir / f"{unique_id}_extraction.h5", "w") as f
):
# traces
f.create_dataset("traces/corrected", data=traces_corrected, compression="gzip")
Expand Down Expand Up @@ -856,16 +856,16 @@ def contour_video(
fontsize=min(24, 2.4 + 2 * x_size),
)
plt.tight_layout(pad=0.1)
plt.savefig(output_dir / "detected_ROIs.png", bbox_inches="tight", pad_inches=0.02)
plt.savefig(output_dir / f"{unique_id}_detected_ROIs.png", bbox_inches="tight", pad_inches=0.02)
for i in (0, 1, 2):
for k in range(rois.shape[0]):
ax[i].text(*cm[k], str(k), color="orange", fontsize=8*lw)
plt.savefig(output_dir / "detected_ROIs_withIDs.png", bbox_inches="tight", pad_inches=0.02)
plt.savefig(output_dir / f"{unique_id}_detected_ROIs_withIDs.png", bbox_inches="tight", pad_inches=0.02)

if args.contour_video:
with h5py.File(str(motion_corrected_fn), "r") as f:
contour_video(
output_dir / "ROI_contours_overlay.webm",
output_dir / f"{unique_id}_ROI_contours_overlay.webm",
f["data"],
rois,
traces_corrected,
Expand Down

0 comments on commit 19156c9

Please sign in to comment.