Skip to content

Commit e1cacdb

Browse files
authored
Fix mask_to_channels with trilinear renderer (#382)
1 parent f77697b commit e1cacdb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

diffdrr/renderers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def forward(
240240
B, D, _ = img.shape
241241
C = int(mask.max().item() + 1)
242242
channels = _get_voxel(
243-
mask, xyzs, img=None, mode=self.mode, align_corners=align_corners
243+
mask, xyzs, img=None, mode="nearest", align_corners=align_corners
244244
).long()
245245
img = (
246246
torch.zeros(B, C, D)

notebooks/api/01_renderers.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@
376376
" B, D, _ = img.shape\n",
377377
" C = int(mask.max().item() + 1)\n",
378378
" channels = _get_voxel(\n",
379-
" mask, xyzs, img=None, mode=self.mode, align_corners=align_corners\n",
379+
" mask, xyzs, img=None, mode=\"nearest\", align_corners=align_corners\n",
380380
" ).long()\n",
381381
" img = (\n",
382382
" torch.zeros(B, C, D)\n",

0 commit comments

Comments
 (0)