Xmipp
v3.23.11-Nereus
|
#include <cuda_gpu_geo_transformer.h>
Public Member Functions | |
GeoTransformer () | |
~GeoTransformer () | |
void | initForMatrix (size_t x, size_t y, size_t z) |
void | initLazyForMatrix (size_t x, size_t y=1, size_t z=1) |
void | initForBSpline (size_t inX, size_t inY, size_t inN, size_t splineX, size_t splineY, size_t splineN, const GPU &gpu) |
void | initLazyForBSpline (size_t inX, size_t inY, size_t inN, size_t splineX, size_t splineY, size_t splineN, const GPU &gpu) |
void | release () |
template<typename T_MAT > | |
void | applyGeometry (int splineDegree, MultidimArray< T > &output, const MultidimArray< T > &input, const Matrix2D< T_MAT > &transform, bool isInv, bool wrap, T outside=0, const MultidimArray< T > *bCoeffsPtr=NULL) |
void | applyBSplineTransform (int splineDegree, MultidimArray< T > &output, const MultidimArray< T > &input, const std::pair< Matrix1D< T >, Matrix1D< T >> &coeffs, size_t imageIdx, T outside=0) |
void | test () |
Protected Member Functions | |
void | applyBSplineTransformRef (int splineDegree, MultidimArray< T > &output, const MultidimArray< T > &input, const std::pair< Matrix1D< T >, Matrix1D< T >> &coeffs, size_t imageIdx, T outside=0) |
void | produceAndLoadCoeffs (const MultidimArray< T > &input) |
std::unique_ptr< T[]> | copy_out_d_in (size_t size) const |
Definition at line 55 of file cuda_gpu_geo_transformer.h.
|
inline |
|
inline |
Definition at line 61 of file cuda_gpu_geo_transformer.h.
void GeoTransformer< T >::applyBSplineTransform | ( | int | splineDegree, |
MultidimArray< T > & | output, | ||
const MultidimArray< T > & | input, | ||
const std::pair< Matrix1D< T >, Matrix1D< T >> & | coeffs, | ||
size_t | imageIdx, | ||
T | outside = 0 |
||
) |
Apply local transformation defined by a BSpline
splineDegree | used for interpolation |
output | where resulting image will be stored |
input | to process |
coeffs | for the X and Y dimension of the input |
imageIdx | index of the current image. This function assumes that multiple calls will be done and that interpolation is done also over time |
outside | value of the output, where the interpolation does not store anything |
Definition at line 187 of file cuda_gpu_geo_transformer.cpp.
|
protected |
Definition at line 155 of file cuda_gpu_geo_transformer.cpp.
void GeoTransformer< T >::applyGeometry | ( | int | splineDegree, |
MultidimArray< T > & | output, | ||
const MultidimArray< T > & | input, | ||
const Matrix2D< T_MAT > & | transform, | ||
bool | isInv, | ||
bool | wrap, | ||
T | outside = 0 , |
||
const MultidimArray< T > * | bCoeffsPtr = NULL |
||
) |
Apply geometry transformation Currently supported transformations: FIXME
splineDegree | used for interpolation |
output | where resulting image will be stored |
input | to process |
transform | to apply |
isInv | if true, 'transform' is expected to be from the resulting image to source image |
wrap | true to wrap after boundaris |
outside | value to be used when reading outside of the image and wrap == false |
bCoeffsPtr | spline coefficients to use |
Definition at line 240 of file cuda_gpu_geo_transformer.cpp.
|
protected |
Definition at line 429 of file cuda_gpu_geo_transformer.cpp.
void GeoTransformer< T >::initForBSpline | ( | size_t | inX, |
size_t | inY, | ||
size_t | inN, | ||
size_t | splineX, | ||
size_t | splineY, | ||
size_t | splineN, | ||
const GPU & | gpu | ||
) |
Release previously obtained resources and initialize the transformer for processing images using BSpline coefficients. It also allocates all resources on GPU.
sizes | of the input images and number of images to be processed |
number | of BSpline control points, including end points |
Definition at line 71 of file cuda_gpu_geo_transformer.cpp.
void GeoTransformer< T >::initForMatrix | ( | size_t | x, |
size_t | y, | ||
size_t | z | ||
) |
Release previously obtained resources and initialize the transformer for processing images of given size. It also allocates all resources on GPU.
x | dim (inner-most) of the resulting image |
y | dim of the resulting image |
z | dim (outer-most) of the resulting image |
Definition at line 49 of file cuda_gpu_geo_transformer.cpp.
void GeoTransformer< T >::initLazyForBSpline | ( | size_t | inX, |
size_t | inY, | ||
size_t | inN, | ||
size_t | splineX, | ||
size_t | splineY, | ||
size_t | splineN, | ||
const GPU & | gpu | ||
) |
Similar as the other init() function, except this method has no effect should the instance be already initialized. It is useful for example in a for loop, where first call will initialize resources and following calls will be ignored
Definition at line 103 of file cuda_gpu_geo_transformer.cpp.
void GeoTransformer< T >::initLazyForMatrix | ( | size_t | x, |
size_t | y = 1 , |
||
size_t | z = 1 |
||
) |
Similar as other init() function, except this method has no effect should the instance be already initialized. It is useful for example in a for loop, where first call will initialize resources and following calls will be ignored
Definition at line 64 of file cuda_gpu_geo_transformer.cpp.
|
protected |
Computes spline coefficients of the image and load them to GPU
splineDegree | to be used |
input | image used to generate the coefficients |
Definition at line 303 of file cuda_gpu_geo_transformer.cpp.
void GeoTransformer< T >::release | ( | ) |
Release all resources hold by this instance
Definition at line 32 of file cuda_gpu_geo_transformer.cpp.
void GeoTransformer< T >::test | ( | ) |
Definition at line 113 of file cuda_gpu_geo_transformer.cpp.