Replies: 3 comments 2 replies
-
Hi, TIFF files are read through a built-in function, which is thread-safe. PNG files are read through the Bio-Formats Java library, which involves starting up a Java VM and so fourth. I had never really thought about this, but I'm not surprised that that process is not thread-safe. @wcaarls you know much more about this than I do. Is there a way to make dipjavaio thread-safe? Or do we need to add a warning to the docs about using it only from one thread? |
Beta Was this translation helpful? Give feedback.
-
Hi Thank you very much for your comments. My solution is to let OpenCV handle the reading, and convert the image to diplib: cvimg = cv2.imread(filename)
img = dip.Image(cvimg) It seems to be quite efficient. What do you think of this ? yann |
Beta Was this translation helpful? Give feedback.
-
By the way, we implemented native PNG reading/writing in DIPlib in dae9724 (included in version 3.4.2). This works in a multi-threaded environment. |
Beta Was this translation helpful? Give feedback.
-
Hello all,
I am new to diplib, so please excuse my naive comprehension of this fantastic tool.
I am trying to develop a multithread python code that processes multiple files. It appears that the reading of png files causes segfault. However, if the file type is tif, it does not segfaults. To reproduce the problem, put files in the Data folder and excute the following code.
Where is my mistake ?
Thank you in advance !
best regards
yann
Beta Was this translation helpful? Give feedback.
All reactions