educelab / volume-cartographer

Volumetric processing toolkit and C++ libraries for the recovery and restoration of damaged cultural materials
GNU General Public License v3.0
62 stars 21 forks source link

[Bug] VC Packager detects MacOS metadata files as actual files #77

Closed TheCleric closed 7 months ago

TheCleric commented 7 months ago

What happened?

When running vc-packager my very first time as instructed in the segmentation tutorial against the campfire zip file, I could not get it to work. I would consistently get an error stating that:

Found 477 files which did not match the initial slice:3s<00m:00s] 954/954                                                                                                                                            
<LONG LIST OF FILES HERE>
ERROR: Slices in slice directory do not have matching properties (width/height/depth)

After a lot of banging my head against the wall I realized it was because MacOS on a non-HFS formatted drive (such as the ExFAT external disk I was using or a samba share) writes a metadata file for each actual file it performs IO on. For example for the file /campfire/rec/0168.tif that was extracted from the zip file, there was a corresponding metadata file of /campfire/rec/._0168.tif`.

It seems the vc-packager tries to parse these just as it would other tif files (and understandably so, though this is less than desirable).

Steps to reproduce

  1. Extract the campfire.zip to a non-HFS disk (such as an external drive or samba share) on MacOS.
  2. Attempt to run vc-packager against the unzipped data, such as vc_packager -s ./campfire/rec -v ./campfire.volpkg -u 104 -n campfire
  3. Receive the described error.

Version

2.26.0-rc.3 (according to homebrew as vc_version doesn't exist in my install)

How did you install the software?

Homebrew

On which operating systems have you experienced this issue?

Relevant log output

No response

Code of Conduct

csparker247 commented 7 months ago

This is not well documented, but packager supports a limited printf-style string to help parsing in situations like this:

vc_packager -s path/to/slices/slice_files_%3d.tif ...