jungmannlab / picasso

A collection of tools for painting super-resolution images

Home Page:https://picassosr.readthedocs.io/en/latest/?badge=latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wishlist/bug: Adding nd2 file detection to cmd localize

GolgiWhillikers opened this issue · comments

  • Picasso version: 0.5.4
  • Python version: 3.8
  • Operating System: Win 10

As far as I can tell this is a very simple addition/fix, but I am not experienced with github/forking and am mediocre with Python so I will list it here.

With 0.5 the ability to load .nd2 files and NDTiffStacks into localize is great (and very convenient timing for us). However the cmd interface for picasso localize doesn't identify .nd2 files when fed a directory full of them - it finds 0 files (however, the cmd line does detect single nd2 files fine). I fixed this in my own version by adding a glob(files + "./*.nd2) statement to the paths variable in line 796 of __main__.py, and it worked for me (below). I don't know if there is a more robust way to do this but having the implementation built into the next version to detect nd2 files in a directory would be useful. Thanks.

    if isdir(files):
        print("Analyzing folder")

        tif_files = check_consecutive_tif(files)

        paths = tif_files + glob(files + "/*.raw") + glob(files + "/*.nd2)
        print("A total of {} files detected".format(len(paths)))
    else:
        paths = glob(files)

Hi,

Thanks very much for raising this issue. I have totally forgotten about updating the cmd functions with the new filetypes. I will hopefully push the update this week.

Bests,
Rafal