ivadomed / utilities

Repository containing utility scripts for handling various aspects in a DL model training pipeline
MIT License
8 stars 0 forks source link

Fix nnUNetPredictor inference #39

Closed hermancollin closed 10 months ago

hermancollin commented 10 months ago

So the reason the --path-dataset arg did not work for me was because the convert_filenames_to_nnunet_format was restricted to NIFTI files. However, for --path-images, there were problems with the code.

One of the advantage of the new inference interface is that folders or lists of files can be processed using the same method: nnUNetPredictor.predict_from_files supports both. Now, this should work for everyone.

Fixes #38

hermancollin commented 10 months ago

Now I only looked at the _run_nnunetinference.py file. _run_inference_singlesubject.py requires less refactoring. It seems there is only one call to the predict_from_files() method and the input are more contained.

While looking at the single subject script, I noticed something that could be improved. Some functions are duplicates in _run_nnunetinference and _run_inference_singlesubject. For example, splitext and add_suffix are exact copies. That's not a major problem but could become annoying if a bug is fixed on one side but not on the other. I would advise to delete them in one file and import them from the other for easier maintenance.