Atlas Free Slice Alignment Helper Functions

slice_alignment_help.A2DtoA3D(A)[source]

TODO - Function description

Parameters:

Atorch.Tensor[torch.float32]

TODO

Returns:

outtorch.Tensor[torch.float32]

TODO

slice_alignment_help.AX(Ai, XJ)[source]

TODO - Function description

Parameters:

Aitorch.Tensor[torch.float32]

TODO

XJtorch.Tensor[torch.float32]

TODO

Returns:

Xstorch.Tensor[torch.float32]

TODO

slice_alignment_help.L_from_xv_a_p(xv, a, p)[source]

TODO - Function description

Parameters:

xvlist[torch.Tensor[torch.float32]]

TODO

afloat

TODO

pfloat

TODO

Returns:

LTODO

TODO

slice_alignment_help.atlas_from_aligned_slices_and_weights(xI, I, dtype, device, phiiRiJ, W, asquare, niter=10, draw=0, fig=None, hfig=None, anisotropy_factor=16, return_K=False, return_fwhm=False)[source]

TODO - Function Description

Parameters:

xIlist[torch.Tensor[int]]

List of 3 orthogonal axes used to define voxel locations

Itorch.Tensor

TODO

dtypestr

TODO

devicestr

TODO

phiiRiJtorch.Tensor

TODO

Wtorch.Tensor

TODO

asquarefloat

TODO

niterint

TODO

drawbool

TODO

figmatplotlib.pyplot.figure

TODO

hfigmatplotlib.pyplot.figure

TODO

anisotropy_factorfloat

TODO

return_Kbool

TODO

return_fwhmbool

TODO

Returns:

Itorch.Tensor

TODO

Efloat

TODO

ERfloat

TODO

slice_alignment_help.detjac(xv, v)[source]

TODO - Function description

Parameters:

xvlist[torch.Tensor[torch.float32]]

TODO

vtorch.Tensor[torch.float32]

TODO

Returns:

detjactorch.Tensor[torch.float32]

TODO

slice_alignment_help.down2ax(I, ax)[source]

TODO - Function description

Parameters:

Ind-array

TODO

axmatplotlib.pyplot.axis

TODO

Returns:

Idnd-array

TODO

slice_alignment_help.exp(x, v, N=5)[source]

Group exponential by scaling and squaring v should have xyz components at the end and be 3d

Take a small displacement, and compose it with itself many times, to give a big displacement.

If N = 1, the output is id + v

If N = 2, the output is (id + v/2)circ (id + v/2)

If N = 3, the output is (id + v/8)circ … circ (id + v/8)

Parameters:

xlist[torch.Tensor[torch.float32]]

TODO

vtorch.Tensor[torch.float32]

TODO

Nint

TODO

Returns:

phitorch.Tensor[torch.float32]

TODO

slice_alignment_help.extent_from_x(x)[source]

This function gets a coordinate system and output the extent argument for matplotlib imshow

Parameters:

xarr[int]

An N-dimensional coordinate system

Returns:

outarr

The extent of x to be used as an input for matplotlib.pyplot.imshow()

slice_alignment_help.interp(x, I, phii, **kwargs)[source]

Interpolate a signal with specified voxel spacing, in torch. Note, the input data should be 3D images, with first dimension a channel. phii has xyz on the last dimension.

Parameters:

xlist[torch.Tensor[torch.float32]]

TODO

Itorch.Tensor[torch.float32]

TODO

phiitorch.Tensor[torch.float32]

TODO

kwargsdict

TODO

Returns:

phiItorch.Tensor[torch.float32]

TODO

slice_alignment_help.inverse_transform_image(xI, I, xv, v, A, xJ, **kwargs)[source]

Note this is redundant with the below, but is a nice helper function

Parameters:

xIlist[torch.Tensor[torch.float32]]

TODO

Itorch.Tensor[torch.float32]

TODO

xvlist[torch.Tensor[torch.float32]]

TODO

vtorch.Tensor[torch.float32]

TODO

Atorch.Tensor[torch.float32]

TODO

xJlist[torch.Tensor[torch.float32]]

TODO

kwargsdict

TODO

Returns:

phiiAiItorch.Tensor[torch.float32]

TODO

slice_alignment_help.robust_loss(RphiI, xJ, J, W, c=0.5, return_weights=False)[source]

We input the deformed atlas I, the target J, and the voxel coordinates of J, and the robust constant c note there is a W here which should be binary because we’re not going to sum over all the pixels

Parameters:

RphiItorch.Tensor[torch.float32]

TOOD

xJlist[torch.Tensor[torch.float32]]

TODO

Jtorch.Tensor[torch.float32]

TODO

Wtorch.Tensor[torch.float32]

TODO

cfloat32

Default - 0.5; TODO - Parameter description

return_weights - bool

Default - False; If true, return the weights too

Returns:

ETODO

TODO

WTODO

TODO

slice_alignment_help.transform_image(xI, I, xv, v, A, xJ, **kwargs)[source]

Note this is redundant with the below, but is a nice helper function

Parameters:

xIlist[torch.Tensor[torch.float32]]

TODO

Itorch.Tensor[torch.float32]

TODO

xvlist[torch.Tensor[torch.float32]]

TODO

vtorch.Tensor[torch.float32]

TODO

Atorch.Tensor[torch.float32]

TODO

xJlist[torch.Tensor[torch.float32]]

TODO

kwargsdict

TODO

Returns:

AphiItorch.Tensor[torch.float32]

TODO

slice_alignment_help.v2DToV3D(v2d)[source]

TOOD - Function description

Parameters:

v2dtorch.Tensor[torch.float32]

TODO

Returns:

outtorch.Tensor[torch.float32]

TODO

slice_alignment_help.weighted_see_registration(xI, I, xJ, J, W, xv, v, A, a, p, sigmaM, sigmaR, niter, epT, epL, epv, draw=0, fig=None, hfig=None)[source]

TODO - Function description

Parameters:

xIlist[torch.Tensor[torch.float32]]

TODO

Itorch.Tensor[torch.float32]

TODO

xJlist[torch.Tensor[torch.float32]]

TODO

Jtorch.Tensor[torch.float32]

TODO

Wtorch.Tensor[torch.float32]

TODO

xvlist[torch.Tensor[torch.float32]]

TODO

vtorch.Tensor[torch.float32]

TODO

Atorch.Tensor[torch.float32]

TODO

afloat

TODO

pfloat

TODO

sigmaMfloat

TODO

sigmaRfloat

TODO

niterint

TODO

epTfloat

TODO

epLfloat

TODO

epvfloat

TODO

drawbool

TODO

figmatplotlib.pyplot.figure

TODO

hfigmatplotlib.pyplot.figure

TODO

Returns:

Atorch.Tensor[torch.float32]

TODO

vtorch.Tensor[torch.float32]

TODO

Efloat

TODO

ERfloat

TODO

slice_alignment_help.x_from_n_d(n, d)[source]

This function takes in an image size and pixel size, and outputs a zero centered coordinate system

Parameters:

nint or arr[int]

The image size along each axis

dint or arr[int]

The pixel size along each axis

Returns:

xarr

The zero-centered coordinate system for an image of size ‘n’ with pixel size ‘d’