Beware of pydicom new version

Beware of pydicom new version  

  By: Zhack on Sept. 9, 2024, 1:51 p.m.

Hello everyone, hang in there we're almost there! In the meantime, if f you're using pydicom, or a library that is using it (nnunet uses dicom2nifti which uses pydicom, so that's likely), you may have a timeout in your container caused by the download of a test dicom file. This is caused by the release of the v3.0.0 of pydicom this morning.

An easy way to fix this issue is to set pydicom==2.4.4 in your requirements.txt file.

Regards

Zhack

Re: Beware of pydicom new version  

  By: tanya.chutani on Sept. 12, 2024, 9:09 a.m.

Thanks Zhack, you saved me

Re: Beware of pydicom new version  

  By: TUM_ibbm on Sept. 15, 2024, 9:09 p.m.

this is CRAZY. Thank you very much.

Re: Beware of pydicom new version  

  By: TUM_ibbm on Sept. 15, 2024, 9:19 p.m.

and... may I ask how did you debug this? From the error message, I could not guess it was because of the version problem.

Re: Beware of pydicom new version  

  By: jdex on Sept. 15, 2024, 9:39 p.m.

Great post Zhack, thanks for the hint!

Re: Beware of pydicom new version  

  By: TUM_ibbm on Sept. 15, 2024, 10:17 p.m.

thanks everyone. It would be great if we could still use the preliminary test for some more hours.

Re: Beware of pydicom new version  

  By: Zhack on Sept. 16, 2024, 11:58 a.m.

Hi everyone,

@TUM_ibbm I got lucky because I was working with TotalSegmentator on something else at the same time and I had the same file download at the beginning of the script. This narrowed it down to the common dependencies of my AP3 container and TotalSegmentator.

Turns out the problem is propagated via nnUNet and through the dicom2nifti library, which uses pydicom without a upper bound for the version and v3.0.0 had just been released. New main version means breaking changes, a lot of deprecated functions were removed; so even without the failing download there would have been more problems down the line.

I don't know if or when the dicom2nifti library will be updated to reflect the changes to pydicom's API. For now it's simpler to force the version to be below 3.0.0.

Spread the word in other projects that might be affected by this when updating dependencies :)

Good luck for the remaining time of this competition !

Zhack

Re: Beware of pydicom new version  

  By: Balthasar on Sept. 16, 2024, 1:06 p.m.

Must have been quite an annoyance to run into this issue. But it looks like the developers of pydicom addressed this problem of downloading examples at first import now: https://pydicom.github.io/pydicom/dev/release_notes/index.html#version-3-1-0

Re: Beware of pydicom new version  

  By: Zhack on Sept. 16, 2024, 1:09 p.m.

Yes, they were quick to respond to this unwanted behavior