45 #include "numpy/arrayobject.h" 56 if (PyArg_ParseTuple(args,
"s", &str))
65 if (PyArg_ParseTuple(args,
"i", &label))
68 return PyUnicode_FromString(labelStr.c_str());
79 if (PyArg_ParseTuple(args,
"is|i", &color, &str, &attrib))
82 return PyUnicode_FromString(labelStr.c_str());
91 PyObject* str_exc_type =
nullptr;
92 PyObject* pyStr =
nullptr;
93 if (PyArg_ParseTuple(args,
"O", &input))
95 if (PyUnicode_Check(input))
96 return Py_BuildValue(
"i", (
int)
MDL::labelType((
char*)PyUnicode_AsUTF8(PyObject_Str(input))));
98 else if (PyLong_Check(input))
102 PyErr_SetString(PyExc_TypeError,
103 "labelType: Only int or string are allowed as input");
112 PyObject* str_exc_type =
nullptr;
113 PyObject* pyStr =
nullptr;
116 if (PyArg_ParseTuple(args,
"Oi", &input, &tag))
120 if (PyUnicode_Check(input))
127 else if (PyLong_Check(input))
128 label = (
MDLabel) PyLong_AsLong(input);
138 PyErr_SetString(PyExc_TypeError,
139 "labelHasTag: Input label should be int or string");
150 if (PyArg_ParseTuple(args,
"O", &input))
154 if (PyUnicode_Check(input))
155 label =
MDL::str2Label((
char*)PyUnicode_AsUTF8(PyObject_Str(input)));
157 else if (PyLong_Check(input))
158 label = (
MDLabel) PyLong_AsLong(input);
168 PyErr_SetString(PyExc_TypeError,
169 "labelIsImage: Input label should be int or string");
180 if (PyArg_ParseTuple(args,
"s", &str))
182 else if (PyArg_ParseTuple(args,
"i", &label))
204 if (PyArg_ParseTuple(args,
"Oii|iii", &input, &Xdim, &Ydim, &Zdim,
210 auto inputStr = (std::string)(
char*)PyUnicode_AsUTF8(PyObject_Str(input));
229 if (PyArg_ParseTuple(args,
"O", &pyValue))
234 PyObject * pyStr = PyObject_Str(pyValue);
235 auto *str = (
char*)PyUnicode_AsUTF8(pyStr);
242 return Py_BuildValue(
"kkkk", xdim, ydim, zdim, ndim);
255 PyObject *pyStr =
nullptr;
257 if (PyArg_ParseTuple(args,
"O", &pyValue))
263 bool destroyMd =
true;
265 if (PyUnicode_Check(pyValue))
267 PyObject* repr = PyObject_Str(pyValue);
268 auto * str = (
char*)PyUnicode_AsUTF8(pyValue);
289 PyErr_SetString(
PyXmippError,
"Invalid argument: expected String, FileName or MetaData");
300 return Py_BuildValue(
"iiikk", xdim, ydim, zdim, ndim, size);
315 PyObject *input =
nullptr;
316 PyObject *pyStr =
nullptr;
318 if (PyArg_ParseTuple(args,
"O", &input))
322 if ((pyStr = PyObject_Str(input)) !=
nullptr )
324 str = (
char*)PyUnicode_AsUTF8(pyStr);
348 if (PyArg_ParseTuple(args,
"O", &filename))
352 PyObject * pyStr = PyObject_Str(filename);
353 auto *str = (
char*)PyUnicode_AsUTF8(pyStr);
374 if (PyArg_ParseTuple(args,
"O", &filename))
378 PyObject * pyStr = PyObject_Str(filename);
379 auto * str = (
char*)PyUnicode_AsUTF8(pyStr);
401 if (PyArg_ParseTuple(args,
"OO", &filename1, &filename2))
405 PyObject * pyStr1 = PyObject_Str(filename1);
406 PyObject * pyStr2 = PyObject_Str(filename2);
408 auto * str1 = (
char*)PyUnicode_AsUTF8(pyStr1);
409 auto * str2 = (
char*)PyUnicode_AsUTF8(pyStr2);
432 if (PyArg_ParseTuple(args,
"OO|i", &filename1, &filename2, &offset))
436 PyObject * pyStr1 = PyObject_Str(filename1);
437 PyObject * pyStr2 = PyObject_Str(filename2);
439 auto * str1 = (
char*)PyUnicode_AsUTF8(pyStr1);
440 auto * str2 = (
char*)PyUnicode_AsUTF8(pyStr2);
463 if (PyArg_ParseTuple(args,
"OO", &filename1, &filename2))
467 PyObject * pyStr1 = PyObject_Str(filename1);
468 PyObject * pyStr2 = PyObject_Str(filename2);
470 auto * str1 = (
char*)PyUnicode_AsUTF8(pyStr1);
471 auto * str2 = (
char*)PyUnicode_AsUTF8(pyStr2);
491 if (PyArg_ParseTuple(args,
"OO", &filename1, &filename2))
495 PyObject * pyStr1 = PyObject_Str(filename1);
496 PyObject * pyStr2 = PyObject_Str(filename2);
498 auto * str1 = (
char*)PyUnicode_AsUTF8(pyStr1);
499 auto * str2 = (
char*)PyUnicode_AsUTF8(pyStr2);
520 if (PyArg_ParseTuple(args,
"OO|d", &input1, &input2, &tolerance))
531 if (PyTuple_Check(input1))
534 index1 = PyLong_AsSsize_t(PyTuple_GetItem(input1, 0));
535 fn1 = (
char*)PyUnicode_AsUTF8(PyObject_Str(PyTuple_GetItem(input1, 1)));
538 fn1 = (
char*)PyUnicode_AsUTF8(PyObject_Str(input1));
540 if (PyTuple_Check(input2))
543 index2 = PyLong_AsSsize_t(PyTuple_GetItem(input2, 0));
544 fn2 = (
char*)PyUnicode_AsUTF8(PyObject_Str(PyTuple_GetItem(input2, 1)));
547 fn2 = (
char*)PyUnicode_AsUTF8(PyObject_Str(input2));
575 if (PyArg_ParseTuple(args,
"OO", &pyStr, &pyMd))
580 PyErr_SetString(PyExc_TypeError,
581 "Expected MetaData as second argument");
584 if (PyUnicode_Check(pyStr))
593 PyErr_SetString(PyExc_TypeError,
594 "Expected string or FileName as first argument");
611 PyObject *pyStrFnOrig;
612 PyObject *pyStrFnOut;
616 if (PyArg_ParseTuple(args,
"OOOii", &pyStrFn, &pyStrFnOrig, &pyStrFnOut,
617 &label, &skipFirstBlock))
624 if (PyUnicode_Check(pyStrFn))
625 fn = (
char*)PyUnicode_AsUTF8(pyStrFn);
630 PyErr_SetString(PyExc_TypeError,
631 "Expected string or FileName as first argument");
633 if (PyUnicode_Check(pyStrFnOrig))
634 fnOrig = (
char*)PyUnicode_AsUTF8(pyStrFnOrig);
639 PyErr_SetString(PyExc_TypeError,
640 "Expected string or FileName as second argument");
642 if (PyUnicode_Check(pyStrFnOut))
643 fnOut = (
char*)PyUnicode_AsUTF8(pyStrFnOut);
648 PyErr_SetString(PyExc_TypeError,
649 "Expected string or FileName as third argument");
652 (
bool) skipFirstBlock);
667 PyErr_SetString(PyExc_TypeError,
668 "bad argument: Expected Image as first argument");
671 if (PyUnicode_Check(pyStrFn))
672 fn = (
char*)PyUnicode_AsUTF8(pyStrFn);
678 PyErr_SetString(PyExc_TypeError,
679 "bad argument:Expected string or FileName as second argument");
692 if (PyArg_ParseTuple(args,
"OO", &pyStrFn1, &pyStrFn2))
699 pyStrAux = PyObject_Str(pyStrFn1);
701 if (pyStrAux !=
nullptr)
702 fn1 = (
char*)PyUnicode_AsUTF8(pyStrAux);
704 PyErr_SetString(PyExc_TypeError,
"Expected string or FileName as first argument");
706 pyStrAux = PyObject_Str(pyStrFn2);
707 if (pyStrAux !=
nullptr)
708 fn2 = (
char*)PyUnicode_AsUTF8(pyStrAux);
711 PyErr_SetString(PyExc_TypeError,
712 "Expected string or FileName as first argument");
728 #define FILTER_TRY()\ 730 if (validateInputImageString(pyImage, pyStrFn, fn)) {\ 733 MultidimArray<double> &data = MULTIDIM_ARRAY(img);\ 735 data.getDimensions(idim); 737 #define FILTER_CATCH()\ 738 size_t w = dim, h = dim, &x = idim.xdim, &y = idim.ydim;\ 739 if (x > y) h = y * (dim/x);\ 742 selfScaleToSize(LINEAR, data, w, h);\ 743 Image_Value(pyImage).setDatatype(DT_Double);\ 745 MULTIDIM_ARRAY_GENERIC(Image_Value(pyImage)).setImage(data);\ 747 }} catch (XmippError &xe)\ 748 { PyErr_SetString(PyXmippError, xe.what());}\ 759 if (PyArg_ParseTuple(args,
"O", &pyStrFn))
761 pyStrAux = PyObject_Str(pyStrFn);
762 if (pyStrAux !=
nullptr)
764 fn = (
char*)PyUnicode_AsUTF8(pyStrAux);
779 if (PyArg_ParseTuple(args,
"ddd", &rot,&tilt,&psi))
784 auto * arr = (PyArrayObject*) PyArray_SimpleNew(2, dims, NPY_DOUBLE);
785 void * data = PyArray_DATA(arr);
788 memcpy(data, (euler.
mdata), 9 *
sizeof(
double));
789 return (PyObject*)arr;
799 if (PyArg_ParseTuple(args,
"O", &input))
802 auto dType = PyArray_ObjectType(input, NPY_FLOAT);
803 auto *arr =
reinterpret_cast<PyArrayObject*
>(PyArray_FROM_OTF(input, dType, NPY_ARRAY_IN_ARRAY));
804 if (
nullptr == arr) {
807 if (
const auto *dims = PyArray_DIMS(arr); 2 != PyArray_NDIM(arr) || (3 != dims[0]) || (3 != dims[1])) {
808 PyErr_SetString(PyExc_IndexError,
"2D array of size <3,3> expected");
813 if (PyTypeNum_ISFLOAT(dType)) {
814 memcpy(euler.
mdata, PyArray_DATA(arr), 9 *
sizeof(
double));
815 }
else if (PyTypeNum_ISINTEGER(dType)) {
816 for (
auto i = 0;
i < 9; ++
i) {
817 euler.
mdata[
i] =
static_cast<double>(*
reinterpret_cast<int*
>(PyArray_GETPTR1(arr,
i)));
820 PyErr_SetString(PyExc_TypeError,
"Array of type 'double' or 'int' expected");
827 return Py_BuildValue(
"fff", rot, tilt, psi);
839 if (PyArg_ParseTuple(args,
"ddd", &rot,&tilt,&psi))
856 auto *pyHomogeneous = Py_False;
857 if (PyArg_ParseTuple(args,
"ddd|O", &x,&y,&z,&pyHomogeneous))
859 if(PyBool_Check(pyHomogeneous))
860 homogeneous = pyHomogeneous == Py_True;
873 auto * arr = (PyArrayObject*) PyArray_SimpleNew(2, dims, NPY_DOUBLE);
874 void * data = PyArray_DATA(arr);
879 memcpy(data, (R.
mdata), dims[0] * dims[1] *
sizeof(
double));
880 return (PyObject*)arr;
933 if (PyArg_ParseTuple(args,
"OOdii", &pyImage, &pyStrFn, &downsampling, &dim, &Nthreads))
956 #define FILTER_TRY()\ 958 if (validateInputImageString(pyImage, pyStrFn, fn)) {\ 961 MultidimArray<double> &data = MULTIDIM_ARRAY(img);\ 963 data.getDimensions(idim); 966 #define FILTER_CATCH()\ 967 size_t w = dim, h = dim, &x = idim.xdim, &y = idim.ydim;\ 968 if (x > y) h = y * (dim/x);\ 971 selfScaleToSize(xmipp_transformation::LINEAR, data, w, h);\ 972 Image_Value(pyImage).setDatatype(DT_Double);\ 974 MULTIDIM_ARRAY_GENERIC(Image_Value(pyImage)).setImage(data);\ 976 }} catch (XmippError &xe)\ 977 { PyErr_SetString(PyXmippError, xe.what());}\ 993 if (PyArg_ParseTuple(args,
"OOdddi", &pyImage, &pyStrFn, &w1, &w2, &raised_w, &dim))
1013 if (PyArg_ParseTuple(args,
"OOdi", &pyImage, &pyStrFn, &freqSigma, &dim))
1033 if (PyArg_ParseTuple(args,
"OOdi", &pyImage, &pyStrFn, &realSigma, &dim))
1053 if (PyArg_ParseTuple(args,
"OOdi", &pyImage, &pyStrFn, &factor, &dim))
1070 double minFreq=0.05;
1071 double maxFreq=0.25;
1074 if (PyArg_ParseTuple(args,
"OO|idd" 1076 ,&dim,&minFreq,&maxFreq))
1081 PyErr_SetString(PyExc_TypeError,
1082 "Expected MetaData as first argument");
1084 PyErr_SetString(PyExc_TypeError,
1085 "Expected MetaData as second argument");
1092 return Py_BuildValue(
"f", error);
1108 double phaseDiffRad;
1110 if (PyArg_ParseTuple(args,
"Od", &pyMd1, &phaseDiffRad))
1115 PyErr_SetString(PyExc_TypeError,
1116 "Expected MetaData as first argument");
1122 return Py_BuildValue(
"f", resolutionA);
1140 if (PyArg_ParseTuple(args,
"OO", &pyMd1, &pyMd2))
1145 PyErr_SetString(PyExc_TypeError,
1146 "Expected MetaData as first argument");
1148 PyErr_SetString(PyExc_TypeError,
1149 "Expected MetaData as second argument");
1155 return Py_BuildValue(
"f", resolutionA);
1173 if (
self !=
nullptr)
1177 auto &image =
self->image;
1197 PyObject *pimg1 =
nullptr;
1198 PyObject *pimg2 =
nullptr;
1202 if (PyArg_ParseTuple(args,
"OO", &pimg1, &pimg2))
1207 result->image = std::make_unique<ImageGeneric>(
Image_Value(img2));
1208 *result->image = *img2->image;
1210 result->image->convert2Datatype(
DT_Double);
1214 img1->image->convert2Datatype(
DT_Double);
1231 return (PyObject *)result;
1238 PyObject *pimg =
nullptr;
1239 PyObject *input =
nullptr;
1242 auto *pyReplace = Py_False;
1243 bool absPhase =
false;
1247 PyArg_ParseTuple(args,
"OOd|kO", &pimg, &input,&Ts,&rowId,&pyReplace);
1248 if (pimg !=
nullptr && input !=
nullptr)
1250 if(PyBool_Check(pyReplace))
1251 absPhase = pyReplace == Py_True;
1257 auto &image = img->image;
1271 pyStr = PyObject_Str(input);
1272 FileName fnCTF = (
char*)PyUnicode_AsUTF8(pyStr);
1292 PyObject *pvol =
nullptr;
1298 if (PyArg_ParseTuple(args,
"Oddd", &pvol, &rot,&tilt,&psi))
1305 Py_BEGIN_ALLOW_THREADS
1309 vol->image->
data->getMultidimArrayPointer(mVolume);
1316 result->
image = std::make_unique<ImageGeneric>();
1319 Py_END_ALLOW_THREADS
1320 return (PyObject *)result;
1334 {
"getBlocksInMetaDataFile",
1336 "return list with metadata blocks in a file" },
1338 "Convert MDLabel to string" },
1340 "Create a string with color characters sequence for print in console" },
1342 "Return the type of a label" },
1344 "Return the if the label has a specific tag" },
1346 "Return if the label has the TAGLABEL_IMAGE tag" },
1348 "Convert an string to MDLabel" },
1351 "Check if the label is a valid one" },
1352 {
"MDValueRelational",
1354 METH_VARARGS,
"Construct a relational query" },
1356 METH_VARARGS,
"Construct a relational query" },
1358 METH_VARARGS,
"Construct a relational query" },
1360 METH_VARARGS,
"Construct a relational query" },
1362 METH_VARARGS,
"Construct a relational query" },
1364 METH_VARARGS,
"Construct a relational query" },
1366 METH_VARARGS,
"Construct a relational query" },
1368 METH_VARARGS,
"Construct a range query" },
1370 METH_VARARGS,
"Add a label alias dinamically in run time. Use for reading non xmipp star files" },
1372 METH_VARARGS,
"Add a label dinamically in run time. Use for reading non xmipp star files" },
1374 METH_VARARGS,
"create empty stack (speed up things)" },
1376 METH_VARARGS,
"Get image dimensions" },
1378 "Get image dimensions of first metadata entry and the number of entries" },
1380 "Does block exists in file" },
1382 "return true if both files are identical" },
1384 "return true if the file has at least as many bytes as needed to read the image" },
1386 "return false if the image has repeated pixels at some corner" },
1388 "return true if both files are identical" },
1390 "convert bsoft star files to xmipp star files" },
1392 "convert xmipp star files to bsoft star files" },
1394 "return true if both images are very similar" },
1396 "Read a 1 or two column list of micrographs" },
1398 "Substitute the original images into a given column of a metadata" },
1400 "Compare two metadata files" },
1402 "dump metadata to sqlite database" },
1404 "convert euler angles to transformation matrix" },
1406 "convert transformation matrix to euler angles" },
1408 "converts euler angles to direction" },
1410 "align vector with Z" },
1412 METH_VARARGS,
"activate math function in metadatas" },
1414 METH_VARARGS,
"activate regular expressions in metadatas" },
1416 "Utility function to calculate PSD preview" },
1418 "Utility function to apply bandpass filter" },
1420 "Utility function to apply gaussian filter in Fourier space" },
1422 "Utility function to apply gaussian filter in Real space" },
1424 "Bad pixel filter" },
1426 METH_VARARGS,
"difference between two metadatas" },
1428 METH_VARARGS,
"resolution at which CTFs phase differs more than 90 degrees" },
1430 METH_VARARGS,
"resolution at which CTFs phase differs more than 90 degrees, 2D case" },
1432 "Convert to PSD: center FFT and use logarithm" },
1433 {
"image_align", (PyCFunction)
Image_align, METH_VARARGS,
1434 "I2aligned=image_align(I1,I2), align I2 to resemble I1." },
1436 "Apply CTF to this image. Ts is the sampling rate of the image." },
1438 "project a volume using Euler angles" },
1442 #define INIT_TYPE(type) if (PyType_Ready(&type##Type) < 0) return module; Py_INCREF(&type##Type);\ 1443 PyModule_AddObject(module, #type, (PyObject *) &type##Type); 1446 static struct PyModuleDef moduledef = {
1447 PyModuleDef_HEAD_INIT,
1458 PyObject *module = PyModule_Create(&moduledef);
1471 char message[32]=
"xmipp.XmippError";
1472 PyXmippError = PyErr_NewException(message,
nullptr,
nullptr);
1477 PyObject * dict = PyModule_GetDict(module);
std::string datatype2Str(DataType datatype)
PyObject * xmipp_errorMaxFreqCTFs2D(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * xmipp_labelIsImage(PyObject *obj, PyObject *args)
PyObject_HEAD std::unique_ptr< ImageGeneric > image
static MDLabel str2Label(const String &labelName)
void addLabels(PyObject *dict)
PyMODINIT_FUNC PyInit_xmippLib(void)
String colorString(const char *msg, int color, int attribute, int bgcolor)
void Euler_angles2matrix(T alpha, T beta, T gamma, Matrix2D< T > &A, bool homogeneous)
PyObject * xmipp_str2Label(PyObject *obj, PyObject *args)
void Euler_direction(double alpha, double beta, double gamma, Matrix1D< double > &v)
PyObject * xmipp_dumpToFile(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * xmipp_createEmptyFile(PyObject *obj, PyObject *args, PyObject *kwargs)
void gaussianFilter(MultidimArray< double > &img, double w1)
PyObject * xmipp_alignWithZ(PyObject *obj, PyObject *args, PyObject *kwargs)
void apply(MultidimArray< double > &img)
static bool isValidLabel(const MDLabel &label)
#define FileName_Check(v)
PyObject * xmipp_compareTwoFiles(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * xmipp_ImgCompare(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * xmipp_MetaDataInfo(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * xmipp_badPixelFilter(PyObject *obj, PyObject *args, PyObject *kwargs)
#define MULTIDIM_ARRAY(v)
PyObject * xmipp_getImageSize(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * Image_convertPSD(PyObject *obj, PyObject *args, PyObject *kwargs)
double errorMaxFreqCTFs2D(MetaData &MD1, MetaData &MD2, size_t Xdim, double phaseRad)
void read(const FileName &fn, bool disable_if_not_K=true)
bool enable_CTF
Enable CTF part.
static MDLabelType labelType(const MDLabel label)
PyObject * xmipp_Euler_direction(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * xmipp_substituteOriginalImages(PyObject *obj, PyObject *args, PyObject *kwargs)
SWIGINTERN int PyModule_AddObject(PyObject *m, char *name, PyObject *o)
PyObject * xmipp_fastEstimateEnhancedPSD(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * xmipp_bandPassFilter(PyObject *obj, PyObject *args, PyObject *kwargs)
void xmipp2PSD(const MultidimArray< T > &input, MultidimArray< T > &output, bool takeLog)
PyObject * xmipp_bsoftRestoreLoopBlock(PyObject *obj, PyObject *args, PyObject *kwargs)
void applyCTF(MultidimArray< std::complex< double > > &FFTI, const MultidimArray< double > &I, double Ts, bool absPhase=false)
Apply CTF to an image.
PyObject * xmipp_isValidLabel(PyObject *obj, PyObject *args, PyObject *kwargs)
void readFromMetadataRow(const MetaData &MD, size_t id, bool disable_if_not_K=true)
PyObject * xmipp_activateRegExtensions(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * xmipp_bsoftRemoveLoopBlock(PyObject *obj, PyObject *args, PyObject *kwargs)
bool compareTwoImageTolerance(const FileName &fn1, const FileName &fn2, double tolerance, size_t index1, size_t index2)
binary comparison of two images with a tolerance factor
PyObject * xmipp_compareTwoMetadataFiles(PyObject *obj, PyObject *args, PyObject *kwargs)
double errorBetween2CTFs(MetaData &MD1, MetaData &MD2, size_t Xdim, double minFreq, double maxFreq)
PyObject * xmipp_gaussianFilter(PyObject *obj, PyObject *args, PyObject *kwargs)
#define FileName_Value(v)
bool compareTwoFiles(const FileName &fn1, const FileName &fn2, size_t offset)
binary comparison of two files skipping first "offset" bytes
bool validateInputImageString(PyObject *pyImage, PyObject *pyStrFn, FileName &fn)
PyObject * xmipp_compareTwoImageTolerance(PyObject *obj, PyObject *args, PyObject *kwargs)
void projectVolume(FourierProjector &projector, Projection &P, int Ydim, int Xdim, double rot, double tilt, double psi, const MultidimArray< double > *ctf)
void direction(const MultidimArray< double > &orMap, MultidimArray< double > &qualityMap, double lambda, int size, MultidimArray< double > &dirMap, int x, int y)
PyObject * Image_align(PyObject *obj, PyObject *args, PyObject *kwargs)
void createEmptyFile(const FileName &filename, int xdim, int ydim, int Zdim, size_t select_img, bool isStack, int mode, int _swapWrite, const MDRowVec *md)
PyObject * xmipp_activateMathExtensions(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * xmipp_labelHasTag(PyObject *obj, PyObject *args)
PyObject * xmipp_colorStr(PyObject *obj, PyObject *args)
PyObject * xmipp_label2Str(PyObject *obj, PyObject *args)
PyObject * xmipp_readMetaDataWithTwoPossibleImages(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * xmipp_Euler_angles2matrix(PyObject *obj, PyObject *args, PyObject *kwargs)
double errorMaxFreqCTFs(MetaData &MD1, double phaseRad)
void bandpassFilter(MultidimArray< double > &img, double w1, double w2, double raised_w)
#define MULTIDIM_ARRAY_GENERIC(v)
PyObject * xmipp_CheckImageFileSize(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * xmipp_errorMaxFreqCTFs(PyObject *obj, PyObject *args, PyObject *kwargs)
void realGaussianFilter(MultidimArray< double > &img, double sigma)
PyObject * xmipp_Euler_matrix2angles(PyObject *obj, PyObject *args, PyObject *kwargs)
PyObject * xmipp_CheckImageCorners(PyObject *obj, PyObject *args, PyObject *kwargs)
void produceSideInfo()
Produce Side information.
double psi(const double x)
void Euler_matrix2angles(const Matrix2D< double > &A, double &alpha, double &beta, double &gamma, bool homogeneous)
#define VECTOR_R3(v, x, y, z)
PyObject * Image_projectVolumeDouble(PyObject *obj, PyObject *args, PyObject *kwargs)
static bool hasTag(const MDLabel label, const int tags)
static String label2Str(const MDLabel &label)
PyObject * xmipp_realGaussianFilter(PyObject *obj, PyObject *args, PyObject *kwargs)
bool enable_CTFnoise
Enable CTFnoise part.
PyObject * xmipp_existsBlockInMetaDataFile(PyObject *obj, PyObject *args, PyObject *kwargs)
double alignImagesConsideringMirrors(const MultidimArray< double > &Iref, const AlignmentTransforms &IrefTransforms, MultidimArray< double > &I, Matrix2D< double > &M, AlignmentAux &aux, CorrelationAux &aux2, RotationalCorrelationAux &aux3, bool wrap, const MultidimArray< int > *mask)
PyObject * Image_applyCTF(PyObject *obj, PyObject *args, PyObject *kwargs)
void fastEstimateEnhancedPSD(const FileName &fnMicrograph, double downsampling, MultidimArray< double > &enhancedPSD, int numberOfThreads)
bool checkImageFileSize(const FileName &name, const ImageInfo &imgInfo, bool error)
PyObject * xmipp_errorBetween2CTFs(PyObject *obj, PyObject *args, PyObject *kwargs)
bool checkImageCorners(const FileName &name)
PyObject * xmipp_labelType(PyObject *obj, PyObject *args)
void getDimensions(size_t &Xdim, size_t &Ydim, size_t &Zdim, size_t &Ndim) const