Error using picai_prep v2

Error using picai_prep v2  

  By: jiperez11 on Sept. 5, 2022, 8:33 a.m.

Hi, I was trying to preprocess the data using https://github.com/DIAGNijmegen/picai_baseline/blob/main/src/picai_baseline/prepare_data_semi_supervised.py, but this script currently doesn't work because of the new version of picai_prep. I tried adapting the picai_baseline script mentioned above but there is an error when passing the annotation_preprocess_func as an option in the settings (previosly that was the lbl_preprocess_func argument): jsonschema.exceptions.ValidationError: Additional properties are not allowed ('options' was unexpected) The way I am passing the argument option is directly after the task like this: mha2nnunet_settings["dataset_json"]["task"] = task #(this was not modified) mha2nnunet_settings['options'] = {'annotation_preprocess_func': preprocess_picai_annotation}

And when creating the MHA2nnUNetConverter im passing that object instead of the json path to the mha2nnunet_settings argument and using the new argument names. Those are the only things that I've modified. Is there something i'm doing wrong here?

Thank you for your help!

Re: Error using picai_prep v2  

  By: joeran.bosma on Sept. 5, 2022, 1:30 p.m.

Hi Jorge,

Thanks for raising this issue! Unfortunately, we indeed broke the preprocessing scripts with the update to picai_prep>=2.0.0. The steps you performed to fix this issue are indeed correct, and I will add the same to the picai_baseline documentation as well.

The error you got after patching prepare_data_semi_supervised.py traces back to the picai_prep>=2.0.0 module. I have proposed a bugfix for this issue, and will update you once this is finished!

Kind regards, Joeran

 Last edited by: joeran.bosma on Aug. 15, 2023, 12:57 p.m., edited 1 time in total.

Re: Error using picai_prep v2  

  By: joeran.bosma on Sept. 5, 2022, 2:17 p.m.

Hi Jorge,

We have updated the picai_prep module to version 2.0.1, which fixes this issue. I have also updated the Docker container joeranbosma/picai_nnunet:latest to install the updated picai_prep module. I tested this locally, and for me the conversion works again.

To run your preprocessing script, please ensure you pull the latest Docker container (docker pull joeranbosma/picai_nnunet:latest) or install the updated picai_prep module (pip install picai_prep==2.0.1).

The updated scripts (prepare_data.py and prepare_data_semi_supervised.py) are under review by my colleage, and can be found here: https://github.com/DIAGNijmegen/picai_baseline/pull/13.

Please let me know if you run into any other issues!

Kind regards, Joeran