konfai 1.2.7__py3-none-any.whl → 1.2.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of konfai might be problematic. Click here for more details.
- konfai/data/patching.py +1 -1
- konfai/data/transform.py +4 -4
- {konfai-1.2.7.dist-info → konfai-1.2.9.dist-info}/METADATA +1 -1
- {konfai-1.2.7.dist-info → konfai-1.2.9.dist-info}/RECORD +8 -8
- {konfai-1.2.7.dist-info → konfai-1.2.9.dist-info}/WHEEL +0 -0
- {konfai-1.2.7.dist-info → konfai-1.2.9.dist-info}/entry_points.txt +0 -0
- {konfai-1.2.7.dist-info → konfai-1.2.9.dist-info}/licenses/LICENSE +0 -0
- {konfai-1.2.7.dist-info → konfai-1.2.9.dist-info}/top_level.txt +0 -0
konfai/data/patching.py
CHANGED
|
@@ -218,7 +218,7 @@ class Patch(ABC):
|
|
|
218
218
|
),
|
|
219
219
|
)
|
|
220
220
|
slices = [s] + list(self._patch_slices[a][index][1:])
|
|
221
|
-
data_sliced = data[slices_pre + slices]
|
|
221
|
+
data_sliced = data[tuple(slices_pre + slices)]
|
|
222
222
|
if extend_slice > 0 and data_sliced.shape[len(slices_pre)] < bottom + top + 1:
|
|
223
223
|
pad_bottom = 0
|
|
224
224
|
pad_top = 0
|
konfai/data/transform.py
CHANGED
|
@@ -311,7 +311,7 @@ class Padding(TransformInverse):
|
|
|
311
311
|
slices = [slice(0, shape) for shape in tensor.shape]
|
|
312
312
|
for dim in range(len(self.padding) // 2):
|
|
313
313
|
slices[-dim - 1] = slice(self.padding[dim * 2], tensor.shape[-dim - 1] - self.padding[dim * 2 + 1])
|
|
314
|
-
result = tensor[slices]
|
|
314
|
+
result = tensor[tuple(slices)]
|
|
315
315
|
return result
|
|
316
316
|
|
|
317
317
|
|
|
@@ -368,7 +368,7 @@ class ResampleToResolution(Resample):
|
|
|
368
368
|
super().__init__(inverse)
|
|
369
369
|
self.spacing = torch.tensor([0 if s < 0 else s for s in spacing])
|
|
370
370
|
|
|
371
|
-
def transform_shape(self, shape: list[int], cache_attribute: Attribute) -> list[int]:
|
|
371
|
+
def transform_shape(self, name: str, shape: list[int], cache_attribute: Attribute) -> list[int]:
|
|
372
372
|
if "Spacing" not in cache_attribute:
|
|
373
373
|
TransformError(
|
|
374
374
|
"Missing 'Spacing' in cache attributes, the data is likely not a valid image.",
|
|
@@ -383,7 +383,7 @@ class ResampleToResolution(Resample):
|
|
|
383
383
|
if s == 0:
|
|
384
384
|
spacing[i] = image_spacing[i]
|
|
385
385
|
resize_factor = spacing / image_spacing
|
|
386
|
-
return [int(x) for x in (torch.tensor(shape) * 1 / resize_factor)]
|
|
386
|
+
return [int(x) for x in (torch.tensor(shape) * 1 / resize_factor.flip(0))]
|
|
387
387
|
|
|
388
388
|
def __call__(self, name: str, tensor: torch.Tensor, cache_attribute: Attribute) -> torch.Tensor:
|
|
389
389
|
image_spacing = cache_attribute.get_tensor("Spacing")
|
|
@@ -394,7 +394,7 @@ class ResampleToResolution(Resample):
|
|
|
394
394
|
resize_factor = spacing / cache_attribute.get_tensor("Spacing")
|
|
395
395
|
cache_attribute["Spacing"] = spacing
|
|
396
396
|
cache_attribute["Size"] = np.asarray([int(x) for x in torch.tensor(tensor.shape[1:])])
|
|
397
|
-
size = [int(x) for x in (torch.tensor(tensor.shape[1:]) * 1 / resize_factor)]
|
|
397
|
+
size = [int(x) for x in (torch.tensor(tensor.shape[1:]) * 1 / resize_factor.flip(0))]
|
|
398
398
|
cache_attribute["Size"] = np.asarray(size)
|
|
399
399
|
return self._resample(tensor, size)
|
|
400
400
|
|
|
@@ -6,8 +6,8 @@ konfai/trainer.py,sha256=g_TkPDUjToFGDGB7aaRZMn-fQllHV_I2GHFKUzDGF8o,27106
|
|
|
6
6
|
konfai/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
konfai/data/augmentation.py,sha256=7jrWcpw61t3cCIdHtUlnekRO7JwXIM5Q6RIXY8Ya-xM,27796
|
|
8
8
|
konfai/data/data_manager.py,sha256=tZ2DZHDW4UySCCzwEzR2WIL0fTp7lqAfqEbNPiEw5NE,31064
|
|
9
|
-
konfai/data/patching.py,sha256=
|
|
10
|
-
konfai/data/transform.py,sha256=
|
|
9
|
+
konfai/data/patching.py,sha256=PNxRFk2wkB5yWRJ6krj6slvUXRq0Tb7ysp4E2IZkUp8,16533
|
|
10
|
+
konfai/data/transform.py,sha256=RB0iT3GX9O4OeuwOdFV_kSdLN6ML2WiHTzQUEyRJGv0,30366
|
|
11
11
|
konfai/metric/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
konfai/metric/measure.py,sha256=0mOIZKTa2u0UECpoDSbdJUhttAw_e1BlsROQQpi1oBk,27804
|
|
13
13
|
konfai/metric/schedulers.py,sha256=TpYMA24FMpxRnqfhMGb0i_Mm-bzT9kySbBgvkYk-6wM,1327
|
|
@@ -30,9 +30,9 @@ konfai/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
30
30
|
konfai/utils/config.py,sha256=a7t44CYMUT5oCDdjL94IswhCVfFbQ5FCgDWZktDDkc4,14347
|
|
31
31
|
konfai/utils/dataset.py,sha256=Au22fcADKyDJMfS8Z9q8kEXLtKkoufJsH7Pwly6pALo,28288
|
|
32
32
|
konfai/utils/utils.py,sha256=jCj3tZ8agQYceSY_tlVYp88UFPE5oUn6tXrqnZGrKiI,28410
|
|
33
|
-
konfai-1.2.
|
|
34
|
-
konfai-1.2.
|
|
35
|
-
konfai-1.2.
|
|
36
|
-
konfai-1.2.
|
|
37
|
-
konfai-1.2.
|
|
38
|
-
konfai-1.2.
|
|
33
|
+
konfai-1.2.9.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
34
|
+
konfai-1.2.9.dist-info/METADATA,sha256=pGFfOyf57TF55Xi8mfsFPLhhexr3i_YaA7XCev2A3v4,2475
|
|
35
|
+
konfai-1.2.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
36
|
+
konfai-1.2.9.dist-info/entry_points.txt,sha256=fG82HRN5-g39ACSOCtij_I3N6EHxfYnMR0D7TI_8pW8,81
|
|
37
|
+
konfai-1.2.9.dist-info/top_level.txt,sha256=xF470dkIlFoFqTZEOlRehKJr4WU_8OKGXrJqYm9vWKs,7
|
|
38
|
+
konfai-1.2.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|