jlevy44 / PathFlow-MixMatch

Don't mix, match! Simple utilities for improved registration of Histopathology Whole Slide Images.
10 stars 6 forks source link

No such file or directory:"A npy" #22

Closed gmh1033286494 closed 3 years ago

gmh1033286494 commented 3 years ago

Hi, my goal is to do the image registration for 2 wsi. I used the same level of both image and output them as png files. Then, I tried your Minimal working example. I did success once when not using gpu. But latter I tried again suddenly it wouldn't work and showed me :No such file or directory:"A npy" Here is my code:

pathflow-mixmatch register_images --im1.png --im2.png --fix_rotation False --output_dir output_registered_images/ --gpu_device -1 --transform_type similarity --lr 0.1 --iterations 100 --min_object_size 500

error: Loading images. Traceback (most recent call last): File "/home/chixing/.local/bin/pathflow-mixmatch", line 8, in sys.exit(main()) File "/home/chixing/.local/lib/python3.8/site-packages/pathflow_mixmatch/cli.py", line 386, in main fire.Fire(Commands) File "/home/chixing/.local/lib/python3.8/site-packages/fire/core.py", line 138, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/home/chixing/.local/lib/python3.8/site-packages/fire/core.py", line 463, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/home/chixing/.local/lib/python3.8/site-packages/fire/core.py", line 672, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/home/chixing/.local/lib/python3.8/site-packages/pathflow_mixmatch/cli.py", line 370, in register_images registerimages(npy1=npy1, File "/home/chixing/.local/lib/python3.8/site-packages/pathflow_mixmatch/cli.py", line 248, in registerimages im1=np.load(npy1) File "/home/chixing/.local/lib/python3.8/site-packages/numpy/lib/npyio.py", line 416, in load fid = stack.enter_context(open(os_fspath(file), "rb")) FileNotFoundError: [Errno 2] No such file or directory: 'A.npy'

sumanthratna commented 3 years ago

can you try this?

pathflow-mixmatch register_images --im1 ./im1.png --im2 ./im2.png --fix_rotation False --output_dir output_registered_images/ --gpu_device -1 --transform_type similarity --lr 0.1 --iterations 100 --min_object_size 500

(note the difference in the --im1 and --im2 flags)

you'll need to have two files in your current working directory: im1.png and im2.png

gmh1033286494 commented 3 years ago

can you try this?

pathflow-mixmatch register_images --im1 ./im1.png --im2 ./im2.png --fix_rotation False --output_dir output_registered_images/ --gpu_device -1 --transform_type similarity --lr 0.1 --iterations 100 --min_object_size 500

(note the difference in the --im1 and --im2 flags)

you'll need to have two files in your current working directory: im1.png and im2.png

Hi, thank you for your reply. I did as you said but I still got the same error. I checked my file. There are im1.png and im2.png in the directory.

sumanthratna commented 3 years ago

can you try this?

pathflow-mixmatch register_images --im1 ./im1.png --im2 ./im2.png --fix_rotation False --output_dir output_registered_images/ --gpu_device -1 --transform_type similarity --lr 0.1 --iterations 100 --min_object_size 500

(note the difference in the --im1 and --im2 flags) you'll need to have two files in your current working directory: im1.png and im2.png

Hi, thank you for your reply. I did as you said but I still got the same error. I checked my file. There are im1.png and im2.png in the directory.

strange—I'm not sure why it would suddenly stop working. Can you try installing the VCS version using pip install git+https://github.com/jlevy44/PathFlow-MixMatch.git? This may resolve the issue.

gmh1033286494 commented 3 years ago

can you try this?

pathflow-mixmatch register_images --im1 ./im1.png --im2 ./im2.png --fix_rotation False --output_dir output_registered_images/ --gpu_device -1 --transform_type similarity --lr 0.1 --iterations 100 --min_object_size 500

(note the difference in the --im1 and --im2 flags) you'll need to have two files in your current working directory: im1.png and im2.png

Hi, thank you for your reply. I did as you said but I still got the same error. I checked my file. There are im1.png and im2.png in the directory.

strange—I'm not sure why it would suddenly stop working. Can you try installing the VCS version using pip install git+https://github.com/jlevy44/PathFlow-MixMatch.git? This may resolve the issue.

It worked!!!! Thank you very much!