def setUp(self):
    set_determinism(seed=0)
    self.data_dir = tempfile.mkdtemp()
    for i in range(40):
        (im, _) = create_test_image_2d(64, 64, num_objs=3, rad_max=14, num_seg_classes=1, channel_dim=(- 1))
        n = nib.Nifti1Image(im, np.eye(4))
        nib.save(n, os.path.join(self.data_dir, f'img{i:d}.nii.gz'))
    self.device = torch.device(('cuda:0' if torch.cuda.is_available() else 'cpu:0'))
    monai.config.print_config()
    logging.basicConfig(stream=sys.stdout, level=logging.INFO)
def setUp(self):
    set_determinism(seed=0)
    self.data_dir = tempfile.mkdtemp()
    for i in range(40):
        (im, _) = create_test_image_2d(64, 64, num_objs=3, rad_max=14, num_seg_classes=1, channel_dim=(- 1))
        n = nib.Nifti1Image(im, np.eye(4))
        nib.save(n, os.path.join(self.data_dir, f'img{i:d}.nii.gz'))
    self.device = torch.device(('cuda:0' if torch.cuda.is_available() else 'cpu:0'))
    monai.config.print_config()
    logging.basicConfig(stream=sys.stdout, level=logging.INFO)