qurit / rt-utils

A minimal Python library to facilitate the creation and manipulation of DICOM RTStructs.
MIT License
192 stars 56 forks source link

RTSTRUCT save as #5

Closed awtkns closed 3 years ago

awtkns commented 3 years ago

Two small things here:

https://github.com/qurit/rt-utils/blob/26447ff98d271df6f978073c7aa3f2803d8943d7/rt_utils/rtstruct.py#L54-L61

asim-shrestha commented 3 years ago

motivation behind it is to ensure we have a valid file name / file is writable / can overwrite existing files. I'm not sure if we can do this with those methods (initially the path will probably be empty so .exists() would be false. Issue arises since .exists() also just returns false with invalid file names)

As for closing, python should handle closing it eventually but I added a close to be sure