imagej / pyimagej

Use ImageJ from Python
https://pyimagej.readthedocs.io/
Other
473 stars 82 forks source link

ImgLabeling conversions use suboptimal tmp directory #286

Open ctrueden opened 1 year ago

ctrueden commented 1 year ago

In the Labeling <-> ImgLabeling conversion code in convert.py, temporary paths of the form "./tmp" and os.getcwd() + "/tmp" are used. There are a couple of issues with this:

  1. Inconsistency between those two expressions.
  2. Use of forward slashes might not work as expected on Windows (testing probably needed).
  3. Creation and use of temp folders from the CWD is generally considered bad practice. Better is to use dedicated temp file management functions of the language standard library. In Python this would be the tempfile module.