monashmicroimaging / podocytes

GNU General Public License v3.0
2 stars 3 forks source link

Need to filter out hidden files ("not a valid Leica LIF file") #21

Closed GenevieveBuckley closed 5 years ago

GenevieveBuckley commented 6 years ago

Need to either:

  1. Filter out hidden files from our filelist, or
  2. Put a try except around the pims.open() command to catch and recover from these events Probably both.
2018-06-27 11:29:26,312 Processing file: /Volumes/Genevieve/ImageAnalysis/kidney_glomeruli/input_data/SP8/Postnatal21day_mice/._51571 and 51575.lif
[90260] Failed to execute script launch-gui
/var/folders/gz/6f0v_zhs09x38mb4td_h6py80000gn/T/_MEI4PO2xP/pims/api.py:191: UserWarning: <class 'pims.bioformats.BioformatsReader'> errored: loci.formats.FormatException: /Volumes/Genevieve/ImageAnalysis/kidney_glomeruli/input_data/SP8/Postnatal21day_mice/._51571 and 51575.lif is not a valid Leica LIF file
Traceback (most recent call last):
  File "bin/launch-gui.py", line 3, in <module>
  File "site-packages/gooey/python_bindings/gooey_decorator.py", line 89, in <lambda>
  File "podocytes/main.py", line 81, in main
  File "site-packages/pims/api.py", line 193, in open
pims.api.UnknownFormatError: All handlers returned exceptions:
<class 'pims.bioformats.BioformatsReader'> errored: loci.formats.FormatException: /Volumes/Genevieve/ImageAnalysis/kidney_glomeruli/input_data/SP8/Postnatal21day_mice/._51571 and 51575.lif is not a valid Leica LIF file
jni commented 6 years ago

I think (1) should be sufficient. We should filter all files that start with . and all files that don't end in .lif.

GenevieveBuckley commented 6 years ago

@jni - (2) might also allow recovery if there is somehow a corrupted file in the mix, but otherwise, yeah.

We already filter out any files not ending in .lif (or whichever extension the user specifies), but I forgot to think about hidden files.

jni commented 6 years ago

Fair enough about (2). And at that point we can give an informative error message.

GenevieveBuckley commented 5 years ago

Fixed in the giant PR https://github.com/monashmicroimaging/podocytes/pull/38