Splatting weights with respect to a deformation field (pull adjoint). This function is equivalent to applying grid_push to an image of ones. `interpolation` can be an int, a string or an InterpolationType. Possible values are:: - 0 or 'nearest' or InterpolationType.nea
(grid: torch.Tensor, shape=None, interpolation="linear", bound="zero", extrapolate: bool = True)
| 259 | |
| 260 | |
| 261 | def grid_count(grid: torch.Tensor, shape=None, interpolation="linear", bound="zero", extrapolate: bool = True): |
| 262 | """ |
| 263 | Splatting weights with respect to a deformation field (pull adjoint). |
| 264 | |
| 265 | This function is equivalent to applying grid_push to an image of ones. |
| 266 | |
| 267 | `interpolation` can be an int, a string or an InterpolationType. |
| 268 | Possible values are:: |
| 269 | |
| 270 | - 0 or 'nearest' or InterpolationType.nearest |
| 271 | - 1 or 'linear' or InterpolationType.linear |
| 272 | - 2 or 'quadratic' or InterpolationType.quadratic |
| 273 | - 3 or 'cubic' or InterpolationType.cubic |
| 274 | - 4 or 'fourth' or InterpolationType.fourth |
| 275 | - 5 or 'fifth' or InterpolationType.fifth |
| 276 | - 6 or 'sixth' or InterpolationType.sixth |
| 277 | - 7 or 'seventh' or InterpolationType.seventh |
| 278 | |
| 279 | A list of values can be provided, in the order [W, H, D], |
| 280 | to specify dimension-specific interpolation orders. |
| 281 | |
| 282 | `bound` can be an int, a string or a BoundType. |
| 283 | Possible values are:: |
| 284 | |
| 285 | - 0 or 'replicate' or 'nearest' or BoundType.replicate |
| 286 | - 1 or 'dct1' or 'mirror' or BoundType.dct1 |
| 287 | - 2 or 'dct2' or 'reflect' or BoundType.dct2 |
| 288 | - 3 or 'dst1' or 'antimirror' or BoundType.dst1 |
| 289 | - 4 or 'dst2' or 'antireflect' or BoundType.dst2 |
| 290 | - 5 or 'dft' or 'wrap' or BoundType.dft |
| 291 | - 7 or 'zero' or BoundType.zero |
| 292 | |
| 293 | A list of values can be provided, in the order [W, H, D], |
| 294 | to specify dimension-specific boundary conditions. |
| 295 | `sliding` is a specific condition than only applies to flow fields |
| 296 | (with as many channels as dimensions). It cannot be dimension-specific. |
| 297 | Note that: |
| 298 | |
| 299 | - `dft` corresponds to circular padding |
| 300 | - `dct2` corresponds to Neumann boundary conditions (symmetric) |
| 301 | - `dst2` corresponds to Dirichlet boundary conditions (antisymmetric) |
| 302 | |
| 303 | See Also: |
| 304 | |
| 305 | - https://en.wikipedia.org/wiki/Discrete_cosine_transform |
| 306 | - https://en.wikipedia.org/wiki/Discrete_sine_transform |
| 307 | - ``help(monai._C.BoundType)`` |
| 308 | - ``help(monai._C.InterpolationType)`` |
| 309 | |
| 310 | Args: |
| 311 | grid: Deformation field `(B, Wi, Hi, Di, 2|3)`. |
| 312 | shape: shape of the source image. |
| 313 | interpolation (int or list[int] , optional): Interpolation order. |
| 314 | Defaults to `'linear'`. |
| 315 | bound (BoundType, or list[BoundType], optional): Boundary conditions. |
| 316 | Defaults to `'zero'`. |
| 317 | extrapolate (bool, optional): Extrapolate out-of-bound data. |
| 318 | Defaults to `True`. |
nothing calls this directly
no test coverage detected
searching dependent graphs…