Skip to content

Add session_builder lib#94

Merged
PaulHax merged 15 commits intomainfrom
make-session
Dec 4, 2025
Merged

Add session_builder lib#94
PaulHax merged 15 commits intomainfrom
make-session

Conversation

@PaulHax
Copy link
Copy Markdown
Collaborator

@PaulHax PaulHax commented Dec 2, 2025

Add a Python session builder library for programmatically generating VolView sessions with annotations and segment groups. Sessions are output as .volview.json files with URI-referenced data.

  • session_builder/session_builder.py - Core library with high-level generate_session() and composable API (create_manifest(), add_dataset(), add_annotation(), add_segment_group())
  • Support for rectangle, ruler, and polygon annotations
  • Support for segment groups (labelmaps) with named segments
  • Five example scripts demonstrating different workflows (item, folder, composable API, ITK analysis, TotalSegmentator)
  • Documentation in session_builder/README.md

Supporting changes:

  • Add support for .volview.json session files alongside .volview.zip
  • Update Girder plugin UI to recognize and open JSON session files

Depends on Kitware/VolView#827

…tions

- volview_session.py: Standalone module to create session.volview.zip files
  with rectangle, ruler, and polygon annotations
- Examples for item and folder session generation
- Supports DICOM series (uses last source ID for merged volumes)
- Add collection source that groups all URI sources
- Create named dataset ("volume") referencing the collection
- Annotations reference dataset ID instead of guessing source index
- ITK example now supports both items and DICOM folders
- Use imageID (matching VolView schema) instead of imageId
- Add "How It Works" section to README explaining data source → collection → dataset pattern
- Expand create_sparse_manifest docstring
Labelmaps are now uploaded separately and referenced by URL instead of
being embedded in zip files. Session output changed from .volview.zip
to .volview.json since all data is URI-referenced.
- Add create_manifest(), add_dataset(), add_annotation(), add_labelmap()
- Each function returns new manifest copy (immutable/functional style)
- Consistent dataset_id parameter across add_annotation and add_labelmap
- Remove create_sparse_manifest() in favor of composable functions
- Add composable_example.py demonstrating the builder pattern
- Clean up verbose logging (remove bytes size from output)
@PaulHax PaulHax changed the title Make session Make session python code Dec 3, 2025
@PaulHax PaulHax changed the title Make session python code Make session.volview.json python code Dec 3, 2025
@PaulHax PaulHax changed the title Make session.volview.json python code Add session_builder lib Dec 4, 2025
@PaulHax PaulHax merged commit dcb2dd1 into main Dec 4, 2025
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.

1 participant