Skip to content

Commit

Permalink
Merge pull request #40 from CBICA/gurayerus-patch-1
Browse files Browse the repository at this point in the history
Bug fix in reading nifti list
  • Loading branch information
spirosmaggioros authored Oct 11, 2024
2 parents 6ad18aa + d9d0409 commit 9173b62
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions NiChart_DLMUSE/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,14 @@ def make_img_list(in_data: str) -> pd.DataFrame:
else:
with open(in_data, "r") as file:
lines = file.readlines()
nii_files = [
os.path.abspath(line.strip())
for line in lines
if line.strip().endswith(LIST_IMG_EXT) # type:ignore
]
nii_files = []
for line in lines:
is_nifti = False
for tmp_ext in LIST_IMG_EXT:
if line.strip().endswith(tmp_ext):
is_nifti = True
if is_nifti is True:
nii_files.append(os.path.abspath(line.strip()))

nii_files = np.array(nii_files)
print(f"Detected {nii_files.shape[0]} images ...") # type:ignore
Expand Down

0 comments on commit 9173b62

Please sign in to comment.