You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minimum_size=reduce(lambdax,y: x*y, dims) # get product of dimensions
49
49
logging.debug(f"Minimum calculated size of '{fp}' is {minimum_size} bytes")
50
+
expected_filesize=minimum_size*2
50
51
iffile_size==minimum_size:
51
52
return'uint8'
52
53
eliffile_size==minimum_size*2:
53
54
return'uint16'
54
55
eliffile_size==minimum_size*4:
55
56
return'float32'
56
57
else:
57
-
iffile_size<minimum_size:
58
-
logging.warning(f"Detected possible data corruption. File is smaller than expected '{fp}'. Expected at <{file_size*2}> bytes but found <{file_size}> bytes. Defaulting to unsigned 16-bit.")
58
+
iffile_size<expected_filesize:
59
+
logging.warning(f"Detected possible data corruption. File is smaller than expected '{fp}'. Expected at <{expected_filesize}> bytes but found <{file_size}> bytes. Defaulting to unsigned 16-bit.")
59
60
return'uint16'
60
61
else:
61
-
logging.warning(f"Unable to determine bit-depth of volume '{fp}'. Expected at <{file_size*2}> bytes but found <{file_size}> bytes. Defaulting to unsigned 16-bit.")
62
+
logging.warning(f"Unable to determine bit-depth of volume '{fp}'. Expected at <{expected_filesize}> bytes but found <{file_size}> bytes. Defaulting to unsigned 16-bit.")
0 commit comments