Skip to content

113 add 3d segmentation template - #114

Open
mikaelsimard5 wants to merge 33 commits into
TemplateV2from
113-add-3d-segmentation-template
Open

113 add 3d segmentation template#114
mikaelsimard5 wants to merge 33 commits into
TemplateV2from
113-add-3d-segmentation-template

Conversation

@mikaelsimard5

Copy link
Copy Markdown

Linked Issue(s)

Issue 113, adding a 3d segmentation template based on nnunet v2.

Summary of changes

Massive amount of code reorganisation from the existing autoseg codebases. Everything stems from train.py - start with that. Documentation has been added, all logging (including from the nnunet subprocess) is sent to a single file. Code was uniformed as much as possible with the 2d classifier, although it does have significant differences due to the need to call nnunetv2 via subprocesses.

Config file has been slightly simplified by removing some useless parameters. All nnunetv2 subprocesses are called from the command.py file, which includes a massive amount of docstrings to help users understand how each nnunet command works and what it does.

The MLflow artifact logging folder has been slightly revamped to be more intuitive in how things are sorted.

Overall there has been no change in what is actually computed compared to autoseg repos - the code is just more general and has been optimised where possible.

Reason for changes

As of now there was no 3d seg task in the project template.

It is also required as we keep building new autoseg apps with different datasets, each coming with their different repo and variations. In the future there should be a single autoseg repo (copied from this one) which just requires different config files for the different models.

Also udpated nomenclature for xnat 0.8
Mostly based on previous autoseg code; I've largely refactored setup() to use more modern pandas methods (apply(), map() and split in clear steps.
Final organisation of repo - split in smaller functions, nnunet CLI calls are defined inside commands.py but ran through a runner class defined in runtime.py
There were many sources of logging (subprocess.log, and just general log from logger.*). I uniformised so that everything gets dumped into logger.* and gets sent to a final unique log file containing both the logger data and the nnunet subprocesses.
…s into class

Also uniformised some variable names throughout scripts.
Includes duplicate label names in regions.json file, and nifti can work with a single contour (not necessarily more than one) if you want to learn only for one organ.
Otherwise runtime contained all nnunet related functions which was clumsy and hard to navigate.
used to be a bunch of functions loosely interacting; now the schema is populated via _from_config.
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.

2 participants