Add ColorBlending module for multi-image blending support - #161
Conversation
… subsetting and alpha preservation
…iterative probing
…om_imageview_id class method
…olor blending objects
…ology and usage patterns
…or coordinate system and number format methods
…lorBlending initialization
… for consistency with naming conventions
…ColorBlending and Layer method docstrings
…ces for consistency with documentation style
…of setActiveFrameById
…ayer_index before image for consistency
…ge_class registry method for dynamic image-view wrapper instantiation
…or blending alert when making image spatial reference
…le base layer deletion by promoting next layer or closing color blending
…tribute instead of manual length checking
… handle base layer by making it the spatial reference
…age lists with optional ID filtering
… with Session.images method
…ding spec.kwonlyargs in parameter name extraction
…et_layer_image, and Session.image_by_id methods with corresponding test coverage
confluence
left a comment
There was a problem hiding this comment.
I'm happy with these changes; I have a few more minor suggestions and a question.
…lending classes instead of using ImageBase.image_class factory method
…out codebase, refactor ImageBase to View class, and update related documentation and method names for consistency
…ds parameter to layers method for selective layer retrieval with validation
…images and include corresponding test coverage
…ow explicit image selection and layer ordering, with validation for duplicates and session membership
confluence
left a comment
There was a problem hiding this comment.
One more issue with fetching lists -- this is the last thing; everything else looks good!
…ntend state queries, add validation for out-of-range and closed view indices, and improve error handling for unsupported view types
confluence
left a comment
There was a problem hiding this comment.
One more set of comments about the list code.
Also, a general comment about code style: because comprehensions are supposed to be compact, I favour using short iterator variable names rather than the long descriptive names that would be more appropriate in a loop. So e.g. it would be fine to write [i for i in some_list if i > something].
(If you prefer to use long names everywhere because of a linting tool, that's fine.)
…rator for missing ID/index detection, simplify list comprehensions, and improve error messages to list all invalid values instead of just the first one
confluence
left a comment
There was a problem hiding this comment.
I'm happy to merge this with @kswang1029's approval. I will review the remaining PRs once they're updated after the merge.
Description
Closes #160.
Need frontend PR #2759 to be merged first. (merged)
This PR adds color blending support and refactors the session/image APIs around a shared "image-view item" model so frame-backed images and color blendings can be handled consistently.
What is implemented
ColorBlendingAPI withLayerobjects for:ImageBaseas the shared abstraction for image-view items and move common behaviors such asmake_active()andimage_view_orderonto the base classImageto align with the image-view-item model:file_idterminology consistently__repr__outputImageBaseSessionwith heterogeneous image-view-item support:image_list()now returns bothImageandColorBlending_find_image_view_order()image_by_id(image_view_order=..., file_id=..., color_blending_id=...)active_frame()withactive_image()create_color_blending()andopen_as_color_blending()carta_versionand include it inSession.__repr__when availableset_cursor()to use a better APIImageTypeandColormapSetChecklist