Skip to content

Commit

Permalink
Fix AslContext bug
Browse files Browse the repository at this point in the history
  • Loading branch information
aptinis committed May 1, 2024
1 parent 8de3b5f commit e19fcf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/d2b_asl.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def find_asl_acquisitions(acquisitions: list[Acquisition]) -> list[Acquisition]:

def is_asl(acquisition: Acquisition) -> bool:
description = acquisition.description
return description.data_type == "perf"
return description.modality_label == "_asl"


class Aslcontext:
Expand Down Expand Up @@ -128,7 +128,7 @@ def json_file(self) -> Path:

def validate(self, asl_file: str | Path):
img: nib.Nifti1Image = nib.load(asl_file)
nvols, nlabels = img.shape[-1], len(self.labels)
nvols, nlabels = img.header['dim'][4], len(self.labels)
if nvols != nlabels:
raise AslContextConfigurationError(asl_file, nvols, nlabels)
for label in self.labels:
Expand Down

0 comments on commit e19fcf3

Please sign in to comment.