Skip to content

Feature/protocol to table#361

Merged
ebrahimebrahim merged 10 commits into
mainfrom
feature/protocol-to-table
Jul 28, 2025
Merged

Feature/protocol to table#361
ebrahimebrahim merged 10 commits into
mainfrom
feature/protocol-to-table

Conversation

@peterhollender

Copy link
Copy Markdown
Contributor

Closes #360

google-labs-jules Bot and others added 6 commits July 15, 2025 14:07
This commit introduces a `to_table` method to the `Protocol` class, which returns a Pandas DataFrame summarizing the protocol's parameters. This is useful for displaying protocol information in a structured format.

- Added `to_table` method to `Protocol` class.
- Added `get_table` methods to `FocalPattern`, `SimSetup`, `DelayMethod`, `ApodizationMethod`, and `SegmentationMethod` classes and their subclasses.
- Added tests for the new `to_table` method.
- Added an example of the table output to the `to_table` method's docstring.
There was a mix of `get_table` and `to_table` already driving `protocol.to_table`. Since the `get_table` methods were all lower-level, I've switched everything to be `to_table`.
@peterhollender peterhollender requested a review from arhowe00 July 22, 2025 17:29

@arhowe00 arhowe00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved for merging, but I left a question @peterhollender you should look at before doing so.

Comment thread src/openlifu/seg/seg_methods/uniform.py Outdated

:returns: Pandas DataFrame of the segmentation method parameters
"""
records = [{"Name": "Type", "Value": "Uniform Tissue", "Unit": ""},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we returning the reference material here but not for the UniformTissue/UniformWater? Also, are we sure that all UniformSegmentation are always "Uniform Tissue" Type?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. We should be. Fixed.

@ebrahimebrahim ebrahimebrahim self-requested a review July 28, 2025 12:51

@ebrahimebrahim ebrahimebrahim left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some commit messages do not follow the guidelines of referencing an issue number. Adding a "request changes" to block merging so that we remember to address this.

Awaiting peter's reply to andrew's review then if the commit messages are left as is we can just squash-n-merge

@ebrahimebrahim ebrahimebrahim left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, thanks! Squashing and merging for this one

@ebrahimebrahim ebrahimebrahim merged commit 4913215 into main Jul 28, 2025
9 checks 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.

Protocol to_table

3 participants