Skip to content

Commit 77c5c99

Browse files
committed
correct flags
1 parent abccdaa commit 77c5c99

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

TPTBox/core/nii_wrapper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,8 +987,7 @@ def resample_from_to(self, to_vox_map:Image_Reference|Has_Grid|tuple[SHAPE,AFFIN
987987
pad = tuple((int(b), int(a)) for b, a in zip(pad_before, pad_after))
988988
ret = s.apply_pad(pad, mode=mode,inplace=inplace,verbose=verbose)
989989

990-
#TODO SET raise_error=False before committing
991-
valid = ret.assert_affine(mapping,raise_error=True,origin_tolerance=0.0001,error_tolerance=0.0001,shape_tolerance=0)
990+
valid = ret.assert_affine(mapping,raise_error=False,origin_tolerance=0.0001,error_tolerance=0.0001,shape_tolerance=0)
992991
if valid:
993992
log.print(f"resample_from_to only needs padding/cropping {pad}",verbose=verbose)
994993
ret.affine = mapping.affine #remove floating point error

TPTBox/registration/_deformable/multilabel_segmentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def transform_nii(self, nii_atlas: NII, allow_only_same_grid_as_moving=True, onl
330330
nii_reg = self.reg_deform.transform_nii(nii_atlas)
331331
if nii_reg.seg:
332332
nii_reg.set_dtype_("smallest_uint")
333-
out = nii_reg.resample_from_to(self.target_grid_org)
333+
out = nii_reg.resample_from_to(self.target_grid_org, mode="constant")
334334
if self.same_side:
335335
return out
336336
axis = out.get_axis("R")

0 commit comments

Comments
 (0)