class_docstr: Helper class to slice 3d volume into smaller volumes and merge them back
class_docstr_tok: ["Helper","class","to","slice","3d","volume","into","smaller","volumes","and","merge","them","back"]
code: def iter_split(
      self, volume, value=0
  ) -> Iterable[Tuple[np.ndarray, Any]]:
      if (volume.shape != self.volume_shape).any():
          raise ValueError(
              f"Volume shape {volume.shape} is not equal to the expected {self.volume_shape}"
          )
  
      pad_width = np.stack([self.pad_before, self.pad_after], axis=-1)
      image_pad = np.pad(
          volume, pad_width, mode="constant", constant_values=value
      )
  
      for roi in self.crops:
          tile = image_pad[roi].copy()
          yield tile, roi
  
file_path: pytorch-toolbelt/pytorch_toolbelt/inference/tiles_3d.py
imports: from typing import Union, Tuple, List, Iterable, Any
  import numpy
  import torch
  from pytorch_toolbelt.inference import compute_pyramid_patch_weight_loss
label_desc: Use image node_id 3 for calling the VolumeSlicer obj's underlying member method code with example usage: obj.iter_split(volume, value) without return types