BodenmillerGroup / ImcSegmentationPipeline

A pixel classification based multiplexed image segmentation pipeline
https://bodenmillergroup.github.io/ImcSegmentationPipeline/
MIT License
83 stars 35 forks source link

Error in generating ome.tiff from mcd #45

Closed hfl112 closed 4 years ago

hfl112 commented 4 years ago

Hi, Recently I got an error here. seems that something wrong in decoding mcd xml file? Any idea to fix this?

ERROR INFOMATION:

../zip/20200814I90R2h_Jd.zip
ERROR:root:Error in ../zip//20200814I90R2h_Jd.zip
Traceback (most recent call last):
  File "<timed exec>", line 12, in <module>
  File "/opt/anaconda3/envs/imctools/lib/python3.6/site-packages/imctools/scripts/convertfolder2imcfolder.py", line 52, in convert_folder2imcfolder
    mcd = McdParser(mcd_files[0])
  File "opt/anaconda3/envs/imctools/lib/python3.6/site-packages/imctools/io/mcdparser.py", line 34, in __init__
    McdParserBase.__init__(self, filename, filehandle, metafilename)
  File "opt/anaconda3/envs/imctools/lib/python3.6/site-packages/imctools/io/mcdparserbase.py", line 49, in __init__
    self.retrieve_mcd_xml()
  File "opt/anaconda3/envs/imctools/lib/python3.6/site-packages/imctools/io/mcdparser.py", line 97, in retrieve_mcd_xml
    xml = mm[xml_start:xml_stop].decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xae in position 1452: invalid start byte

Thank you, Funan

hfl112 commented 4 years ago

I tried to change the decode to 'ISO-8859-1', which can successfully get the xml of mcd file. But got an error in self._xml = et.fromstring(xml)

Traceback (most recent call last):

  File "/Users/funanhe/opt/anaconda3/envs/imctools/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 3331, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-72-49eb546902a5>", line 72, in retrieve_mcd_xml
    self._xml = et.fromstring(xml)

  File "/Users/funanhe/opt/anaconda3/envs/imctools/lib/python3.6/xml/etree/ElementTree.py", line 1315, in XML
    return parser.close()

  File "<string>", line unknown
ParseError: unclosed token: line 22, column 47786
votti commented 4 years ago

Hi Funan, Sorry for not answering earlier - I somehow must have missed this one. Usually this error is an error with the MCD file - can you open the file e.g. on the instrument software and save it again? Does it open in the Fluidigm MCD viewer?

hfl112 commented 4 years ago

Hi Funan, Sorry for not answering earlier - I somehow must have missed this one. Usually this error is an error with the MCD file - can you open the file e.g. on the instrument software and save it again? Does it open in the Fluidigm MCD viewer?

Hi vito, I have solve this problem by loading into cytof software and saving it again, seems that missing some header file or xml information in previous ones. Thank you anyway