Skip to content

Commit 62b17f6

Browse files
committed
Doc+Enhancement(align_tpm): go back to 1e-4 tiny before log
1 parent fd70e2f commit 62b17f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nitorch/tools/registration/affine_tpm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def align_tpm(dat, tpm=None, weights=None, spacing=(8, 4), device=None,
6969
Input image(s)
7070
tpm : file(s) or tensor or (tensor, affine), optional
7171
Input tissue probability map. Uses SPM's TPM by default.
72+
If a tensor, must have shape `(K, *spatial)`.
7273
weights : file(s) or tensor
7374
Input mask or weight map
7475
device : torch.device, optional
@@ -161,7 +162,7 @@ def align_tpm(dat, tpm=None, weights=None, spacing=(8, 4), device=None,
161162
# ensure normalized
162163
logtpm = logtpm.clamp(tiny, 1-tiny).div_(logtpm.sum(0, keepdim=True))
163164
# transform to logits
164-
logtpm = logtpm.add_(tiny).log_()
165+
logtpm = logtpm.add_(1e-4).log_()
165166
# spline prefilter
166167
splineopt = dict(interpolation=2, bound='replicate')
167168
logtpm = spatial.spline_coeff_nd(logtpm, dim=3, inplace=True, **splineopt)

0 commit comments

Comments
 (0)