Commit 537a3032 authored by mibaumgartner's avatar mibaumgartner
Browse files

fix restore seg, mark SegmentationEnsembler as experimental

parent d7450974
...@@ -26,11 +26,13 @@ from torch import Tensor ...@@ -26,11 +26,13 @@ from torch import Tensor
from nndet.inference.ensembler.base import BaseEnsembler from nndet.inference.ensembler.base import BaseEnsembler
from nndet.inference.restore import restore_fmap from nndet.inference.restore import restore_fmap
from nndet.utils.info import experimental
class SegmentationEnsembler(BaseEnsembler): class SegmentationEnsembler(BaseEnsembler):
ID = "seg" ID = "seg"
@experimental
def __init__(self, def __init__(self,
seg_key: str = 'pred_seg', seg_key: str = 'pred_seg',
data_key: str = 'data', data_key: str = 'data',
......
...@@ -100,11 +100,11 @@ def restore_fmap(fmap: np.ndarray, ...@@ -100,11 +100,11 @@ def restore_fmap(fmap: np.ndarray,
spacing_after_resampling = np.asarray(spacing_after_resampling) spacing_after_resampling = np.asarray(spacing_after_resampling)
resampled_spacing = spacing_after_resampling[transpose_backward] resampled_spacing = spacing_after_resampling[transpose_backward]
if np.any([i != j for i, j in zip(fmap.shape[1:], size_after_cropping)]): if np.any([i != j for i, j in zip(fmap_transposed.shape[1:], size_after_cropping)]):
lowres_axis = _get_lowres_axes(original_spacing, resampled_spacing, lowres_axis = _get_lowres_axes(original_spacing, resampled_spacing,
do_separate_z=do_separate_z) do_separate_z=do_separate_z)
logger.info(f"Resampling: do separate z: {do_separate_z}; lowres axis: {lowres_axis}") logger.info(f"Resampling: do separate z: {do_separate_z}; lowres axis: {lowres_axis}")
fmap_old_spacing = resample_data_or_seg(fmap, size_after_cropping, is_seg=False, fmap_old_spacing = resample_data_or_seg(fmap_transposed, size_after_cropping, is_seg=False,
axis=lowres_axis, order=interpolation_order, axis=lowres_axis, order=interpolation_order,
do_separate_z=do_separate_z, cval=0, do_separate_z=do_separate_z, cval=0,
order_z=interpolation_order_z) order_z=interpolation_order_z)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment