Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pystackreg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
from .pystackreg import StackReg
from .version import __version__
from pystackreg.pystackreg import StackReg
from pystackreg.version import __version__
8 changes: 7 additions & 1 deletion src/pymain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,10 @@ PyObject *turbogreg_register(PyObject *self, PyObject *args) {
double *img_ref = (double *)PyArray_DATA(ref_array);
double *img_mov = (double *)PyArray_DATA(mov_array);

Py_BEGIN_ALLOW_THREADS
registerImg(img_ref, img_mov, (Transformation)tf, Ny_ref, Nx_ref,
rm); // width and height (Nx/Ny) have to be swapped!
Py_END_ALLOW_THREADS

/* clean up */
Py_XDECREF(ref_array);
Expand Down Expand Up @@ -282,9 +284,13 @@ PyArrayObject *turbogreg_transform(PyObject *self, PyObject *args) {
matrix<double> m(Nx_mat, Ny_mat);
memcpy(m.begin(), tmat, (Nx_mat * Ny_mat * sizeof(double)));

std::vector<double> imgout =
std::vector<double> imgout;

Py_BEGIN_ALLOW_THREADS
imgout =
transformImg(m, img_mov, Ny_mov,
Nx_mov); // width and height (Nx/Ny) have to be swapped!
Py_END_ALLOW_THREADS

/* clean up */
Py_XDECREF(mat_array);
Expand Down
Loading