templateflow / python-client

A python client to query TemplateFlow via pyBIDS
https://templateflow.org/python-client/
Apache License 2.0
8 stars 12 forks source link

Failed or interrupted downloads leaves corrupted template files. #53

Open bpinsard opened 4 years ago

bpinsard commented 4 years ago

If a templateflow image download fails, the truncated file is non-zero and considered as fetched and returned in subsequent queries.

This occurred in a rare case where the truncated image silently propagated through Ants-based resampling and subsequent brain extraction, corrupting the whole pipeline. https://github.com/poldracklab/fmriprep/issues/2192# It seems that it was using the default non-datalad download.

An option would be to checksum-validate each time the template is queried.

oesteban commented 3 years ago

Using the datalad backend this should not occur. I'm not sure it is worth the pain maintaining a MANIFEST file with MD5 sums. Perhaps we could reconsider making datalad the default since it is more stable now?

oesteban commented 5 months ago

Opening with nibabel could be an easy tradeoff between today and a decent validation of checksums.