Skip to content

Commit c6700a8

Browse files
committed
Address typing errors
1 parent 6eedfe1 commit c6700a8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/torchio/datasets/ct_rate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,14 +319,14 @@ def _instantiate_image(self, image_row: pd.Series) -> ScalarImage:
319319
image_row: A pandas Series representing a row from the metadata DataFrame,
320320
containing information about a single image.
321321
"""
322-
image_dict = image_row.to_dict()
323-
filename = image_dict[self._FILENAME_KEY]
322+
image_dict: dict[str, str | dict[str, str]] = image_row.to_dict() # type: ignore[assignment]
323+
filename: str = image_dict[self._FILENAME_KEY] # type: ignore[assignment]
324324
relative_image_path = self._get_image_path(
325325
filename,
326326
load_fixed=self._load_fixed,
327327
)
328328
image_path = self._root_dir / relative_image_path
329-
report_dict = self._extract_report_dict(image_dict)
329+
report_dict = self._extract_report_dict(image_dict) # type: ignore[arg-type]
330330
image_dict[self._report_key] = report_dict
331331
image = ScalarImage(image_path, verify_path=self._verify_paths, **image_dict)
332332
return image

src/torchio/datasets/ixi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def _check_exists(root, modalities):
107107
return exists
108108

109109
@staticmethod
110-
def _get_subjects_list(root, modalities):
110+
def _get_subjects_list(root: Path, modalities: Sequence[str]) -> list[Subject]:
111111
# The number of files for each modality is not the same
112112
# E.g. 581 for T1, 578 for T2
113113
# Let's just use the first modality as reference for now
@@ -134,7 +134,7 @@ def _get_subjects_list(root, modalities):
134134
skip_subject = False
135135
if skip_subject:
136136
continue
137-
subjects.append(Subject(**images_dict))
137+
subjects.append(Subject(**images_dict)) # type: ignore[arg-type]
138138
return subjects
139139

140140
def _download(self, root, modalities):

0 commit comments

Comments
 (0)