Skip to content

Commit ea4b1c3

Browse files
authored
Merge branch 'Project-MONAI:dev' into dev
2 parents 7afe692 + 1dc47a5 commit ea4b1c3

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

monai/networks/nets/segresnet_ds.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,20 @@ class SegResNetDS(nn.Module):
254254
image spacing into an approximately isotropic space.
255255
Otherwise, by default, the kernel size and downsampling is always isotropic.
256256
257+
**Spatial shape constraints**: If ``resolution`` is ``None`` (isotropic mode),
258+
each spatial dimension must be divisible by ``2 ** (len(blocks_down) - 1)``.
259+
With the default ``blocks_down=(1, 2, 2, 4)``, each dimension must be
260+
divisible by 8. If ``resolution`` is provided (anisotropic mode),
261+
divisibility can differ per dimension; use :py:meth:`shape_factor` for
262+
the exact required factors and :py:meth:`is_valid_shape` to verify a shape.
263+
264+
Example::
265+
266+
model = SegResNetDS(spatial_dims=3, blocks_down=(1, 2, 2, 4))
267+
print(model.shape_factor()) # [8, 8, 8]
268+
print(model.is_valid_shape((1, 1, 128, 128, 128))) # True
269+
print(model.is_valid_shape((1, 1, 100, 100, 100))) # False
270+
257271
"""
258272

259273
def __init__(

0 commit comments

Comments
 (0)