Skip to content

feat: Section and Sectioning#1695

Open
dbirman wants to merge 7 commits intodevfrom
1684-chunk-sections-and-handling-multi-slice-mapseq-sections
Open

feat: Section and Sectioning#1695
dbirman wants to merge 7 commits intodevfrom
1684-chunk-sections-and-handling-multi-slice-mapseq-sections

Conversation

@dbirman
Copy link
Member

@dbirman dbirman commented Jan 27, 2026

This PR introduces Section and Sectioning into Procedures in a backward compatible way (the old Section is now PlanarSection).

@dbirman dbirman linked an issue Jan 27, 2026 that may be closed by this pull request
@dbirman dbirman requested a review from saskiad February 4, 2026 18:53
) # note: exact field name is used by a validator
)

sections: List[Union[Section, PlanarSection]] = Field(
Copy link
Collaborator

Choose a reason for hiding this comment

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

can't PlanarSectioning only be a list of PlanarSections? Or is this for backwards compatibility?

Copy link
Member Author

Choose a reason for hiding this comment

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

Required for backward compatibility unfortunately. If you try to pass a Section with any of the old fields set the validator raises deprecation warnings though so it's pretty obvious. Of course since these are procedures it's moot, most users won't see it. But I'll coordinate with Mekhla to update that code.


class Section(DataModel):
"""Description of a slice of brain tissue"""
"""Description of a single section of brain tissue"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's specify that this should not be used for slices and point to the PlanarSectioning for that.


output_specimen_id: str = Field(..., title="Specimen ID")
targeted_structure: Optional[BrainStructureModel] = Field(default=None, title="Targeted structure")
includes_surrounding_tissue: Optional[bool] = Field(
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it possible to indicate which of these fields will become required in v3.0 (similar to how we mark the deprecated fields)? It might just help to get that information so future upgrades will be easier. (and so we remember to make them required)

Copy link
Collaborator

@saskiad saskiad left a comment

Choose a reason for hiding this comment

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

just some questions - still remembering how this works

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.

Chunk sections and handling multi-slice MAPseq sections

2 participants