Skip to content

Write registered movies as deflated HDF5 by default - #14

Merged
KasparP merged 3 commits into
devfrom
h5-movie-default
Nov 24, 2026
Merged

KasparP merged 3 commits into
devfrom
h5-movie-default

Conversation

@KasparP

@KasparP KasparP commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Registered movies are now written as deflated HDF5 by default. MultiRoiRegistrationParams.save_tif defaults to False, so register_multiroi writes E<epoch>T<trial>DMD<path>_REGISTERED_DOWNSAMPLED-80Hz.h5 with /data at deflate level 1 (movie_deflate), about 7x smaller than the BigTIFF. In the SLAP2 F0 GPU capsule, registration was limited by writing TIFF movies (GPU 3–6% busy, 53–137 GB of movies per session at 180 s; AllenNeuralDynamics/slap2-dev#57).

giant register gains --tif for MATLAB's BigTIFF. --h5 still works and now matches the default; the two are mutually exclusive.

Readers of the movie.

  • GIAnT-Python's raster localization (Raster SiLo localization (port of localizeSources_vIM), with optional detection changes for the network baseline #16) reads .h5 and .tif movies (load_registered_trial). A new test writes the same frames with the registration's MovieWriter in both formats and checks that they load identically.
  • GIAnT-MATLAB SILo reads .h5 movies when loading trials (loadAndProcessTrialAsync) and when sizing its worker pool (localizationTrialBytes).
  • GIAnT-MATLAB's getAnnotationImage used the movie's file size as a stand-in for trial length, which compression breaks. Since Choose the annotation trial by movie data, not file size GIAnT-MATLAB#55 (merged) it sizes .h5 movies by their dataset, so TIFF and HDF5 runs annotate on the same trial.
  • The integration-test capsule passes only its overrides to GIAnT-Python, so its Python arm will write HDF5 while the MATLAB arm writes TIFF, unless the run sets saveTif. saveTif is already a neutral parameter in its comparison.
  • The SLAP2 F0 network's predict-registered reads only TIFF. The GPU capsule fetches GIAnT-Python's slap2-trial-table branch, which does not include this change, so it keeps writing TIFF for now.

dev is merged in (9004673), including #16; the only conflicts were in test_cli.py and the fn_reg_ds row of file_formats.rst. Tests: all 116 pass (new ones cover the CLI flags and the HDF5/TIFF round trip through localization); black and flake8 are clean.

🤖 Generated with Claude Code

save_tif now defaults to False, so register_multiroi writes
E*_REGISTERED_DOWNSAMPLED-80Hz.h5 (deflate 1, about 7x smaller than
TIFF) unless asked for TIFF. GIAnT-MATLAB SILo reads both. giant
register gains --tif for MATLAB's BigTIFF; --h5 is kept and now
matches the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the change to default registered-movie output to HDF5.

No open issues 🎉

What changed in this PR

This PR makes deflate-compressed HDF5 the default output for registered movies, reducing storage and write overhead while retaining TIFF as an explicit option.

Changes:

  • Changes MultiRoiRegistrationParams.save_tif to default to False, using the existing HDF5 writer.
  • Adds giant register --tif and retains --h5, with the flags mutually exclusive.
  • Adds CLI format-selection tests and updates documentation for the new default.
File Description
tests/​registration/​test_cli.py Tests default HDF5 output, explicit format flags, and mutual exclusion.
src/​giant_python/​models/​params.py Defaults to HDF5 and updates parameter documentation.
src/​giant_python/​cli.py Adds --tif and passes the selected format to registration.
README.md Documents default compressed HDF5 output and the BigTIFF option.
docs/​source/​file_formats.rst Describes registered-movie filenames as either .tif or .h5.

Review effort: Balanced

KasparP and others added 2 commits November 24, 2026 09:07
# Conflicts:
#	docs/source/file_formats.rst
#	tests/registration/test_cli.py
Raster localization reads the registered movie that GIAnT-Python's
registration writes, now HDF5 by default. The new test writes the same
frames with MovieWriter in both formats and checks that
load_registered_trial returns them in MATLAB's rows and columns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the switch to compressed HDF5 as the default registered-movie format.

No open issues 🎉

Review effort: Balanced

@KasparP
KasparP merged commit c5d83dc into dev Nov 24, 2026
1 check passed
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.

2 participants