-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StructureSetToSegmentation
types
#126
Comments
unsure about the examples but at a glance:? Examples
--------
Example 1: Using `None` (Default Behavior)
If no `roi_names` is specified or set to None, all ROIs will be used.
>>> roi_names = None
>>> seg = StructureSetToSegmentation(reference_image, roi_names=roi_names)
>>> print(seg.roi_names)
{"GTV1", "GTV2", "CTV", "Lung_Left", "Heart"} # Example output
Example 2: Using a Single String Pattern
Matches any ROI name that contains "GTV" (case-sensitive).
>>> roi_names = "GTV"
>>> seg = StructureSetToSegmentation(reference_image, roi_names=roi_names)
>>> print(seg.roi_names)
{"GTV1", "GTV2"} # Example output when self.roi_names = ["GTV1", "GTV2", "CTV"]
Example 3: Using a Regular Expression String Pattern
Matches ROI names starting with "PTV" or "CTV".
>>> roi_names = "^(PTV|CTV)"
>>> seg = StructureSetToSegmentation(reference_image, roi_names=roi_names)
>>> print(seg.roi_names)
{"PTV1", "CTV1"} # Example output when self.roi_names = ["PTV1", "CTV1", "GTV"]
Example 4: Using a List of Patterns
Matches ROI names that start with "Lung" or "Heart".
>>> roi_names = ["Lung", "Heart"]
>>> seg = StructureSetToSegmentation(reference_image, roi_names=roi_names)
>>> print(seg.roi_names)
{"Lung_Left", "Lung_Right", "Heart"} # Example output
Example 5: Using a Dictionary with Single Patterns
Matches specific ROIs and groups them under a common label.
>>> roi_names = {"Tumor": "GTV", "Lung": "Lung"}
>>> seg = StructureSetToSegmentation(reference_image, roi_names=roi_names)
>>> print(seg.roi_names)
{"Tumor": ["GTV1", "GTV2"], "Lung": ["Lung_Left"]} # Example output
Example 6: Using a Dictionary with Lists of Patterns
Combine ROIs under common labels using multiple patterns.
>>> roi_names = {
... "Tumor": ["GTV.*", "Neoplasm"],
... "Organs": ["Lung.*", "Heart"]
... }
>>> seg = StructureSetToSegmentation(reference_image, roi_names=roi_names)
>>> print(seg.roi_names)
{
"Tumor": ["GTV1", "Neoplasm_1"],
"Organs": ["Lung_Left", "Heart"]
} # Example output |
jjjermiah
added a commit
that referenced
this issue
Oct 22, 2024
…128) * chore: bump artifact action version * refactor: update StructureSetToSegmentation docstring and remove unused dev group in pyproject.toml * chore: fix download action in workflow to use correct artifact version * chore: correct instantiation reference and update parameter description in StructureSetToSegmentation docstring * chore: enhance StructureSetToSegmentation docstring to support None as a roi_names option for loading all ROIs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Between:
med-imagetools/src/imgtools/ops/ops.py
Lines 1467 to 1549 in 5546cec
and
med-imagetools/src/imgtools/modules/structureset.py
Lines 128 to 187 in 5546cec
can I assume that the type hint for
roi_names
is incorrect?The text was updated successfully, but these errors were encountered: