Skip to content

Conversation

@AdvancedImagingUTSW
Copy link
Collaborator

This change fixes BDV metadata so per‑view stage rotation (theta) is encoded as a true rotation about the volume center instead of the first voxel. The BDV affine now explicitly applies the required translation offset (t' = t + c − R·c), ensuring rotations are centered on the volume in voxel coordinates. Tile IDs are still derived from translation only, so angle changes don’t create new tiles. A small unit test was added to validate tile/angle mapping in the generated XML.

Enable handling of the rotation (theta) axis in the tiling wizard and harden defaults.

- configuration_controller: use .get for stage config and provide sane default step sizes to avoid KeyError.
- channels_tab: include theta in the axes passed to the tiling wizard.
- tiling: initialize validated axes dynamically, include theta in axes, pull default theta FOV from stage_step, treat theta overlap as 0 when computing tiles, and skip irrelevant UI branches for theta. Also adjust how theta start/tiles/length are set based on presence in axes.
- multipos_table_tools: compute_tiles no longer applies fractional overlap to theta (theta_step = theta_length).
- tiling_wizard_popup2: UI shows Greek theta symbol for theta rows and uses "Step" label for theta FOV.

These changes allow tiling operations to include rotation properly, avoid crashes from missing config keys, and present clearer UI labels for the theta axis.
Introduce _derive_tile_angle_maps to extract and deduplicate tile positions and angle values from view metadata, returning tile_ids, angle_ids, angle_values, and tile_count. Use these mappings in bdv_xml_dict to assign per-ViewSetup tile and angle attributes, populate the Tile and Angle Attributes lists, and ensure correct counts. Update stage_positions_to_affine_matrix to apply theta as a rotation about the stage y-axis (degrees -> radians) mapped to BDV axes. Add a unit test verifying tile/angle id mapping and attribute population. Also make minor adjustments to bdv_xml_dict structure to support the new Angle list format.
Add _stage_translation_pixels helper to compute stage translations in pixels (BDV order [Y, X, Z]) and handle optional coupled axes (with a warning for unrecognized leaders). Replace duplicated inline translation logic with calls to this helper when deriving tile keys and building affine matrices. Also adjust affine matrix translation to rotate about the volume center by applying center - rot.dot(center), ensuring correct pivot for rotations.
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.

1 participant