Skip to content

Commit

Permalink
Doc+Enhancement(align_tpm): go back to 1e-4 tiny before log
Browse files Browse the repository at this point in the history
  • Loading branch information
balbasty committed Oct 16, 2024
1 parent fd70e2f commit 62b17f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nitorch/tools/registration/affine_tpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def align_tpm(dat, tpm=None, weights=None, spacing=(8, 4), device=None,
Input image(s)
tpm : file(s) or tensor or (tensor, affine), optional
Input tissue probability map. Uses SPM's TPM by default.
If a tensor, must have shape `(K, *spatial)`.
weights : file(s) or tensor
Input mask or weight map
device : torch.device, optional
Expand Down Expand Up @@ -161,7 +162,7 @@ def align_tpm(dat, tpm=None, weights=None, spacing=(8, 4), device=None,
# ensure normalized
logtpm = logtpm.clamp(tiny, 1-tiny).div_(logtpm.sum(0, keepdim=True))
# transform to logits
logtpm = logtpm.add_(tiny).log_()
logtpm = logtpm.add_(1e-4).log_()
# spline prefilter
splineopt = dict(interpolation=2, bound='replicate')
logtpm = spatial.spline_coeff_nd(logtpm, dim=3, inplace=True, **splineopt)
Expand Down

0 comments on commit 62b17f6

Please sign in to comment.