Skip to content

Commit 33d8aa2

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 82c0fb3 commit 33d8aa2

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,4 @@ runs
166166

167167
*zarr/*
168168

169-
monai-dev/
169+
monai-dev/

monai/transforms/intensity/array.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def __init__(
173173
prob: float = 0.1,
174174
mean: Sequence[float] | float = 0.0,
175175
std: Sequence[float] | float = 1.0,
176-
degrees_of_freedom: int = 64, #64 default because typical modern brain MRI is 32 quadrature coils
176+
degrees_of_freedom: int = 64, #64 default because typical modern brain MRI is 32 quadrature coils
177177
channel_wise: bool = False,
178178
relative: bool = False,
179179
sample_std: bool = True,
@@ -242,9 +242,9 @@ def __call__(self, img: NdarrayOrTensor, randomize: bool = True) -> NdarrayOrTen
242242
raise RuntimeError(f"std must be a float or int number, got {type(std)}.")
243243
img = self._add_noise(img, mean=self.mean, std=std, k=self.degrees_of_freedom)
244244
return img
245-
246-
247-
245+
246+
247+
248248
class RandRicianNoise(RandomizableTransform):
249249
"""
250250
Add Rician noise to image.

monai/transforms/intensity/dictionary.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ def __call__(self, data: Mapping[Hashable, NdarrayOrTensor]) -> dict[Hashable, N
236236
for key in self.key_iterator(d):
237237
d[key] = self.rand_gaussian_noise(img=d[key], randomize=False)
238238
return d
239-
240-
239+
240+
241241
class RandNonCentralChiNoised(RandomizableTransform, MapTransform):
242242
"""
243243
Dictionary-based version :py:class:`monai.transforms.RandNonCentralChiNoise`.
@@ -283,7 +283,7 @@ def __init__(
283283
MapTransform.__init__(self, keys, allow_missing_keys)
284284
RandomizableTransform.__init__(self, prob)
285285
self.rand_non_central_chi_noise = RandNonCentralChiNoise(
286-
prob=1.0,
286+
prob=1.0,
287287
mean=mean,
288288
std=std,
289289
degrees_of_freedom=degrees_of_freedom,

tests/transforms/test_rand_noncentralchi_noise.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ def test_correct_results(self, _, in_type, mean, std):
4040
np.random.seed(seed)
4141
np.random.random()
4242
_std = np.random.uniform(0, std)
43-
43+
4444
noise_shape = (degrees_of_freedom, *self.imt.shape)
4545
all_noises = np.random.normal(mean, _std, size=noise_shape).astype(np.float32)
4646
all_noises[0] += self.imt
4747
sum_sq = np.sum(all_noises**2, axis=0)
4848
expected = np.sqrt(sum_sq)
49-
49+
5050
if isinstance(noised, torch.Tensor):
5151
noised = noised.cpu()
5252
np.testing.assert_allclose(expected, noised, atol=1e-5)
53-
53+
5454
@parameterized.expand(TESTS)
5555
def test_correct_results_dof2(self, _, in_type, mean, std):
5656
"""

tests/transforms/test_rand_noncentralchi_noised.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_correct_results(self, _, in_type, keys, mean, std):
4848
if isinstance(noised[k], torch.Tensor):
4949
noised[k] = noised[k].cpu()
5050
np.testing.assert_allclose(expected, noised[k], atol=1e-5, rtol=1e-5)
51-
51+
5252
@parameterized.expand(TESTS)
5353
def test_correct_results_k2(self, _, in_type, keys, mean, std):
5454
degrees_of_freedom = 2
@@ -61,7 +61,7 @@ def test_correct_results_k2(self, _, in_type, keys, mean, std):
6161
for k in keys:
6262
np.random.random()
6363
_std = np.random.uniform(0, std)
64-
64+
6565
noise_shape = (degrees_of_freedom, *self.imt.shape)
6666
all_noises = np.random.normal(mean, _std, size=noise_shape).astype(np.float32)
6767
all_noises[0] += self.imt

0 commit comments

Comments
 (0)