andreped commited on
Commit
a687f1a
·
1 Parent(s): b6a06fa

added check to skip non-nifti files in for loop

Browse files
Files changed (1) hide show
  1. livermask/livermask.py +4 -0
livermask/livermask.py CHANGED
@@ -69,6 +69,10 @@ def func(path, output, cpu, verbose):
69
  os.makedirs(output + "/", exist_ok=True)
70
 
71
  for curr in tqdm(paths, "CT:"):
 
 
 
 
72
  log.info("preprocessing...")
73
  nib_volume = nib.load(curr)
74
  new_spacing = [1., 1., 1.]
 
69
  os.makedirs(output + "/", exist_ok=True)
70
 
71
  for curr in tqdm(paths, "CT:"):
72
+ # check if current file is a nifti file, if not, skip
73
+ if not curr.endswith(".ini"):
74
+ continue
75
+
76
  log.info("preprocessing...")
77
  nib_volume = nib.load(curr)
78
  new_spacing = [1., 1., 1.]