Skip to content

Commit 5485cc7

Browse files
committed
Ignore some typing errors
1 parent 8b4c307 commit 5485cc7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • src/torchio/transforms/preprocessing/spatial

src/torchio/transforms/preprocessing/spatial/crop.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def apply_transform(self, subject: Subject) -> Subject:
5252
low = self.bounds_parameters[::2]
5353
high = self.bounds_parameters[1::2]
5454
index_ini = low
55-
index_fin = np.array(subject.spatial_shape) - high
55+
index_fin = np.asarray(subject.spatial_shape, dtype=int) - high
5656

5757
if self._copy_patch:
5858
# Create a clean new subject to copy the images into
@@ -79,7 +79,7 @@ def apply_transform(self, subject: Subject) -> Subject:
7979
cropped_subject[key] = self._crop_image(
8080
value,
8181
index_ini,
82-
index_fin,
82+
index_fin, # type: ignore[arg-type]
8383
copy_patch=self._copy_patch,
8484
)
8585

@@ -92,7 +92,7 @@ def apply_transform(self, subject: Subject) -> Subject:
9292
self._crop_image(
9393
image,
9494
index_ini,
95-
index_fin,
95+
index_fin, # type: ignore[arg-type]
9696
copy_patch=self._copy_patch,
9797
)
9898
return subject

0 commit comments

Comments
 (0)