Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Path loader has no fallback to relative paths #14

Open
cniedwor opened this issue Mar 16, 2018 · 2 comments
Open

Path loader has no fallback to relative paths #14

cniedwor opened this issue Mar 16, 2018 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@cniedwor
Copy link
Collaborator

See title - when a brain is copied someplace else, the path file needs to be updated by hand since the image loader does not attempt to locate the images relative to the image path file.

@crousseau
Copy link
Collaborator

Can you confirm this pertains to loading image sequence from text file

@cniedwor
Copy link
Collaborator Author

cniedwor commented Mar 16, 2018

Yes:

cniedwo@MS-workstation:~/swc_github/amap_python$ python3 amap/main.py /media/cniedwo/Data/epo/1058_stitching_2/1058-Ch_0.txt amap-python-test /media/cniedwo/Data/epo/countTest/1058/amap -x 0.002 -y 0.002 --save-unfiltered --generate-outlines -p
Preprocessing
Loading images:   0%|                                                                                                                                                                                                    | 0/1600 [00:00<?, ?plane/s]
Traceback (most recent call last):
  File "amap/main.py", line 111, in <module>
    print("Segmentation finished. Result can be found here: {}".format(process(args)))
  File "amap/main.py", line 83, in process
    _args.x_pixel_mm, _args.y_pixel_mm, _args.z_pixel_mm)
  File "/home/cniedwo/swc_github/amap_python/amap/brain/brain_processor.py", line 38, in __init__
    self.target_brain = bio.load_any(self.target_brain_path, x_scaling, y_scaling, z_scaling)
  File "/home/cniedwo/swc_github/amap_python/amap/brain/brain_io.py", line 46, in load_any
    img = load_img_sequence(src_path, x_scaling_factor, y_scaling_factor)
  File "/home/cniedwo/swc_github/amap_python/amap/brain/brain_io.py", line 85, in load_img_sequence
    return load_from_paths_sequence(paths, x_scaling_factor, y_scaling_factor)
  File "/home/cniedwo/swc_github/amap_python/amap/brain/brain_io.py", line 90, in load_from_paths_sequence
    img = tifffile.imread(p)
  File "/usr/local/lib/python3.5/dist-packages/tifffile-0.14.0-py3.5-linux-x86_64.egg/tifffile/tifffile.py", line 424, in imread
    with TiffFile(files, **kwargs_file) as tif:
  File "/usr/local/lib/python3.5/dist-packages/tifffile-0.14.0-py3.5-linux-x86_64.egg/tifffile/tifffile.py", line 1677, in __init__
    fh = FileHandle(arg, mode='rb', name=name, offset=offset, size=size)
  File "/usr/local/lib/python3.5/dist-packages/tifffile-0.14.0-py3.5-linux-x86_64.egg/tifffile/tifffile.py", line 4548, in __init__
    self.open()
  File "/usr/local/lib/python3.5/dist-packages/tifffile-0.14.0-py3.5-linux-x86_64.egg/tifffile/tifffile.py", line 4559, in open
    self._fh = open(self._file, self._mode)
FileNotFoundError: [Errno 2] No such file or directory: '/media/cniedwo/Data/1058_stitching_2/ch00/1058_45_00000_ch00.tif'

The Error disappears as soon as the paths in the text file are corrected.

@crousseau crousseau added the bug Something isn't working label Mar 21, 2018
@crousseau crousseau added this to the 1.2 milestone Mar 22, 2018
@crousseau crousseau modified the milestones: 1.2, 2.0 Apr 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants