macronucleus / Chromagnon

Image correction software for chromatic shifts in fluorescence microscopic images
GNU General Public License v2.0
21 stars 5 forks source link

UnicodeEncodeError while aligning target files #24

Closed yfukai closed 3 years ago

yfukai commented 3 years ago

I'm trying to use Chromagnon v0.86. When I try to align the target file with the reference, I get the following error:

Traceback (most recent call last):
File "Chromagnon/threads.py", line 275, in run
File "Chromagnon/aligner.py", line 1211, in saveAlignedImage
File "imgio/generalIO.py", line 491, in write3DArr
File "imgio/generalIO.py", line 481, in writeArr
File "imgio/multitifIO.py", line 366, in writeSec
File "site-packages/tifffile/tifffile.py", line 1267, in save
File "site-packages/tifffile/tifffile.py", line 10173, in str2bytes
UnicodeEncodeError: 'ascii' codec can't encode character '\xb5' in position 365: ordinal not in range(128)

and it fails to align.

I would like to ask if there's any workaround for this problem.

Thanks!

macronucleus commented 3 years ago

Thank you for reporting the issue. I can guess what is happening, but need to study more to solve it. The easiest solution for the time being is to select other output file formats; both "dv" and "ome.tif" can be read by Fiji, though writing "ome.tif" requires installing JDK and more processing time.

If you could contribute to improve Chromagnon, it would be great if you could send your image files so that I can read the metadata (the problem is that the character "µ" is written in the metadata somewhere that I don't expect). You can send it safely using this url: https://fexcc.nict.go.jp/user/~th/c6a9dipq3db666b4ucclsgg4m0 password: 3LZaLn87CB This server is going to shut down for maintenance during the following periods: 2/16 11:30-13:00, 2/17 12:00-13:00 JST. Thank you.

yfukai commented 3 years ago

Thank you for your helpful response. I will try to check if that option will work. The target image and the reference file are linked from the original post, and I will also upload them to the URL. Thanks!

macronucleus commented 3 years ago

I am sorry for overlooking the links in the previous post. I have confirmed the problem exactly as you mentioned. Let me take a closer look and see if I can solve it.

macronucleus commented 3 years ago

I have solved the issue. Please use the newer version of Chromagnon (v0.87), that I just uploaded.

yfukai commented 3 years ago

Thank you so much for the quick fix. I just confirmed that it works with that image!