marcnol / pyHiM

Multiplexed DNA-FISH data analysis pipeline
GNU Lesser General Public License v3.0
4 stars 2 forks source link

Error with image filename #247

Closed marcnol closed 3 months ago

marcnol commented 3 months ago

Somehow it is unable to find a file that exists... there is clearly a problem with the way it is now constructing filenames from the folder structure...

see traceback

Traceback (most recent call last):
  File "/home/marcnol/Repositories/pyHiM/src/pyHiM.py", line 217, in <module>
    main()
  File "/home/marcnol/Repositories/pyHiM/src/pyHiM.py", line 51, in main
    pipe.run()
  File "/home/marcnol/Repositories/pyHiM/src/core/function_caller.py", line 438, in run
    results, npy_files = run_pattern(
  File "/home/marcnol/Repositories/pyHiM/src/core/function_caller.py", line 465, in run_pattern
    data = f2p.load()
  File "/home/marcnol/Repositories/pyHiM/src/core/data_file.py", line 49, in load
    return io.imread(self.path_name).squeeze()
  File "/home/marcnol/anaconda3/envs/pyHiM39/lib/python3.9/site-packages/skimage/io/_io.py", line 48, in imread
    img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
  File "/home/marcnol/anaconda3/envs/pyHiM39/lib/python3.9/site-packages/skimage/io/manage_plugins.py", line 207, in call_plugin
    return func(*args, **kwargs)
  File "/home/marcnol/anaconda3/envs/pyHiM39/lib/python3.9/site-packages/skimage/io/_plugins/tifffile_plugin.py", line 30, in imread
    return tifffile_imread(fname, **kwargs)
  File "/home/marcnol/anaconda3/envs/pyHiM39/lib/python3.9/site-packages/tifffile/tifffile.py", line 816, in imread
    with TiffFile(files, **kwargs_file) as tif:
  File "/home/marcnol/anaconda3/envs/pyHiM39/lib/python3.9/site-packages/tifffile/tifffile.py", line 3000, in __init__
    fh = FileHandle(arg, mode=mode, name=name, offset=offset, size=size)
  File "/home/marcnol/anaconda3/envs/pyHiM39/lib/python3.9/site-packages/tifffile/tifffile.py", line 9537, in __init__
    self.open()
  File "/home/marcnol/anaconda3/envs/pyHiM39/lib/python3.9/site-packages/tifffile/tifffile.py", line 9550, in open
    self._fh = open(self._file, self._mode)
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/grey/DATA/ProcessedData_2024/Experiment_49_David_RAMM_DNAFISH_Bantignies_proto_G1E_cells_LRKit/deinterleave_deconvolved_test/009/009/scan_001_DAPI_009_ROI_converted_decon_ch01.tif'
marcnol commented 3 months ago

I tried it in v0.9 and the dev branch. The problem exists in both

XDevos commented 3 months ago

Which command was executed from the terminal and from where?

XDevos commented 3 months ago

In the error message, the image path have both ".../009/009/...". Is it normal or is it the source of the error ? @marcnol

marcnol commented 3 months ago

I found it ! it has to do with symbolic links between files.... when linux makes these links it is critical to use the full path... otherwise use of relative paths get pyHiM confused.