refactor: Unify pull and push mode architectures for standalone viewing #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This refactor eliminates duplicate T/FOV sliders when using load_dataset() (pull mode) by adopting a hybrid architecture:
Problem
When loading datasets via load_dataset(), NDV's ArrayViewer created its own sliders for the 6D array dimensions (time, fov, z, channel, y, x), while LightweightViewer also had custom T/FOV sliders - resulting in duplicate controls.
Solution: Hybrid Architecture
Key Changes
New Internal State
_pull_mode: Flag to track navigation mode (True = fast NDV navigation)_is_ome_format: Track dataset format for proper plane loading_ome_file_index: Map FOV indices to OME-TIFF filepaths_pixel_size_um,_dz_um: Scale metadata for 3D renderingNew Methods
_navigate_ndv(dim, value): Navigate NDV viewer without array rebuilds_hide_ndv_dimension_sliders(dims): Hide NDV's built-in time/fov sliders_insert_sliders_into_ndv_layout(): Position custom sliders adjacent to NDV's z-slider for cohesive visual grouping_on_ndv_ndims_requested(ndims): Re-hide sliders when 2D/3D toggle clicked_build_6d_lazy_array(): Build complete 6D dask array for pull mode_load_ome_plane(): Load planes from OME-TIFF format files_scan_ome_tiff_to_state(): Scan OME-TIFF datasetsModified Slider Handlers
_on_time_slider_changed: Check_pull_modeto either navigate NDV or rebuild array_on_fov_slider_changed: Same hybrid behaviorUI Improvements
Testing
Tested with 9 datasets covering single-TIFF and OME-TIFF formats: