Add fetalsynthseg support for segmentation option#92
Add fetalsynthseg support for segmentation option#92vladzalevskyi wants to merge 2 commits intofetpype:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for the fetalsynthseg segmentation method as an alternative to the existing bounti method. The implementation includes new configuration files, BIDS output path regex rules for renaming segmentation outputs, and updates to valid pipeline definitions. The default Docker configuration is also updated to use fetalsynthseg instead of bounti.
Key changes:
- Added
fetalsynthsegto the list of valid segmentation pipelines - Implemented BIDS-compliant output file renaming rules for fetalsynthseg segmentation results
- Created configuration files for the new segmentation pipeline and corresponding surface extraction variant
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
fetpype/definitions.py |
Added "fetalsynthseg" to VALID_SEGMENTATION list |
configs/segmentation/fetalsynthseg.yaml |
New configuration file defining Docker command for fetalsynthseg pipeline |
configs/surface/surfpypefss.yaml |
New surface extraction configuration using fetalsynthseg labelling scheme |
configs/default_docker.yaml |
Updated default segmentation from bounti to fetalsynthseg and surface config to surfpypefss |
fetpype/utils/utils_bids.py |
Added regex rules for renaming fetalsynthseg output files to BIDS format; minor code formatting cleanup |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
We also have a bit of a finicky flake8, please address this style comments: |
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| --input <input_dir>/input_srr.nii.gz | ||
| --output <output_dir>/seg-drifts_pred.nii.gz | ||
| --gpu --lateralize" | ||
| path_to_output: "seg-drifts_pred.nii.gz" |
There was a problem hiding this comment.
Why is the output name of FetalSynthSeg still named drifts?
There was a problem hiding this comment.
Rather than creating a duplicated surfpype, the idea would be to have
labelling_scheme:
bounti: [....]
fetalsynthseg: [13, 14, 16]
and keep use_scheme=bounti for now.
There was a problem hiding this comment.
The idea here would be to have a single file surfpype.yaml, have different labelling schemes and and then use_scheme based on what segmentation you're using. Could you adapt your code to this?
Also, I think that if would be great to add a minor edit in the function
check_valid_pipeline
to have
if "surface" in cfg:
...
if cfg.surface.surface_rh.use_scheme != cfg.segmentation.pipeline:
raise RuntimeError(f"Segmentation method {cfg.segmentation.pipeline} is incompatible with the surface extraction scheme {cfg.surface.surface_rh.use_scheme }")
And the same check on the LH. Let me know if this isn't clear.
No description provided.