Skip to content

Commit 6d6654d

Browse files
committed
minor bug fixes
1 parent 0f647d9 commit 6d6654d

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

TPTBox/core/bids_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ def get_changed_bids(
687687
auto_add_run_id=False,
688688
additional_folder: str | None = None,
689689
dataset_path: str | None = None,
690-
make_parent=True,
690+
make_parent=False,
691691
non_strict_mode=False,
692692
):
693693
ds = dataset_path if dataset_path is not None else self.get_path_decomposed()[0]

TPTBox/core/nii_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ def resample_from_to(self, to_vox_map:Image_Reference|Has_Grid|tuple[SHAPE,AFFIN
985985
# padding after = remaining dst size after src
986986
pad_after = dst_shape-shift-src_shape
987987
pad = tuple((int(b), int(a)) for b, a in zip(pad_before, pad_after))
988-
ret = s.apply_pad(pad, mode=mode,inplace=inplace)
988+
ret = s.apply_pad(pad, mode=mode,inplace=inplace,verbose=verbose)
989989

990990
#TODO SET raise_error=False before committing
991991
valid = ret.assert_affine(mapping,raise_error=True,origin_tolerance=0.0001,error_tolerance=0.0001,shape_tolerance=0)
@@ -1801,7 +1801,7 @@ def infect(self: NII, reference_mask: NII, inplace=False,verbose=True,axis:int|s
18011801
"""
18021802
self.assert_affine(reference_mask)
18031803
if _do_crop:
1804-
crop = reference_mask.compute_crop(0,5)
1804+
crop = reference_mask.compute_crop(0,5,raise_error=False)
18051805
s = self.apply_crop(crop)
18061806
reference_mask = reference_mask.apply_crop(crop)
18071807
else:

TPTBox/segmentation/VibeSeg/inference_nnunet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def to_int(a: str, k: None | int = None):
227227
try:
228228
return enum_[a].value
229229
except Exception:
230-
print("no ", enum_)
230+
pass
231231
if k is not None and k not in unknown_strings.values():
232232
return k
233233
unknown_strings[a] = unknown_strings["max"]
@@ -247,7 +247,7 @@ def to_int(a: str, k: None | int = None):
247247
logger.print(f"{mapping=}")
248248
seg_nii.map_labels_(mapping)
249249
if out_file is not None and (not Path(out_file).exists() or override):
250-
seg_nii.save(out_file)
250+
seg_nii.set_dtype("smallest_uint").save(out_file)
251251
del nnunet
252252

253253
torch.cuda.empty_cache()

0 commit comments

Comments
 (0)