Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File names ending with space #75

Open
SoroushOskouei opened this issue Jul 20, 2023 · 5 comments
Open

File names ending with space #75

SoroushOskouei opened this issue Jul 20, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@SoroushOskouei
Copy link

Using this artifact https:/AICAN-Research/FAST-Pathology/actions/runs/4808864433.

There is an issue with the files having a filename ending with a space such as "something .vsi". When saving the results of the models, the last space is ignored and consequently, the results cannot then be loaded.

error: unable to open file: name = ... , errno = 2, error message = 'No such file or directory'.

@andreped
Copy link
Member

This is likely an issue if the filename has a space anywhere, not just at the end.

A fix in FAST was added to handle full paths with space in them, such that FAST POs like fast.WholeSlideImageImporter can read these files, but we have likely not yet added the same fix to FP yet.

After inference, the result will be moved to the Project folder, and as it fails to use this filename, for whatever reason, the result won't be loaded correctly. AFAIK, right after inference, the prediction might actually just disappear from the viewer. Is that correct, @SoroushOskouei?

@SoroushOskouei
Copy link
Author

SoroushOskouei commented Aug 10, 2023

I don't think the disappearing issue is related to the spaces.
That occurs in filenames without any spaces and also sometimes does not even occur for filenames with spaces.
BUT If the filename has a space at the end of it, the program will crash.
Because when it creates the folder for saving the results, the space at the end will be ignored so it can not find the folder with the name including the space at the end.

@SoroushOskouei
Copy link
Author

I think when you create a folder that has a name with spaces at the end the OS will ignore them. For example "folder " will be created as "folder". This does not happen if the space is in the middle. That is why FP cannot find it when the space is at the end.

@andreped
Copy link
Member

andreped commented Aug 10, 2023

I think when you create a folder that has a name with spaces at the end the OS will ignore them.

That's surprising to me. I just tried on macOS, and I could not reproduce this issue. This I tried outside FP, just on my macbook. Is this a Windows-issue maybe? Or Qt-related?

Could you try just making a folder through the Windows terminal, like so: mkdir "test_dir "? Note the added space " ".

@mhoibo
Copy link

mhoibo commented Aug 11, 2023

@andreped and I were able to reproduce this issue. For an image with space at the end of the filename (e.g., "some_image .svs"), the space is lost inside the Project when making the result directory, and thus after inference, the segmentation vanishes. Result is also not stored, likely because FP was unable to find an existing path to store the result.

@smistad

@andreped andreped added the bug Something isn't working label Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

3 participants